Ingrid.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. --[[
  2. Script Name : SpawnScripts/FarJourneyFreeport/Ingrid.lua
  3. Script Author : Cynnar
  4. Script Date : 2019.10.18 06:10:27
  5. Script Purpose :
  6. Notes :
  7. Notes :
  8. --]]
  9. require "SpawnScripts/Generic/DialogModule"
  10. local TaskAboardTheFarJourney = 524
  11. local TempAnimationVar = nil
  12. local ShardOfLuclin = 12565
  13. function spawn(NPC)
  14. SetTempVariable(NPC, "TempAnimationVar", "FirstRun")
  15. AddTimer(NPC, 30000, "WalkToGeredo")
  16. end
  17. function hailed(NPC, Spawn)
  18. step = GetQuestStep(Spawn, 524)
  19. if step == 4 then
  20. SendStateCommand(NPC, 0)
  21. Dialog.New(NPC, Spawn)
  22. Dialog.AddDialog("Hello, how are you?")
  23. Dialog.AddVoiceover("voiceover/english/ingrid/boat_06p_tutorial02/ingrid_0_001.mp3", 1960704460, 917558592)
  24. Dialog.AddOption("Good, thanks. How about you?", "small_talk")
  25. Dialog.Start()
  26. elseif step == 5 then
  27. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_005.mp3",
  28. "Is Vim not going to sell it to you? That is just my luck... well I guess I will have to finish this work then.",
  29. "", 4181806501, 3186272404)
  30. elseif step == 6 then
  31. SetTutorialStep(Spawn, 31)
  32. AddCoin(Spawn, 10)
  33. DisplayText(Spawn, 34, "You receive 10 Copper.")
  34. Dialog.New(NPC, Spawn)
  35. Dialog.AddDialog(
  36. "Ah! You got the shard. Great! Now I can stop doing this work and enjoy the rest of this trip. Here is some coin for your help.")
  37. Dialog.AddVoiceover("voiceover/english/ingrid/boat_06p_tutorial02/ingrid_0_006.mp3", 502975024, 483052250)
  38. Dialog.AddOption("Thanks.", "thanks_for_getting_shard")
  39. Dialog.Start()
  40. elseif GetX(NPC) < 5 then
  41. FaceTarget(NPC, Spawn)
  42. local rand = math.random(0, 2)
  43. if rand == 0 then
  44. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_009.mp3",
  45. "I hate rats, every time we dock they get on board and eat our supplies.", "grumble", 3636322414,
  46. 1973183674, Spawn)
  47. elseif rand == 1 then
  48. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_008.mp3", "Don't you just love the sea?",
  49. "sniff", 541733813, 1294072887, Spawn)
  50. else
  51. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_007.mp3", "Yo ho ho and a bottle of rum!",
  52. "smile", 964088856, 3568852318, Spawn)
  53. end
  54. end
  55. end
  56. function WalkToGeredo(NPC, Spawn)
  57. playerhasquest = HasQuest(Spawn, 524)
  58. if playerhasquest == true then
  59. MoveToLocation(NPC, 2.35, -2.07, -3.34, 5, nil, false)
  60. else
  61. MoveToLocation(NPC, 5.85, -2.07, -2.94, 2, nil, true)
  62. MoveToLocation(NPC, 5.77, -2.07, -1.56, 2, nil, false)
  63. AddTimer(NPC, 1500, "EmoteAnimationStart")
  64. end
  65. end
  66. -- sends to Geredo to start the flirting
  67. -- no action on Ingrid's part yet
  68. function EmoteAnimationStart(NPC, Spawn)
  69. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  70. AnimationChoice = math.random(0, 10)
  71. local Geredo = GetSpawn(NPC, 270004)
  72. if Geredo ~= nil then
  73. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  74. AddTimer(Geredo, 2000, "GeredoFlirtingWithIngird")
  75. else
  76. if GetTempVariable(NPC, "TempAnimationVar") == "SecondRun" and AnimationChoice <= 5 then
  77. AddTimer(Geredo, 5000, "GeredoFlirtingWithIngird")
  78. else
  79. AddTimer(Geredo, 5000, "FlirtingWithGeredo")
  80. end
  81. end
  82. end
  83. end
  84. end
  85. -- sent from Geredo's flex
  86. -- sends back to Geredo after Ingrid's response with a chuckle
  87. function FlirtWithIngrid(NPC, Spawn)
  88. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  89. PlayFlavor(NPC, "", "", "chuckle", 0, 0)
  90. AnimationChoice = math.random(0, 9)
  91. local Geredo = GetSpawn(NPC, 270004)
  92. if Geredo ~= nil then
  93. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  94. AddTimer(Geredo, 5000, "FlirtingWithGeredo")
  95. else
  96. if GetTempVariable(NPC, "TempAnimationVar") == "SecondRun" and AnimationChoice >= 7 then
  97. AddTimer(Geredo, 5000, "FlirtingWithGeredo")
  98. else
  99. EmoteAnimationStart(NPC, Spawn)
  100. end
  101. end
  102. end
  103. end
  104. end
  105. -- sent form Geredo's bow
  106. -- sends back to Geredo after Ingrid's curtsey
  107. function FlirtWithIngrid_2(NPC, Spawn)
  108. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  109. PlayFlavor(NPC, "", "", "curtsey", 0, 0)
  110. AnimationChoice = math.random(0, 9)
  111. local Geredo = GetSpawn(NPC, 270004)
  112. if Geredo ~= nil then
  113. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  114. AddTimer(Geredo, 5000, "FlirtingWithGeredo_2")
  115. elseif GetTempVariable(NPC, "TempAnimationVar") == "SecondRun" and AnimationChoice >= 7 then
  116. AddTimer(Geredo, 5000, "FlirtingWithGeredo_2")
  117. else
  118. EmoteAnimationStart(NPC, Spawn)
  119. end
  120. end
  121. end
  122. end
  123. -- sent form Geredo's flirt
  124. -- sends to flustered animation next
  125. function FlirtWithIngrid_3(NPC, Spawn)
  126. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  127. PlayFlavor(NPC, "", "", "giggle", 0, 0)
  128. AddTimer(NPC, 2500, "Ingridflustered")
  129. end
  130. end
  131. -- emotes flustered
  132. -- sends back to Geredo after Ingrid's giggle
  133. function Ingridflustered(NPC, Spawn)
  134. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  135. PlayFlavor(NPC, "", "", "flustered", 0, 0)
  136. local Geredo = GetSpawn(NPC, 270004)
  137. if Geredo ~= nil then
  138. AddTimer(Geredo, 3000, "FlirtingWithGeredo_3")
  139. end
  140. end
  141. end
  142. -- sent form Geredo's blowkiss
  143. -- sends back to Geredo after Ingrid's no
  144. function FlirtWithIngrid_4(NPC, Spawn)
  145. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  146. PlayFlavor(NPC, "", "", "no", 0, 0)
  147. local Geredo = GetSpawn(NPC, 270004)
  148. if Geredo ~= nil then
  149. AddTimer(Geredo, 2000, "FlirtingWithGeredo_4")
  150. end
  151. end
  152. end
  153. -- sent form Geredo's beg
  154. -- sends to foot tap animation
  155. function FlirtWithIngrid_5(NPC, Spawn)
  156. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  157. PlayFlavor(NPC, "", "", "tapfoot", 0, 0)
  158. AddTimer(NPC, 3000, "IngridTapFoot")
  159. end
  160. end
  161. -- emotes foot tap
  162. -- sends back to Geredo after Ingrid's shrug
  163. function IngridTapFoot(NPC, Spawn)
  164. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  165. PlayFlavor(NPC, "", "", "shrug", 0, 0)
  166. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  167. SetTempVariable(NPC, "TempAnimationVar", "SecondRun")
  168. end
  169. AddTimer(NPC, 5000, "EmoteAnimationStart")
  170. end
  171. end
  172. -- Ingrid runs to Captain after camera shake
  173. -- sends to FaceCaptainVarlos function after movement
  174. function CaptainCallingIngrid(NPC, Spawn)
  175. PlayAnimation(NPC, 12246)
  176. if GetTempVariable(NPC, "TempAnimationVar") == nil then
  177. MoveToLocation(NPC, 2.47, -2.07, -3.26, 5)
  178. end
  179. SetTempVariable(NPC, "IngridSpawnPointer", Spawn)
  180. MoveToLocation(NPC, -2.72, -2.00, -8.34, 5, nil, true)
  181. MoveToLocation(NPC, -2.11, 1.21, -14.69, 5, nil, true)
  182. MoveToLocation(NPC, 0.78, 1.21, -14.51, 5, nil, true)
  183. MoveToLocation(NPC, 0.54, 1.18, -11.70, 5, nil, true)
  184. MoveToLocation(NPC, 1.68, 1.19, -12.13, 5, "FaceCaptainVarlos", false)
  185. end
  186. -- Ingird reaches Captain
  187. -- sends back to Captain upon arrival
  188. function FaceCaptainVarlos(NPC)
  189. local Spawn = GetTempVariable(NPC, "IngridSpawnPointer")
  190. SetTempVariable(NPC, "IngridSpawnPointer", nil)
  191. local Varlos = GetSpawn(NPC, 270000)
  192. FaceTarget(NPC, Varlos)
  193. if GetDistance(NPC, Varlos) >= 1.48 then
  194. AddTimer(Varlos, 500, "TalkToCaptainVarlos", 1, Spawn)
  195. end
  196. end
  197. -- Ingrid salutes Captain
  198. -- sends to ReturnToSpawnPoint function
  199. -- sends back to Captain
  200. function SaluteCaptainVarlos(NPC, Spawn)
  201. local Varlos = GetSpawn(NPC, 270000)
  202. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02/020_deckhand_ingrid_010_1637e047.mp3",
  203. "Aye, aye, Captain!", "salute", 1250282628, 237171958, Spawn)
  204. AddTimer(Varlos, 3000, "IngridLeaveCaptain", 1, Spawn)
  205. AddTimer(NPC, 2000, "ReturnToSpawnPoint", 1, Spawn)
  206. end
  207. function ReturnToSpawnPoint(NPC, Spawn)
  208. MoveToLocation(NPC, 0.78, 1.21, -14.51, 5, nil, true)
  209. MoveToLocation(NPC, -2.11, 1.21, -14.69, 5, nil, true)
  210. MoveToLocation(NPC, -2.72, -2.00, -8.34, 5, nil, true)
  211. MoveToLocation(NPC, 3.34, -2.07, -3.97, 5, nil, true)
  212. MoveToLocation(NPC, 2.35, -2.07, -3.34, 5, nil, false)
  213. end
  214. function small_talk(NPC, Spawn)
  215. Dialog.New(NPC, Spawn)
  216. Dialog.AddDialog(
  217. "I am fine, just... after the last pickup I have been working extra hard, since Vim said she would give me the piece of Luclin she found.")
  218. Dialog.AddVoiceover("voiceover/english/ingrid/boat_06p_tutorial02/ingrid_0_002.mp3", 3891218598, 1657063801)
  219. Dialog.AddOption("Vim?", "vim_who")
  220. Dialog.Start()
  221. end
  222. function vim_who(NPC, Spawn)
  223. Dialog.New(NPC, Spawn)
  224. Dialog.AddDialog(
  225. "Yes, yes, Vim. The merchant over there. She found a small piece of the moon and is having me work for it. Maybe you can go buy it from her for me?")
  226. Dialog.AddVoiceover("voiceover/english/ingrid/boat_06p_tutorial02/ingrid_0_003.mp3", 3050752668, 1437910974)
  227. Dialog.AddOption("Sure, but I have no money.", "no_money")
  228. Dialog.Start()
  229. vim = GetRandomSpawnByID(NPC, 270007)
  230. FaceTarget(NPC, vim)
  231. AddTimer(NPC, 3000, "turn_towards_player", 1, Spawn)
  232. end
  233. function turn_towards_player(NPC, Spawn)
  234. FaceTarget(NPC, Spawn)
  235. end
  236. function no_money(NPC, Spawn)
  237. Dialog.New(NPC, Spawn)
  238. Dialog.AddDialog("Maybe you have something she will buy. Why don't you go talk to her.")
  239. Dialog.AddVoiceover("voiceover/english/ingrid/boat_06p_tutorial02/ingrid_0_004.mp3", 3978048706, 2537762235)
  240. Dialog.AddOption("Sure.", "finished_step_four")
  241. Dialog.Start()
  242. end
  243. function finished_step_four(NPC, Spawn)
  244. SetTutorialStep(Spawn, 22)
  245. SetStepComplete(Spawn, 524, 4)
  246. end
  247. function thanks_for_getting_shard(NPC, Spawn)
  248. SetStepComplete(Spawn, 524, 6)
  249. RemoveItem(Spawn, ShardOfLuclin)
  250. end
  251. function respawn(NPC)
  252. end