LieutenantDawson.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  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 :
  7. Added in a completion flag for quest TheUnfortunateEarth from Botantist Lith. Updated quest IDs 507-512. 5/6/20. -Darksinga
  8. --]]
  9. local MIN_LEVEL = 5
  10. local QUEST_FROM_JOHFRIT = 46
  11. local QUEST_1 = 507
  12. local QUEST_2 = 508
  13. local QUEST_3 = 509
  14. local QUEST_4 = 510
  15. local QUEST_5 = 511
  16. local QUEST_6 = 512
  17. local QUEST_UEARTH = 518
  18. function spawn(NPC)
  19. ProvidesQuest(NPC, QUEST_1)
  20. ProvidesQuest(NPC, QUEST_2)
  21. ProvidesQuest(NPC, QUEST_3)
  22. ProvidesQuest(NPC, QUEST_4)
  23. ProvidesQuest(NPC, QUEST_5)
  24. ProvidesQuest(NPC, QUEST_6)
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. conversation = CreateConversation()
  32. if HasQuest(Spawn, QUEST_FROM_JOHFRIT) then
  33. SetStepComplete(Spawn, QUEST_FROM_JOHFRIT, 1)
  34. end
  35. if HasQuest (Spawn, QUEST_UEARTH) then
  36. SetStepComplete(Spawn, QUEST_UEARTH, 5)
  37. end
  38. if HasCompletedQuest(Spawn, QUEST_1) then
  39. if HasCompletedQuest(Spawn, QUEST_2) then
  40. if HasCompletedQuest(Spawn, QUEST_3) then
  41. if HasCompletedQuest(Spawn, QUEST_4) then
  42. if HasCompletedQuest(Spawn, QUEST_5) then
  43. if HasCompletedQuest(Spawn, QUEST_6) then
  44. Say(NPC, "Once again, thank you for all you have done.", Spawn)
  45. elseif HasQuest(Spawn, QUEST_6) then
  46. Say(NPC, "Once again, thank you for all you have done.", Spawn)
  47. else
  48. OnQuest5(NPC, Spawn, conversation)
  49. end
  50. elseif HasQuest(Spawn, QUEST_5) then
  51. OnQuest5(NPC, Spawn, conversation)
  52. else
  53. OnQuest4(NPC, Spawn, conversation)
  54. end
  55. elseif HasQuest(Spawn, QUEST_4) then
  56. OnQuest4(NPC, Spawn, conversation)
  57. else
  58. OnQuest3(NPC, Spawn, conversation)
  59. end
  60. elseif HasQuest(Spawn, QUEST_3) then
  61. OnQuest3(NPC, Spawn, conversation)
  62. else
  63. OnQuest2(NPC, Spawn, conversation)
  64. end
  65. elseif HasQuest(Spawn, QUEST_2) then
  66. OnQuest2(NPC, Spawn, conversation)
  67. else
  68. OnQuest1(NPC, Spawn, conversation)
  69. end
  70. elseif HasQuest(Spawn, QUEST_1) then
  71. OnQuest1(NPC, Spawn, conversation)
  72. else
  73. if GetLevel(Spawn) < MIN_LEVEL then
  74. 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)
  75. else
  76. DoYouHaveAQuestion(NPC, Spawn, conversation)
  77. end
  78. end
  79. end
  80. -----------------------------------------------------------------------------------------------------------------------------------
  81. -- QUEST 1
  82. -----------------------------------------------------------------------------------------------------------------------------------
  83. function DoYouHaveAQuestion(NPC, Spawn, conversation)
  84. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson000.mp3", "", "", 2113696179, 3288237924, Spawn)
  85. AddConversationOption(conversation, "What is your mind occupied with?", "dlg_0_1")
  86. StartConversation(conversation, NPC, Spawn, "Do you have a question? Please be brief, my mind is occupied at the moment.")
  87. end
  88. function dlg_0_1(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. conversation = CreateConversation()
  91. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson001.mp3", "", "", 1614058358, 1618385129, Spawn)
  92. AddConversationOption(conversation, "How do you plan on doing that?", "dlg_0_2")
  93. 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.")
  94. end
  95. function dlg_0_2(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. conversation = CreateConversation()
  98. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson002.mp3", "", "", 3230267563, 3912489115, Spawn)
  99. AddConversationOption(conversation, "Sure, what can I do?", "dlg_0_3")
  100. 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?")
  101. end
  102. function dlg_0_3(NPC, Spawn)
  103. FaceTarget(NPC, Spawn)
  104. conversation = CreateConversation()
  105. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson003.mp3", "", "", 1827785196, 3415599407, Spawn)
  106. AddConversationOption(conversation, "Sure, I can do it.", "dlg_0_4")
  107. AddConversationOption(conversation, "Not now, sorry.")
  108. 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?")
  109. end
  110. function dlg_0_4(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. conversation = CreateConversation()
  113. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson004.mp3", "", "", 146673171, 1820291654, Spawn)
  114. AddConversationOption(conversation, "All right.", "OfferQuest1")
  115. 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.")
  116. end
  117. function OfferQuest1(NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. OfferQuest(NPC, Spawn, QUEST_1)
  120. end
  121. function OnQuest1(NPC, Spawn, conversation)
  122. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson005.mp3", "", "", 3763908858, 4198264181, Spawn)
  123. if (HasQuest(Spawn, QUEST_1) and GetQuestStep(Spawn, QUEST_1) == 3) or (HasCompletedQuest(Spawn, QUEST_1)) then
  124. AddConversationOption(conversation, "Yes, I have.", "dlg_1_1")
  125. else
  126. AddConversationOption(conversation, "No, not yet.")
  127. end
  128. StartConversation(conversation, NPC, Spawn, "Have you killed the slugs and fungus men?")
  129. end
  130. -----------------------------------------------------------------------------------------------------------------------------------
  131. -- QUEST 2
  132. -----------------------------------------------------------------------------------------------------------------------------------
  133. function dlg_1_1(NPC, Spawn)
  134. if HasQuest(Spawn, QUEST_1) then
  135. SetStepComplete(Spawn, QUEST_1, 3)
  136. end
  137. FaceTarget(NPC, Spawn)
  138. conversation = CreateConversation()
  139. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson006.mp3", "", "", 74693624, 878787652, Spawn)
  140. AddConversationOption(conversation, "Sure, what can I do?", "dlg_1_2")
  141. AddConversationOption(conversation, "Sorry, no.")
  142. 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?")
  143. end
  144. function dlg_1_2(NPC, Spawn)
  145. FaceTarget(NPC, Spawn)
  146. conversation = CreateConversation()
  147. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson007.mp3", "", "", 3523318297, 3580020244, Spawn)
  148. AddConversationOption(conversation, "Ok, I'll attach the beacon.", "OfferQuest2")
  149. 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.")
  150. end
  151. function OfferQuest2(NPC, Spawn)
  152. FaceTarget(NPC, Spawn)
  153. OfferQuest(NPC, Spawn, QUEST_2)
  154. end
  155. function OnQuest2(NPC, Spawn)
  156. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson008.mp3", "", "", 702901482, 1827477819, Spawn)
  157. if (HasQuest(Spawn, QUEST_2) and GetQuestStep(Spawn, QUEST_2) == 2) or (HasCompletedQuest(Spawn, QUEST_2)) then
  158. AddConversationOption(conversation, "Yes. I attached the beacon, but before that I was attacked by a gnoll.", "dlg_6_1")
  159. else
  160. AddConversationOption(conversation, "No, not yet.")
  161. end
  162. StartConversation(conversation, NPC, Spawn, "Did you find the machine?")
  163. end
  164. function dlg_6_1(NPC, Spawn)
  165. if HasQuest(Spawn, QUEST_2) then
  166. SetStepComplete(Spawn, QUEST_2, 2)
  167. end
  168. FaceTarget(NPC, Spawn)
  169. conversation = CreateConversation()
  170. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson009.mp3", "", "", 416950362, 1150655784, Spawn)
  171. AddConversationOption(conversation, "Yes. I will help.", "dlg_6_2")
  172. AddConversationOption(conversation, "For now I must leave.")
  173. StartConversation(conversation, NPC, Spawn, "A gnoll?! Things are worse here than I thought. Perhaps they... hmm... I still need your help, can you stay?")
  174. end
  175. -----------------------------------------------------------------------------------------------------------------------------------
  176. -- QUEST 3
  177. -----------------------------------------------------------------------------------------------------------------------------------
  178. function dlg_6_2(NPC, Spawn)
  179. FaceTarget(NPC, Spawn)
  180. conversation = CreateConversation()
  181. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson010.mp3", "", "", 2108767843, 3888763580, Spawn)
  182. AddConversationOption(conversation, "Where are the ambush sites?", "dlg_6_3")
  183. 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.")
  184. end
  185. function dlg_6_3(NPC, Spawn)
  186. FaceTarget(NPC, Spawn)
  187. conversation = CreateConversation()
  188. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson011.mp3", "", "", 3580800965, 1143356388, Spawn)
  189. AddConversationOption(conversation, "I will return.", "OfferQuest3")
  190. 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.")
  191. end
  192. function OfferQuest3(NPC, Spawn)
  193. FaceTarget(NPC, Spawn)
  194. OfferQuest(NPC, Spawn, QUEST_3)
  195. end
  196. function OnQuest3(NPC, Spawn, conversation)
  197. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson012.mp3", "", "", 3649722083, 1259667690, Spawn)
  198. if (HasQuest(Spawn, QUEST_3) and GetQuestStep(Spawn, QUEST_3) == 4) or (HasCompletedQuest(Spawn, QUEST_3)) then
  199. AddConversationOption(conversation, "Yes, at one I found a gnoll paw. There was nothing telling at the others.", "dlg_12_1")
  200. else
  201. AddConversationOption(conversation, "No, not yet.")
  202. end
  203. StartConversation(conversation, NPC, Spawn, "Have you examined all of the ambush sites?")
  204. end
  205. function dlg_12_1(NPC, Spawn)
  206. if HasQuest(Spawn, QUEST_3) then
  207. SetStepComplete(Spawn, QUEST_3, 4)
  208. end
  209. FaceTarget(NPC, Spawn)
  210. conversation = CreateConversation()
  211. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson013.mp3", "", "", 459920710, 2550974214, Spawn)
  212. AddConversationOption(conversation, "Yes, I can help.", "dlg_12_2")
  213. AddConversationOption(conversation, "Not right now.")
  214. 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?")
  215. end
  216. -----------------------------------------------------------------------------------------------------------------------------------
  217. -- QUEST 4
  218. -----------------------------------------------------------------------------------------------------------------------------------
  219. function dlg_12_2(NPC, Spawn)
  220. FaceTarget(NPC, Spawn)
  221. conversation = CreateConversation()
  222. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson014.mp3", "", "", 3721129561, 3085892436, Spawn)
  223. AddConversationOption(conversation, "I'll be back when this is done.", "OfferQuest4")
  224. 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.")
  225. end
  226. function OfferQuest4(NPC, Spawn)
  227. FaceTarget(NPC, Spawn)
  228. OfferQuest(NPC, Spawn, QUEST_4)
  229. end
  230. function OnQuest4(NPC, Spawn, conversation)
  231. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson015.mp3", "", "", 2647530103, 2587149233, Spawn)
  232. if (HasQuest(Spawn, QUEST_4) and GetQuestStep(Spawn, QUEST_4) == 4) or (HasCompletedQuest(Spawn, QUEST_4)) then
  233. AddConversationOption(conversation, "Yes, I have.", "dlg_14_1")
  234. else
  235. AddConversationOption(conversation, "Not yet.")
  236. end
  237. StartConversation(conversation, NPC, Spawn, "Did you stop the gnolls?")
  238. end
  239. function dlg_14_1(NPC, Spawn)
  240. if HasQuest(Spawn, QUEST_4) then
  241. SetStepComplete(Spawn, QUEST_4, 4)
  242. end
  243. FaceTarget(NPC, Spawn)
  244. conversation = CreateConversation()
  245. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson017.mp3", "", "", 3063961189, 3632961186, Spawn)
  246. AddConversationOption(conversation, "What loose end?", "dlg_14_2")
  247. 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.")
  248. end
  249. -----------------------------------------------------------------------------------------------------------------------------------
  250. -- QUEST 5
  251. -----------------------------------------------------------------------------------------------------------------------------------
  252. function dlg_14_2(NPC, Spawn)
  253. FaceTarget(NPC, Spawn)
  254. conversation = CreateConversation()
  255. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson018.mp3", "", "", 1491634247, 1091662891, Spawn)
  256. AddConversationOption(conversation, "I can do this.", "dlg_14_3")
  257. AddConversationOption(conversation, "I can't do this.")
  258. 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?")
  259. end
  260. function dlg_14_3(NPC, Spawn)
  261. FaceTarget(NPC, Spawn)
  262. conversation = CreateConversation()
  263. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/lieutenant_dawson/qey_adv04_bog/quests/dawson/dawson019.mp3", "", "", 726337004, 1780065710, Spawn)
  264. AddConversationOption(conversation, "Is he dangerous?", "OfferQuest5")
  265. 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.")
  266. end
  267. function OfferQuest5(NPC, Spawn)
  268. FaceTarget(NPC, Spawn)
  269. OfferQuest(NPC, Spawn, QUEST_5)
  270. end
  271. function OnQuest5(NPC, Spawn, conversation)
  272. if (HasQuest(Spawn, QUEST_5) and GetQuestStep(Spawn, QUEST_5) == 2) or (HasCompletedQuest(Spawn, QUEST_5)) then
  273. AddConversationOption(conversation, "I have.", "Quest5Done")
  274. else
  275. AddConversationOption(conversation, "Not yet.")
  276. end
  277. StartConversation(conversation, NPC, Spawn, "Did you dispose of Dentfang?")
  278. end
  279. function Quest5Done(NPC, Spawn)
  280. if HasQuest(Spawn, QUEST_5) then
  281. SetStepComplete(Spawn, QUEST_5, 2)
  282. end
  283. FaceTarget(NPC, Spawn)
  284. conversation = CreateConversation()
  285. AddConversationOption(conversation, "You are welcome.", "WordHasCome")
  286. 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.")
  287. end
  288. -----------------------------------------------------------------------------------------------------------------------------------
  289. -- QUEST 6
  290. -----------------------------------------------------------------------------------------------------------------------------------
  291. function WordHasCome(NPC, Spawn)
  292. FaceTarget(NPC, Spawn)
  293. conversation = CreateConversation()
  294. PlayFlavor(NPC, "", "", "bow", 0, 0, Spawn)
  295. AddConversationOption(conversation, "I can do this.", "OfferQuest6")
  296. 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.")
  297. end
  298. function OfferQuest6(NPC, Spawn)
  299. FaceTarget(NPC, Spawn)
  300. OfferQuest(NPC, Spawn, QUEST_6)
  301. end