NathiniaSparklebright.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/NathiniaSparklebright.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.04 02:09:26
  5. Script Purpose : Nathinia Sparklebright on Isle of Refuge
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Priest2 = 5732
  10. local Priest3 = 5734
  11. local Priest4 = 5738
  12. local Priest5 = 5742
  13. local Priest6 = 5750
  14. local Blessing = true
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 12, "InRange", "LeaveRange")
  17. ProvidesQuest(NPC, Priest3)
  18. ProvidesQuest(NPC, Priest4)
  19. ProvidesQuest(NPC, Priest5)
  20. ProvidesQuest(NPC, Priest6)
  21. AddTimer(NPC,3000,"CastBlessing")
  22. end
  23. function CastBlessing(NPC,Spawn)
  24. if Blessing == true then
  25. choice = MakeRandomInt(1,7)
  26. if choice == 1 then
  27. CastSpell(NPC,110002)
  28. elseif choice == 2 then
  29. CastSpell(NPC,58)
  30. elseif choice == 3 then
  31. CastSpell(NPC,57)
  32. elseif choice == 4 then
  33. CastSpell(NPC,52)
  34. elseif choice == 5 then
  35. CastSpell(NPC,232)
  36. elseif choice == 6 then
  37. CastSpell(NPC,110002)
  38. elseif choice == 7 then
  39. CastSpell(NPC,572)
  40. end
  41. end
  42. AddTimer(NPC,math.random(45000,75000),"CastBlessing")
  43. end
  44. function ResetCasting(NPC,Spawn)
  45. Blessing = true
  46. end
  47. function InRange(NPC,Spawn)
  48. if HasQuest(Spawn,Priest2)then
  49. FaceTarget(NPC, Spawn)
  50. PlayFlavor(NPC,"voiceover/english/nathinia_sparklebright/tutorial_island02_fvo_priestcallout.mp3","If you are one that follows the ways of the priest, then I need your help.","hello",2406483258,3086152442, Spawn)
  51. elseif not HasQuest(Spawn, Priest4) and HasCompletedQuest(Spawn,Priest3) and not HasCompletedQuest(Spawn,Priest4) then
  52. FaceTarget(NPC, Spawn)
  53. PlayFlavor(NPC,"voiceover/english/nathinia_sparklebright/tutorial_island02_fvo_priestq2.mp3","I hope all is going well for you.","bye",3742259648,1726362202, Spawn)
  54. end
  55. end
  56. function hailed(NPC, Spawn)
  57. Blessing = false
  58. AddTimer(NPC,60000,"ResetCasting",1,Spawn)
  59. if GetClass(Spawn)==0 then
  60. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_3_1011.mp3","I can sense a deep spirituality inside you, but I can't teach you until you register with Garven.","no",0,0, Spawn)
  61. elseif HasQuest(Spawn, Priest2) or not HasQuest(Spawn, Priest3) and not HasCompletedQuest(Spawn, Priest3) and HasCompletedQuest(Spawn,Priest2) then
  62. Dialog2(NPC,Spawn)
  63. elseif not HasQuest(Spawn, Priest4) and HasCompletedQuest(Spawn,Priest3) and not HasCompletedQuest(Spawn,Priest4) then
  64. Dialog3(NPC,Spawn)
  65. elseif not HasQuest(Spawn, Priest5) and HasCompletedQuest(Spawn,Priest4) and not HasCompletedQuest(Spawn,Priest5) then
  66. Dialog4(NPC,Spawn)
  67. elseif not HasQuest(Spawn, Priest6) and HasCompletedQuest(Spawn,Priest5) and not HasCompletedQuest(Spawn,Priest6) then
  68. Dialog5(NPC,Spawn)
  69. else
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("Spiritual enlightenment is as important to being as air to breathe or food to eat.")
  73. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright001.mp3", 3193576979, 57142690)
  74. if GetQuestStep(Spawn, Priest3)==2 then
  75. Dialog.AddOption("The statues have been cleansed.","Priest3Turnin")
  76. end
  77. if GetQuestStep(Spawn, Priest4)==2 then
  78. Dialog.AddOption("I have five giant spider venom sacs for you.","Priest4Turnin")
  79. end
  80. if GetQuestStep(Spawn, Priest5)==2 then
  81. Dialog.AddOption("I have returned with four totems for you.","Priest5Turnin")
  82. end
  83. if GetQuestStep(Spawn, Priest6)==3 then
  84. Dialog.AddOption("The orc has been removed from power.","Priest6Turnin")
  85. end
  86. if HasCompletedQuest(Spawn, Priest6) then
  87. Dialog.AddOption("Blessings to you, Nathinia. Thank you again for your lessons.", "Thanks")
  88. end
  89. Dialog.AddOption("Thank you for that bit of wisdom.")
  90. Dialog.Start()
  91. end
  92. end
  93. function Thanks(NPC,Spawn)
  94. FaceTarget(NPC, Spawn)
  95. PlayFlavor(NPC,"voiceover/english/nathinia_sparklebright/tutorial_island02_fvo_priestq2.mp3","I hope all is going well for you.","curtsey",3742259648,1726362202, Spawn)
  96. end
  97. function respawn(NPC)
  98. spawn(NPC)
  99. end
  100. --------------------------------------------------------------------------------------------------------------------------------
  101. -- QUEST 3
  102. --------------------------------------------------------------------------------------------------------------------------------
  103. function Dialog2(NPC,Spawn)
  104. FaceTarget(NPC, Spawn)
  105. Dialog.New(NPC, Spawn)
  106. Dialog.AddDialog("Word has spread about you defending our outpost from the goblin assaults. Your effort is greatly appreciated. However, I have another task, if you are interested.")
  107. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright002.mp3", 514500382, 260398895)
  108. PlayFlavor(NPC, "", "", "curtsey", 0, 0, Spawn)
  109. Dialog.AddOption("I am interested. What is it?","Interested")
  110. Dialog.AddOption("Not right now.")
  111. Dialog.Start()
  112. if HasQuest(Spawn, Priest2) then
  113. SetStepComplete(Spawn,Priest2,1)
  114. end
  115. end
  116. function Interested(NPC,Spawn)
  117. FaceTarget(NPC, Spawn)
  118. Dialog.New(NPC, Spawn)
  119. Dialog.AddDialog("The Gruttooth invaders you fought off at the barricades are but fodder compared to the goblins trying to push us from this outpost. Among the more dangerous members of their makeshift army you'll find the Gruttooth mystics.")
  120. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright003.mp3", 3378158003,1090901335)
  121. Dialog.AddOption("How are these mystics different?","Mystics")
  122. Dialog.Start()
  123. end
  124. function Mystics(NPC,Spawn)
  125. FaceTarget(NPC, Spawn)
  126. Dialog.New(NPC, Spawn)
  127. Dialog.AddDialog("While physically the same as the other goblins, the mystics rely on depraved priestly powers gained from the idols they worship to perform their foul magic. I've come to learn that the source of this power may have to do with the goblin idol statues found on this island.")
  128. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright018.mp3", 2424446864,2926608065)
  129. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  130. Dialog.AddOption("And so you want me to destroy these statues.","YouWantMe")
  131. Dialog.Start()
  132. end
  133. function YouWantMe(NPC,Spawn)
  134. FaceTarget(NPC, Spawn)
  135. Dialog.New(NPC, Spawn)
  136. Dialog.AddDialog("Exactly. It is only one of our professions that can perform such a task, for I've heard the idols are impossible to destroy without divine power. Will you aid us in destroying the heart of these goblins' foul powers?")
  137. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright019.mp3", 110104558,1387202040)
  138. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  139. Dialog.AddOption("I will.","Iwill")
  140. Dialog.AddOption("Perhaps another time.")
  141. Dialog.Start()
  142. end
  143. function Iwill(NPC,Spawn)
  144. OfferQuest(NPC,Spawn,Priest3)
  145. FaceTarget(NPC, Spawn)
  146. end
  147. function Priest3Turnin(NPC,Spawn)
  148. FaceTarget(NPC, Spawn)
  149. Dialog.New(NPC, Spawn)
  150. Dialog.AddDialog("Well done brave friend. With the mystics weakened, the goblins will have a harder time with their siege plans. I have taken the liberty of placing a reward in your bank. Seek out Banker Vertbridge and he will help you receive it. Wear them well, you will need the protection. Are you able to assist us with another task?")
  151. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright005.mp3", 1831865050,2426267765)
  152. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  153. Dialog.AddOption("Thank you. I will seek out the banker.")
  154. Dialog.Start()
  155. if not HasItem(Spawn,130119) then
  156. SummonItem (Spawn, 130119, 1, "bank", 1)
  157. end
  158. SetStepComplete(Spawn,Priest3,2)
  159. end
  160. --------------------------------------------------------------------------------------------------------------------------------
  161. -- QUEST 4
  162. --------------------------------------------------------------------------------------------------------------------------------
  163. function Dialog3(NPC,Spawn)
  164. FaceTarget(NPC, Spawn)
  165. Dialog.New(NPC, Spawn)
  166. Dialog.AddDialog("Thus far we've done well defending our outpost against the goblin forces, but now many goblins are tipping their spears with a form of poison. Goblin shaman create the poison by using giant spider venom sacs. We need you to collect a few of these sacs so I can produce an antidote. Would you do us this favor, friend?")
  167. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright006.mp3", 1039316566,2813655652)
  168. Dialog.AddOption("I will collect the venom sacs for you.","IwillCollect")
  169. Dialog.AddOption("That does sound like a problem, but I am busy at the momment.")
  170. Dialog.Start()
  171. end
  172. function IwillCollect(NPC,Player)
  173. OfferQuest(NPC,Player,Priest4)
  174. FaceTarget(NPC, Spawn)
  175. end
  176. function Priest4Turnin(NPC,Spawn)
  177. FaceTarget(NPC, Spawn)
  178. Dialog.New(NPC, Spawn)
  179. Dialog.AddDialog("Excellent job! You proved your value, adventurer. I will start on this antidote immediately. For a job well done, here are some leggings. I know it is asking a lot, but may I ask you another favor?")
  180. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright008.mp3", 1685520077,3945672786)
  181. PlayFlavor(NPC, "", "", "curtsey", 0, 0, Spawn)
  182. Dialog.AddOption("I'll do what I can.","Dialog4")
  183. Dialog.AddOption("Perhaps. I need a momment.")
  184. Dialog.Start()
  185. SetStepComplete(Spawn,Priest4,2)
  186. end
  187. --------------------------------------------------------------------------------------------------------------------------------
  188. -- QUEST 5
  189. --------------------------------------------------------------------------------------------------------------------------------
  190. function Dialog4(NPC,Spawn)
  191. FaceTarget(NPC, Spawn)
  192. Dialog.New(NPC, Spawn)
  193. Dialog.AddDialog("Our scouts have found the location of the goblins' main encampment. Adventurers are organizing now to attack the village. I don't know if this will defeat the goblins or just scatter them for a time, but either way, it is a necessary action. The warriors fighting there will undoubtedly need of your healing talents and blessings. Could you join the assault on the goblin village and, perhaps, collect something for me in the process?")
  194. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright009.mp3", 1871132929,3238860300)
  195. Dialog.AddOption("I'll assist with the assault.","Quest5Offer")
  196. Dialog.AddOption("I need to consider this further.")
  197. Dialog.Start()
  198. end
  199. function Quest5Offer(NPC,Player)
  200. OfferQuest(NPC,Player,Priest5)
  201. FaceTarget(NPC, Spawn)
  202. end
  203. function Priest5Turnin(NPC,Spawn)
  204. FaceTarget(NPC, Spawn)
  205. Dialog.New(NPC, Spawn)
  206. Dialog.AddDialog("Excellent. I shall study these totems and determine if they are part of what is stirring the goblins up. You have been very helpful to the people of this outpost. Please, take this tunic as a token of our appreciation. You have most assuredly earned it. I am reluctant to ask this but others need your service one final time. Are you willing to help us with this last task?")
  207. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright011.mp3", 744531264,1982225584)
  208. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  209. Dialog.AddOption("I will help with this task.","Dialog5")
  210. Dialog.AddOption("Perhaps, but I need a momment.")
  211. Dialog.Start()
  212. SetStepComplete(Spawn,Priest5,2)
  213. end
  214. --------------------------------------------------------------------------------------------------------------------------------
  215. -- QUEST 6
  216. --------------------------------------------------------------------------------------------------------------------------------
  217. function Dialog5(NPC,Spawn)
  218. FaceTarget(NPC, Spawn)
  219. Dialog.New(NPC, Spawn)
  220. Dialog.AddDialog("We know the force behind the goblin attacks. Some time ago a renowned orc pirate capsized on the island and took control of the goblin tribes. Now he rules over the goblins and uses them for his private army. We must put an end to his treachery. We need your help. Are you ready for the task, adventurer?")
  221. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright012.mp3", 4086085032,2441283948)
  222. Dialog.AddOption("I will help remove this orc from power.","Quest6Offer")
  223. Dialog.AddOption("I don't care about some crazy orc.")
  224. Dialog.Start()
  225. end
  226. function Quest6Offer(NPC,Player)
  227. OfferQuest(NPC,Player,Priest6)
  228. FaceTarget(NPC, Spawn)
  229. end
  230. function Priest6Turnin(NPC,Spawn)
  231. FaceTarget(NPC, Spawn)
  232. Dialog.New(NPC, Spawn)
  233. Dialog.AddDialog("Now that the orc is defeated the goblin attacks should cease. We thank you for your hard work. In appreciation, on behalf of our people, I offer you a sceptre. May the gods look upon you favorably, friend.")
  234. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright014.mp3",1479847046,137812808)
  235. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  236. Dialog.AddOption("Thank you for the gift.")
  237. Dialog.Start()
  238. SetStepComplete(Spawn,Priest6,3)
  239. end