9
3

LieutenantDawson.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/LieutenantDawson.lua
  3. Script Purpose : Lieutenant Dawson <Qeynos Guard>
  4. Script Author : Scatman
  5. Script Date : 2009.08.10
  6. Script Notes : Updated 1/8/2020 by Shatou
  7. --]]
  8. local MIN_LEVEL = 5
  9. local QUEST_FROM_JOHFRIT = 46
  10. local QUEST_1 = 507
  11. local QUEST_2 = 508
  12. local QUEST_3 = 509
  13. local QUEST_4 = 510
  14. local QUEST_5 = 511
  15. local QUEST_6 = 512
  16. function spawn(NPC)
  17. ProvidesQuest(NPC, QUEST_1)
  18. ProvidesQuest(NPC, QUEST_2)
  19. ProvidesQuest(NPC, QUEST_3)
  20. ProvidesQuest(NPC, QUEST_4)
  21. ProvidesQuest(NPC, QUEST_5)
  22. ProvidesQuest(NPC, QUEST_6)
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end
  27. function hailed(NPC, Spawn)
  28. FaceTarget(NPC, Spawn)
  29. conversation = CreateConversation()
  30. if HasQuest(Spawn, QUEST_FROM_JOHFRIT) then
  31. SetStepComplete(Spawn, QUEST_FROM_JOHFRIT, 1)
  32. end
  33. if HasCompletedQuest(Spawn, QUEST_1) then
  34. if HasCompletedQuest(Spawn, QUEST_2) then
  35. if HasCompletedQuest(Spawn, QUEST_3) then
  36. if HasCompletedQuest(Spawn, QUEST_4) then
  37. if HasCompletedQuest(Spawn, QUEST_5) then
  38. if HasCompletedQuest(Spawn, QUEST_6) then
  39. Say(NPC, "Once again, thank you for all you have done.", Spawn)
  40. elseif HasQuest(Spawn, QUEST_6) then
  41. Say(NPC, "Once again, thank you for all you have done.", Spawn)
  42. else
  43. OnQuest5(NPC, Spawn, conversation)
  44. end
  45. elseif HasQuest(Spawn, QUEST_5) then
  46. OnQuest5(NPC, Spawn, conversation)
  47. else
  48. OnQuest4(NPC, Spawn, conversation)
  49. end
  50. elseif HasQuest(Spawn, QUEST_4) then
  51. OnQuest4(NPC, Spawn, conversation)
  52. else
  53. OnQuest3(NPC, Spawn, conversation)
  54. end
  55. elseif HasQuest(Spawn, QUEST_3) then
  56. OnQuest3(NPC, Spawn, conversation)
  57. else
  58. OnQuest2(NPC, Spawn, conversation)
  59. end
  60. elseif HasQuest(Spawn, QUEST_2) then
  61. OnQuest2(NPC, Spawn, conversation)
  62. else
  63. OnQuest1(NPC, Spawn, conversation)
  64. end
  65. elseif HasQuest(Spawn, QUEST_1) then
  66. OnQuest1(NPC, Spawn, conversation)
  67. else
  68. if GetLevel(Spawn) < MIN_LEVEL then
  69. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/qst_dawson_toolow_bd47ca5c.mp3", "Return to me when you're a bit more experienced, I think I could use your help.", "", 664604870, 1946809996, Spawn)
  70. else
  71. DoYouHaveAQuestion(NPC, Spawn, conversation)
  72. end
  73. end
  74. end
  75. -----------------------------------------------------------------------------------------------------------------------------------
  76. -- QUEST 1
  77. -----------------------------------------------------------------------------------------------------------------------------------
  78. function DoYouHaveAQuestion(NPC, Spawn, conversation)
  79. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson000.mp3", "", "", 2113696179, 3288237924, Spawn)
  80. AddConversationOption(conversation, "What is your mind occupied with?", "dlg_0_1")
  81. StartConversation(conversation, NPC, Spawn, "Do you have a question? Please be brief, my mind is occupied at the moment.")
  82. end
  83. function dlg_0_1(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. conversation = CreateConversation()
  86. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson001.mp3", "", "", 1614058358, 1618385129, Spawn)
  87. AddConversationOption(conversation, "How do you plan on doing that?", "dlg_0_2")
  88. StartConversation(conversation, NPC, Spawn, "I'm not entirely sure yet. Strange things have been happening in the Peat Bog. The ecology here has taken a staggering turn and that has attracted attention. I am trying to provide a strong presence here but with no direct support from Qeynos that is tough. I just need to show Qeynos that investing more people here is necessary.")
  89. end
  90. function dlg_0_2(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. conversation = CreateConversation()
  93. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson002.mp3", "", "", 3230267563, 3912489115, Spawn)
  94. AddConversationOption(conversation, "Sure, what can I do?", "dlg_0_3")
  95. StartConversation(conversation, NPC, Spawn, "That is yet another thing I'm not quite certain of yet. I need time to think that over but there are enough mundane problems that I've very little time to think. Care to lend a hand?")
  96. end
  97. function dlg_0_3(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. conversation = CreateConversation()
  100. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson003.mp3", "", "", 1827785196, 3415599407, Spawn)
  101. AddConversationOption(conversation, "Sure, I can do it.", "dlg_0_4")
  102. AddConversationOption(conversation, "Not now, sorry.")
  103. StartConversation(conversation, NPC, Spawn, "You can take care of some of the recurring problems while I try to focus my mind elsewhere. The fungus men around here have been causing enough incidents to warrant action. And the ravenous bog slugs are becoming more active. Take some of them out for me and it will give me the time needed to plan. Whadya say?")
  104. end
  105. function dlg_0_4(NPC, Spawn)
  106. FaceTarget(NPC, Spawn)
  107. conversation = CreateConversation()
  108. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson004.mp3", "", "", 146673171, 1820291654, Spawn)
  109. AddConversationOption(conversation, "All right.", "OfferQuest1")
  110. StartConversation(conversation, NPC, Spawn, "Great. The fungus men can be found around the mushrooms that dot the landscape. The ravenous bog slugs can be found south of here: if you follow this path to where the sewer grate lies and then head south, heading east once you hit the water, then further south, you should find them.")
  111. end
  112. function OfferQuest1(NPC, Spawn)
  113. FaceTarget(NPC, Spawn)
  114. OfferQuest(NPC, Spawn, QUEST_1)
  115. end
  116. function OnQuest1(NPC, Spawn, conversation)
  117. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson005.mp3", "", "", 3763908858, 4198264181, Spawn)
  118. if (HasQuest(Spawn, QUEST_1) and GetQuestStep(Spawn, QUEST_1) == 3) or (HasCompletedQuest(Spawn, QUEST_1)) then
  119. AddConversationOption(conversation, "Yes, I have.", "dlg_1_1")
  120. else
  121. AddConversationOption(conversation, "No, not yet.")
  122. end
  123. StartConversation(conversation, NPC, Spawn, "Have you killed the slugs and fungus men?")
  124. end
  125. -----------------------------------------------------------------------------------------------------------------------------------
  126. -- QUEST 2
  127. -----------------------------------------------------------------------------------------------------------------------------------
  128. function dlg_1_1(NPC, Spawn)
  129. if HasQuest(Spawn, QUEST_1) then
  130. SetStepComplete(Spawn, QUEST_1, 3)
  131. end
  132. FaceTarget(NPC, Spawn)
  133. conversation = CreateConversation()
  134. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson006.mp3", "", "", 74693624, 878787652, Spawn)
  135. AddConversationOption(conversation, "Sure, what can I do?", "dlg_1_2")
  136. AddConversationOption(conversation, "Sorry, no.")
  137. StartConversation(conversation, NPC, Spawn, "Good, it's a relief to have those taken care of. This will allow us to expend resources in more important areas. Speaking of which, I've recently received some strange reports. How'd you like to help me again?")
  138. end
  139. function dlg_1_2(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. conversation = CreateConversation()
  142. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson007.mp3", "", "", 3523318297, 3580020244, Spawn)
  143. AddConversationOption(conversation, "Ok, I'll attach the beacon.", "OfferQuest2")
  144. StartConversation(conversation, NPC, Spawn, "The body of water you passed earlier: I've had at least two reports of some sort of machine in that water. I've alerted the research teams, but they are busy elsewhere. In the mean time, it would be helpful if you could do two things for me. First, find the machine to verify it exists. And, second, if it does exist, tag it with an arcanic beacon.")
  145. end
  146. function OfferQuest2(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. OfferQuest(NPC, Spawn, QUEST_2)
  149. end
  150. function OnQuest2(NPC, Spawn)
  151. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson008.mp3", "", "", 702901482, 1827477819, Spawn)
  152. if (HasQuest(Spawn, QUEST_2) and GetQuestStep(Spawn, QUEST_2) == 2) or (HasCompletedQuest(Spawn, QUEST_2)) then
  153. AddConversationOption(conversation, "Yes. I attached the beacon, but before that I was attacked by a gnoll.", "dlg_6_1")
  154. else
  155. AddConversationOption(conversation, "No, not yet.")
  156. end
  157. StartConversation(conversation, NPC, Spawn, "Did you find the machine?")
  158. end
  159. function dlg_6_1(NPC, Spawn)
  160. if HasQuest(Spawn, QUEST_2) then
  161. SetStepComplete(Spawn, QUEST_2, 2)
  162. end
  163. FaceTarget(NPC, Spawn)
  164. conversation = CreateConversation()
  165. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson009.mp3", "", "", 416950362, 1150655784, Spawn)
  166. AddConversationOption(conversation, "Yes. I will help.", "dlg_6_2")
  167. AddConversationOption(conversation, "For now I must leave.")
  168. StartConversation(conversation, NPC, Spawn, "A gnoll?! Things are worse here than I thought. Perhaps they... hmm... I still need your help, can you stay?")
  169. end
  170. -----------------------------------------------------------------------------------------------------------------------------------
  171. -- QUEST 3
  172. -----------------------------------------------------------------------------------------------------------------------------------
  173. function dlg_6_2(NPC, Spawn)
  174. FaceTarget(NPC, Spawn)
  175. conversation = CreateConversation()
  176. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson010.mp3", "", "", 2108767843, 3888763580, Spawn)
  177. AddConversationOption(conversation, "Where are the ambush sites?", "dlg_6_3")
  178. StartConversation(conversation, NPC, Spawn, "I am glad. A number of our research teams in the Peat Bog were recently ambushed. Nobody was killed, thankfully, but their work has been lost. We've escorted the researchers to safety and left the ambush sites undisturbed. I would like you to go to each site and check for any clues that may tell us who did this. It would be easy to assume it was the gnolls, but I would like evidence to complement my gut feeling.")
  179. end
  180. function dlg_6_3(NPC, Spawn)
  181. FaceTarget(NPC, Spawn)
  182. conversation = CreateConversation()
  183. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson011.mp3", "", "", 3580800965, 1143356388, Spawn)
  184. AddConversationOption(conversation, "I will return.", "OfferQuest3")
  185. StartConversation(conversation, NPC, Spawn, "The first is west from Two Logs Pond, which is south from the sewer grate. The second is east of the pond in the north eastern corner of the area there. The final ambush site is directly south of the second site.")
  186. end
  187. function OfferQuest3(NPC, Spawn)
  188. FaceTarget(NPC, Spawn)
  189. OfferQuest(NPC, Spawn, QUEST_3)
  190. end
  191. function OnQuest3(NPC, Spawn, conversation)
  192. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson012.mp3", "", "", 3649722083, 1259667690, Spawn)
  193. if (HasQuest(Spawn, QUEST_3) and GetQuestStep(Spawn, QUEST_3) == 4) or (HasCompletedQuest(Spawn, QUEST_3)) then
  194. AddConversationOption(conversation, "Yes, at one I found a gnoll paw. There was nothing telling at the others.", "dlg_12_1")
  195. else
  196. AddConversationOption(conversation, "No, not yet.")
  197. end
  198. StartConversation(conversation, NPC, Spawn, "Have you examined all of the ambush sites?")
  199. end
  200. function dlg_12_1(NPC, Spawn)
  201. if HasQuest(Spawn, QUEST_3) then
  202. SetStepComplete(Spawn, QUEST_3, 4)
  203. end
  204. FaceTarget(NPC, Spawn)
  205. conversation = CreateConversation()
  206. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson013.mp3", "", "", 459920710, 2550974214, Spawn)
  207. AddConversationOption(conversation, "Yes, I can help.", "dlg_12_2")
  208. AddConversationOption(conversation, "Not right now.")
  209. StartConversation(conversation, NPC, Spawn, "That's good. Well, it's bad, but it's good. You know what I mean. This means we have less to worry about. It seems the gnolls are on the move, probably because we've found them. If our intelligence is correct they're moving a number of machines out of the Peat Bog. I don't know if this is a retreat or some movement for another advance, but we need to stop those machines. Can you help?")
  210. end
  211. -----------------------------------------------------------------------------------------------------------------------------------
  212. -- QUEST 4
  213. -----------------------------------------------------------------------------------------------------------------------------------
  214. function dlg_12_2(NPC, Spawn)
  215. FaceTarget(NPC, Spawn)
  216. conversation = CreateConversation()
  217. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson014.mp3", "", "", 3721129561, 3085892436, Spawn)
  218. AddConversationOption(conversation, "I'll be back when this is done.", "OfferQuest4")
  219. StartConversation(conversation, NPC, Spawn, "Wonderful. Their exit route seems to start in the south-east most corner of the Peat Bog and move west from there. There should be three machines. Kill the gnolls protecting the machine, destroy the machine itself, and then move on to the next one. Our people will be along soon enough to take care of the remains.")
  220. end
  221. function OfferQuest4(NPC, Spawn)
  222. FaceTarget(NPC, Spawn)
  223. OfferQuest(NPC, Spawn, QUEST_4)
  224. end
  225. function OnQuest4(NPC, Spawn, conversation)
  226. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson015.mp3", "", "", 2647530103, 2587149233, Spawn)
  227. if (HasQuest(Spawn, QUEST_4) and GetQuestStep(Spawn, QUEST_4) == 4) or (HasCompletedQuest(Spawn, QUEST_4)) then
  228. AddConversationOption(conversation, "Yes, I have.", "dlg_14_1")
  229. else
  230. AddConversationOption(conversation, "Not yet.")
  231. end
  232. StartConversation(conversation, NPC, Spawn, "Did you stop the gnolls?")
  233. end
  234. function dlg_14_1(NPC, Spawn)
  235. if HasQuest(Spawn, QUEST_4) then
  236. SetStepComplete(Spawn, QUEST_4, 4)
  237. end
  238. FaceTarget(NPC, Spawn)
  239. conversation = CreateConversation()
  240. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson017.mp3", "", "", 3063961189, 3632961186, Spawn)
  241. AddConversationOption(conversation, "What loose end?", "dlg_14_2")
  242. StartConversation(conversation, NPC, Spawn, "Good. I would hate to see one of the other Lieutenants clean up my mess. Thank you. There's still one loose end to clean up, if you're willing.")
  243. end
  244. -----------------------------------------------------------------------------------------------------------------------------------
  245. -- QUEST 5
  246. -----------------------------------------------------------------------------------------------------------------------------------
  247. function dlg_14_2(NPC, Spawn)
  248. FaceTarget(NPC, Spawn)
  249. conversation = CreateConversation()
  250. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson018.mp3", "", "", 1491634247, 1091662891, Spawn)
  251. AddConversationOption(conversation, "I can do this.", "dlg_14_3")
  252. AddConversationOption(conversation, "I can't do this.")
  253. StartConversation(conversation, NPC, Spawn, "Dentfang. He was one of the gnolls in charge of this area. He knows he can't return after such a failure, perhaps he hopes to hide out here long enough to reclaim his honor by slaying the guards of Qeynos. Nobody wants to see that happen. My scouts have suggested three possible places within the Peat Bog where he may be hiding. I've already sent teams to two places, the two I consider least likely. I'm positive he's at the final spot, and I would like you to take care of him. What do you say?")
  254. end
  255. function dlg_14_3(NPC, Spawn)
  256. FaceTarget(NPC, Spawn)
  257. conversation = CreateConversation()
  258. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson019.mp3", "", "", 726337004, 1780065710, Spawn)
  259. AddConversationOption(conversation, "Is he dangerous?", "OfferQuest5")
  260. StartConversation(conversation, NPC, Spawn, "Good. If you start in the southwestern corner of the Peat Bog and then travel north, you should come to the area where he's hiding. Travel there and give him what he deserves.")
  261. end
  262. function OfferQuest5(NPC, Spawn)
  263. FaceTarget(NPC, Spawn)
  264. OfferQuest(NPC, Spawn, QUEST_5)
  265. end
  266. function OnQuest5(NPC, Spawn, conversation)
  267. if (HasQuest(Spawn, QUEST_5) and GetQuestStep(Spawn, QUEST_5) == 2) or (HasCompletedQuest(Spawn, QUEST_5)) then
  268. AddConversationOption(conversation, "I have.", "Quest5Done")
  269. else
  270. AddConversationOption(conversation, "Not yet.")
  271. end
  272. StartConversation(conversation, NPC, Spawn, "Did you dispose of Dentfang?")
  273. end
  274. function Quest5Done(NPC, Spawn)
  275. if HasQuest(Spawn, QUEST_5) then
  276. SetStepComplete(Spawn, QUEST_5, 2)
  277. end
  278. FaceTarget(NPC, Spawn)
  279. conversation = CreateConversation()
  280. AddConversationOption(conversation, "You are welcome.", "WordHasCome")
  281. StartConversation(conversation, NPC, Spawn, "Good. With him gone the gnoll presence here will not be able to regain strength. They will flee or be killed. You've done a great thing for us, " .. GetName(Spawn) .. ". I appreciate it more than you know. And Qeynos, appreciates it too.")
  282. end
  283. -----------------------------------------------------------------------------------------------------------------------------------
  284. -- QUEST 6
  285. -----------------------------------------------------------------------------------------------------------------------------------
  286. function WordHasCome(NPC, Spawn)
  287. FaceTarget(NPC, Spawn)
  288. conversation = CreateConversation()
  289. PlayFlavor(NPC, "", "", "bow", 0, 0, Spawn)
  290. AddConversationOption(conversation, "I can do this.", "OfferQuest6")
  291. StartConversation(conversation, NPC, Spawn, "Word has come down from above, " .. GetName(Spawn) .. ". You have been requested specifically. Because of your help here you have been noticed. You are specifically being request in The Caves. You should be very proud. I am glad to have worked with you, I am sure you will be a huge asset in the coming battle.")
  292. end
  293. function OfferQuest6(NPC, Spawn)
  294. FaceTarget(NPC, Spawn)
  295. OfferQuest(NPC, Spawn, QUEST_6)
  296. end