9
3

BlartonBlumble.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. SetPlayerProximityFunction(NPC, 15, "InRange", Spawn)
  16. end
  17. function InRange(NPC, Spawn)
  18. if not HasCompletedQuest(Spawn, Lucky) then
  19. ProvidesQuest(NPC, Lucky)
  20. elseif HasCompletedQuest(Spawn, Lucky) then
  21. ProvidesQuest(NPC, FishingHoleHunt)
  22. SetInfoFlag(NPC)
  23. SetVisualFlag(NPC)
  24. elseif HasCompletedQuest(Spawn, FishingHoleHunt) then
  25. ProvidesQuest(NPC, TheOneThatGotAway)
  26. SetInfoFlag(NPC)
  27. SetVisualFlag(NPC)
  28. elseif HasCompletedQuest(Spawn, TheOneThatGotAway) then
  29. ProvidesQuest(NPC, FishingForBait)
  30. SetInfoFlag(NPC)
  31. SetVisualFlag(NPC)
  32. end
  33. end
  34. function respawn(NPC)
  35. spawn(NPC)
  36. end
  37. function hailed(NPC, Spawn)
  38. FaceTarget(NPC, Spawn)
  39. local choice = MakeRandomInt(1, 3)
  40. if choice == 1 then
  41. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1040.mp3", "", "", 0, 0, Spawn)
  42. elseif choice == 2 then
  43. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1040.mp3", "", "", 0, 0, Spawn)
  44. elseif choice == 3 then
  45. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1040.mp3", "", "", 0, 0, Spawn)
  46. end
  47. if not HasQuest(Spawn, Lucky) and not HasCompletedQuest(Spawn, Lucky) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  48. Option1(NPC, Spawn)
  49. 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
  50. Quest_Progress(NPC, Spawn)
  51. elseif GetQuestStep(Spawn, Lucky) == 2 and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  52. Quest1_Complete(NPC, Spawn)
  53. elseif HasCompletedQuest(Spawn, Lucky) and not HasQuest(Spawn, FishingHoleHunt) and not HasCompletedQuest(Spawn, FishingHoleHunt) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  54. Option2(NPC, Spawn)
  55. elseif GetQuestStep(Spawn, FishingHoleHunt) == 7 and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  56. Quest2_Complete(NPC, Spawn)
  57. elseif HasCompletedQuest(Spawn, Lucky) and HasCompletedQuest(Spawn, FishingHoleHunt) and not HasQuest(Spawn, TheOneThatGotAway) and not HasCompletedQuest(Spawn, TheOneThatGotAway) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  58. Option4(NPC, Spawn)
  59. elseif GetQuestStep(Spawn, TheOneThatGotAway) == 2 then
  60. Quest3_Complete(NPC, Spawn)
  61. 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
  62. Option6(NPC, Spawn)
  63. elseif GetQuestStep(Spawn, FishingForBait) == 2 and not GetQuestStep(Spawn, PracticalJokeOnBlarton) == 1 then
  64. Quest4_Complete(NPC, Spawn)
  65. elseif HasCompletedQuest(Spawn, Lucky) and HasCompletedQuest(Spawn, FishingHoleHunt) and HasCompletedQuest(Spawn, TheOneThatGotAway) and HasCompletedQuest(Spawn, FishingForBait) and not HasQuest(Spawn, PracticalJokeOnBlarton) then
  66. PlayFlavor(NPC, "", "Thank you so much for all of your help! I can't wait to get back to fishing again.", "", 0, 0, Spawn)
  67. elseif GetQuestStep(Spawn, PracticalJokeOnBlarton) == 1 then
  68. SIDEQUEST_OPTION(NPC, Spawn)
  69. elseif GetTempVariable(NPC, "Drunk") == "true" then
  70. PlayFlavor(NPC, "", "...", "", 0, 0, Spawn)
  71. end
  72. end
  73. function Option1(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. local conversation = CreateConversation()
  76. AddConversationOption(conversation, "What happened to your leg?", "dlg_9_1")
  77. AddConversationOption(conversation, "I'm afraid I don't have time to chat.")
  78. 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.")
  79. end
  80. function Option2(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. local conversation = CreateConversation()
  83. AddConversationOption(conversation, "Sure, I can go check your fishing spots for you.", "Option3")
  84. AddConversationOption(conversation, "No thanks. I'm not going to run all over the place to check on your fish.")
  85. 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?")
  86. end
  87. function Option3(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. local conversation = CreateConversation()
  90. AddConversationOption(conversation, "Alright.", "offer2")
  91. AddConversationOption(conversation, "Sorry, I can't.")
  92. 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.")
  93. end
  94. function Option4(NPC, Spawn)
  95. FaceTarget(NPC, Spawn)
  96. local conversation = CreateConversation()
  97. AddConversationOption(conversation, "What's so special about this fish?", "Option5")
  98. AddConversationOption(conversation, "I think I've heard enough of your fishing stories.")
  99. 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.")
  100. end
  101. function Option5(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. local conversation = CreateConversation()
  104. AddConversationOption(conversation, "Yes, I'd be happy to help again.", "offer3")
  105. AddConversationOption(conversation, "I think I've helped you enough already, Blarton.")
  106. 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.")
  107. end
  108. function Option6(NPC, Spawn)
  109. FaceTarget(NPC, Spawn)
  110. local conversation = CreateConversation()
  111. AddConversationOption(conversation, "Sure, what can I do for you?", "Option7")
  112. AddConversationOption(conversation, "I'm sorry, but I don't have the time right now.")
  113. 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?")
  114. end
  115. function Option7(NPC, Spawn)
  116. FaceTarget(NPC, Spawn)
  117. local conversation = CreateConversation()
  118. AddConversationOption(conversation, "Shouldn't be a problem. I'll see how it goes.", "offer4")
  119. AddConversationOption(conversation, "I'm not in the mood to deal with more gnolls right now.")
  120. 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?")
  121. end
  122. function Quest_Progress(NPC, Spawn)
  123. PlayFlavor(NPC, "", "Hello again! Please hurry back when you're done.", "", 1689589577, 4560189, Spawn)
  124. end
  125. function Quest1_Complete(NPC, Spawn)
  126. SetStepComplete(Spawn, Lucky, 2)
  127. FaceTarget(NPC, Spawn)
  128. local conversation = CreateConversation()
  129. AddConversationOption(conversation, "Always glad to help.")
  130. 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.")
  131. end
  132. function Quest2_Complete(NPC, Spawn)
  133. SetStepComplete(Spawn, FishingHoleHunt, 7)
  134. FaceTarget(NPC, Spawn)
  135. local conversation = CreateConversation()
  136. AddConversationOption(conversation, "You are more than welcome.")
  137. 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.")
  138. end
  139. function Quest3_Complete(NPC, Spawn)
  140. SetStepComplete(Spawn, TheOneThatGotAway, 2)
  141. FaceTarget(NPC, Spawn)
  142. local conversation = CreateConversation()
  143. AddConversationOption(conversation, "No problem.")
  144. 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!")
  145. end
  146. function Quest4_Complete(NPC, Spawn)
  147. SetStepComplete(Spawn, FishingForBait, 2)
  148. FaceTarget(NPC, Spawn)
  149. local conversation = CreateConversation()
  150. AddConversationOption(conversation, "Don't worry about it. It was my pleasure.")
  151. StartConversation(conversation, NPC, Spawn, "Great. Thank you kindly. You have been very helpful to me. Hopefully I can repay the favor sometime.")
  152. end
  153. function dlg_9_1(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. conversation = CreateConversation()
  156. AddConversationOption(conversation, "Really?", "dlg_9_2")
  157. AddConversationOption(conversation, "I'm sorry, but I have pressing business elsewhere.")
  158. 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.")
  159. end
  160. function dlg_9_2(NPC, Spawn)
  161. FaceTarget(NPC, Spawn)
  162. conversation = CreateConversation()
  163. AddConversationOption(conversation, "Sure, I'd be happy to help.", "offer")
  164. AddConversationOption(conversation, "No thanks.")
  165. 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?")
  166. end
  167. function SIDEQUEST_OPTION(NPC, Spawn)
  168. FaceTarget(NPC, Spawn)
  169. conversation = CreateConversation()
  170. AddConversationOption(conversation, "I have a gift for you.", "SIDEQUEST_OPTION2")
  171. StartConversation(conversation, NPC, Spawn, "What? Oh, hello there.")
  172. end
  173. function SIDEQUEST_OPTION2(NPC, Spawn)
  174. FaceTarget(NPC, Spawn)
  175. local conversation = CreateConversation()
  176. AddConversationOption(conversation, "Oh, it's not from me.", "SIDEQUEST_OPTION3")
  177. StartConversation(conversation, NPC, Spawn, "Really? Why thank you, you shouldn't have.")
  178. end
  179. function SIDEQUEST_OPTION3(NPC, Spawn)
  180. FaceTarget(NPC, Spawn)
  181. local conversation = CreateConversation()
  182. AddConversationOption(conversation, "Uh, your good friend from the bar.", "SIDEQUEST_OPTION4")
  183. StartConversation(conversation, NPC, Spawn, "Oh? Who is it from?")
  184. end
  185. function SIDEQUEST_OPTION4(NPC, Spawn)
  186. SetStepComplete(Spawn, PracticalJokeOnBlarton, 1)
  187. FaceTarget(NPC, Spawn)
  188. local conversation = CreateConversation()
  189. AddConversationOption(conversation, "Yeah, her. I delivered it for her. Drink up!", "drunk")
  190. StartConversation(conversation, NPC, Spawn, "Matsy? She's my cousin, she's so nice!")
  191. end
  192. function drunk(NPC, Spawn)
  193. SetTempVariable(NPC, "Drunk", "true")
  194. PlayFlavor(NPC, "", "I'll just have a sip for now...", "", 0, 0, Spawn)
  195. SpawnSet(NPC, "visual_state", 228)
  196. AddTimer(NPC, 60000, "wakeup")
  197. end
  198. function wakeup(NPC, Spawn)
  199. SetTempVariable(NPC, "Drunk", "false")
  200. SpawnSet(NPC, "visual_state", 540)
  201. PlayFlavor(NPC, "", "Ugh... just breathing is painful.", "", 0, 0, Spawn)
  202. end
  203. function offer(NPC, Spawn)
  204. OfferQuest(NPC, Spawn, Lucky)
  205. end
  206. function offer2(NPC, Spawn)
  207. OfferQuest(NPC, Spawn, FishingHoleHunt)
  208. end
  209. function offer3(NPC, Spawn)
  210. OfferQuest(NPC, Spawn, TheOneThatGotAway)
  211. end
  212. function offer4(NPC, Spawn)
  213. OfferQuest(NPC, Spawn, FishingForBait)
  214. end