NathiniaSparklebright.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. dofile("SpawnScripts/Generic/ClassSkillCheck.lua")
  9. require "SpawnScripts/Generic/DialogModule"
  10. local Priest2 = 5732
  11. local Priest3 = 5734
  12. local Priest4 = 5738
  13. local Priest5 = 5742
  14. local Priest6 = 5750
  15. local Blessing = true
  16. function spawn(NPC)
  17. SetPlayerProximityFunction(NPC, 12, "InRange", "LeaveRange")
  18. ProvidesQuest(NPC, Priest3)
  19. ProvidesQuest(NPC, Priest4)
  20. ProvidesQuest(NPC, Priest5)
  21. ProvidesQuest(NPC, Priest6)
  22. AddTimer(NPC,3000,"CastBlessing")
  23. end
  24. function CastBlessing(NPC,Spawn)
  25. if Blessing == true then
  26. choice = MakeRandomInt(1,7)
  27. if choice == 1 then
  28. CastSpell(NPC,110002)
  29. elseif choice == 2 then
  30. CastSpell(NPC,58)
  31. elseif choice == 3 then
  32. CastSpell(NPC,57)
  33. elseif choice == 4 then
  34. CastSpell(NPC,52)
  35. elseif choice == 5 then
  36. CastSpell(NPC,232)
  37. elseif choice == 6 then
  38. CastSpell(NPC,110002)
  39. elseif choice == 7 then
  40. CastSpell(NPC,572)
  41. end
  42. end
  43. AddTimer(NPC,math.random(45000,75000),"CastBlessing")
  44. end
  45. function ResetCasting(NPC,Spawn)
  46. Blessing = true
  47. end
  48. function InRange(NPC,Spawn)
  49. if HasQuest(Spawn,Priest2)then
  50. FaceTarget(NPC, Spawn)
  51. 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)
  52. elseif not HasQuest(Spawn, Priest4) and HasCompletedQuest(Spawn,Priest3) and not HasCompletedQuest(Spawn,Priest4) then
  53. FaceTarget(NPC, Spawn)
  54. PlayFlavor(NPC,"voiceover/english/nathinia_sparklebright/tutorial_island02_fvo_priestq2.mp3","I hope all is going well for you.","bye",3742259648,1726362202, Spawn)
  55. end
  56. end
  57. function hailed(NPC, Spawn)
  58. Blessing = false
  59. AddTimer(NPC,60000,"ResetCasting",1,Spawn)
  60. if GetClass(Spawn)==0 then
  61. 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)
  62. elseif HasQuest(Spawn, Priest2) or not HasQuest(Spawn, Priest3) and not HasCompletedQuest(Spawn, Priest3) and HasCompletedQuest(Spawn,Priest2) then
  63. Dialog2(NPC,Spawn)
  64. elseif not HasQuest(Spawn, Priest4) and HasCompletedQuest(Spawn,Priest3) and not HasCompletedQuest(Spawn,Priest4) then
  65. Dialog3(NPC,Spawn)
  66. elseif not HasQuest(Spawn, Priest5) and HasCompletedQuest(Spawn,Priest4) and not HasCompletedQuest(Spawn,Priest5) then
  67. Dialog4(NPC,Spawn)
  68. elseif not HasQuest(Spawn, Priest6) and HasCompletedQuest(Spawn,Priest5) and not HasCompletedQuest(Spawn,Priest6) then
  69. Dialog5(NPC,Spawn)
  70. else
  71. FaceTarget(NPC, Spawn)
  72. Dialog.New(NPC, Spawn)
  73. Dialog.AddDialog("Spiritual enlightenment is as important to being as air to breathe or food to eat.")
  74. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright001.mp3", 3193576979, 57142690)
  75. if GetQuestStep(Spawn, Priest3)==2 then
  76. Dialog.AddOption("The statues have been cleansed.","Priest3Turnin")
  77. end
  78. if GetQuestStep(Spawn, Priest4)==2 then
  79. Dialog.AddOption("I have five giant spider venom sacs for you.","Priest4Turnin")
  80. end
  81. if GetQuestStep(Spawn, Priest5)==2 then
  82. Dialog.AddOption("I have returned with four totems for you.","Priest5Turnin")
  83. end
  84. if GetQuestStep(Spawn, Priest6)==3 then
  85. Dialog.AddOption("The orc has been removed from power.","Priest6Turnin")
  86. end
  87. if HasCompletedQuest(Spawn, Priest6) then
  88. Dialog.AddOption("Blessings to you, Nathinia. Thank you again for your lessons.", "Thanks")
  89. end
  90. Dialog.AddOption("Thank you for that bit of wisdom.")
  91. if GetClass(Spawn)==11 then
  92. Dialog.AddOption("Can you make sure my skills are in order?","Skills")
  93. end
  94. Dialog.Start()
  95. end
  96. end
  97. function Skills(NPC,Spawn)
  98. SkillCheck(NPC,Spawn)
  99. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  100. end
  101. function Thanks(NPC,Spawn)
  102. FaceTarget(NPC, Spawn)
  103. PlayFlavor(NPC,"voiceover/english/nathinia_sparklebright/tutorial_island02_fvo_priestq2.mp3","I hope all is going well for you.","curtsey",3742259648,1726362202, Spawn)
  104. end
  105. function respawn(NPC)
  106. spawn(NPC)
  107. end
  108. --------------------------------------------------------------------------------------------------------------------------------
  109. -- QUEST 3
  110. --------------------------------------------------------------------------------------------------------------------------------
  111. function Dialog2(NPC,Spawn)
  112. FaceTarget(NPC, Spawn)
  113. Dialog.New(NPC, Spawn)
  114. 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.")
  115. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright002.mp3", 514500382, 260398895)
  116. PlayFlavor(NPC, "", "", "curtsey", 0, 0, Spawn)
  117. Dialog.AddOption("I am interested. What is it?","Interested")
  118. Dialog.AddOption("Not right now.")
  119. Dialog.Start()
  120. if HasQuest(Spawn, Priest2) then
  121. SetStepComplete(Spawn,Priest2,1)
  122. end
  123. end
  124. function Interested(NPC,Spawn)
  125. FaceTarget(NPC, Spawn)
  126. Dialog.New(NPC, Spawn)
  127. 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.")
  128. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright003.mp3", 3378158003,1090901335)
  129. Dialog.AddOption("How are these mystics different?","Mystics")
  130. Dialog.Start()
  131. end
  132. function Mystics(NPC,Spawn)
  133. FaceTarget(NPC, Spawn)
  134. Dialog.New(NPC, Spawn)
  135. 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.")
  136. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright018.mp3", 2424446864,2926608065)
  137. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  138. Dialog.AddOption("And so you want me to destroy these statues.","YouWantMe")
  139. Dialog.Start()
  140. end
  141. function YouWantMe(NPC,Spawn)
  142. FaceTarget(NPC, Spawn)
  143. Dialog.New(NPC, Spawn)
  144. 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?")
  145. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright019.mp3", 110104558,1387202040)
  146. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  147. Dialog.AddOption("I will.","Iwill")
  148. Dialog.AddOption("Perhaps another time.")
  149. Dialog.Start()
  150. end
  151. function Iwill(NPC,Spawn)
  152. OfferQuest(NPC,Spawn,Priest3)
  153. FaceTarget(NPC, Spawn)
  154. end
  155. function Priest3Turnin(NPC,Spawn)
  156. FaceTarget(NPC, Spawn)
  157. Dialog.New(NPC, Spawn)
  158. 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?")
  159. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright005.mp3", 1831865050,2426267765)
  160. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  161. Dialog.AddOption("Thank you. I will seek out the banker.")
  162. Dialog.Start()
  163. if not HasItem(Spawn,130119) then
  164. SummonItem (Spawn, 130119, 1, "bank", 1)
  165. end
  166. SetStepComplete(Spawn,Priest3,2)
  167. end
  168. --------------------------------------------------------------------------------------------------------------------------------
  169. -- QUEST 4
  170. --------------------------------------------------------------------------------------------------------------------------------
  171. function Dialog3(NPC,Spawn)
  172. FaceTarget(NPC, Spawn)
  173. Dialog.New(NPC, Spawn)
  174. 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?")
  175. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright006.mp3", 1039316566,2813655652)
  176. Dialog.AddOption("I will collect the venom sacs for you.","IwillCollect")
  177. Dialog.AddOption("That does sound like a problem, but I am busy at the momment.")
  178. Dialog.Start()
  179. end
  180. function IwillCollect(NPC,Player)
  181. OfferQuest(NPC,Player,Priest4)
  182. FaceTarget(NPC, Spawn)
  183. end
  184. function Priest4Turnin(NPC,Spawn)
  185. FaceTarget(NPC, Spawn)
  186. Dialog.New(NPC, Spawn)
  187. 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?")
  188. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright008.mp3", 1685520077,3945672786)
  189. PlayFlavor(NPC, "", "", "curtsey", 0, 0, Spawn)
  190. Dialog.AddOption("I'll do what I can.","Dialog4")
  191. Dialog.AddOption("Perhaps. I need a momment.")
  192. Dialog.Start()
  193. SetStepComplete(Spawn,Priest4,2)
  194. end
  195. --------------------------------------------------------------------------------------------------------------------------------
  196. -- QUEST 5
  197. --------------------------------------------------------------------------------------------------------------------------------
  198. function Dialog4(NPC,Spawn)
  199. FaceTarget(NPC, Spawn)
  200. Dialog.New(NPC, Spawn)
  201. 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?")
  202. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright009.mp3", 1871132929,3238860300)
  203. Dialog.AddOption("I'll assist with the assault.","Quest5Offer")
  204. Dialog.AddOption("I need to consider this further.")
  205. Dialog.Start()
  206. end
  207. function Quest5Offer(NPC,Player)
  208. OfferQuest(NPC,Player,Priest5)
  209. FaceTarget(NPC, Spawn)
  210. end
  211. function Priest5Turnin(NPC,Spawn)
  212. FaceTarget(NPC, Spawn)
  213. Dialog.New(NPC, Spawn)
  214. 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?")
  215. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright011.mp3", 744531264,1982225584)
  216. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  217. Dialog.AddOption("I will help with this task.","Dialog5")
  218. Dialog.AddOption("Perhaps, but I need a momment.")
  219. Dialog.Start()
  220. SetStepComplete(Spawn,Priest5,2)
  221. end
  222. --------------------------------------------------------------------------------------------------------------------------------
  223. -- QUEST 6
  224. --------------------------------------------------------------------------------------------------------------------------------
  225. function Dialog5(NPC,Spawn)
  226. FaceTarget(NPC, Spawn)
  227. Dialog.New(NPC, Spawn)
  228. 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?")
  229. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright012.mp3", 4086085032,2441283948)
  230. Dialog.AddOption("I will help remove this orc from power.","Quest6Offer")
  231. Dialog.AddOption("I don't care about some crazy orc.")
  232. Dialog.Start()
  233. end
  234. function Quest6Offer(NPC,Player)
  235. OfferQuest(NPC,Player,Priest6)
  236. FaceTarget(NPC, Spawn)
  237. end
  238. function Priest6Turnin(NPC,Spawn)
  239. FaceTarget(NPC, Spawn)
  240. Dialog.New(NPC, Spawn)
  241. 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.")
  242. Dialog.AddVoiceover("voiceover/english/nathinia_sparklebright/tutorial_island02/nathiniasparklebright014.mp3",1479847046,137812808)
  243. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  244. Dialog.AddOption("Thank you for the gift.")
  245. Dialog.Start()
  246. SetStepComplete(Spawn,Priest6,3)
  247. end