Ingrid.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. function spawn(NPC)
  13. if not HasCompletedQuest(Player, TaskAboardTheFarJourney) then
  14. SetTempVariable(NPC, "TempAnimationVar", "FirstRun")
  15. AddTimer(NPC, 1500, "WalkToGeredo")
  16. else
  17. SetTempVariable(NPC, "TempAnimationVar", nil)
  18. end
  19. end
  20. function hailed(NPC, Spawn)
  21. if GetTempVariable(NPC, "TempAnimationVar") == nil then
  22. FaceTarget(NPC, Spawn)
  23. local rand = math.random(0, 2)
  24. if rand == 0 then
  25. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_009.mp3", "I hate rats, every time we dock they get on board and eat our supplies.", "grumble", 3636322414, 1973183674, Spawn)
  26. elseif rand == 1 then
  27. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_008.mp3", "Don't you just love the sea?", "sniff", 541733813, 1294072887, Spawn)
  28. else
  29. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02_fvo_007.mp3", "Yo ho ho and a bottle of rum!", "smile", 964088856, 3568852318, Spawn)
  30. end
  31. end
  32. end
  33. function WalkToGeredo(NPC, Spawn)
  34. MoveToLocation(NPC, 5.85, -2.07, -2.94, 2, nil, true)
  35. MoveToLocation(NPC, 5.77, -2.07, -1.56, 2, nil, false)
  36. AddTimer(NPC, 1500, "EmoteAnimationStart")
  37. end
  38. --sends to Geredo to start the flirting
  39. --no action on Ingrid's part yet
  40. function EmoteAnimationStart(NPC, Spawn)
  41. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  42. AnimationChoice = math.random(0, 10)
  43. local Geredo = GetSpawn(NPC, 270004)
  44. if Geredo ~= nil then
  45. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  46. AddTimer(Geredo, 2000, "GeredoFlirtingWithIngird")
  47. else
  48. if GetTempVariable(NPC, "TempAnimationVar") == "SecondRun" and AnimationChoice <= 5 then
  49. AddTimer(Geredo, 5000, "GeredoFlirtingWithIngird")
  50. else
  51. AddTimer(Geredo, 5000, "FlirtingWithGeredo")
  52. end
  53. end
  54. end
  55. end
  56. end
  57. --sent from Geredo's flex
  58. --sends back to Geredo after Ingrid's response with a chuckle
  59. function FlirtWithIngrid(NPC, Spawn)
  60. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  61. PlayFlavor(NPC, "", "", "chuckle", 0, 0)
  62. AnimationChoice = math.random(0, 9)
  63. local Geredo = GetSpawn(NPC, 270004)
  64. if Geredo ~= nil then
  65. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  66. AddTimer(Geredo, 5000, "FlirtingWithGeredo")
  67. else
  68. if GetTempVariable(NPC, "TempAnimationVar") == "SecondRun" and AnimationChoice >= 7 then
  69. AddTimer(Geredo, 5000, "FlirtingWithGeredo")
  70. else
  71. EmoteAnimationStart(NPC, Spawn)
  72. end
  73. end
  74. end
  75. end
  76. end
  77. --sent form Geredo's bow
  78. --sends back to Geredo after Ingrid's curtsey
  79. function FlirtWithIngrid_2(NPC, Spawn)
  80. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  81. PlayFlavor(NPC, "", "", "curtsey", 0, 0)
  82. AnimationChoice = math.random(0, 9)
  83. local Geredo = GetSpawn(NPC, 270004)
  84. if Geredo ~= nil then
  85. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  86. AddTimer(Geredo, 5000, "FlirtingWithGeredo_2")
  87. elseif GetTempVariable(NPC, "TempAnimationVar") == "SecondRun" and AnimationChoice >= 7 then
  88. AddTimer(Geredo, 5000, "FlirtingWithGeredo_2")
  89. else
  90. EmoteAnimationStart(NPC, Spawn)
  91. end
  92. end
  93. end
  94. end
  95. --sent form Geredo's flirt
  96. --sends to flustered animation next
  97. function FlirtWithIngrid_3(NPC, Spawn)
  98. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  99. PlayFlavor(NPC, "", "", "giggle", 0, 0)
  100. AddTimer(NPC, 2500, "Ingridflustered")
  101. end
  102. end
  103. --emotes flustered
  104. --sends back to Geredo after Ingrid's giggle
  105. function Ingridflustered(NPC, Spawn)
  106. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  107. PlayFlavor(NPC, "", "", "flustered", 0, 0)
  108. local Geredo = GetSpawn(NPC, 270004)
  109. if Geredo ~= nil then
  110. AddTimer(Geredo, 3000, "FlirtingWithGeredo_3")
  111. end
  112. end
  113. end
  114. --sent form Geredo's blowkiss
  115. --sends back to Geredo after Ingrid's no
  116. function FlirtWithIngrid_4(NPC, Spawn)
  117. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  118. PlayFlavor(NPC, "", "", "no", 0, 0)
  119. local Geredo = GetSpawn(NPC, 270004)
  120. if Geredo ~= nil then
  121. AddTimer(Geredo, 2000, "FlirtingWithGeredo_4")
  122. end
  123. end
  124. end
  125. --sent form Geredo's beg
  126. --sends to foot tap animation
  127. function FlirtWithIngrid_5(NPC, Spawn)
  128. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  129. PlayFlavor(NPC, "", "", "tapfoot", 0, 0)
  130. AddTimer(NPC, 3000, "IngridTapFoot")
  131. end
  132. end
  133. --emotes foot tap
  134. --sends back to Geredo after Ingrid's shrug
  135. function IngridTapFoot(NPC, Spawn)
  136. if GetTempVariable(NPC, "TempAnimationVar") ~= nil then
  137. PlayFlavor(NPC, "", "", "shrug", 0, 0)
  138. if GetTempVariable(NPC, "TempAnimationVar") == "FirstRun" then
  139. SetTempVariable(NPC, "TempAnimationVar", "SecondRun")
  140. end
  141. AddTimer(NPC, 5000, "EmoteAnimationStart")
  142. end
  143. end
  144. function CaptainCallingIngrid(NPC, Spawn)
  145. if GetTempVariable(NPC, "TempAnimationVar") == nil then
  146. MoveToLocation(NPC, 2.47, -2.07, -3.26, 5)
  147. end
  148. MoveToLocation(NPC, -2.72, -2.00, -8.34, 5, nil, true)
  149. MoveToLocation(NPC, -2.11, 1.21, -14.69, 5, nil, true)
  150. MoveToLocation(NPC, 0.78, 1.21, -14.51, 5, nil, true)
  151. MoveToLocation(NPC, 0.54, 1.18, -11.70, 5, nil, true)
  152. MoveToLocation(NPC, 1.68, 1.19, -12.13, 5, "FaceCaptainVarlos", false)
  153. end
  154. function FaceCaptainVarlos(NPC, Spawn)
  155. local Varlos = GetSpawn(NPC, 270000)
  156. FaceTarget(NPC, Varlos)
  157. if GetDistance(NPC, Varlos) >= 1.48 then
  158. AddTimer(Varlos, 500, "TalkToCaptainVarlos", 1, Spawn)
  159. end
  160. end
  161. function SaluteCaptainVarlos(NPC, Spawn)
  162. local Varlos = GetSpawn(NPC, 270000)
  163. PlayFlavor(NPC, "voiceover/english/ingrid/boat_06p_tutorial02/020_deckhand_ingrid_010_1637e047.mp3", "Aye, aye, Captain!", "salute", 1250282628, 237171958, Spawn)
  164. AddTimer(Varlos, 3000, "IngridLeaveCaptain", 1, Spawn)
  165. AddTimer(NPC, 2000, "ReturnToSpawnPoint", 1, Spawn)
  166. end
  167. function ReturnToSpawnPoint(NPC, Spawn)
  168. MoveToLocation(NPC, 0.78, 1.21, -14.51, 5, nil, true)
  169. MoveToLocation(NPC, -2.11, 1.21, -14.69, 5, nil, true)
  170. MoveToLocation(NPC, -2.72, -2.00, -8.34, 5, nil, true)
  171. MoveToLocation(NPC, 3.34, -2.07, -3.97, 5, nil, true)
  172. MoveToLocation(NPC, 2.35, -2.07, -3.34, 5, nil, false)
  173. end
  174. function respawn(NPC)
  175. end