9
3

ActingLieutenantGermain.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/ActingLieutenantGermain.lua
  3. Script Purpose : Acting Lieutenant Germain
  4. Script Author : Scatman
  5. Script Date : 2009.09.27
  6. Script Notes : This script needs a re-write. Using the dialog parser will help. The mess here has been modified by several unlisted people. - 07.14.2022 Dorbin
  7. --]]
  8. local QUEST_FROM_REMMY = 533
  9. local QUEST_FROM_POKO = 5474
  10. local QUEST_FROM_Ilaen = 5495
  11. local QUEST_1 = 520 --News for Germain
  12. local QUEST_2 = 521 --Favors
  13. local QUEST_3 = 522 --Return to the Disturbance
  14. local QUEST_4 = 5492 --Uncovering the Caches
  15. function spawn(NPC)
  16. ProvidesQuest(NPC, QUEST_1)
  17. ProvidesQuest(NPC, QUEST_2)
  18. ProvidesQuest(NPC, QUEST_3)
  19. ProvidesQuest(NPC, QUEST_4)
  20. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  21. end
  22. function InRange(NPC, Spawn)
  23. if math.random(1, 100) <= 75 then
  24. choice = math.random(1,3)
  25. FaceTarget(NPC, Spawn)
  26. if choice ==1 then
  27. PlayFlavor(NPC, "", "", "ponder", 0, 0, Spawn)
  28. elseif choice ==2 then
  29. PlayFlavor(NPC, "", "", "salute", 0, 0, Spawn)
  30. else
  31. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  32. end
  33. end
  34. end
  35. function respawn(NPC)
  36. spawn(NPC)
  37. end
  38. function hailed(NPC, Spawn)
  39. FaceTarget(NPC, Spawn)
  40. conversation = CreateConversation()
  41. if HasQuest(Spawn, QUEST_FROM_POKO) and GetQuestStep(Spawn, QUEST_FROM_POKO) == 3 then
  42. AddConversationOption(conversation, "I have news for you.", "NewsForYou")
  43. elseif HasQuest(Spawn, QUEST_FROM_REMMY) and GetQuestStep(Spawn, QUEST_FROM_REMMY) == 2 then
  44. AddConversationOption(conversation, "I have news for you.", "NewsForYou2")
  45. elseif GetQuestStep(Spawn,QUEST_FROM_Ilaen)==3 then
  46. AddConversationOption(conversation,"I found this arrow on a fallen deer around here.", "Dialog32")
  47. end
  48. --[[ choice = math.random(1, 3)
  49. if choice == 1 then
  50. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1004.mp3", "", "", 0, 0)
  51. elseif choice == 2 then
  52. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3", "", "", 0, 0)
  53. else
  54. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", "", "", 0, 0)
  55. end]]--
  56. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain000.mp3", "", "hello", 3884077763, 891162435, Spawn)
  57. if HasCompletedQuest(Spawn, QUEST_1) then
  58. -- Say(NPC, "Hey! quest 1 complete")
  59. if HasCompletedQuest(Spawn, QUEST_2) then
  60. -- Say(NPC, "Hey! quest 2 complete")
  61. if HasCompletedQuest(Spawn, QUEST_3) then
  62. Say(NPC, "Hey! quest 3 complete")
  63. elseif HasQuest(Spawn, QUEST_4) then
  64. AddConversationOption(conversation, "Not yet.")
  65. StartConversation(conversation, NPC, Spawn, "Have you destroyed the tools?")
  66. if GetQuestStep(Spawn,QUEST_3)==3 or HasCompletedQuest(Spawn, QUEST_3) then
  67. AddConversationOption(conversation, "I found this book.","Step3Done")
  68. end
  69. AddConversationOption(conversation, "I'll come back when I've performed the task.")
  70. StartConversation(conversation, NPC, Spawn, "Well?")
  71. elseif HasCompletedQuest(Spawn, QUEST_3) then
  72. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain009.mp3", "", "", 4053457773, 134802130, Spawn)
  73. AddConversationOption(conversation, "What happened with the leaf?", "dlg_3_1")
  74. StartConversation(conversation, NPC, Spawn, "Welcome back. Are you ready for some more work?")
  75. end
  76. elseif HasQuest(Spawn, QUEST_2) then
  77. if GetQuestStep(Spawn, QUEST_2) == 8 then
  78. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain009.mp3", "", "", 4053457773, 134802130, Spawn)
  79. AddConversationOption(conversation, "What happened with the leaf?", "dlg_3_1")
  80. StartConversation(conversation, NPC, Spawn, "Welcome back. Are you ready for some more work?")
  81. end
  82. else
  83. OnQuest1(NPC, Spawn, conversation)
  84. end
  85. elseif HasQuest(Spawn, QUEST_1) then
  86. OnQuest1(NPC, Spawn, conversation)
  87. else
  88. if GetLevel(Spawn) >= 5 then
  89. WelcomeCitizen(NPC, Spawn, conversation)
  90. else
  91. Say(NPC, "Come back to me once you've gotten a bit stronger.", Spawn)
  92. end
  93. end
  94. end
  95. --[[
  96. if convo==1 then
  97. AddConversationOption(conversation, "I do not know yet.", "dlg_0_1")
  98. StartConversation(conversation, NPC, Spawn, "What does Poko say?")
  99. end
  100. if convo==6 then
  101. end
  102. if convo==7 then
  103. StartConversation(conversation, NPC, Spawn, "Any news of Del Varun?")
  104. end
  105. if convo==8 then
  106. AddConversationOption(conversation, "I do not know yet.", "dlg_8_1")
  107. StartConversation(conversation, NPC, Spawn, "What does Poko say?")
  108. end
  109. if convo==16 then
  110. AddConversationOption(conversation, "I have news for you.", "dlg_16_1")
  111. StartConversation(conversation, NPC, Spawn, "Welcome, citizen. Please be careful around here.")
  112. end
  113. --]]
  114. ----------------------------------------------------------------------------------------------------------
  115. -- QUEST FROM POKO
  116. ----------------------------------------------------------------------------------------------------------
  117. function NewsForYou(NPC, Spawn)
  118. SetStepComplete(Spawn, QUEST_FROM_POKO, 3)
  119. FaceTarget(NPC, Spawn)
  120. conversation = CreateConversation()
  121. PlayFlavor(NPC, "", "", "ponder", 0, 0)
  122. AddConversationOption(conversation, "I was collecting machine parts for Poko and one of the parts I returned seems to be of Freeportian origin.", "dlg_16_2")
  123. StartConversation(conversation, NPC, Spawn, "What is it, citizen?")
  124. end
  125. function dlg_16_2(NPC, Spawn)
  126. FaceTarget(NPC, Spawn)
  127. conversation = CreateConversation()
  128. PlayFlavor(NPC, "", "", "nod", 0, 0)
  129. if not HasQuest(Spawn, QUEST_1) and not HasCompletedQuest(Spawn, QUEST_1) then
  130. AddConversationOption(conversation, "I can help.", "dlg_1_3")
  131. else
  132. AddConversationOption(conversation, "You're welcome.")
  133. end
  134. StartConversation(conversation, NPC, Spawn, "The bad news just doesn't cease. Citizen, there are obviously multiple things afoot in this place, I thank you for your help even if you're adding to my discomfort.")
  135. end
  136. ----------------------------------------------------------------------------------------------------------
  137. -- QUEST FROM REMMY
  138. ----------------------------------------------------------------------------------------------------------
  139. function NewsForYou2(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. conversation = CreateConversation()
  142. PlayFlavor(NPC, "", "", "ponder", 0, 0)
  143. AddConversationOption(conversation, "Remmy Tumbum is innocent. I found this clump of fur on some of the supplies recently broken into. It smells like gnoll.", "dlg_16_2a")
  144. StartConversation(conversation, NPC, Spawn, "What is it, citizen?")
  145. end
  146. function dlg_16_2a(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. conversation = CreateConversation()
  149. PlayFlavor(NPC, "", "", "nod", 0, 0)
  150. SetStepComplete(Spawn, QUEST_FROM_REMMY, 2)
  151. while HasItem(Player, 7797) do
  152. RemoveItem(Player,7797)
  153. end
  154. if not HasQuest(Spawn, QUEST_1) and not HasCompletedQuest(Spawn, QUEST_1) then
  155. AddConversationOption(conversation, "I can help.", "dlg_1_3")
  156. else
  157. AddConversationOption(conversation, "You're welcome.")
  158. end
  159. StartConversation(conversation, NPC, Spawn, "The bad news just doesn't cease. Citizen, there are obviously multiple things afoot in this place, I thank you for your help even if you're adding to my discomfort.")
  160. end
  161. ----------------------------------------------------------------------------------------------------------
  162. -- QUEST FROM Ilaen
  163. ----------------------------------------------------------------------------------------------------------
  164. function Dialog32(NPC, Spawn)
  165. FaceTarget(NPC, Spawn)
  166. conversation = CreateConversation()
  167. Dialog.AddDialog("")
  168. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain_ilaen001.mp3","","nod", 1946196030, 3212706189,Spawn)
  169. SetStepComplete(Spawn, QUEST_FROM_Ilaen, 3)
  170. if not HasQuest(Spawn, QUEST_1) and not HasCompletedQuest(Spawn, QUEST_1) then
  171. AddConversationOption(conversation, "I can help.", "dlg_1_3")
  172. end
  173. AddConversationOption(conversation,"The proof will come in time.")
  174. StartConversation(conversation, NPC, Spawn, "I recognize this design... I hope this doesn't mean what I think it means. The gnolls may be on the move. Proof of this would spur Qeynos to move, but a single arrow is not proof.")
  175. end
  176. ----------------------------------------------------------------------------------------------------------
  177. -- QUEST 1
  178. ----------------------------------------------------------------------------------------------------------
  179. function WelcomeCitizen(NPC, Spawn, conversation)
  180. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain000.mp3", "", "hello", 3884077763, 891162435, Spawn)
  181. AddConversationOption(conversation, "Is it dangerous here?", "dlg_1_1")
  182. StartConversation(conversation, NPC, Spawn, "Welcome, citizen. Please be careful around here.")
  183. end
  184. function dlg_1_1(NPC, Spawn)
  185. FaceTarget(NPC, Spawn)
  186. conversation = CreateConversation()
  187. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain001.mp3", "", "", 1672198547, 0, Spawn)
  188. AddConversationOption(conversation, "It sounds very busy here.", "dlg_1_2")
  189. StartConversation(conversation, NPC, Spawn, "Yes, quite dangerous. We have been getting reports, strange reports, over the past few days. Nobody is sure exactly what is going on, and we don't have the manpower to find out once and for all. I've got scouts but even they can only do so much. We've got so few people that it's hard to take care of all the little things. Ever since the pirates landed the Concordium has been asking for more and more protection.")
  190. end
  191. function dlg_1_2(NPC, Spawn)
  192. FaceTarget(NPC, Spawn)
  193. conversation = CreateConversation()
  194. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain002.mp3", "", "nod", 2829219447, 0, Spawn)
  195. AddConversationOption(conversation, "I can help.", "dlg_1_3")
  196. AddConversationOption(conversation, "Sorry, I can't help right now.")
  197. StartConversation(conversation, NPC, Spawn, "More than you know. With dead-end investigations, big threats, little threats, and vague orders from the Qeynos Guard AND the Concordium I'm amazed this place hasn't been put under siege by the hawks yet. I'm sorry for complaining to you. Listen, how would you like to help me out?")
  198. end
  199. function dlg_1_3(NPC, Spawn)
  200. FaceTarget(NPC, Spawn)
  201. conversation = CreateConversation()
  202. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain003.mp3", "", "", 1108120794, 0, Spawn)
  203. AddConversationOption(conversation, "I'll see what I can find.", "OfferQuest1")
  204. StartConversation(conversation, NPC, Spawn, "Good, that's great news. The first thing I'd like you to do is help me locate a missing scout. Del Varun was assigned to the small pond on the western side of the ruins. He hasn't checked back in and hasn't been spotted in a few days. I'd like you to head that direction and see if you can find him.")
  205. end
  206. function OfferQuest1(NPC, Spawn)
  207. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain003a.mp3", "Don't get yourself hurt doing something foolish!", "", 3821205637, 0, Spawn)
  208. FaceTarget(NPC, Spawn)
  209. OfferQuest(NPC, Spawn, QUEST_1)
  210. end
  211. function OnQuest1(NPC, Spawn, conversation)
  212. if (HasQuest(Spawn, QUEST_1) and GetQuestStep(Spawn, QUEST_1) == 4) or (HasCompletedQuest(Spawn, QUEST_1)) then
  213. AddConversationOption(conversation, "Yes. I found his satchel.", "dlg_7_1")
  214. else
  215. AddConversationOption(conversation, "Not quite yet.")
  216. end
  217. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain004.mp3", "", "nod", 4174680410, 4068442606, Spawn)
  218. StartConversation(conversation, NPC, Spawn, "Any news of Del Varun?")
  219. end
  220. function dlg_3_1(NPC, Spawn)
  221. FaceTarget(NPC, Spawn)
  222. conversation = CreateConversation()
  223. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain010.mp3", "", "", 2663997308, 470495818, Spawn)
  224. AddConversationOption(conversation, "What are we going to do?", "dlg_3_2")
  225. StartConversation(conversation, NPC, Spawn, "It was part of an illusion. Poko made up some kind of dust that he says can dispel the illusion for short periods of time. So, it's time for us to figure out what someone has been trying to hide.")
  226. end
  227. function dlg_3_2(NPC, Spawn)
  228. FaceTarget(NPC, Spawn)
  229. SetStepComplete(Spawn, QUEST_2, 8)
  230. conversation = CreateConversation()
  231. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain011.mp3", "", "", 3240178244, 1388073275, Spawn)
  232. AddConversationOption(conversation, "What should I be looking for?", "dlg_3_3")
  233. StartConversation(conversation, NPC, Spawn, "Find out what those plants are hiding. I'd like you to take Poko's dust and go sprinkle it on the plants. Try to bring back some kind of clue if at all possible, I doubt it will all be nailed down.")
  234. end
  235. function dlg_3_3(NPC, Spawn)
  236. FaceTarget(NPC, Spawn)
  237. OfferQuest(NPC, Spawn, QUEST_3)
  238. -- Sprinkle Nullification Powder
  239. conversation = CreateConversation()
  240. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain011a.mp3", "", "", 1214679313, 1635044010, Spawn)
  241. AddConversationOption(conversation, "Okay.")
  242. StartConversation(conversation, NPC, Spawn, "Plans would help the most. Some paper or a book or something of the kind.")
  243. end
  244. function dlg_7_1(NPC, Spawn)
  245. FaceTarget(NPC, Spawn)
  246. conversation = CreateConversation()
  247. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/acting_lieutenant_germain/qey_adv02_ruins/quests/germain/germain005.mp3", "", "", 1917536977, 2373330590, Spawn)
  248. AddConversationOption(conversation, "There is more. In his notes he mentioned some strange, glowing plants north of the pond. I brought back a sample.", "dlg_7_2")
  249. StartConversation(conversation, NPC, Spawn, "Only his satchel? I was afraid of this. I wish we had some leads, he may yet be alive.")
  250. end
  251. function dlg_7_2(NPC, Spawn)
  252. if HasQuest(Spawn, QUEST_1) then
  253. SetStepComplete(Spawn, QUEST_1, 4)
  254. end
  255. FaceTarget(NPC, Spawn)
  256. conversation = CreateConversation()
  257. AddConversationOption(conversation, "Yes, take a look at this leaf.", "dlg_7_3")
  258. StartConversation(conversation, NPC, Spawn, "Ah, good thinking. Did you see the glowing too? Perhaps it was a transitory thing.")
  259. end
  260. ----------------------------------------------------------------------------------------------------------
  261. -- QUEST 2
  262. ----------------------------------------------------------------------------------------------------------
  263. function dlg_7_3(NPC, Spawn)
  264. FaceTarget(NPC, Spawn)
  265. conversation = CreateConversation()
  266. AddConversationOption(conversation, "What do you think it is?", "OfferQuest2")
  267. StartConversation(conversation, NPC, Spawn, "Incredible. Please, take this to Poko Zing over there. Have him analyze it for us.")
  268. end
  269. function OfferQuest2(NPC, Spawn)
  270. FaceTarget(NPC, Spawn)
  271. OfferQuest(NPC, Spawn, QUEST_2)
  272. end
  273. function dlg_7_4(NPC, Spawn)
  274. FaceTarget(NPC, Spawn)
  275. conversation = CreateConversation()
  276. AddConversationOption(conversation, "All right.", "dlg_7_5")
  277. StartConversation(conversation, NPC, Spawn, "I don't know, but I'm hoping Poko will be able to tell us.")
  278. end
  279. function dlg_7_5(NPC, Spawn)
  280. FaceTarget(NPC, Spawn)
  281. conversation = CreateConversation()
  282. AddConversationOption(conversation, "I do not know yet.", "dlg_7_6")
  283. StartConversation(conversation, NPC, Spawn, "What does Poko say?")
  284. end
  285. function QuestComplete(NPC, Spawn)
  286. FaceTarget(NPC, Spawn)
  287. conversation = CreateConversation()
  288. SetStepComplete(Spawn, QUEST_2, 8)
  289. AddConversationOption(conversation, "I HAVE COMPLETED QUEST PLACEHOLDER")
  290. StartConversation(conversation, NPC, Spawn, "GOOD JOB PLACEHOLDER")
  291. end
  292. ----------------------------------------------------------------------------------------------------------
  293. -- QUEST 3
  294. ----------------------------------------------------------------------------------------------------------
  295. function OfferQuest3(NPC, Spawn)
  296. FaceTarget(NPC, Spawn)
  297. OfferQuest(NPC, Spawn, QUEST_3)
  298. end
  299. function Step3Done(NPC, Spawn)
  300. FaceTarget(NPC, Spawn)
  301. conversation = CreateConversation()
  302. AddConversationOption(conversation, "It was a camp.", "Step3Done2")
  303. StartConversation(conversation, NPC, Spawn, "Gnolls... was there anything else other than the book?")
  304. end
  305. function Step3Done2(NPC, Spawn)
  306. FaceTarget(NPC, Spawn)
  307. conversation = CreateConversation()
  308. SetStepComplete(Spawn, QUEST_3, 3)
  309. PlayFlavor(NPC, "", "", "sigh", 1917536977, 2373330590, Spawn)
  310. AddConversationOption(conversation, "Does the book say what the gnolls are planning?", "Step3Done3")
  311. StartConversation(conversation, NPC, Spawn, "That is quite unfortunate. This diagrams in this book look like they involve digging tools and machines. Thi- wait a minute! Accoding to these plans the gnolls have digging tools stored all over the place! They are probably under the same magical veil as the camp.")
  312. end
  313. function Step3Done3(NPC, Spawn)
  314. FaceTarget(NPC, Spawn)
  315. conversation = CreateConversation()
  316. PlayFlavor(NPC, "", "", "no", 1917536977, 2373330590, Spawn)
  317. AddConversationOption(conversation, "All right, I'll return.", "OfferQuest4")
  318. StartConversation(conversation, NPC, Spawn, "No, but we need to stop them. I need you to go back out around the ruins. Find these hidden digging tools, sprinkle some of Poko's powder on them, and destroy them.")
  319. end
  320. function OfferQuest4(NPC, Spawn)
  321. FaceTarget(NPC, Spawn)
  322. OfferQuest(NPC, Spawn, QUEST_4)
  323. end