MizanVaeolin.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/MizanVaeolin.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.04 02:09:36
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Mage2 = 5733
  10. local Mage3 = 5736
  11. local Mage4 = 5740
  12. local Mage5 = 5744
  13. local Mage6 = 5752
  14. local Research = true
  15. function spawn(NPC)
  16. SetPlayerProximityFunction(NPC, 5, "InRange", "LeaveRange")
  17. ProvidesQuest(NPC, Mage3)
  18. ProvidesQuest(NPC, Mage4)
  19. ProvidesQuest(NPC, Mage5)
  20. ProvidesQuest(NPC, Mage6)
  21. AddTimer(NPC,3000,"CastResearch")
  22. end
  23. function CastResearch(NPC,Spawn)
  24. if Research == true then
  25. choice = MakeRandomInt(1,8)
  26. if choice == 1 then
  27. CastSpell(NPC,16)
  28. elseif choice == 2 then
  29. CastSpell(NPC,19)
  30. elseif choice == 3 then
  31. CastSpell(NPC,132)
  32. elseif choice == 4 then
  33. CastSpell(NPC,183)
  34. elseif choice == 5 then
  35. CastSpell(NPC,17)
  36. elseif choice == 6 then
  37. CastSpell(NPC,210011)
  38. elseif choice == 7 then
  39. CastSpell(NPC,62)
  40. end
  41. AddTimer(NPC,4000,"Consideration")
  42. end
  43. AddTimer(NPC,math.random(24000,32000),"CastResearch")
  44. end
  45. function Consideration(NPC,Spawn)
  46. choice2 = MakeRandomInt(1,8)
  47. if choice2 == 1 then
  48. PlayFlavor(NPC, "", "", "ponder", 0, 0)
  49. elseif choice2 ==2 then
  50. PlayFlavor(NPC, "", "", "confused", 0, 0)
  51. elseif choice2 ==3 then
  52. PlayFlavor(NPC, "", "", "agree", 0, 0)
  53. elseif choice2 ==4 then
  54. PlayFlavor(NPC, "", "", "boggle", 0, 0)
  55. elseif choice2 ==5 then
  56. PlayFlavor(NPC, "", "", "sniff", 0, 0)
  57. elseif choice2 ==6 then
  58. PlayFlavor(NPC, "", "", "nod", 0, 0)
  59. elseif choice2 ==7 then
  60. PlayFlavor(NPC, "", "", "no", 0, 0)
  61. end
  62. end
  63. function ResetResearch(NPC,Spawn)
  64. Research = true
  65. --SetTempVariable(NPC,"Research","Yes")
  66. end
  67. function InRange(NPC,Spawn)
  68. if GetClass(Spawn)== 0 then
  69. FaceTarget(NPC, Spawn)
  70. PlayFlavor(NPC,"voiceover/english/mizan_vaeoulin/tutorial_island02_fvo_nomage.mp3","You there! Unregistered refugees are not permitted in this area. Return to Garven Tralk and register at once. You'll find him on the beach where you arrived.","no",777511365,1811810491, Spawn)
  71. else
  72. if HasQuest(Spawn,Mage2)then
  73. FaceTarget(NPC, Spawn)
  74. PlayFlavor(NPC,"voiceover/english/mizan_vaeoulin/tutorial_island02_fvo_mageintro.mp3","You there! You are a wielder of the magic arts, yes? I have need of your assistance.","",471449740,174970929, Spawn)
  75. elseif not HasQuest(Spawn, Mage4) and not HasCompletedQuest(Spawn, Mage4) and HasCompletedQuest(Spawn,Mage3) then
  76. FaceTarget(NPC, Spawn)
  77. PlayFlavor(NPC,"voiceover/english/mizan_vaeoulin/tutorial_island02_fvo_mageq2.mp3","Ah, you have returned. I am in need of your assistance.","nod",2357058615,3609625942, Spawn)
  78. elseif not HasQuest(Spawn, Mage6) and not HasCompletedQuest(Spawn, Mage5) and HasCompletedQuest(Spawn,Mage6) then
  79. FaceTarget(NPC, Spawn)
  80. PlayFlavor(NPC,"voiceover/english/mizan_vaeoulin/tutorial_island02_fvo_mageq4.mp3","The vile leader of the goblins has been discovered!","nod",1615575534,1155005165, Spawn)
  81. end
  82. end
  83. end
  84. function hailed(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. Research = false
  87. AddTimer(NPC,60000,"ResetResearch",1,Spawn)
  88. if GetClass(Spawn)== 0 then
  89. PlayFlavor(NPC,"voiceover/english/mizan_vaeoulin/tutorial_island02_fvo_nomage.mp3","You there! Unregistered refugees are not permitted in this area. Return to Garven Tralk and register at once. You'll find him on the beach where you arrived.","scold",777511365,1811810491, Spawn)
  90. elseif HasQuest(Spawn, Mage2) or not HasQuest(Spawn, Mage3) and not HasCompletedQuest(Spawn, Mage3) and HasCompletedQuest(Spawn,Mage2) then
  91. Dialog2(NPC,Spawn)
  92. elseif not HasQuest(Spawn, Mage4) and not HasCompletedQuest(Spawn, Mage4) and HasCompletedQuest(Spawn,Mage3) then
  93. Dialog2(NPC,Spawn)
  94. elseif not HasQuest(Spawn, Mage5) and not HasCompletedQuest(Spawn, Mage5) and HasCompletedQuest(Spawn,Mage4) then
  95. Quest5Start(NPC,Spawn)
  96. elseif not HasQuest(Spawn, Mage6) and not HasCompletedQuest(Spawn, Mage6) and HasCompletedQuest(Spawn,Mage5) then
  97. Quest6Start(NPC,Spawn)
  98. else
  99. Dialog.New(NPC, Spawn)
  100. Dialog.AddDialog("Can't you see I am in the middle of my research. What do you need?")
  101. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin001.mp3", 1286845802, 4234951506)
  102. if GetQuestStep(Spawn,Mage3)==2 then
  103. Dialog.AddOption("I destroyed five of the supply crates.","Quest3Turnin")
  104. end
  105. if GetQuestStep(Spawn,Mage4)==2 then
  106. Dialog.AddOption("I have returned with the remains of five mire bogs.","Quest4Turnin")
  107. end
  108. if GetQuestStep(Spawn,Mage5)==2 then
  109. Dialog.AddOption("I have the goblin blood samples you asked for.","Quest5Turnin")
  110. end
  111. if GetQuestStep(Spawn,Mage6)==3 then
  112. Dialog.AddOption("The orc responsible for the goblin uprising is no more.","Quest6Turnin")
  113. end
  114. if HasCompletedQuest(Spawn,Mage6) then
  115. Dialog.AddOption("I suppose it is time I do my own research off the island. Good day Mizan.","Thanks")
  116. end
  117. Dialog.AddOption("I will leave you to your research.")
  118. Dialog.Start()
  119. end
  120. end
  121. function Thanks(NPC,Spawn)
  122. FaceTarget(NPC, Spawn)
  123. PlayFlavor(NPC,"","","bow",0,0, Spawn)
  124. end
  125. function respawn(NPC)
  126. spawn(NPC)
  127. end
  128. --------------------------------------------------------------------------------------------------------------------------------
  129. -- QUEST 3
  130. --------------------------------------------------------------------------------------------------------------------------------
  131. function Dialog2(NPC,Spawn)
  132. FaceTarget(NPC, Spawn)
  133. Dialog.New(NPC, Spawn)
  134. Dialog.AddDialog("I heard how you destroyed the goblins at the barricade. Impressive, you are promising at your chosen profession. If you are interested I could use your expertise.")
  135. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin002.mp3", 1506501392, 1121947234)
  136. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  137. if not HasCompletedQuest(Spawn,Mage3) and not HasQuest(Spawn,Mage3)then
  138. Dialog.AddOption("I am interested. What is it?","Quest3Start")
  139. end
  140. if HasCompletedQuest(Spawn,Mage3) and not HasCompletedQuest(Spawn,Mage4) and not HasQuest(Spawn,Mage4) or GetQuestStep(Spawn,Mage3)==3 and not HasQuest(Spawn,Mage4) then
  141. Dialog.AddOption("I am interested. What is it?","Quest4Start")
  142. end
  143. if HasCompletedQuest(Spawn,Mage4) and not HasCompletedQuest(Spawn,Mage5) and not HasQuest(Spawn,Mage5) then
  144. Dialog.AddOption("Yes, how can I be of further assistance?","Dialog4")
  145. end
  146. Dialog.AddOption("I am too busy right now.")
  147. Dialog.Start()
  148. end
  149. function Quest3Start(NPC,Spawn)
  150. FaceTarget(NPC, Spawn)
  151. Dialog.New(NPC, Spawn)
  152. Dialog.AddDialog("The goblins are staging an attack from a forward supply camp west of here. The outpost leaders asked me to gather mages who will attack this camp and destroy the goblin supplies. Will you help?")
  153. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin003.mp3", 2472743072, 4160462863)
  154. Dialog.AddOption("I'll help destroy the supplies.","Quest3Offer")
  155. Dialog.AddOption("I'll get back to you on that.")
  156. Dialog.Start()
  157. end
  158. function Quest3Offer(NPC,Spawn)
  159. OfferQuest(NPC,Spawn,Mage3)
  160. FaceTarget(NPC, Spawn)
  161. if HasQuest(Spawn, Mage2) then
  162. SetStepComplete(Spawn,Mage2,1)
  163. end
  164. end
  165. function Quest3Turnin(NPC,Spawn)
  166. FaceTarget(NPC, Spawn)
  167. Dialog.New(NPC, Spawn)
  168. Dialog.AddDialog("Word travels fast. Already I've heard of your success in demolishing the goblin supply crates. Excellent work. As a small token, I conjured up a pair of boots in your bank vault. Find Banker Vertbridge and he will give you the reward. Trust me, you will need the boots to protect you from the dangers lurking in the island forest.")
  169. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin005.mp3", 487769549, 120903513)
  170. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  171. Dialog.AddOption("Thank you. I will return.")
  172. Dialog.Start()
  173. if not HasItem(Spawn,132364) then
  174. SummonItem (Spawn, 132364, 1, "bank", 1)
  175. end
  176. SetStepComplete(Spawn,Mage3,2)
  177. end
  178. --------------------------------------------------------------------------------------------------------------------------------
  179. -- QUEST 4
  180. --------------------------------------------------------------------------------------------------------------------------------
  181. function Quest4Start(NPC,Spawn)
  182. FaceTarget(NPC, Spawn)
  183. Dialog.New(NPC, Spawn)
  184. Dialog.AddDialog("It seems the goblins are more clever than we gave them credit. After seeing the destructive power of your spells, they're obsessed with fire and learning how to use it against our barricades. Fortunately, I know how to solve the problem. Provided you will collect the materials I need.")
  185. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin006.mp3", 4248536758, 519393255)
  186. Dialog.AddOption("I'll help collect what you need.","Quest4Offer")
  187. Dialog.AddOption("That does sound like a problem, but I am busy at the momment.")
  188. Dialog.Start()
  189. end
  190. function Quest4Offer(NPC,Player)
  191. OfferQuest(NPC,Player,Mage4)
  192. FaceTarget(NPC, Spawn)
  193. end
  194. function Quest4Turnin(NPC,Spawn)
  195. FaceTarget(NPC, Spawn)
  196. Dialog.New(NPC, Spawn)
  197. Dialog.AddDialog("Splendid. I will start my first batch of sealant with these mire bog remains. As payment for your hard work, take these leggings. You've earned them. You've aided our outpost well, adventurer, but more work must be done. Can we count on you to help?")
  198. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin008.mp3", 4291717677, 2222410962)
  199. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  200. Dialog.AddOption("Yes, how can I be of further assistance?","Quest5Start")
  201. Dialog.AddOption("I have other matters to attend to. Perhaps later.")
  202. Dialog.Start()
  203. SetStepComplete(Spawn,Mage4,2)
  204. end
  205. --------------------------------------------------------------------------------------------------------------------------------
  206. -- QUEST 5
  207. --------------------------------------------------------------------------------------------------------------------------------
  208. function Quest5Start(NPC,Spawn)
  209. FaceTarget(NPC, Spawn)
  210. Dialog.New(NPC, Spawn)
  211. Dialog.AddDialog("While you were away, it seems that a few of Vladiminn's new recruits scouted out the main goblin encampment on the northwestern part of the island. Other adventurers are gathering to make an attack against it. My teacher, Malvonicus, has determined that we could make use of goblin blood in creating wards against the creatures. If you are willing, could you go along with this attack and while you are there, collect a few samples of goblin blood?")
  212. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin009.mp3", 963345532, 1033695526)
  213. Dialog.AddOption("I'll go along and collect the samples.","Quest5Offer")
  214. Dialog.AddOption("That sounds dreadful! I'd rather not deal with goblin blood.")
  215. Dialog.Start()
  216. end
  217. function Quest5Offer(NPC,Player)
  218. OfferQuest(NPC,Player,Mage5)
  219. FaceTarget(NPC, Spawn)
  220. end
  221. function Quest5Turnin(NPC,Spawn)
  222. FaceTarget(NPC, Spawn)
  223. Dialog.New(NPC, Spawn)
  224. Dialog.AddDialog("This is exactly what Malvonicus needs to begin research on the goblin warding spells. He instructed me to give you this apprentice robe in appreciation for the work you rendered here. I am remiss to ask this, but others need your services for one final task. Are you willing to help us?")
  225. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin011.mp3", 4291717677, 2222410962) --UNKNOWN KEY. MISSING.
  226. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  227. Dialog.AddOption("I will help with this task.","Quest6Start")
  228. Dialog.AddOption("I must leave this island. Best of luck with your tasks.")
  229. Dialog.Start()
  230. SetStepComplete(Spawn,Mage5,2)
  231. end
  232. --------------------------------------------------------------------------------------------------------------------------------
  233. -- QUEST 6
  234. --------------------------------------------------------------------------------------------------------------------------------
  235. function Quest6Start(NPC,Spawn)
  236. FaceTarget(NPC, Spawn)
  237. Dialog.New(NPC, Spawn)
  238. Dialog.AddDialog("We know the force behind the goblin attacks. Some time ago, a renowned orc pirate settled on the island and took control of the goblin tribes. He rules over the tribes and holds a deep hatred for the Far Seas Trading Company. Adventurers are forming an alliance to find the orc and destroy him. They shall put an end to his menacing our outpost. They need your help. Are you ready for the task, adventurer?")
  239. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin012.mp3", 2000860005, 2814938079)
  240. Dialog.AddOption("I'll go and aid them with my magic.","Quest6Offer")
  241. Dialog.AddOption("You must be joking. I will NOT be dealing with any orc!")
  242. Dialog.Start()
  243. end
  244. function Quest6Offer(NPC,Player)
  245. OfferQuest(NPC,Player,Mage6)
  246. FaceTarget(NPC, Spawn)
  247. end
  248. function Quest6Turnin(NPC,Spawn)
  249. FaceTarget(NPC, Spawn)
  250. Dialog.New(NPC, Spawn)
  251. Dialog.AddDialog("You have served this outpost well. In sincere appreciation, we award you this mage staff. Use it well on your path to knowledge and mastery of the arcane arts. ")
  252. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin014.mp3", 35364237, 702859208)
  253. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  254. Dialog.AddOption("Thank you. I wish you luck in your future research.")
  255. Dialog.Start()
  256. SetStepComplete(Spawn,Mage6,3)
  257. end