CaptainVarlos.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. --[[
  2. Script Name : SpawnScripts/FarJourneyFreeport/CaptainVarlos.lua
  3. Script Author : Cynnar
  4. Script Date : 2019.09.28 03:09:56
  5. Script Purpose :
  6. :
  7. --]]
  8. get_attention_animation = true
  9. needs_selection_help = true
  10. finished_hailed = false
  11. finished_where_am_I = false
  12. finished_who_are_you = false
  13. finished_how_did_I_get_here = false
  14. finished_where_are_we_headed = false
  15. finished_high_winds_1 = false
  16. finished_high_winds_2 = false
  17. finished_high_winds_3 = false
  18. seen_quest_praise = false
  19. require "SpawnScripts/Generic/DialogModule"
  20. function spawn(NPC)
  21. end
  22. function get_attention_init(NPC, player)
  23. InstructionWindow(player, -1.0, "Captain Varlos looks like he is trying to get your attention.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_027_30c39009.mp3", 2146230300, 3258594756, "captain_attention", "", "continue")
  24. AddTimer(NPC, 100, "get_attention", 1, player)
  25. end
  26. function get_attention(NPC, player)
  27. FaceTarget(NPC, player)
  28. SendStateCommand(NPC, 883)
  29. AddTimer(NPC, math.random(2000, 3000), "stop_get_attention", 1, player)
  30. end
  31. function stop_get_attention(NPC, player)
  32. SendStateCommand(NPC, 0)
  33. if get_attention_animation and HasQuest(player, 524) == true and GetQuestStep(player, 524) == 7 then
  34. AddTimer(NPC, 500, "get_attention", 1, player)
  35. end
  36. end
  37. function hailed(NPC, player)
  38. FaceTarget(NPC, player)
  39. SendStateCommand(GetSpawn(NPC, 270000), 318)
  40. SendStateCommand(GetSpawn(NPC, 270000), 0)
  41. if HasQuest(player, 524) == false and HasCompletedQuest(player, 524) == false then
  42. InstructionWindowClose(player)
  43. needs_selection_help = true
  44. finished_hailed = false
  45. finished_where_am_I = false
  46. finished_who_are_you = false
  47. finished_how_did_I_get_here = false
  48. finished_where_are_we_headed = false
  49. finished_high_winds_1 = false
  50. finished_high_winds_2 = false
  51. finished_high_winds_3 = false
  52. Dialog.New(NPC, player)
  53. Dialog.AddDialog("Ahoy! 'Tis good to see you awake. Ya seem a little squiffy, least ya' cheated death!")
  54. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_001.mp3", 1930075150, 2666442405)
  55. Dialog.AddEmote("salute")
  56. Dialog.AddOption("Where am I?", "where_am_I")
  57. Dialog.Start()
  58. AddTimer(NPC, 8000, "hailed_instructions", 1, player)
  59. elseif HasQuest(player, 524) == true and GetQuestStep(player, 524) == 7 then
  60. SetTutorialStep(player, 32)
  61. Dialog.New(NPC, player)
  62. Dialog.AddDialog("Avast ye! We need to talk.")
  63. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_011.mp3", 570868734, 3287597835)
  64. Dialog.AddOption("What is it?", "quest_step_7a")
  65. Dialog.Start()
  66. get_attention_animation = false
  67. elseif HasQuest(player, 524) == true and GetQuestStep(player, 524) == 10 then
  68. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_023.mp3", "You still need to kill that landlubber of a goblin! Get to it mate!", "", 3269557913, 3104212801)
  69. elseif HasQuest(player, 524) == true and GetQuestStep(player, 524) == 9 then
  70. SetTutorialStep(player, 51)
  71. Dialog.New(NPC, player)
  72. Dialog.AddDialog("Ya' made quick work of them vermin.")
  73. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_016.mp3", 1130776869, 4119313971)
  74. Dialog.AddOption("Thanks.", "quest_step_9")
  75. Dialog.Start()
  76. elseif HasCompletedQuest(player, 524) == true and seen_quest_praise == false then
  77. seen_quest_praise = true
  78. Dialog.New(NPC, player)
  79. Dialog.AddDialog("Arr! Ya saved the Far Journey and me crew! Seems ya' proved ta' be quite a hero. Well, with the help of that young lass there, ya' do.")
  80. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_024.mp3", 998172564, 1159207795)
  81. Dialog.AddOption("It was nothing.", "quest_completed")
  82. Dialog.Start()
  83. elseif HasCompletedQuest(player, 524) == true then
  84. Dialog.New(NPC, player)
  85. Dialog.AddDialog("So, ya' ready ta go ashore matey?")
  86. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_027.mp3", 2285948102, 2994720481)
  87. Dialog.AddOption("Yes.", "ready_to_go_ashore")
  88. Dialog.AddOption("No. I would like some more time.", "conversation8_2")
  89. Dialog.Start()
  90. end
  91. end
  92. function quest_completed(NPC, player)
  93. Dialog.New(NPC, player)
  94. Dialog.AddDialog("There be the Island of Refuge, get ready ta' drop anchor. Just let me know when ya' want ta' go ashore.")
  95. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_025.mp3", 3643967618, 2645907420)
  96. Dialog.AddOption("Ok.", "drop_anchor")
  97. Dialog.Start()
  98. end
  99. function drop_anchor(NPC, player)
  100. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_026.mp3", "Ingrid! Swing the lead and prepare to drop anchor!", "", 3011518245, 3851752713)
  101. end
  102. function ready_to_go_ashore(NPC, player)
  103. Dialog.New(NPC, player)
  104. Dialog.AddDialog("Don't ya' mind, we get paid ta' do that.")
  105. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_028.mp3", 1009737776, 2173458794)
  106. Dialog.AddOption("Good point.", "zone_to_isle")
  107. Dialog.Start()
  108. end
  109. function zone_to_isle(NPC, player)
  110. Zone(GetZone(325), player)
  111. end
  112. function quest_step_9(NPC, player)
  113. AddTimer(GetSpawn(NPC, 270013), 100, "attack")
  114. AddTimer(NPC, 1000, "quest_step_9b", 1, player)
  115. end
  116. function quest_step_9b(NPC, player)
  117. FaceTarget(NPC, GetSpawn(NPC, 270013))
  118. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_017.mp3", "Wait. Tis that a... No, it cain' be!", "", 1253231512, 1752159147)
  119. AddTimer(NPC, 5000, "quest_step_9c", 1, player)
  120. SendStateCommand(GetSpawn(NPC, 270005), 250)
  121. end
  122. function quest_step_9c(NPC, player)
  123. Drake = GetSpawn(NPC, 270013)
  124. Anikra = GetSpawn(NPC, 270006)
  125. Valik = GetSpawn(NPC, 270005)
  126. Geredo = GetSpawn(NPC, 270004)
  127. FaceTarget(Anikra, Drake)
  128. FaceTarget(Valik, Drake)
  129. FaceTarget(Geredo, Drake)
  130. SendStateCommand(Anikra, 429)
  131. SendStateCommand(Valik, 429)
  132. SendStateCommand(Geredo, 429)
  133. SendStateCommand(GetSpawn(NPC, 270001), 219)
  134. SendStateCommand(GetSpawn(NPC, 270007), 631)
  135. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_018.mp3", "Quick! Ingrid, secure th'loot! Thar be a Drakota off the bow! Quick now! Secure those chests!", "", 3607547478, 39534308)
  136. AddTimer(NPC, 9000, "quest_step_9d", 1, player)
  137. end
  138. function quest_step_9d(NPC, player)
  139. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_019.mp3", "Everyone down! Watch it!", "", 2065401462, 2542613809)
  140. SendStateCommand(GetSpawn(NPC, 270007), 219)
  141. SendStateCommand(GetSpawn(NPC, 270001), 220)
  142. SendStateCommand(GetSpawn(NPC, 270004), 210)
  143. SendStateCommand(GetSpawn(NPC, 270006), 403)
  144. SendStateCommand(GetSpawn(NPC, 270005), 218)
  145. SendStateCommand(GetSpawn(NPC, 270002), 218)
  146. AddTimer(NPC, 3500, "quest_step_9e", 1, player)
  147. i=1
  148. spawns = GetSpawnListBySpawnID(player, 270011)
  149. repeat
  150. cage = GetSpawnFromList(spawns, i-1)
  151. if cage then
  152. Despawn(cage)
  153. end
  154. i = i + 1
  155. until cage == Nil
  156. end
  157. function quest_step_9e(NPC, player)
  158. PerformCameraShake(player, 0.699999988079071)
  159. PerformCameraShake(player, 0.5)
  160. PerformCameraShake(player, 0.30000001192092896)
  161. PerformCameraShake(player, 0.10000000149011612)
  162. AddTimer(NPC, 3500, "quest_step_9f", 1, player)
  163. end
  164. function quest_step_9f(NPC, player)
  165. AddTimer(NPC, 3500, "quest_step_9g", 1, player)
  166. end
  167. function quest_step_9g(NPC, player)
  168. AddTimer(NPC, 3000, "quest_step_9h", 1, player)
  169. end
  170. function quest_step_9h(NPC, player)
  171. SendStateCommand(GetSpawn(NPC, 270001), 0)
  172. SendStateCommand(GetSpawn(NPC, 270004), 0)
  173. SendStateCommand(GetSpawn(NPC, 270006), 0)
  174. SendStateCommand(GetSpawn(NPC, 270005), 0)
  175. SendStateCommand(GetSpawn(NPC, 270002), 0)
  176. SendStateCommand(GetSpawn(NPC, 270007), 220)
  177. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_020.mp3", "Blimey! That was close! It has been near two months since the last reported sightings of one of them.", "", 814285897, 1688547621)
  178. AddTimer(NPC, 6000, "quest_step_9i", 1, player)
  179. end
  180. function quest_step_9i(NPC, player)
  181. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_021.mp3", "That damnable goblin has escaped. An' look, me beautiful ship is on fire!", "", 1401094820, 2183903275)
  182. AddTimer(NPC, 6000, "quest_step_9j", 1, player)
  183. end
  184. function quest_step_9j(NPC, player)
  185. SetStepComplete(player, 524, 9)
  186. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_022.mp3", "Ye must put an end to 'is life, afore he tears me ship apart!", "", 2385052787, 1324494518)
  187. end
  188. function quest_step_7a(NPC, player)
  189. Dialog.New(NPC, player)
  190. Dialog.AddDialog("Well, 'tis a bit of a problem. Ya' see, there be rats on board. The vermin keep eating the supplies and I need ya' to go feed them to the deep, afore they eat anything else.")
  191. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_012.mp3", 705765462, 3202743441)
  192. Dialog.AddOption("So you want me to kill them?", "quest_step_7b")
  193. Dialog.Start()
  194. end
  195. function quest_step_7b(NPC, player)
  196. Dialog.New(NPC, player)
  197. Dialog.AddDialog("Yar! That's what we be needin'.")
  198. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_013.mp3", 3880459741, 170861362)
  199. Dialog.AddOption("How do you expect me to kill them?", "quest_step_7c")
  200. Dialog.Start()
  201. end
  202. function quest_step_7c(NPC, player)
  203. Dialog.New(NPC, player)
  204. Dialog.AddDialog("Wit this 'ere club. It is nice and splintered, sure ta' cause them some pain.")
  205. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_014.mp3", 2083163804, 202693960)
  206. Dialog.AddOption("Aye, aye, Captain!", "quest_step_7d")
  207. Dialog.Start()
  208. end
  209. function quest_step_7d(NPC, player)
  210. SetStepComplete(player, 524, 7)
  211. end
  212. function hailed_instructions(NPC, player)
  213. if needs_selection_help == true then
  214. InstructionWindowGoal(player,0)
  215. InstructionWindowClose(player)
  216. InstructionWindow(player, -1.0, "To respond to the Captain and other characters you will meet, left click on the response text.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_006_7521b625.mp3", 3936228257, 1877316160, "tutorial_stage_8", "Left click on one of the response options.", "server")
  217. needs_selection_help = false
  218. end
  219. end
  220. function where_am_I(NPC, player)
  221. finished_hailed = true
  222. --[[Say(NPC, "Testing function call")
  223. drake = GetSpawn(player, 270013)
  224. SendStateCommand(drake,65")
  225. Say(drake, "attacking")
  226. AddTimer(drake, 40000, "drake_rain")
  227. --]]
  228. if needs_selection_help == true then
  229. needs_selection_help = false
  230. else
  231. InstructionWindowGoal(player,0)
  232. InstructionWindowClose(player)
  233. end
  234. if finished_where_am_I == false then
  235. FaceTarget(NPC, player)
  236. Dialog.New(NPC, player)
  237. Dialog.AddDialog("Me apologies.")
  238. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_002.mp3", 2054400186, 1976167819)
  239. Dialog.AddOption("Who are you?", "who_are_you")
  240. Dialog.Start()
  241. end
  242. end
  243. function who_are_you(NPC, player)
  244. if finished_who_are_you == false then
  245. finished_where_am_I = true
  246. FaceTarget(NPC, player)
  247. Dialog.New(NPC, player)
  248. Dialog.AddDialog("I am Captain Draik Varlos, and this 'ere fine ship is the Far Journey.")
  249. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_003.mp3", 2565389482, 560555759)
  250. Dialog.AddOption("How did I get here?", "how_did_I_get_here")
  251. Dialog.Start()
  252. end
  253. end
  254. function how_did_I_get_here(NPC, player)
  255. finished_who_are_you = true
  256. if finished_how_did_I_get_here == false then
  257. FaceTarget(NPC, player)
  258. Dialog.New(NPC, player)
  259. Dialog.AddDialog("Me hearties pulled ya' from the sea, you an those other bilge rats. Do ya' remember?")
  260. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_004.mp3", 29296168, 2709023783)
  261. Dialog.AddOption("Vaguely. Where are we headed?", "where_are_we_headed")
  262. Dialog.Start()
  263. end
  264. end
  265. function where_are_we_headed(NPC, player)
  266. finished_how_did_I_get_here = true
  267. if finished_where_are_we_headed == false then
  268. FaceTarget(NPC, player)
  269. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_005.mp3", "We are heading to the Island of Refuge.", "", 1602680439, 2810422278)
  270. AddTimer(NPC, 500, "shake_camera_medium", 1, player)
  271. AddTimer(NPC, 1500, "shake_camera_low", 1, player)
  272. AddTimer(NPC, 2500, "shake_camera_low", 1, player)
  273. AddTimer(NPC, 3000, "high_winds_1", 1, player)
  274. end
  275. end
  276. function shake_camera_low(NPC, player)
  277. PerformCameraShake(player, 0.10000000149011612)
  278. end
  279. function shake_camera_medium(NPC, player)
  280. PerformCameraShake(player, 0.20000000298023224)
  281. end
  282. function shake_camera_high(NPC, player)
  283. PerformCameraShake(player, 0.699999988079071)
  284. end
  285. function high_winds_1(NPC, player)
  286. finished_where_are_we_headed = true
  287. if finished_high_winds_1 == false then
  288. FaceTarget(NPC, GetSpawn(NPC, 270001))
  289. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_006.mp3", "Ingrid! Quit gawking at the shorty and fix that yard-arm!", "", 2753489262, 3183736171)
  290. SendStateCommand(GetSpawn(NPC, 270001), 0)
  291. AddTimer(NPC, 3500, "high_winds_2", 1, player)
  292. end
  293. end
  294. function high_winds_2(NPC, player)
  295. finished_high_winds_1 = true
  296. if finished_high_winds_2 == false then
  297. PlayFlavor(GetSpawn(NPC, 270001), "voiceover/english/ingrid/boat_06p_tutorial02/020_deckhand_ingrid_010_1637e047.mp3", "Aye, aye, Captain!", "", 1250282628, 237171958)
  298. SendStateCommand(GetSpawn(NPC, 270001), 520)
  299. AddTimer(NPC, 2500, "high_winds_3", 1, player)
  300. end
  301. end
  302. function high_winds_3(NPC, player)
  303. finished_high_winds_2 = true
  304. if finished_high_winds_3 == false then
  305. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_007.mp3", "Don't want the ship to come apart in these high winds, do ya'?!", "", 517097409, 4194681002)
  306. SendStateCommand(GetSpawn(NPC, 270001), 0)
  307. AddTimer(NPC, 5000, "high_winds_4", 1, player)
  308. end
  309. end
  310. function high_winds_4(NPC, player)
  311. finished_high_winds_3 = true
  312. FaceTarget(NPC, player)
  313. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_008.mp3", "Ya think she'd never seen a gnome afore.", "", 2447879193, 4289147535)
  314. SendStateCommand(GetSpawn(NPC, 270001), 630)
  315. AddTimer(NPC, 500, "shake_camera_medium", 1, player)
  316. AddTimer(NPC, 3500, "shake_camera_high", 1, player)
  317. AddTimer(NPC, 5500, "shake_camera_medium", 1, player)
  318. AddTimer(NPC, 9500, "shake_camera_low", 1, player)
  319. AddTimer(NPC, 5000, "offer_quest", 1, player)
  320. end
  321. function offer_quest(NPC, player)
  322. if HasQuest(player, 524) == false then
  323. OfferQuest(NPC, player, 524, true)
  324. AddTimer(NPC, 7000, "Accepted_Tutorial_Instructions", 1, player)
  325. end
  326. end
  327. function Accepted_Tutorial_Instructions(NPC, player)
  328. InstructionWindowClose(player)
  329. ShowWindow(player, "Journals.JournalsQuest", 0)
  330. InstructionWindow(player, -1.0, "The Captain has given you a quest. Left click on the quest journal button to open your quest journal.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_007_59f6d83b.mp3", 1470829818, 519016852, "tutorial_stage_9", "Open your quest journal. (click on the journal button)", "open JournalsQuest")
  331. ShowWindow(player, "MainHUD.StartMenu", 1)
  332. FlashWindow(player, "MainHUD.StartMenu.quest_journal", 20.0)
  333. SetTutorialStep(player, 8)
  334. end
  335. function respawn(NPC)
  336. end