MizanVaeolin.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. dofile("SpawnScripts/Generic/ClassSkillCheck.lua")
  9. require "SpawnScripts/Generic/DialogModule"
  10. local Mage2 = 5733
  11. local Mage3 = 5736
  12. local Mage4 = 5740
  13. local Mage5 = 5744
  14. local Mage6 = 5752
  15. local Research = true
  16. function spawn(NPC)
  17. SetPlayerProximityFunction(NPC, 5, "InRange", "LeaveRange")
  18. ProvidesQuest(NPC, Mage3)
  19. ProvidesQuest(NPC, Mage4)
  20. ProvidesQuest(NPC, Mage5)
  21. ProvidesQuest(NPC, Mage6)
  22. AddTimer(NPC,3000,"CastResearch")
  23. end
  24. function CastResearch(NPC,Spawn)
  25. if Research == true then
  26. choice = MakeRandomInt(1,8)
  27. if choice == 1 then
  28. CastSpell(NPC,16)
  29. elseif choice == 2 then
  30. CastSpell(NPC,19)
  31. elseif choice == 3 then
  32. CastSpell(NPC,132)
  33. elseif choice == 4 then
  34. CastSpell(NPC,183)
  35. elseif choice == 5 then
  36. CastSpell(NPC,17)
  37. elseif choice == 6 then
  38. CastSpell(NPC,210011)
  39. elseif choice == 7 then
  40. CastSpell(NPC,62)
  41. end
  42. AddTimer(NPC,4000,"Consideration")
  43. end
  44. AddTimer(NPC,math.random(24000,32000),"CastResearch")
  45. end
  46. function Consideration(NPC,Spawn)
  47. choice2 = MakeRandomInt(1,8)
  48. if choice2 == 1 then
  49. PlayFlavor(NPC, "", "", "ponder", 0, 0)
  50. elseif choice2 ==2 then
  51. PlayFlavor(NPC, "", "", "confused", 0, 0)
  52. elseif choice2 ==3 then
  53. PlayFlavor(NPC, "", "", "agree", 0, 0)
  54. elseif choice2 ==4 then
  55. PlayFlavor(NPC, "", "", "boggle", 0, 0)
  56. elseif choice2 ==5 then
  57. PlayFlavor(NPC, "", "", "sniff", 0, 0)
  58. elseif choice2 ==6 then
  59. PlayFlavor(NPC, "", "", "nod", 0, 0)
  60. elseif choice2 ==7 then
  61. PlayFlavor(NPC, "", "", "no", 0, 0)
  62. end
  63. end
  64. function ResetResearch(NPC,Spawn)
  65. Research = true
  66. --SetTempVariable(NPC,"Research","Yes")
  67. end
  68. function InRange(NPC,Spawn)
  69. if GetClass(Spawn)== 0 then
  70. FaceTarget(NPC, Spawn)
  71. 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)
  72. else
  73. if HasQuest(Spawn,Mage2)then
  74. FaceTarget(NPC, Spawn)
  75. 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)
  76. elseif not HasQuest(Spawn, Mage4) and not HasCompletedQuest(Spawn, Mage4) and HasCompletedQuest(Spawn,Mage3) then
  77. FaceTarget(NPC, Spawn)
  78. 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)
  79. elseif not HasQuest(Spawn, Mage6) and not HasCompletedQuest(Spawn, Mage5) and HasCompletedQuest(Spawn,Mage6) then
  80. FaceTarget(NPC, Spawn)
  81. PlayFlavor(NPC,"voiceover/english/mizan_vaeoulin/tutorial_island02_fvo_mageq4.mp3","The vile leader of the goblins has been discovered!","nod",1615575534,1155005165, Spawn)
  82. end
  83. end
  84. end
  85. function hailed(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. Research = false
  88. AddTimer(NPC,60000,"ResetResearch",1,Spawn)
  89. if GetClass(Spawn)== 0 then
  90. 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)
  91. elseif HasQuest(Spawn, Mage2) or not HasQuest(Spawn, Mage3) and not HasCompletedQuest(Spawn, Mage3) and HasCompletedQuest(Spawn,Mage2) then
  92. Dialog2(NPC,Spawn)
  93. elseif not HasQuest(Spawn, Mage4) and not HasCompletedQuest(Spawn, Mage4) and HasCompletedQuest(Spawn,Mage3) then
  94. Dialog2(NPC,Spawn)
  95. elseif not HasQuest(Spawn, Mage5) and not HasCompletedQuest(Spawn, Mage5) and HasCompletedQuest(Spawn,Mage4) then
  96. Quest5Start(NPC,Spawn)
  97. elseif not HasQuest(Spawn, Mage6) and not HasCompletedQuest(Spawn, Mage6) and HasCompletedQuest(Spawn,Mage5) then
  98. Quest6Start(NPC,Spawn)
  99. else
  100. Dialog.New(NPC, Spawn)
  101. Dialog.AddDialog("Can't you see I am in the middle of my research. What do you need?")
  102. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin001.mp3", 1286845802, 4234951506)
  103. if GetQuestStep(Spawn,Mage3)==2 then
  104. Dialog.AddOption("I destroyed five of the supply crates.","Quest3Turnin")
  105. end
  106. if GetQuestStep(Spawn,Mage4)==2 then
  107. Dialog.AddOption("I have returned with the remains of five mire bogs.","Quest4Turnin")
  108. end
  109. if GetQuestStep(Spawn,Mage5)==2 then
  110. Dialog.AddOption("I have the goblin blood samples you asked for.","Quest5Turnin")
  111. end
  112. if GetQuestStep(Spawn,Mage6)==3 then
  113. Dialog.AddOption("The orc responsible for the goblin uprising is no more.","Quest6Turnin")
  114. end
  115. if HasCompletedQuest(Spawn,Mage6) then
  116. Dialog.AddOption("I suppose it is time I do my own research off the island. Good day Mizan.","Thanks")
  117. end
  118. Dialog.AddOption("I will leave you to your research.")
  119. if GetClass(Spawn)==21 then
  120. Dialog.AddOption("Can you make sure my skills are in order?","Skills")
  121. end
  122. Dialog.Start()
  123. end
  124. end
  125. function Skills(NPC,Spawn)
  126. SkillCheck(NPC,Spawn)
  127. PlayFlavor(NPC,"","","nod",0,0,Spawn)
  128. end
  129. function Thanks(NPC,Spawn)
  130. FaceTarget(NPC, Spawn)
  131. PlayFlavor(NPC,"","","bow",0,0, Spawn)
  132. end
  133. function respawn(NPC)
  134. spawn(NPC)
  135. end
  136. --------------------------------------------------------------------------------------------------------------------------------
  137. -- QUEST 3
  138. --------------------------------------------------------------------------------------------------------------------------------
  139. function Dialog2(NPC,Spawn)
  140. FaceTarget(NPC, Spawn)
  141. Dialog.New(NPC, Spawn)
  142. 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.")
  143. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin002.mp3", 1506501392, 1121947234)
  144. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  145. if not HasCompletedQuest(Spawn,Mage3) and not HasQuest(Spawn,Mage3)then
  146. Dialog.AddOption("I am interested. What is it?","Quest3Start")
  147. end
  148. 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
  149. Dialog.AddOption("I am interested. What is it?","Quest4Start")
  150. end
  151. if HasCompletedQuest(Spawn,Mage4) and not HasCompletedQuest(Spawn,Mage5) and not HasQuest(Spawn,Mage5) then
  152. Dialog.AddOption("Yes, how can I be of further assistance?","Dialog4")
  153. end
  154. Dialog.AddOption("I am too busy right now.")
  155. Dialog.Start()
  156. end
  157. function Quest3Start(NPC,Spawn)
  158. FaceTarget(NPC, Spawn)
  159. Dialog.New(NPC, Spawn)
  160. 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?")
  161. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin003.mp3", 2472743072, 4160462863)
  162. Dialog.AddOption("I'll help destroy the supplies.","Quest3Offer")
  163. Dialog.AddOption("I'll get back to you on that.")
  164. Dialog.Start()
  165. end
  166. function Quest3Offer(NPC,Spawn)
  167. OfferQuest(NPC,Spawn,Mage3)
  168. FaceTarget(NPC, Spawn)
  169. if HasQuest(Spawn, Mage2) then
  170. SetStepComplete(Spawn,Mage2,1)
  171. end
  172. end
  173. function Quest3Turnin(NPC,Spawn)
  174. FaceTarget(NPC, Spawn)
  175. Dialog.New(NPC, Spawn)
  176. 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.")
  177. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin005.mp3", 487769549, 120903513)
  178. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  179. Dialog.AddOption("Thank you. I will return.")
  180. Dialog.Start()
  181. if not HasItem(Spawn,132364) then
  182. SummonItem (Spawn, 132364, 1, "bank", 1)
  183. end
  184. SetStepComplete(Spawn,Mage3,2)
  185. end
  186. --------------------------------------------------------------------------------------------------------------------------------
  187. -- QUEST 4
  188. --------------------------------------------------------------------------------------------------------------------------------
  189. function Quest4Start(NPC,Spawn)
  190. FaceTarget(NPC, Spawn)
  191. Dialog.New(NPC, Spawn)
  192. 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.")
  193. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin006.mp3", 4248536758, 519393255)
  194. Dialog.AddOption("I'll help collect what you need.","Quest4Offer")
  195. Dialog.AddOption("That does sound like a problem, but I am busy at the momment.")
  196. Dialog.Start()
  197. end
  198. function Quest4Offer(NPC,Player)
  199. OfferQuest(NPC,Player,Mage4)
  200. FaceTarget(NPC, Spawn)
  201. end
  202. function Quest4Turnin(NPC,Spawn)
  203. FaceTarget(NPC, Spawn)
  204. Dialog.New(NPC, Spawn)
  205. 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?")
  206. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin008.mp3", 4291717677, 2222410962)
  207. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  208. Dialog.AddOption("Yes, how can I be of further assistance?","Quest5Start")
  209. Dialog.AddOption("I have other matters to attend to. Perhaps later.")
  210. Dialog.Start()
  211. SetStepComplete(Spawn,Mage4,2)
  212. end
  213. --------------------------------------------------------------------------------------------------------------------------------
  214. -- QUEST 5
  215. --------------------------------------------------------------------------------------------------------------------------------
  216. function Quest5Start(NPC,Spawn)
  217. FaceTarget(NPC, Spawn)
  218. Dialog.New(NPC, Spawn)
  219. 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?")
  220. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin009.mp3", 963345532, 1033695526)
  221. Dialog.AddOption("I'll go along and collect the samples.","Quest5Offer")
  222. Dialog.AddOption("That sounds dreadful! I'd rather not deal with goblin blood.")
  223. Dialog.Start()
  224. end
  225. function Quest5Offer(NPC,Player)
  226. OfferQuest(NPC,Player,Mage5)
  227. FaceTarget(NPC, Spawn)
  228. end
  229. function Quest5Turnin(NPC,Spawn)
  230. FaceTarget(NPC, Spawn)
  231. Dialog.New(NPC, Spawn)
  232. 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?")
  233. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin011.mp3", 4291717677, 2222410962) --UNKNOWN KEY. MISSING.
  234. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  235. Dialog.AddOption("I will help with this task.","Quest6Start")
  236. Dialog.AddOption("I must leave this island. Best of luck with your tasks.")
  237. Dialog.Start()
  238. SetStepComplete(Spawn,Mage5,2)
  239. end
  240. --------------------------------------------------------------------------------------------------------------------------------
  241. -- QUEST 6
  242. --------------------------------------------------------------------------------------------------------------------------------
  243. function Quest6Start(NPC,Spawn)
  244. FaceTarget(NPC, Spawn)
  245. Dialog.New(NPC, Spawn)
  246. 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?")
  247. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin012.mp3", 2000860005, 2814938079)
  248. Dialog.AddOption("I'll go and aid them with my magic.","Quest6Offer")
  249. Dialog.AddOption("You must be joking. I will NOT be dealing with any orc!")
  250. Dialog.Start()
  251. end
  252. function Quest6Offer(NPC,Player)
  253. OfferQuest(NPC,Player,Mage6)
  254. FaceTarget(NPC, Spawn)
  255. end
  256. function Quest6Turnin(NPC,Spawn)
  257. FaceTarget(NPC, Spawn)
  258. Dialog.New(NPC, Spawn)
  259. 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. ")
  260. Dialog.AddVoiceover("voiceover/english/mizan_vaeoulin/tutorial_island02/mizanvaeoulin014.mp3", 35364237, 702859208)
  261. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  262. Dialog.AddOption("Thank you. I wish you luck in your future research.")
  263. Dialog.Start()
  264. SetStepComplete(Spawn,Mage6,3)
  265. end