BlartonBlumble.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. --[[
  2. Script Name : SpawnScripts/Antonica/BlartonBlumble.lua
  3. Script Purpose : Blarton Blumble
  4. Script Author : geordie0511
  5. Script Date : 2019.01.29
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. local Lucky = 457
  9. local Care = 467
  10. local FishingHoleHunt = 5337
  11. local TheOneThatGotAway = 5338
  12. local FishingForBait = 5339
  13. local PracticalJokeOnBlarton = 5355
  14. function spawn(NPC)
  15. ProvidesQuest(NPC,Lucky)
  16. ProvidesQuest(NPC,FishingHoleHunt)
  17. ProvidesQuest(NPC,TheOneThatGotAway)
  18. SetPlayerProximityFunction(NPC, 15, "InRange", Spawn)
  19. end
  20. function InRange(NPC, Spawn)
  21. end
  22. function respawn(NPC)
  23. spawn(NPC)
  24. end
  25. function hailed(NPC, Spawn)
  26. FaceTarget(NPC, Spawn)
  27. local choice = MakeRandomInt(1, 3)
  28. if choice == 1 then
  29. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1040.mp3", "", "", 0, 0, Spawn)
  30. elseif choice == 2 then
  31. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1040.mp3", "", "", 0, 0, Spawn)
  32. elseif choice == 3 then
  33. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1040.mp3", "", "", 0, 0, Spawn)
  34. end
  35. if GetQuestStep(Spawn, PracticalJokeOnBlarton) == 1 then
  36. SIDEQUEST_OPTION(NPC, Spawn)
  37. elseif not HasQuest(Spawn, Lucky) and not HasCompletedQuest(Spawn, Lucky) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  38. Option1(NPC, Spawn)
  39. elseif GetQuestStep(Spawn, Lucky) == 1 or GetQuestStep(Spawn, FishingHoleHunt) == 1 or GetQuestStep(Spawn, FishingHoleHunt) == 2 or GetQuestStep(Spawn, FishingHoleHunt) == 3 or GetQuestStep(Spawn, FishingHoleHunt) == 4 or GetQuestStep(Spawn, FishingHoleHunt) == 5 or GetQuestStep(Spawn, FishingHoleHunt) == 6 or GetQuestStep(Spawn, TheOneThatGotAway) == 1 or GetQuestStep(Spawn, FishingForBait) == 1 and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  40. Quest_Progress(NPC, Spawn)
  41. elseif GetQuestStep(Spawn, Lucky) == 2 and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  42. Quest1_Complete(NPC, Spawn)
  43. elseif HasCompletedQuest(Spawn, Lucky) and not HasQuest(Spawn, FishingHoleHunt) and not HasCompletedQuest(Spawn, FishingHoleHunt) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  44. Option2(NPC, Spawn)
  45. elseif GetQuestStep(Spawn, FishingHoleHunt) == 7 and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  46. Quest2_Complete(NPC, Spawn)
  47. elseif HasCompletedQuest(Spawn, Lucky) and HasCompletedQuest(Spawn, FishingHoleHunt) and not HasQuest(Spawn, TheOneThatGotAway) and not HasCompletedQuest(Spawn, TheOneThatGotAway) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  48. Option4(NPC, Spawn)
  49. elseif GetQuestStep(Spawn, TheOneThatGotAway) == 2 then
  50. Quest3_Complete(NPC, Spawn)
  51. elseif HasCompletedQuest(Spawn, Lucky) and HasCompletedQuest(Spawn, FishingHoleHunt) and HasCompletedQuest(Spawn, TheOneThatGotAway) and not HasQuest(Spawn, FishingForBait) and not HasCompletedQuest(Spawn, FishingForBait) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  52. Option6(NPC, Spawn)
  53. elseif GetQuestStep(Spawn, FishingForBait) == 2 and not GetQuestStep(Spawn, PracticalJokeOnBlarton) == 1 then
  54. Quest4_Complete(NPC, Spawn)
  55. elseif HasCompletedQuest(Spawn, Lucky) and HasCompletedQuest(Spawn, FishingHoleHunt) and HasCompletedQuest(Spawn, TheOneThatGotAway) and HasCompletedQuest(Spawn, FishingForBait) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  56. PlayFlavor(NPC, "", "Thank you so much for all of your help! I can't wait to get back to fishing again.", "", 0, 0, Spawn)
  57. elseif GetTempVariable(NPC, "Drunk") == "true" then
  58. PlayFlavor(NPC, "", "...", "", 0, 0, Spawn)
  59. end
  60. end
  61. function Option1(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. local conversation = CreateConversation()
  64. AddConversationOption(conversation, "What happened to your leg?", "dlg_9_1")
  65. AddConversationOption(conversation, "I'm afraid I don't have time to chat.")
  66. StartConversation(conversation, NPC, Spawn, "Why, hello there! Pleased to meet you, friend. I do hope you're having a better day than I am. With my leg being as it is, I'm not sure how much longer I can take being stuck here.")
  67. end
  68. function Option2(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. local conversation = CreateConversation()
  71. AddConversationOption(conversation, "Sure, I can go check your fishing spots for you.", "Option3")
  72. AddConversationOption(conversation, "No thanks. I'm not going to run all over the place to check on your fish.")
  73. StartConversation(conversation, NPC, Spawn, "Hello again! Thanks again for finding my lure for me. I can't wait to get back to fishin' my old spots as soon as my leg is healed. I've been cooped up here longer than I had hoped and I just can't stop wondering how my favorite spots are right now. Are the fish biting? Have the gnolls fished 'em out yet? I can't stand not knowing! Can you please go check my fishin' spots for me and let me know how they are?")
  74. end
  75. function Option3(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. local conversation = CreateConversation()
  78. AddConversationOption(conversation, "Alright.", "offer2")
  79. AddConversationOption(conversation, "Sorry, I can't.")
  80. StartConversation(conversation, NPC, Spawn, "Oh, thank you so much. If I can't get out there and fish, at least I can find out what's going on. Here, let me see that journal you've got there and I'll write down all my favorite spots for you. Mind you, I'd take it as a favor if you don't go showin' this to anyone else. These spots are nice and quiet and I'd like to keep 'em that way.")
  81. end
  82. function Option4(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. local conversation = CreateConversation()
  85. AddConversationOption(conversation, "What's so special about this fish?", "Option5")
  86. AddConversationOption(conversation, "I think I've heard enough of your fishing stories.")
  87. StartConversation(conversation, NPC, Spawn, "I'm sorry to trouble you again after all that you've done, but I need you to find a specific fish for me. I've been trying to catch him for a long time now, but he's a cunning old devil and he always gets away.")
  88. end
  89. function Option5(NPC, Spawn)
  90. FaceTarget(NPC, Spawn)
  91. local conversation = CreateConversation()
  92. AddConversationOption(conversation, "Yes, I'd be happy to help again.", "offer3")
  93. AddConversationOption(conversation, "I think I've helped you enough already, Blarton.")
  94. StartConversation(conversation, NPC, Spawn, "His name is Ol' One Eye. He's been living in these waters for some time and has eluded many a would-be fisherman. Can you go look for him and let me know if he's still out there? I just can't stop wonderin' where he is.")
  95. end
  96. function Option6(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. local conversation = CreateConversation()
  99. AddConversationOption(conversation, "Sure, what can I do for you?", "Option7")
  100. AddConversationOption(conversation, "I'm sorry, but I don't have the time right now.")
  101. StartConversation(conversation, NPC, Spawn, "Well, hello again. It's good to see you. I don't suppose that you can offer me a little more assistance?")
  102. end
  103. function Option7(NPC, Spawn)
  104. FaceTarget(NPC, Spawn)
  105. local conversation = CreateConversation()
  106. AddConversationOption(conversation, "Shouldn't be a problem. I'll see how it goes.", "offer4")
  107. AddConversationOption(conversation, "I'm not in the mood to deal with more gnolls right now.")
  108. StartConversation(conversation, NPC, Spawn, "My cousin had a tin of bait for me, but he left it sitting at an abandoned camp to the south of here while he was out and about. Now I hear some gnolls have moved in. Do you think you can pick up the bait for me?")
  109. end
  110. function Quest_Progress(NPC, Spawn)
  111. PlayFlavor(NPC, "", "Hello again! Please hurry back when you're done.", "", 1689589577, 4560189, Spawn)
  112. end
  113. function Quest1_Complete(NPC, Spawn)
  114. SetStepComplete(Spawn, Lucky, 2)
  115. FaceTarget(NPC, Spawn)
  116. local conversation = CreateConversation()
  117. AddConversationOption(conversation, "Always glad to help.")
  118. StartConversation(conversation, NPC, Spawn, "Oh, you've found it! Thank you so much! I didn't think I'd ever get it back. I don't know how I can repay you. I'm in your debt, friend.")
  119. end
  120. function Quest2_Complete(NPC, Spawn)
  121. SetStepComplete(Spawn, FishingHoleHunt, 7)
  122. FaceTarget(NPC, Spawn)
  123. local conversation = CreateConversation()
  124. AddConversationOption(conversation, "You are more than welcome.")
  125. StartConversation(conversation, NPC, Spawn, "Wonderful! Thank you for checking on my spots for me. It sounds like it would be a great fishing day if I could make it out there. At least now I know everything's fine and most of my favorite places are teeming with fish and are still as quiet as ever.")
  126. end
  127. function Quest3_Complete(NPC, Spawn)
  128. SetStepComplete(Spawn, TheOneThatGotAway, 2)
  129. FaceTarget(NPC, Spawn)
  130. local conversation = CreateConversation()
  131. AddConversationOption(conversation, "No problem.")
  132. StartConversation(conversation, NPC, Spawn, "Ahh, so he's still out there lurking. I'll just have to rest up and save my strength so I can get back to the hunt. I will catch him someday! I know it isn't enough for all that you've done for me, but please take this reward. Thank you so much for all your help!")
  133. end
  134. function Quest4_Complete(NPC, Spawn)
  135. SetStepComplete(Spawn, FishingForBait, 2)
  136. FaceTarget(NPC, Spawn)
  137. local conversation = CreateConversation()
  138. AddConversationOption(conversation, "Don't worry about it. It was my pleasure.")
  139. StartConversation(conversation, NPC, Spawn, "Great. Thank you kindly. You have been very helpful to me. Hopefully I can repay the favor sometime.")
  140. end
  141. function dlg_9_1(NPC, Spawn)
  142. FaceTarget(NPC, Spawn)
  143. conversation = CreateConversation()
  144. AddConversationOption(conversation, "Really?", "dlg_9_2")
  145. AddConversationOption(conversation, "I'm sorry, but I have pressing business elsewhere.")
  146. StartConversation(conversation, NPC, Spawn, "Ah, I can't believe I was such a darn fool. How'd I manage to hurt my leg and lose my best fishin' lure all in one day? There I was up on the coast, north of here, having a nice walk before settling down for a long day of fishin' when I slipped and hurt my poor leg.")
  147. end
  148. function dlg_9_2(NPC, Spawn)
  149. FaceTarget(NPC, Spawn)
  150. conversation = CreateConversation()
  151. AddConversationOption(conversation, "Sure, I'd be happy to help.", "offer")
  152. AddConversationOption(conversation, "No thanks.")
  153. StartConversation(conversation, NPC, Spawn, "It hurt somethin' fierce and I only barely managed to drag myself back here. The next morning I found I could stand on it okay, but not for too long. I thought I'd try to do some fishin' here at this nice pond since I'm stuck until I can heal enough to get back to my favorite fishin' holes. Just as I was getting set up, I realized I'd lost my favorite lure! I must have dropped it somewhere up on the beach north of here near where I fell. With my leg like this, I can't go and look for it myself. I don't suppose you might be able to help find it for me?")
  154. end
  155. function SIDEQUEST_OPTION(NPC, Spawn)
  156. FaceTarget(NPC, Spawn)
  157. conversation = CreateConversation()
  158. AddConversationOption(conversation, "I have a gift for you.", "SIDEQUEST_OPTION2")
  159. StartConversation(conversation, NPC, Spawn, "What? Oh, hello there.")
  160. end
  161. function SIDEQUEST_OPTION2(NPC, Spawn)
  162. FaceTarget(NPC, Spawn)
  163. local conversation = CreateConversation()
  164. AddConversationOption(conversation, "Oh, it's not from me.", "SIDEQUEST_OPTION3")
  165. StartConversation(conversation, NPC, Spawn, "Really? Why thank you, you shouldn't have.")
  166. end
  167. function SIDEQUEST_OPTION3(NPC, Spawn)
  168. FaceTarget(NPC, Spawn)
  169. local conversation = CreateConversation()
  170. AddConversationOption(conversation, "Uh, your good friend from the bar.", "SIDEQUEST_OPTION4")
  171. StartConversation(conversation, NPC, Spawn, "Oh? Who is it from?")
  172. end
  173. function SIDEQUEST_OPTION4(NPC, Spawn)
  174. SetStepComplete(Spawn, PracticalJokeOnBlarton, 1)
  175. FaceTarget(NPC, Spawn)
  176. local conversation = CreateConversation()
  177. AddConversationOption(conversation, "Yeah, her. I delivered it for her. Drink up!", "drunk")
  178. StartConversation(conversation, NPC, Spawn, "Matsy? She's my cousin, she's so nice!")
  179. end
  180. function drunk(NPC, Spawn)
  181. SetTempVariable(NPC, "Drunk", "true")
  182. PlayFlavor(NPC, "", "I'll just have a sip for now...", "", 0, 0, Spawn)
  183. SpawnSet(NPC, "visual_state", 228)
  184. AddTimer(NPC, 60000, "wakeup")
  185. end
  186. function wakeup(NPC, Spawn)
  187. SetTempVariable(NPC, "Drunk", "false")
  188. SpawnSet(NPC, "visual_state", 540)
  189. PlayFlavor(NPC, "", "Ugh... just breathing is painful.", "", 0, 0, Spawn)
  190. end
  191. function offer(NPC, Spawn)
  192. OfferQuest(NPC, Spawn, Lucky)
  193. end
  194. function offer2(NPC, Spawn)
  195. OfferQuest(NPC, Spawn, FishingHoleHunt)
  196. end
  197. function offer3(NPC, Spawn)
  198. OfferQuest(NPC, Spawn, TheOneThatGotAway)
  199. end
  200. function offer4(NPC, Spawn)
  201. OfferQuest(NPC, Spawn, FishingForBait)
  202. end