MollyDaysun.lua 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/MollyDaysun.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.29 04:06:11
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. waypoints(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, 245)
  13. end
  14. function InRange(NPC,Spawn)
  15. if GetFactionAmount(Spawn,11)<0 then
  16. FaceTarget(NPC, Spawn)
  17. PlayFlavor(NPC, "", "squeal", 0, 0, Spawn)
  18. else
  19. if not HasQuest(Spawn, 245) and not HasCompletedQuest(Spawn,245)then
  20. local chance = math.random(0, 100)
  21. if chance <= 90 then
  22. local choice = MakeRandomInt(1,2)
  23. if choice == 1 then
  24. PlayFlavor(NPC, "voiceover/english/molly_daysun/qey_village02/100_molly_cat_chasing_callout_6fb3caf0.mp3", "Kitty come back! Please help me get my kitty.", "wave", 690447374, 3480843859, Spawn)
  25. elseif choice == 2 then
  26. PlayFlavor(NPC, "voiceover/english/molly_daysun/qey_village02/100_molly_cat_chasing_multhail2_e54bdfb2.mp3", "Won't you help me get my kitty?", "", 666416041, 907394876, Spawn, 0)
  27. end
  28. end
  29. end
  30. end
  31. end
  32. function hailed(NPC, Spawn)
  33. SetTarget(NPC,Spawn)
  34. FaceTarget(NPC, Spawn)
  35. if GetFactionAmount(Spawn,11)<0 then
  36. PlayFlavor(NPC, "", "", "sulk", 0, 0, Spawn)
  37. else
  38. Dialog1(NPC, Spawn)
  39. end
  40. end
  41. function Dialog1(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. PlayFlavor(NPC, "", "", "wave", 0, 0, Spawn)
  45. Dialog.AddDialog("Stop, Kitty! Come back here!")
  46. Dialog.AddVoiceover("voiceover/english/molly_daysun/qey_village02/mollydaysun.mp3", 2796508243, 3325394808)
  47. if not HasCompletedQuest (Spawn, 245) and not HasQuest (Spawn, 245) then
  48. Dialog.AddOption("Have you had any luck catching Kitty?","Caught")
  49. end
  50. if GetQuestStep (Spawn, 245)==2 then
  51. Dialog.AddOption("I've delivered the King's Field piece. You'll be happy to know you're not in trouble.","Done")
  52. end
  53. if HasCompletedQuest (Spawn, 245) then
  54. Dialog.AddOption("Good luck. Kitty seems to be a quick one!")
  55. end
  56. Dialog.AddOption("Bah! Keep that cat away from me!")
  57. Dialog.Start()
  58. end
  59. function Caught(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. Dialog.New(NPC, Spawn)
  62. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  63. Dialog.AddDialog("Well, I did manage to grab her a few minutes ago. I took this out of her mouth. It looks like a playing piece from that game the erudites play by the gate. Could you return the piece while I catch kitty?")
  64. Dialog.AddVoiceover("voiceover/english/molly_daysun/qey_village02/mollydaysun000.mp3", 2059278603, 4147718964)
  65. Dialog.AddOption("Certainly. I will see if they are missing this piece from their game.", "QuestBegin")
  66. Dialog.AddOption("Afraid I'm busy. Sorry.")
  67. Dialog.Start()
  68. end
  69. function QuestBegin (NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. OfferQuest(NPC, Spawn, 245)
  72. end
  73. function Done(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. Dialog.New(NPC, Spawn)
  76. SetStepComplete(Spawn, 245, 2)
  77. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  78. Dialog.AddDialog("Great! I don't want the players yelling at me for my cat for taking their game piece. Kitty tends to annoy a lot of the erudites in the city.")
  79. Dialog.AddVoiceover("voiceover/english/molly_daysun/qey_village02/mollydaysun001.mp3", 220292318, 3478148880)
  80. Dialog.AddOption("Glad I could help. Good luck with Kitty.")
  81. Dialog.Start()
  82. end
  83. function respawn(NPC)
  84. spawn(NPC)
  85. end
  86. function waypoints(NPC)
  87. MovementLoopAddLocation(NPC, 776.39, -20.52, 287.4, 4, math.random(0,1),"Kitty2")
  88. MovementLoopAddLocation(NPC, 778.21, -20.33, 294.25, 4, 2,"Kitty3")
  89. MovementLoopAddLocation(NPC, 784.48, -20.51, 290.9, 4, math.random(0,1),"Kitty4")
  90. MovementLoopAddLocation(NPC, 785.14, -20.57, 283.67, 4, math.random(0,1),"Kitty5")
  91. MovementLoopAddLocation(NPC, 774.82, -20.57, 275.59, 4, math.random(0,1),"Kitty6")
  92. MovementLoopAddLocation(NPC, 769.64, -20.51, 274.32, 4, math.random(0,1),"Kitty7")
  93. MovementLoopAddLocation(NPC, 757.83, -20.52, 278.97, 4, math.random(0,3),"Kitty8")
  94. MovementLoopAddLocation(NPC, 754.89, -20.48, 281.49, 4, 0,"Kitty9")
  95. MovementLoopAddLocation(NPC, 760.22, -20.49, 280.95, 4, 0,"Kitty10")
  96. MovementLoopAddLocation(NPC, 765.29, -20.47, 274.4, 4, math.random(0,1),"Kitty11")
  97. MovementLoopAddLocation(NPC, 777.6, -20.58, 276.25, 4, math.random(0,1),"Kitty12")
  98. MovementLoopAddLocation(NPC, 781.22, -20.6, 282.04, 4, 0,"Kitty1")
  99. end
  100. function Kitty12(NPC)
  101. Pigchase = true
  102. local kitty = GetSpawn(NPC,2340002)
  103. if kitty ~=nil then
  104. MoveToLocation(kitty, 776.39, -20.52, 287.4, 6)
  105. SetTarget(NPC,kitty)
  106. end
  107. end
  108. function Kitty11(NPC)
  109. Pigchase = true
  110. local kitty = GetSpawn(NPC,2340002)
  111. if kitty ~=nil then
  112. MoveToLocation(kitty, 781.22, -20.6, 282.04, 6)
  113. SetTarget(NPC,kitty)
  114. end
  115. end
  116. function Kitty10(NPC)
  117. Pigchase = true
  118. local kitty = GetSpawn(NPC,2340002)
  119. if kitty ~=nil then
  120. MoveToLocation(kitty, 777.6, -20.58, 276.25, 6)
  121. SetTarget(NPC,kitty)
  122. end
  123. end
  124. function Kitty9(NPC)
  125. Pigchase = true
  126. local kitty = GetSpawn(NPC,2340002)
  127. if kitty ~=nil then
  128. MoveToLocation(kitty, 765.29, -20.47, 274.4, 6)
  129. SetTarget(NPC,kitty)
  130. end
  131. end
  132. function Kitty8(NPC)
  133. Pigchase = true
  134. local kitty = GetSpawn(NPC,2340002)
  135. if kitty ~=nil then
  136. MoveToLocation(kitty, 760.22, -20.49, 280.95, 6)
  137. SetTarget(NPC,kitty)
  138. end
  139. end
  140. function Kitty7(NPC)
  141. Pigchase = true
  142. local kitty = GetSpawn(NPC,2340002)
  143. if kitty ~=nil then
  144. MoveToLocation(kitty, 754.89, -20.48, 281.49, 6)
  145. SetTarget(NPC,kitty)
  146. end
  147. end
  148. function Kitty6(NPC)
  149. Pigchase = true
  150. local kitty = GetSpawn(NPC,2340002)
  151. if kitty ~=nil then
  152. MoveToLocation(kitty, 757.83, -20.52, 278.97, 6)
  153. SetTarget(NPC,kitty)
  154. end
  155. end
  156. function Kitty5(NPC)
  157. Pigchase = true
  158. local kitty = GetSpawn(NPC,2340002)
  159. if kitty ~=nil then
  160. MoveToLocation(kitty, 769.64, -20.51, 274.32, 6)
  161. SetTarget(NPC,kitty)
  162. end
  163. end
  164. function Kitty4(NPC)
  165. Pigchase = true
  166. local kitty = GetSpawn(NPC,2340002)
  167. if kitty ~=nil then
  168. MoveToLocation(kitty, 774.82, -20.57, 275.59, 6)
  169. SetTarget(NPC,kitty)
  170. end
  171. end
  172. function Kitty3(NPC)
  173. Pigchase = true
  174. local kitty = GetSpawn(NPC,2340002)
  175. if kitty ~=nil then
  176. MoveToLocation(kitty, 785.14, -20.57, 283.67, 6)
  177. SetTarget(NPC,kitty)
  178. end
  179. end
  180. function Kitty2(NPC)
  181. Pigchase = true
  182. local kitty = GetSpawn(NPC,2340002)
  183. if kitty ~=nil then
  184. MoveToLocation(kitty, 784.48, -20.51, 290.9, 6)
  185. SetTarget(NPC,kitty)
  186. end
  187. end
  188. function Kitty1(NPC)
  189. Pigchase = true
  190. local kitty = GetSpawn(NPC,2340002)
  191. if kitty ~=nil then
  192. MoveToLocation(kitty, 778.21, -20.33, 294.25, 6)
  193. SetTarget(NPC,kitty)
  194. end
  195. end