Diskmaster Posted July 3, 2009 Author Share Posted July 3, 2009 ```' Executes whenever a scripted NPC does an action.'Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit SubCase 1If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest6") = "Have" ThenCall playermsg(index, "Thanks for doing that, I see you found the chests of Gold in there, that was for you.", 14) Exit SubEnd IfIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest8") = "Have" Then Call playermsg(index, "Please get this delivered, just use it on the door", 14) Exit SubEnd ifIf GetFreeSlots(Index) = 0 Then Call PlayerMsg(Index, "You don't have enough slots!", RED) Exit SubEnd IfCall PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest8", "Have") Call GiveItem(Index, 261, 1)Call playermsg(index, "Could you take this to the room over there with the rug", 14)Case 2If CanTake(Index, 269, 1) Then Call TakeItem(Index, 269, 1) Call GiveItem(Index, 270, 1) Call playermsg(index, "You Cook the meat", 14) Exit SubEnd ifIf CanTake(Index, 269, 1) = FALSE ThenCall playermsg(index, "You have no meat to cook", 14) End IfCase 3If CanTake(Index, 272, 1) Then Call TakeItem(Index, 272, 1) Call GiveItem(Index, 273, 1) Call playermsg(index, "You Cook the meat", 14) Exit SubEnd ifIf CanTake(Index, 272, 1) = FALSE ThenCall playermsg(index, "You have no meat to cook", 14)End IfCase 4If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest11") = "Have" Then Call playermsg(index, "You can only do this quest once", 14) Exit Sub End if If GetFreeSlots(Index) = 0 Then Call PlayerMsg(Index, "Hey, clear out a slot, and come back to me!", RED) Exit SubEnd ifIf CanTake(Index, 178, 1) Then Call GiveCurrency(Index, 277, 1) Call playermsg(index, "You hand Her your graveyard key, She then hands it back", 14) Call playermsg(index, "Thanks, I just never got to see one before!", 14) Call playermsg(index, "She hands you 125 Gold QUEST COMPLETE", 14)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest11", "Have") Exit SubElseCall playermsg(index, "Oh... You don't have it...", 14) Exit SubEnd ifCase 5If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest12") = "Have" Then Call playermsg(index, "Thanks.. but I don't need your help anymore!", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest13") = "Have" Then Call playermsg(index, "Oh, did you tell him, what did he say?", 14) Call playermsg(index, "So, he said you were wrong, and to go away?", 14) Call playermsg(index, "Oh well, I guess I will have to go down there and explain it to him", 14) Call playermsg(index, "Thanks for your help, I, OH, here you go, it is not much, but...", 14) Call GiveCurrency(Index, 2, 50) Call playermsg(index, "There is some gold for your troubles, Thank you!", 14) Call playermsg(index, "You Gain 50 Gold, QUEST COMPLETE", 10)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest12", "Have") Exit SubEnd if If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest14") = "Have" ThenCall playermsg(index, "I Don't Quite Know where he's got to, but he has to be around town", 14)Call playermsg(index, "He is the small boy in the stripped tee shirt", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest2") = "Have" ThenCall playermsg(index, "Hey you, are you interested in making some cash?", 14)Call playermsg(index, "Good, could you go down there and set him streight", 14)Call playermsg(index, "QUEST STARTED: Bad Kid", 15)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest14", "Have") Exit SubEnd ifCase 6If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest12") = "Have" Then Call playermsg(index, "Hmph, My Mommy says you told on me, I don't like you!!", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest13") = "Have" Then Call playermsg(index, "I Won't go, I WON'T I WON'T I WON'T", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest14") = "Have" Then Call playermsg(index, "What, OH, My Mommy Wants me, well, I won't go,", 4) Call playermsg(index, "And you Can't Make Me!!!!!", 4) Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest13", "Have") Exit SubEnd ifCase 7If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest16") = "Have" Then Call playermsg(index, "Thank you again, but I don't actually need the gem...", 14) Exit Sub End if If GetFreeSlots(Index) = 0 Then Call PlayerMsg(Index, "Listen, you need to make room so I can give this to you", RED) Exit SubEnd ifIf CanTake(Index, 250, 0) Then Call GiveItem(Index, 281, 1) Call playermsg(index, "Oh, you got it.. (that was fast). oh, I should offer you payment", 14) Call playermsg(index, "For your deed, how does 1000 gold sound *he hands you a bag of money*", 14) Call playermsg(index, "QUEST COMPLETE", 2)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest16", "Have") Exit SubEnd if If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest15") = "Have" Then Call playermsg(index, "Could you do this for me, Please!!", 14) Exit SubEnd ifCall playermsg(index, "Hello you there, yes you, I would like to go on an expedition", 14)Call playermsg(index, "When I was a little boy, my father was taken away from me by a 3-headed dog", 14)Call playermsg(index, "The dog ran away into the cave and ate him, I would like to avenge my father!", 14)Call playermsg(index, "So, I would like to get the rarest gem in all the lands, the Gem of Death to help bring him back", 14) Call playermsg(index, "QUEST STARTED: Gemeni Of Gems", 10)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest15", "Have") Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```It just doesn't work… Link to comment Share on other sites More sharing options...
Diskmaster Posted July 4, 2009 Author Share Posted July 4, 2009 Any 1? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 4, 2009 Share Posted July 4, 2009 I took a skim over it yesterday, I didn't see anything wrong.Just debug it; what was the last thing you added, before it stopped working? Link to comment Share on other sites More sharing options...
Patrick Posted July 4, 2009 Share Posted July 4, 2009 it's not tabbed in? or is that un-needed? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted July 4, 2009 Share Posted July 4, 2009 @üÑÂøчġġεт:> it's not tabbed in? or is that un-needed?It doesn't have to be tabbed; indents don't matter, it's just easier for us humans to read. Link to comment Share on other sites More sharing options...
DarkSpine Posted July 7, 2009 Share Posted July 7, 2009 I'm going to just go through this again… Idk what's wrong, but I'll change what it has on it to what I would've done...```' Executes whenever a scripted NPC does an action.'Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit SubCase 1If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest6") = "Have" ThenCall playermsg(index, "Thanks for doing that, I see you found the chests of Gold in there, that was for you.", 14) Exit SubEnd IfIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest8") = "Have" Then Call playermsg(index, "Please get this delivered, just use it on the door", 14) Exit SubEnd ifIf GetFreeSlots(Index) = 0 Then Call PlayerMsg(Index, "You don't have enough slots!", RED) Exit SubEnd IfCall PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest8", "Have") Call GiveItem(Index, 261, 1)Call playermsg(index, "Could you take this to the room over there with the rug", 14)Case 2If CanTake(Index, 269, 1) Then Call TakeItem(Index, 269, 1) Call GiveItem(Index, 270, 1) Call playermsg(index, "You Cook the meat", 14) Exit SubEnd ifIf CanTake(Index, 269, 1) = FALSE ThenCall playermsg(index, "You have no meat to cook", 14) End IfCase 3If CanTake(Index, 272, 1) Then Call TakeItem(Index, 272, 1) Call GiveItem(Index, 273, 1) Call playermsg(index, "You Cook the meat", 14) Exit SubEnd ifIf CanTake(Index, 272, 1) = FALSE ThenCall playermsg(index, "You have no meat to cook", 14)End IfCase 4If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest11") = "Have" Then Call playermsg(index, "You can only do this quest once", 14) Exit Sub End if If GetFreeSlots(Index) = 0 Then Call PlayerMsg(Index, "Hey, clear out a slot, and come back to me!", RED) Exit SubEnd ifIf CanTake(Index, 178, 1) Then Call GiveCurrency(Index, 277, 1) Call playermsg(index, "You hand Her your graveyard key, She then hands it back", 14) Call playermsg(index, "Thanks, I just never got to see one before!", 14) Call playermsg(index, "She hands you 125 Gold QUEST COMPLETE", 14)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest11", "Have") Exit SubElseCall playermsg(index, "Oh... You don't have it...", 14) Exit SubEnd ifCase 5If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest12") = "Have" Then Call playermsg(index, "Thanks.. but I don't need your help anymore!", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest13") = "Have" Then Call playermsg(index, "Oh, did you tell him, what did he say?", 14) Call playermsg(index, "So, he said you were wrong, and to go away?", 14) Call playermsg(index, "Oh well, I guess I will have to go down there and explain it to him", 14) Call playermsg(index, "Thanks for your help, I, OH, here you go, it is not much, but...", 14) Call GiveCurrency(Index, 2, 50) Call playermsg(index, "There is some gold for your troubles, Thank you!", 14) Call playermsg(index, "You Gain 50 Gold, QUEST COMPLETE", 10)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest12", "Have") Exit SubEnd if If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest14") = "Have" ThenCall playermsg(index, "I Don't Quite Know where he's got to, but he has to be around town", 14)Call playermsg(index, "He is the small boy in the stripped tee shirt", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest2") = "Have" ThenCall playermsg(index, "Hey you, are you interested in making some cash?", 14)Call playermsg(index, "Good, could you go down there and set him streight", 14)Call playermsg(index, "QUEST STARTED: Bad Kid", 15)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest14", "Have") Exit SubEnd ifCase 6If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest12") = "Have" Then Call playermsg(index, "Hmph, My Mommy says you told on me, I don't like you!!", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest13") = "Have" Then Call playermsg(index, "I Won't go, I WON'T I WON'T I WON'T", 14) Exit SubEnd ifIf GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest14") = "Have" Then Call playermsg(index, "What, OH, My Mommy Wants me, well, I won't go,", 4) Call playermsg(index, "And you Can't Make Me!!!!!", 4) Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest13", "Have") Exit SubEnd ifCase 7If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest16") = "Have" Then Call playermsg(index, "Thank you again, but I don't actually need the gem...", 14) Exit Sub End if If GetFreeSlots(Index) = 0 Then Call PlayerMsg(Index, "Listen, you need to make room so I can give this to you", RED) Exit SubEnd ifIf CanTake(Index, 250, 1) Then Call GiveItem(Index, 281, 1) Call playermsg(index, "Oh, you got it.. (that was fast). oh, I should offer you payment", 14) Call playermsg(index, "For your deed, how does 1000 gold sound *he hands you a bag of money*", 14) Call playermsg(index, "QUEST COMPLETE", 2)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest16", "Have") Exit SubEnd if If GetVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest15") = "Have" Then Call playermsg(index, "Could you do this for me, Please!!", 14) Exit SubEnd ifCall playermsg(index, "Hello you there, yes you, I would like to go on an expedition", 14)Call playermsg(index, "When I was a little boy, my father was taken away from me by a 3-headed dog", 14)Call playermsg(index, "The dog ran away into the cave and ate him, I would like to avenge my father!", 14)Call playermsg(index, "So, I would like to get the rarest gem in all the lands, the Gem of Death to help bring him back", 14) Call playermsg(index, "QUEST STARTED: Gemeni Of Gems", 10)Call PutVar("Chest\" & GetPlayerName(index) & ".ini", "Chest", "Chest15", "Have") Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```I did that very quick…only changed one or two things, I really doubt it did anything... Link to comment Share on other sites More sharing options...
Diskmaster Posted July 7, 2009 Author Share Posted July 7, 2009 well, I found out what was wrong… but it had nothing to do with my scripted NPC. I don't know how, but I somehow deleted half of Goodlord's Inventory script. I re inserted it, and they worked, thx anyway =) Link to comment Share on other sites More sharing options...
DarkSpine Posted July 7, 2009 Share Posted July 7, 2009 Interesting, well at least it's fixed! Link to comment Share on other sites More sharing options...
emblem Posted July 7, 2009 Share Posted July 7, 2009 Bah, right in the middle of me trying to find what was wrong :/Ahh well, glad it's fixed! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now