CaptainVarlos.lua 23 KB

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