9
3

TasksaboardtheFarJourney.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. --[[
  2. Script Name : TasksaboardtheFarJourney.lua
  3. Script Purpose : Handles the quest, "Tasks aboard the Far Journey"
  4. Script Author : Cynnar
  5. Script Date : 2/23/2020
  6. Script Notes :
  7. Zone : Hallmark
  8. Quest Giver :
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. local Waulon = 270002
  13. local CaptainVarlos = 270000
  14. local Ingrid = 270001
  15. local ARat = 270009
  16. local Goblin = 270008
  17. local WaulonsHat = 15354
  18. local ShardOfLucin = 12565
  19. function Init(Quest)
  20. AddQuestStepChat(Quest, 1, "I should speak to Waulon.", 1, "Captain Varlos has asked me to speak to Waulon.", 11, Waulon)
  21. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  22. end
  23. function Step2Init(Quest, QuestGiver, Player)
  24. UpdateQuestStepDescription(Quest, 1, "I spoke to Waulon.")
  25. UpdateQuestTaskGroupDescription(Quest, 1, "I spoke to Waulon as Captain Varlos had asked of me.")
  26. AddQuestStepObtainItem(Quest, 2, "I should start by opening boxes on the deck.", 1, 100, "Waulon has asked me to look for his hat in one of the boxes on the deck.", 11, WaulonsHat)
  27. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  28. end
  29. function Step3Init(Quest, QuestGiver, Player)
  30. SetTutorialStep(Player, 17)
  31. UpdateQuestStepDescription(Quest, 2, "I found Waulon's hat.")
  32. UpdateQuestTaskGroupDescription(Quest, 2, "I found Waulon's hat in one of the boxes.")
  33. AddQuestStepChat(Quest, 3, "I should speak to Waulon.", 1, "Now that I found Waulon's hat, I should return it.", 258, Waulon)
  34. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  35. end
  36. function Step4Init(Quest, QuestGiver, Player)
  37. UpdateQuestStepDescription(Quest, 3, "I returned Waulon's hat to him.")
  38. UpdateQuestTaskGroupDescription(Quest, 3, "I returned Waulon's hat.")
  39. AddQuestStepChat(Quest, 4, "I should speak to Ingrid.", 1, "Waulon has asked me to speak to Ingrid.", 11, Ingrid)
  40. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  41. end
  42. function Step5Init(Quest, QuestGiver, Player)
  43. UpdateQuestStepDescription(Quest, 4, "I have spoken to Ingrid as Waulon had asked.")
  44. UpdateQuestTaskGroupDescription(Quest, 4, "I have spoken to Ingrid.")
  45. AddQuestStepObtainItem(Quest, 5, "I should find a way to buy the shard from Merchant Vim.", 1, 100, "Ingrid would like me to buy her a Shard of Luclin.", 11, ShardOfLucin)
  46. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  47. SetTutorialStep(Player, 24)
  48. end
  49. function Step6Init(Quest, QuestGiver, Player)
  50. UpdateQuestStepDescription(Quest, 5, "I have purchased a Shard of Luclin.")
  51. UpdateQuestTaskGroupDescription(Quest, 5, "I purchased a Shard of Luclin.")
  52. AddQuestStepChat(Quest, 6, "Return to Ingrid.", 1, "Ingrid would like me to give her the Shard of Luclin.", 183, Ingrid)
  53. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  54. SetTutorialStep(Player, 30)
  55. end
  56. function Step7Init(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 6, "I gave the Shard of Luclin to Ingrid.")
  58. UpdateQuestTaskGroupDescription(Quest, 6, "I gave the Shard of Luclin to Ingrid.")
  59. AddQuestStepChat(Quest, 7, "I should speak to Captain Varlos again.", 1, "Captain Varlos is trying to get my attention.", 11, CaptainVarlos)
  60. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  61. end
  62. function Step8Init(Quest, QuestGiver, Player)
  63. UpdateQuestStepDescription(Quest, 7, "I spoke with Captain Varlos as Ingrid has asked of me.")
  64. UpdateQuestTaskGroupDescription(Quest, 7, "I have spoken to Captain Varlos.")
  65. AddQuestStepKill(Quest, 8, "I must kill the rats on the deck.", 2, 100, "Captain Varlos has asked me to kill the rats on the deck.", 99, ARat)
  66. AddQuestStepCompleteAction(Quest, 8, "Step8Complete")
  67. end
  68. function Step9Init(Quest, QuestGiver, Player)
  69. UpdateQuestStepDescription(Quest, 8, "I have killed the rats.")
  70. UpdateQuestTaskGroupDescription(Quest, 8, "I killed the rats that Captain Varlos requested.")
  71. AddQuestStepChat(Quest, 9, "I should speak to Captain Varlos.", 1, "Inform Captain Varlos that you have exterminated the vermin.", 11, CaptainVarlos)
  72. AddQuestStepCompleteAction(Quest, 9, "Step9Complete")
  73. end
  74. function Step10Init(Quest, QuestGiver, Player)
  75. UpdateQuestStepDescription(Quest, 9, "I spoke to Captain Varlos.")
  76. UpdateQuestTaskGroupDescription(Quest, 9, "I spoke to Captain Varlos.") --this this is not 100% like Live but seeing the same entry in your journal for step 9 and 10 like Live is dumb
  77. AddQuestStepKill(Quest, 10, "I must kill the goblin.", 1, 100, "Captain Varlos has ordered you to kill the escaped goblin.", 11, Goblin)
  78. AddQuestStepCompleteAction(Quest, 10, "QuestComplete")
  79. end
  80. function CurrentStep(Quest, QuestGiver, Player)
  81. if GetQuestStep(Player, 524) == 2 then
  82. i = 1
  83. spawns = GetSpawnListBySpawnID(Player, 270010)
  84. repeat
  85. spawn = GetSpawnFromList(spawns, i-1)
  86. if spawn then
  87. ChangeHandIcon(spawn, 1)
  88. AddPrimaryEntityCommand(nil, spawn)
  89. SpawnSet(NPC, "targetable", 1, true, true)
  90. end
  91. i = i + 1
  92. until spawn == Nil
  93. InstructionWindow(Player, -1.0, "You completed the first part of the quest. As you complete quests and defeat enemies, you earn experience points. This is represented in your experience point display. Filling your experience point display is always a requirement to gain your next level. As you gain levels, you will gain access to more powerful skills and abilities.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_011_f16aa848.mp3", 1702963584, 3318288731, "tutorial_stage_15", "", "continue")
  94. FlashWindow(Player, "MainHUD.Experience", 15.0)
  95. SetTutorialStep(Player, 14)
  96. AddPrimaryEntityCommandAllSpawns(Player, 270010, "open", 10, "open")
  97. chest = GetRandomSpawnByID(Player, 270010)
  98. GiveLoot(chest, Player, 0, 185427)
  99. GiveLoot(chest, Player, 0, 20902)
  100. GiveLoot(chest, Player, 0, 15354)
  101. elseif GetQuestStep(Player, 524) == 3 then
  102. InstructionWindow(Player, -1.0, "The items are now in your inventory.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_014_eaa89ef7.mp3", 361706387, 1106127199, "tutorial_stage_18", "", "continue")
  103. SetTutorialStep(Player, 16)
  104. elseif GetQuestStep(Player, 524) == 5 then
  105. InstructionWindowClose(Player)
  106. InstructionWindow(Player, -1.0, "A merchant is a special type of character who buys and sells things. Find and double left click on Merchant Vim to start a transaction.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_020_6ea052d3.mp3", 4250953579, 3003156164, "tutorial_stage_24", "Double left click on Merchant Vim.", "server")
  107. elseif GetQuestStep(Player, 524) == 6 then
  108. InstructionWindowClose(Player)
  109. InstructionWindow(Player, -1.0, "You have made the first of many purchases. Now close the merchant window and speak to Ingrid to complete the quest.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_026_d484fa8d.mp3", 4213145594, 1811880905, "tutorial_stage_31", "Return to Ingrid and speak to her.", "server")
  110. elseif GetQuestStep(Player, 524) == 7 then
  111. InstructionWindowClose(Player)
  112. captain = GetSpawn(Player, 270000)
  113. AddTimer(captain, 2000, "get_attention_init", 1, Player)
  114. elseif GetQuestStep(Player, 524) == 8 then
  115. AddPrimaryEntityCommandAllSpawns(Player, 270009, "attack", 10000.0, "attack")
  116. i=1
  117. spawns = GetSpawnListBySpawnID(Player, 270009)
  118. repeat
  119. rat = GetSpawnFromList(spawns, i-1)
  120. if rat then
  121. SetAttackable(rat, 1)
  122. if HasLootItem(rat, 11615) == false then
  123. AddLootItem(rat, 11615)
  124. end
  125. end
  126. i = i + 1
  127. until rat == Nil
  128. if GetQuestStepProgress(Player, 524, 8) == 1 then -- if we already have credit for a kill, remove one rat
  129. delrat = GetRandomSpawnByID(Player, 270009)
  130. Despawn(delrat)
  131. end
  132. if HasItem(Player, 88140) == false then
  133. GiveQuestItem(Quest, Player, "", 88140)
  134. end
  135. if HasItemEquipped(Player, 88140) == false then
  136. ShowWindow(Player, "Inventory.Inventory", 0)
  137. InstructionWindow(Player, -1.0, "Open your inventory by clicking the inventory button, then right click on the club the Captain just gave you.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_028_458903e8.mp3", 4151437794, 834827635, "equipping_weapons", "Open your inventory. (click on the inventory button)", "open Inventory")
  138. ShowWindow(Player, "MainHUD.StartMenu", 1)
  139. FlashWindow(Player, "MainHUD.StartMenu.inventory", 20.0)
  140. end
  141. elseif GetQuestStep(Player, 524) == 9 then
  142. SetTutorialStep(Player, 49)
  143. InstructionWindow(Player, -1.0, "You have earned enough experience to gain a level. Congratulations.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_046_7e59cd54.mp3", 3272157184, 1454283978, "tutorial_stage_50", "", "continue")
  144. i=1
  145. spawns = GetSpawnListBySpawnID(Player, 270009)
  146. repeat
  147. delrat = GetSpawnFromList(spawns, i-1)
  148. if IsAlive(delrat) then
  149. Despawn(delrat)
  150. end
  151. i = i + 1
  152. until delrat == Nil
  153. elseif GetQuestStep(Player, 524) == 10 then
  154. AddPrimaryEntityCommandAllSpawns(Player, 270008, "attack", 10000.0, "attack")
  155. i=1
  156. spawns = GetSpawnListBySpawnID(Player, 270011)
  157. repeat
  158. cage = GetSpawnFromList(spawns, i-1)
  159. if cage then
  160. Despawn(cage)
  161. end
  162. i = i + 1
  163. until cage == Nil
  164. i=1
  165. spawns = GetSpawnListBySpawnID(Player, 270009)
  166. repeat
  167. delrat = GetSpawnFromList(spawns, i-1)
  168. if delrat then
  169. Despawn(delrat)
  170. end
  171. i = i + 1
  172. until delrat == Nil
  173. end
  174. end
  175. function Step1Complete(Quest, QuestGiver, Player)
  176. GiveExp(Player, 110)
  177. Step2Init(Quest, QuestGiver, Player)
  178. CurrentStep(Quest, QuestGiver, Player)
  179. end
  180. function Step2Complete(Quest, QuestGiver, Player)
  181. Step3Init(Quest, QuestGiver, Player)
  182. CurrentStep(Quest, QuestGiver, Player)
  183. end
  184. function Step3Complete(Quest, QuestGiver, Player)
  185. RemoveItem(Player, WaulonsHat)
  186. GiveQuestItem(Quest, Player, "", 9357)
  187. Step4Init(Quest, QuestGiver, Player)
  188. CurrentStep(Quest, QuestGiver, Player)
  189. end
  190. function Step4Complete(Quest, QuestGiver, Player)
  191. Step5Init(Quest, QuestGiver, Player)
  192. CurrentStep(Quest, QuestGiver, Player)
  193. end
  194. function Step5Complete(Quest, QuestGiver, Player)
  195. Step6Init(Quest, QuestGiver, Player)
  196. CurrentStep(Quest, QuestGiver, Player)
  197. end
  198. function Step6Complete(Quest, QuestGiver, Player)
  199. Step7Init(Quest, QuestGiver, Player)
  200. CurrentStep(Quest, QuestGiver, Player)
  201. end
  202. function Step7Complete(Quest, QuestGiver, Player)
  203. Step8Init(Quest, QuestGiver, Player)
  204. CurrentStep(Quest, QuestGiver, Player)
  205. end
  206. function Step8Complete(Quest, QuestGiver, Player)
  207. Step9Init(Quest, QuestGiver, Player)
  208. CurrentStep(Quest, QuestGiver, Player)
  209. end
  210. function Step9Complete(Quest, QuestGiver, Player)
  211. Step10Init(Quest, QuestGiver, Player)
  212. CurrentStep(Quest, QuestGiver, Player)
  213. end
  214. function QuestComplete(Quest, QuestGiver, Player)
  215. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  216. UpdateQuestStepDescription(Quest, 10, "I have killed the goblin.")
  217. UpdateQuestTaskGroupDescription(Quest, 10, "I killed the escaped goblin.")
  218. UpdateQuestDescription(Quest, "I completed all the tasks assigned to me by Captain Varlos aboard the Far Journey.")
  219. GiveQuestReward(Quest, Player)
  220. end
  221. function Reload(Quest, QuestGiver, Player, Step)
  222. if Step == 1 then
  223. Step2Init(Quest, QuestGiver, Player)
  224. CurrentStep(Quest, QuestGiver, Player)
  225. elseif Step == 2 then
  226. Step3Init(Quest, QuestGiver, Player)
  227. elseif Step == 3 then
  228. Step4Init(Quest, QuestGiver, Player)
  229. elseif Step == 4 then
  230. Step5Init(Quest, QuestGiver, Player)
  231. elseif Step == 5 then
  232. Step6Init(Quest, QuestGiver, Player)
  233. elseif Step == 6 then
  234. Step7Init(Quest, QuestGiver, Player)
  235. elseif Step == 7 then
  236. Step8Init(Quest, QuestGiver, Player)
  237. elseif Step == 8 then
  238. Step9Init(Quest, QuestGiver, Player)
  239. elseif Step == 9 then
  240. Step10Init(Quest, QuestGiver, Player)
  241. elseif Step == 10 then
  242. QuestComplete(Quest, QuestGiver, Player)
  243. end
  244. end
  245. function Accepted(Quest, QuestGiver, Player)
  246. FaceTarget(QuestGiver, Player)
  247. conversation = CreateConversation()
  248. PlayFlavor(QuestGiver, "voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_009.mp3", "", "point", 3537393303, 2188767436, Player)
  249. AddConversationOption(conversation, "Okay.")
  250. StartConversation(conversation, QuestGiver, Player, "Whoa there, the seas are gettin' a bit angry. Go speak ta' me first mate, Waulon. He might have something for ya' ta' do.")
  251. local Waulon = GetSpawn(QuestGiver, 270002)
  252. FaceTarget(QuestGiver, Waulon)
  253. end
  254. function Declined(Quest, QuestGiver, Player)
  255. -- Add dialog here for when the quest is declined
  256. end