Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Quest Script I made not working?


Recommended Posts

Hey all, I made this quest script and its not working at all…

So, can you give it a looksee?

Also, does putvar make a new ini if one doesnt exist already?

Here is what calls it...

> '********************************
> Sub ScriptedNPC(Index, Script)
> '********************************
> Select Case Script
> Case 0
> If getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "QUEST", "Start_Msg") <> "" Then
> Call Quests(Index)
> Else
> Call New_Quest(Index)
> End If
>
> Exit Sub
>
> Case Else
> Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)
> Exit Sub
> End Select
> End Sub

Here is one of the subs…

> '********************************
> Sub Quest(index) 
> '********************************
> Dim status
> Dim start_msg
> Dim questing_msg
> Dim end_msg
> Dim completed_msg
> Dim space_msg
> Dim has_needed
> Dim need_count
> Dim give_count
> Dim need_num
> Dim give_num
> Dim slot
> Dim count
> Dim found 
> Dim durability
> Dim experience
>
> status = getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index))
> start_msg = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Start_Msg)
> questing_msg = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Questing_Msg)
> end_msg = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", End_Msg)
> completed_msg = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Completed_Msg)
> space_msg = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Space_Msg)
> need_count = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", need_count)
> give_count = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", give_count)
> need_num = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", need_num)
> give_num = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", give_num)
> experience = getvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Experience)
>
> If status = 0 Then 
>     Call PlayerMsg(index, start_msg, WHITE)
>         Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 1 )
>     Else If status = 1 Then
>     slot = 0
>     Do While slot < 25
>         If Getplayerinvitemnum(index, Int(slot)) = need_num Then
>             If Gatplayerinvitemvalue(index, Int(slot)) = need_count Then
>                 Call SetPlayerInvItemNum(index, Int(slot), 0)
>                 Call SetPlayerInvItemValue(index, Int(slot), Int(0))
>                 Call SendInventoryUpdate(index, Int(slot)) 
>             Else
>                 Call PlayerMsg(index, questing_msg, WHITE)
>                 Exit Sub
>             End If
>             slot = 25
>         Else
>             Call PlayerMsg(index, questing_msg, WHITE)
>             Exit Sub
>         End If
>         slot = slot + 1
>     Loop
>     slot = 0
>     Do While slot < 25
>         If Getplayerinvitemnum(index, Int(slot)) = 0 Then
>             Call SetPlayerInvItemNum(index, Int(slot), Int(give_num)
>             Call SetPlayerInvItemValue(index, Int(slot), Int(give_value))
>             Call SendInventoryUpdate(index, Int(slot))
>             slot = 25
>         End If
>         slot = slot + 1
>     Loop
>             Call PlayerMsg(index, end_msg, WHITE)
>             Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", "QUEST", GetPlayerMap(index), 2 )
>     Else If status = 2 Then 
>     Call PlayerMsg(index, completed_msg, WHITE)
>     End If
>
> Call PlayerWarp( index, Map, X, Y)
>
> End Sub

Here is the Last Sub…

> '********************************
> Sub New_Quest(index) 
> '********************************
>
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Start_Msg, Bring me a silver key!)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Questing_Msg, Have you got a silver key yet!?)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", End_Msg, Thank you kind sir, here is your reward!)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Completed_Msg, Thanks for your help earlier!)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Space_Msg, Looks like you got your hands full… come back later)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", Experience, 200)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", need_count, 1)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", need_num, 5)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", give_count, 1)
> Call putvar("scripts\charextras\" & GetPlayerMap(index) & ".ini", "QUEST", give_num, 1)
>
> End Sub
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...