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

NPC Killing Quest.


Ertzel
 Share

Recommended Posts

I am trying to work on a quest that when you talk to an NPC, it rolls a random number to give a quest. Then it asks you to kill a certain amount of a certain monster ingame.
I have a script(Thanks to Soul) that adds a number beside the NPCs name in my Kills.ini whenever you kill an NPC. So this script needs to set that kill number to 0 for the NPC you randomly rolled, then when your killcount equals whatever the quest asks for, it would give you exp, then let you get a new quest. Also it adds a line called DoingQuest into the Kills.ini with the number that the Dice rolled, This makes the quest know if you already started a quest or not.

This is what I got to.
```
Case 3
Dim Dice
Dice = Rand(1, 6)

If Getvar("Kills.ini", GetPlayerName(index), "DoingQuest") = 0 Then
                  If Dice = 1 Then
      Call PutVar("Kills.ini", GetPlayerName(index), "Bunny",  "0")
                      Call PlayerMsg(Index, "Go out and kill 10 Rabbits!", GREEN)
      Call PutVar("Kills.ini", GetPlayerName(index), "DoingQuest", "1") 
                  End If

                  If Dice = 2 Then
      Call PutVar("Kills.ini", GetPlayerName(index), "Bat",  "0")
      Call PlayerMsg(Index, "Go out and kill 20 Bats!", GREEN)
                      Call PutVar("Kills.ini", GetPlayerName(index), "DoingQuest", "2")
  End If

                  If Dice = 3 Then
      Call PutVar("Kills.ini", GetPlayerName(index), "Rooster",  "0") 
                      Call PlayerMsg(Index, "Go out and kill 5 Roosters!", GREEN)
                      Call PutVar("Kills.ini", GetPlayerName(index), "DoingQuest", "3")
                  End If

                  If Dice = 4 Then
      Call PutVar("Kills.ini", GetPlayerName(index), "Slug",  "1")
      Call PlayerMsg(Index, "Go out and kill 15 Slugs!", GREEN)
                      Call PutVar("Kills.ini", GetPlayerName(index), "DoingQuest", "4")
  End If

                  If Dice = 5 Then
      Call PutVar("Kills.ini", GetPlayerName(index), "Squirrel",  "0")
                      Call PlayerMsg(Index, "Go out and kill 30 Squirrels!", GREEN)
      Call PutVar("Kills.ini", GetPlayerName(index), "DoingQuest", "5")
                  End If

                  If Dice = 6 Then
      Call PutVar("Kills.ini", GetPlayerName(index), "Dog",  "0")
                      Call PlayerMsg(Index, "Go out and kill 5 dogs!", GREEN)
                      Call PutVar("Kills.ini", GetPlayerName(index), "DoingQuest", "6")
  End If

Else
Call PlayerMsg(Index, "You must finish your current quest before getting another." RED)
End If
Exit Sub
```
All this does right now is make it so it asks you to kill the mob, and sets the number to 0 for the kill count. Then it puts another line called DoingQuest in the Kills.ini with the Dice number so the script knows if you are already doing a quest.

Can anyone help me finish this?
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...