9
3

CaptainVarlos.lua 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. --[[
  2. Script Name : SpawnScripts/FarJourneyFreeport/CaptainVarlos.lua
  3. Script Author : Cynnar
  4. Script Date : 2019.09.28 03:09:56
  5. Script Notes :
  6. Script Purpose :
  7. --]]
  8. dofile("SpawnScripts/Generic/SubClassToCommoner.lua")
  9. get_attention_animation = true
  10. needs_selection_help = true
  11. finished_hailed = false
  12. finished_where_am_I = false
  13. finished_who_are_you = false
  14. finished_how_did_I_get_here = false
  15. finished_where_are_we_headed = false
  16. finished_high_winds_1 = false
  17. finished_high_winds_2 = false
  18. finished_high_winds_3 = false
  19. seen_quest_praise = false
  20. function GenerateStateDefines(player)
  21. local bLegacy = (GetClientVersion(player) <= 526)
  22. if bLegacy then
  23. VSTATE_WAVE = 883
  24. VSTATE_HELLO = 318
  25. VSTATE_DOUBLETAKE = 250
  26. VSTATE_CROUCH_ENTER = 219
  27. VSTATE_CROUCH_EXIT = 220
  28. VSTATE_SQUEAL = 631
  29. VSTATE_POINT = 429
  30. VSTATE_COMBAT_TURN_LEFT = 210
  31. VSTATE_OUCH = 403
  32. VSTATE_CRINGE = 218
  33. VSTATE_SALUTE = 520
  34. VSTATE_SQUARE = 630
  35. else
  36. VSTATE_WAVE = 13287
  37. VSTATE_HELLO = 11682
  38. VSTATE_DOUBLETAKE = 11415
  39. VSTATE_CROUCH_ENTER = 219
  40. VSTATE_CROUCH_EXIT = 220
  41. VSTATE_SQUEAL = 12979
  42. VSTATE_POINT = 12028
  43. VSTATE_COMBAT_TURN_LEFT = 11210
  44. VSTATE_OUCH = 11911
  45. VSTATE_CRINGE = 11256
  46. VSTATE_SALUTE = 12167
  47. VSTATE_SQUARE = 12978
  48. end
  49. end
  50. require "SpawnScripts/Generic/DialogModule"
  51. function spawn(NPC)
  52. end
  53. function get_attention_init(NPC, player)
  54. 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")
  55. AddTimer(NPC, 100, "get_attention", 1, player)
  56. end
  57. function get_attention(NPC, player)
  58. FaceTarget(NPC, player)
  59. GenerateStateDefines(player)
  60. SendStateCommand(NPC, VSTATE_WAVE)
  61. AddTimer(NPC, math.random(2000, 3000), "stop_get_attention", 1, player)
  62. end
  63. function stop_get_attention(NPC, player)
  64. SendStateCommand(NPC, 0)
  65. if get_attention_animation and HasQuest(player, 524) and GetQuestStep(player, 524) == 7 then
  66. AddTimer(NPC, 500, "get_attention", 1, player)
  67. end
  68. end
  69. function hailed(NPC, player)
  70. FaceTarget(NPC, player)
  71. GenerateStateDefines(player)
  72. SendStateCommand(GetSpawn(NPC, 270000), VSTATE_HELLO)
  73. SendStateCommand(GetSpawn(NPC, 270000), 0)
  74. if not HasQuest(player, 524) and not HasCompletedQuest(player, 524) then
  75. SetTarget(NPC,player)
  76. if GetClientVersion(player)<= 546 then --GOBLIN ANIMATIONS
  77. AddTimer(GetSpawn(NPC, 270008), 100, "idle_loop")
  78. else
  79. AddTimer(GetSpawn(NPC, 270008), 100, "NonDoF_idle_loop")
  80. end
  81. InstructionWindowClose(player)
  82. needs_selection_help = true
  83. finished_hailed = false
  84. finished_where_am_I = false
  85. finished_who_are_you = false
  86. finished_how_did_I_get_here = false
  87. finished_where_are_we_headed = false
  88. finished_high_winds_1 = false
  89. finished_high_winds_2 = false
  90. finished_high_winds_3 = false
  91. Dialog.New(NPC, player)
  92. Dialog.AddDialog("Ahoy! 'Tis good to see you awake. Ya seem a little squiffy, least ya' cheated death!")
  93. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_001.mp3", 1930075150, 2666442405)
  94. Dialog.AddEmote("hello")
  95. if GetClass(player)>0 then
  96. Dialog.AddOption("There must be a mistake. I'm just a commoner. [CLASSIC CLASS CHANGE]", "Commoner")
  97. end
  98. Dialog.AddOption("Where am I?", "where_am_I")
  99. Dialog.Start()
  100. AddTimer(NPC, 8000, "hailed_instructions", 1, player)
  101. elseif HasQuest(player, 524) and GetQuestStep(player, 524) <= 6 then
  102. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_010.mp3", "Back ye up a few paces. I be needin' this room.", "", 2009097517, 3594231199, player, 0)
  103. elseif HasQuest(player, 524) and GetQuestStep(player, 524) == 7 then
  104. SetTutorialStep(player, 32)
  105. Dialog.New(NPC, player)
  106. Dialog.AddDialog("Avast ye! We need to talk.")
  107. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_011.mp3", 570868734, 3287597835)
  108. Dialog.AddOption("What is it?", "quest_step_7a")
  109. Dialog.Start()
  110. get_attention_animation = false
  111. elseif HasQuest(player, 524) and GetQuestStep(player, 524) == 8 then
  112. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_015.mp3", "Blimey! Ya' tryin to cause a mutiny? I told you to kill those rats, now do it ya landlubber!", "", 1239213594, 177688376, player, 0)
  113. elseif HasQuest(player, 524) and GetQuestStep(player, 524) == 10 then
  114. 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,player)
  115. elseif HasQuest(player, 524) and GetQuestStep(player, 524) == 9 then
  116. SetTutorialStep(player, 51)
  117. Dialog.New(NPC, player)
  118. Dialog.AddDialog("Ya' made quick work of them vermin.")
  119. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_016.mp3", 1130776869, 4119313971)
  120. Dialog.AddOption("Thanks.", "quest_step_9")
  121. Dialog.Start()
  122. elseif HasCompletedQuest(player, 524) and not seen_quest_praise then
  123. seen_quest_praise = true
  124. Dialog.New(NPC, player)
  125. 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.")
  126. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_024.mp3", 998172564, 1159207795)
  127. -- Todo: Add missing gesture/emote
  128. Dialog.AddOption("It was nothing.", "quest_completed")
  129. Dialog.Start()
  130. elseif HasCompletedQuest(player, 524) then
  131. Dialog.New(NPC, player)
  132. Dialog.AddDialog("So, ya' ready ta go ashore matey?")
  133. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_027.mp3", 2285948102, 2994720481)
  134. Dialog.AddOption("Yes. Send me to the Isle of Refuge!", "ready_to_go_ashore")
  135. Dialog.AddOption("No. I would like some more time.", "conversation8_2")
  136. Dialog.Start()
  137. end
  138. end
  139. function Commoner(NPC, player)
  140. FaceTarget(NPC, player)
  141. Dialog.New(NPC, player)
  142. Dialog.AddDialog("Me apologies. Are you sure? This can't be undone. We'll take you to The Isle of Refuge if that is the case.")
  143. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_002.mp3", 2054400186, 1976167819)
  144. Dialog.AddEmote("ponder")
  145. Dialog.AddOption("Yes, I am a Commoner.", "Commoner2")
  146. Dialog.AddOption("Nevermind. Who are you?","who_are_you")
  147. Dialog.Start()
  148. end
  149. function Commoner2(NPC,player)
  150. PlayFlavor(NPC, "", "", "grumble", 0, 0, player, 0)
  151. Dialog.New(NPC, player)
  152. Dialog.AddDialog("Ya' know, me hates doing paperwork! Arrrr!")
  153. Dialog.AddVoiceover("voiceover/english/captain_varlos/tutorial_island02_fvo_hail2.mp3", 724307296, 1739482284)
  154. Dialog.AddOption("Thank you. Now, where are am I?", "who_are_you")
  155. Dialog.Start()
  156. RemoveGear(NPC,player)
  157. AddTimer(NPC,2000,"ClassSet",1,player)
  158. end
  159. function ClassSet(NPC,player)
  160. SetAdventureClass(player,0)
  161. SendMessage(player, "You are now a Commoner.")
  162. SendPopUpMessage(player, "You are now a Commoner.", 255, 255, 255)
  163. SetPlayerLevel(player,1)
  164. if GetTradeskillClass(player)>0 then
  165. SetTradeskillClass(player,0)
  166. end
  167. end
  168. function quest_completed(NPC, player)
  169. Dialog.New(NPC, player)
  170. Dialog.AddDialog("There be the Island of Refuge, get ready ta' drop anchor. Just let me know when ya' want ta' go ashore.")
  171. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_025.mp3", 3643967618, 2645907420)
  172. Dialog.AddOption("Ok.", "drop_anchor")
  173. Dialog.Start()
  174. end
  175. function drop_anchor(NPC, player)
  176. Dialog.New(NPC, player)
  177. Dialog.AddDialog("Ingrid! Swing the lead and prepare to drop anchor!")
  178. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_026.mp3", 3011518245, 3851752713)
  179. Dialog.AddOption("[Continue]", "hailed")
  180. Dialog.Start()
  181. MovementLoopAddLocation(GetSpawn(NPC, 270001), 4.21, -2.07, 3.72, 4,0)
  182. MovementLoopAddLocation(GetSpawn(NPC, 270001), 1.97, 0.59, 16.73, 4,0)
  183. MovementLoopAddLocation(GetSpawn(NPC, 270001), 1.07, 0.66, 18.69, 4,20)
  184. MovementLoopAddLocation(GetSpawn(NPC, 270001), 1.07, 0.66, 18.69, 2,0)
  185. MovementLoopAddLocation(GetSpawn(NPC, 270001), 1.97, 0.59, 16.73, 2,0)
  186. MovementLoopAddLocation(GetSpawn(NPC, 270001), 4.21, -2.07, 3.72, 2,0)
  187. MovementLoopAddLocation(GetSpawn(NPC, 270001), 2.91, -2.07, -3.61, 2,120)
  188. end
  189. function ready_to_go_ashore(NPC, player)
  190. Dialog.New(NPC, player)
  191. Dialog.AddDialog("Don't ya' mind, we get paid ta' do that.")
  192. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_028.mp3", 1009737776, 2173458794)
  193. Dialog.AddOption("Good point.", "zone_to_isle")
  194. Dialog.Start()
  195. end
  196. function zone_to_isle(NPC, player)
  197. serverType = GetRuleFlagInt32("R_World", "StartingZoneRuleFlag")
  198. -- if no server type is set (default of 0 wildcard) or odd number means bit 1 is set
  199. if serverType == 0 or (serverType % 2) == 1 then
  200. -- DoF alignment, 0 = evil (Outpost of Overlord), 1 = good (Queens Colony)
  201. alignment = GetAlignment(player)
  202. if GetClass(player) == 0 then -- isle of refuge (Commoners are sent here automatically)
  203. ZoneRef = GetZone("IsleRefuge1")
  204. Zone(ZoneRef,player)
  205. elseif alignment == 1 then
  206. Zone(GetZone(278), player) -- outpost of overlord
  207. else
  208. Zone(GetZone(253), player) -- queens colony
  209. end
  210. -- even value serverType > 0 (return 0) means isle of refuge (bit 2) is set
  211. else
  212. Zone(GetZone(325), player) -- isle of refuge (Commoners are sent here automatically)
  213. end
  214. end
  215. function quest_step_9(NPC, player)
  216. if GetClientVersion(player)<= 546 then
  217. AddTimer(GetSpawn(NPC, 270013), 100, "attack")
  218. else
  219. AddTimer(GetSpawn(NPC, 270013), 100, "NonDoFattack")
  220. end
  221. AddTimer(NPC, 1000, "quest_step_9b", 1, player)
  222. end
  223. function quest_step_9b(NPC, player)
  224. FaceTarget(NPC, GetSpawn(NPC, 270013))
  225. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_017.mp3", "Wait. Tis that a... No, it cain' be!", "", 1253231512, 1752159147)
  226. AddTimer(NPC, 4000, "quest_step_9c", 1, player)
  227. GenerateStateDefines(player)
  228. SendStateCommand(GetSpawn(NPC, 270005), VSTATE_DOUBLETAKE)
  229. end
  230. function quest_step_9c(NPC, player)
  231. Drake = GetSpawn(NPC, 270013)
  232. Anikra = GetSpawn(NPC, 270006)
  233. Valik = GetSpawn(NPC, 270005)
  234. Geredo = GetSpawn(NPC, 270004)
  235. Vim = GetSpawn(NPC, 270007)
  236. FaceTarget(Anikra, Drake)
  237. FaceTarget(Valik, Drake)
  238. FaceTarget(Geredo, Drake)
  239. GenerateStateDefines(player)
  240. SendStateCommand(Anikra, VSTATE_POINT)
  241. SendStateCommand(Valik, VSTATE_POINT)
  242. SendStateCommand(Geredo, VSTATE_POINT)
  243. SendStateCommand(GetSpawn(NPC, 270001), VSTATE_CROUCH_ENTER)
  244. SendStateCommand(GetSpawn(NPC, 270007), VSTATE_SQUEAL)
  245. 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)
  246. MoveToLocation(Vim, -0.27, 0.56, 15.78,4)
  247. MoveToLocation(Vim, 2.15, 0.55, 15.60,4)
  248. MoveToLocation(Vim, 5.84, -1.82, 9.84,4)
  249. AddTimer(NPC, 8000, "VimHeading")
  250. AddTimer(NPC, 9000, "quest_step_9d", 1, player)
  251. end
  252. function VimHeading(NPC, player)
  253. Vim = GetSpawn(NPC, 270007)
  254. SetHeading(Vim, 78)
  255. end
  256. function quest_step_9d(NPC, player)
  257. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_019.mp3", "Everyone down! Watch it!", "", 2065401462, 2542613809)
  258. GenerateStateDefines(player)
  259. SendStateCommand(GetSpawn(NPC, 270007), VSTATE_CROUCH_ENTER)
  260. SendStateCommand(GetSpawn(NPC, 270001), VSTATE_CROUCH_EXIT)
  261. SendStateCommand(GetSpawn(NPC, 270004), VSTATE_COMBAT_TURN_LEFT)
  262. SendStateCommand(GetSpawn(NPC, 270006), VSTATE_OUCH)
  263. SendStateCommand(GetSpawn(NPC, 270005), VSTATE_CRINGE)
  264. SendStateCommand(GetSpawn(NPC, 270002), VSTATE_CRINGE)
  265. AddTimer(NPC, 3500, "quest_step_9e", 1, player)
  266. i=1
  267. spawns = GetSpawnListBySpawnID(player, 270011)
  268. repeat
  269. cage = GetSpawnFromList(spawns, i-1)
  270. if cage then
  271. Despawn(cage)
  272. end
  273. i = i + 1
  274. until cage == Nil
  275. end
  276. function quest_step_9e(NPC, player)
  277. PerformCameraShake(player, 0.699999988079071)
  278. PerformCameraShake(player, 0.5)
  279. PerformCameraShake(player, 0.30000001192092896)
  280. PerformCameraShake(player, 0.10000000149011612)
  281. AddTimer(NPC, 3500, "quest_step_9f", 1, player)
  282. end
  283. function quest_step_9f(NPC, player)
  284. AddTimer(NPC, 3500, "quest_step_9g", 1, player)
  285. end
  286. function quest_step_9g(NPC, player)
  287. AddTimer(NPC, 3000, "quest_step_9h", 1, player)
  288. end
  289. function quest_step_9h(NPC, player)
  290. GenerateStateDefines(player)
  291. SendStateCommand(GetSpawn(NPC, 270001), 0)
  292. SendStateCommand(GetSpawn(NPC, 270004), 0)
  293. SendStateCommand(GetSpawn(NPC, 270006), 0)
  294. SendStateCommand(GetSpawn(NPC, 270005), 0)
  295. SendStateCommand(GetSpawn(NPC, 270002), 0)
  296. SendStateCommand(GetSpawn(NPC, 270007), VSTATE_CROUCH_EXIT)
  297. 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)
  298. AddTimer(NPC, 6000, "quest_step_9i", 1, player)
  299. end
  300. function quest_step_9i(NPC, player)
  301. 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)
  302. AddTimer(NPC, 6000, "quest_step_9j", 1, player)
  303. end
  304. function quest_step_9j(NPC, player)
  305. SetStepComplete(player, 524, 9)
  306. 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)
  307. end
  308. function quest_step_7a(NPC, player)
  309. Dialog.New(NPC, player)
  310. 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.")
  311. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_012.mp3", 705765462, 3202743441)
  312. Dialog.AddOption("So you want me to kill them?", "quest_step_7b")
  313. Dialog.Start()
  314. end
  315. function quest_step_7b(NPC, player)
  316. Dialog.New(NPC, player)
  317. Dialog.AddDialog("Yar! That's what we be needin'.")
  318. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_013.mp3", 3880459741, 170861362)
  319. Dialog.AddOption("How do you expect me to kill them?", "quest_step_7c")
  320. Dialog.Start()
  321. end
  322. function quest_step_7c(NPC, player)
  323. Dialog.New(NPC, player)
  324. Dialog.AddDialog("Wit this 'ere club. It is nice and splintered, sure ta' cause them some pain.")
  325. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_014.mp3", 2083163804, 202693960)
  326. Dialog.AddOption("Aye, aye, Captain!", "quest_step_7d")
  327. Dialog.Start()
  328. end
  329. function quest_step_7d (NPC,player)
  330. SetStepComplete(player, 524, 7)
  331. end
  332. function hailed_instructions(NPC, player)
  333. if needs_selection_help then
  334. InstructionWindowGoal(player,0)
  335. InstructionWindowClose(player)
  336. 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")
  337. needs_selection_help = false
  338. end
  339. end
  340. function where_am_I(NPC, player)
  341. finished_hailed = true
  342. --[[Say(NPC, "Testing function call")
  343. drake = GetSpawn(player, 270013)
  344. SendStateCommand(drake,65")
  345. Say(drake, "attacking")
  346. AddTimer(drake, 40000, "drake_rain")
  347. --]]
  348. if needs_selection_help then
  349. needs_selection_help = false
  350. else
  351. InstructionWindowGoal(player, 0)
  352. InstructionWindowClose(player)
  353. end
  354. if not finished_where_am_I then
  355. FaceTarget(NPC, player)
  356. Dialog.New(NPC, player)
  357. Dialog.AddDialog("Me apologies.")
  358. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_002.mp3", 2054400186, 1976167819)
  359. Dialog.AddEmote("bow")
  360. Dialog.AddOption("Who are you?", "who_are_you")
  361. Dialog.Start()
  362. end
  363. end
  364. function who_are_you(NPC, player)
  365. if not finished_who_are_you then
  366. finished_where_am_I = true
  367. FaceTarget(NPC, player)
  368. Dialog.New(NPC, player)
  369. Dialog.AddDialog("I am Captain Draik Varlos, and this 'ere fine ship is the Far Journey.")
  370. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_003.mp3", 2565389482, 560555759)
  371. Dialog.AddOption("How did I get here?", "how_did_I_get_here")
  372. Dialog.Start()
  373. end
  374. end
  375. function how_did_I_get_here(NPC, player)
  376. finished_who_are_you = true
  377. if not finished_how_did_I_get_here then
  378. FaceTarget(NPC, player)
  379. Dialog.New(NPC, player)
  380. Dialog.AddDialog("Me hearties pulled ya' from the sea, you an those other bilge rats. Do ya' remember?")
  381. Dialog.AddVoiceover("voiceover/english/captain_varlos/boat_06p_tutorial02/varlos_0_004.mp3", 29296168, 2709023783)
  382. Dialog.AddOption("Vaguely. Where are we headed?", "where_are_we_headed")
  383. Dialog.Start()
  384. end
  385. end
  386. function where_are_we_headed(NPC, player)
  387. finished_how_did_I_get_here = true
  388. if not finished_where_are_we_headed then
  389. FaceTarget(NPC, player)
  390. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_005.mp3", "We are heading to the Island of Refuge.", "", 1602680439, 2810422278)
  391. AddTimer(NPC, 500, "shake_camera_medium", 1, player)
  392. AddTimer(NPC, 1500, "shake_camera_low", 1, player)
  393. AddTimer(NPC, 2500, "shake_camera_low", 1, player)
  394. AddTimer(NPC, 3100, "shake_camera_low", 1, player)
  395. AddTimer(NPC, 3600, "high_winds_1", 1, player)
  396. end
  397. end
  398. function shake_camera_low(NPC, player)
  399. PerformCameraShake(player, 0.10000000149011612)
  400. end
  401. function shake_camera_medium(NPC, player)
  402. PerformCameraShake(player, 0.20000000298023224)
  403. end
  404. function shake_camera_high(NPC, player)
  405. PerformCameraShake(player, 0.699999988079071)
  406. end
  407. function high_winds_1(NPC, player)
  408. finished_where_are_we_headed = true
  409. if finished_high_winds_1 == false then
  410. FaceTarget(NPC, GetSpawn(NPC, 270001))
  411. 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)
  412. SendStateCommand(GetSpawn(NPC, 270001), 0)
  413. --This should be improved w/ MovementLoop to remove delay when walking
  414. MoveToLocation(GetSpawn(NPC, 270001), -1.86, -2.03, -8.17, 8, "", true)
  415. MoveToLocation(GetSpawn(NPC, 270001), -2.31, 1.21, -15.09, 8, "", true)
  416. MoveToLocation(GetSpawn(NPC, 270001), 1.24, 1.21, -14.47, 8, "", true)
  417. MoveToLocation(GetSpawn(NPC, 270001), 1.40, 1.18, -11.82, 8, "", false)
  418. AddTimer(NPC, 4500, "high_winds_2", 1, player)
  419. end
  420. end
  421. function high_winds_2(NPC, player)
  422. finished_high_winds_1 = true
  423. if not finished_high_winds_2 then
  424. FaceTarget(GetSpawn(NPC, 270001), NPC)
  425. SetTarget(GetSpawn(NPC, 270001), NPC)
  426. FaceTarget(NPC, GetSpawn(NPC, 270001))
  427. SetTarget( NPC,GetSpawn(NPC, 270001))
  428. 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'?!", "scold", 517097409, 4194681002)
  429. SendStateCommand(GetSpawn(NPC, 270001), 0)
  430. AddTimer(NPC, 4000, "high_winds_3", 1, player)
  431. end
  432. end
  433. function high_winds_3(NPC, player)
  434. finished_high_winds_2 = true
  435. if not finished_high_winds_3 then
  436. PlayFlavor(GetSpawn(NPC, 270001), "voiceover/english/ingrid/boat_06p_tutorial02/020_deckhand_ingrid_010_1637e047.mp3", "Aye, aye, Captain!", "salute", 1250282628, 237171958)
  437. GenerateStateDefines(player)
  438. SendStateCommand(GetSpawn(NPC, 270001), VSTATE_SALUTE)
  439. AddTimer(NPC, 2500, "high_winds_4", 1, player)
  440. end
  441. end
  442. function high_winds_4(NPC, player)
  443. finished_high_winds_3 = true
  444. --This should be improved w/ MovementLoop to remove delay when walking
  445. MoveToLocation(GetSpawn(NPC, 270001), 1.40, 1.18, -11.82, 8, "", true)
  446. MoveToLocation(GetSpawn(NPC, 270001), 1.24, 1.21, -14.47, 8, "", true)
  447. MoveToLocation(GetSpawn(NPC, 270001), -2.31, 1.21, -15.09, 8, "", true)
  448. MoveToLocation(GetSpawn(NPC, 270001), -1.86, -2.03, -8.17, 8, "", true)
  449. MoveToLocation(GetSpawn(NPC, 270001), 2.48, -2.07, -3.26, 8, "", false)
  450. FaceTarget(NPC, player)
  451. GetSpawn(nil, NPC)
  452. SetTarget( NPC,nil)
  453. SetTarget(GetSpawn(NPC, 270001), nil)
  454. PlayFlavor(NPC, "voiceover/english/captain_varlos/boat_06p_tutorial02_fvo_008.mp3", "Ya think she'd never seen a gnome afore.", "", 2447879193, 4289147535)
  455. GenerateStateDefines(player)
  456. SendStateCommand(GetSpawn(NPC, 270001), VSTATE_SQUARE)
  457. AddTimer(NPC, 500, "shake_camera_medium", 1, player)
  458. AddTimer(NPC, 3500, "shake_camera_high", 1, player)
  459. AddTimer(NPC, 5500, "shake_camera_medium", 1, player)
  460. AddTimer(NPC, 9500, "shake_camera_low", 1, player)
  461. AddTimer(NPC, 5000, "offer_quest", 1, player)
  462. end
  463. function offer_quest(NPC, player)
  464. if HasQuest(player, 524) == false then
  465. OfferQuest(NPC, player, 524)
  466. AddTimer(NPC, 10000, "Accepted_Tutorial_Instructions", 1, player)
  467. end
  468. end
  469. function Accepted_Tutorial_Instructions(NPC, player)
  470. InstructionWindowClose(player)
  471. ShowWindow(player, "Journals.JournalsQuest", 0)
  472. 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")
  473. ShowWindow(player, "MainHUD.StartMenu", 1)
  474. FlashWindow(player, "MainHUD.StartMenu.quest_journal", 20.0)
  475. SetTutorialStep(player, 8)
  476. end
  477. function respawn(NPC)
  478. end