9
3

CannixSilverflame.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/CannixSilverflame.lua
  3. Script Author : Premierio015//Dorbin
  4. Script Date : 2021.02.27 10:02:00
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. require "SpawnScripts/Generic/NPCModule"
  10. local TheReturnOfTheLight = 485
  11. function spawn(NPC)
  12. NPCModule(NPC, Spawn)
  13. SetPlayerProximityFunction(NPC, 20, "InRange")
  14. SetAggroRadius(NPC, 20)
  15. end
  16. function InRange(NPC, Spawn)
  17. if HasCompletedQuest(Spawn, TheReturnOfTheLight) then
  18. RemoveSpawnAccess(NPC, Spawn)
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. if HasQuest(Spawn,5865) and not QuestStepIsComplete(Spawn,5865,6)then --FREEPORT OPPORTUNITY
  23. SetStepComplete(Spawn,5865,6)
  24. end
  25. if not HasQuest(Spawn, TheReturnOfTheLight) or GetQuestStep(Spawn, TheReturnOfTheLight) == 1 then
  26. FaceTarget(NPC, Spawn)
  27. Dialog.New(NPC, Spawn)
  28. Dialog.AddDialog("Greetings to you as well, traveler. Now if you'll excuse me, I must remain vigilant while this time is appointed unto me.")
  29. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame001.mp3", 3283011934, 1161547540)
  30. Dialog.AddOption("Are you a guard or something?", "Option1")
  31. Dialog.AddOption("You're excused.")
  32. Dialog.Start()
  33. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 2 or GetQuestStep(Spawn, TheReturnOfTheLight) == 3 then
  34. step2or3_progress(NPC, Spawn)
  35. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 4 then
  36. Option4(NPC, Spawn)
  37. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 5 then
  38. step5_progress(NPC, Spawn)
  39. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 6 then
  40. Option6(NPC, Spawn)
  41. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 7 or GetQuestStep(Spawn, TheReturnOfTheLight) == 8 then
  42. step7or8_progress(NPC, Spawn)
  43. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 9 then
  44. Option7(NPC, Spawn)
  45. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 10 then
  46. step10_progress(NPC, Spawn)
  47. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 11 then
  48. Option10(NPC, Spawn)
  49. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 12 then
  50. step12_progress(NPC, Spawn)
  51. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 13 then
  52. Option13(NPC, Spawn)
  53. end
  54. end
  55. function Option1(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. Dialog.New(NPC, Spawn)
  58. Dialog.AddDialog("A guard? No. I suppose if I have a title, you can call me a ... a pilgrim. Yes, just a pilgrim looking for the light of truth. Aren't we all seeking a little truth in these turbulent times?")
  59. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame002.mp3", 1936975525, 2350985185)
  60. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  61. Dialog.AddOption("I see. I'll leave you to your thoughts. ")
  62. if GetQuestStep(Spawn, TheReturnOfTheLight) == 1 then
  63. Dialog.AddOption("Maybe a pilgrim would be interested in buying this unique lightstone.", "Option2")
  64. else
  65. Dialog.AddOption("You're excused.")
  66. end
  67. Dialog.Start()
  68. end
  69. function Option2(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("No, I'm sorry. I'm not interested in any local treasures ... wait ... let me see that lightstone. You're right! This isn't like the other lightstones in these lands. In fact, I've never seen one like it. Could it be? Is it beginning? It's possible, but I must be sure. Will you do something for me?")
  73. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame003.mp3", 514719331, 2019687176)
  74. Dialog.AddOption("Yes, I could use a little adventure.", "Option3")
  75. Dialog.Start()
  76. end
  77. function Option3(NPC, Spawn)
  78. SetStepComplete(Spawn, TheReturnOfTheLight, 1)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("Good, good. You didn't come upon this item by chance. You must be the one to set out on this quest. Seek out both the Mourned and the Forgotten. One has fallen among brethren, the other alone. Both were valorous on the field of battle. Touch this stone to them and honor both.")
  82. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame004.mp3", 997093089, 3927227010)
  83. PlayFlavor(NPC, "", "", "agree", 0, 0, Spawn)
  84. Dialog.AddOption("I will return when it is done. ")
  85. Dialog.Start()
  86. end
  87. function Option4(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. Dialog.AddDialog("The stone you have is glowing again. This proves the lightstone you have is very unique. I can show you how to increase its power.")
  91. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame006.mp3", 2082775910, 3850348152)
  92. Dialog.AddOption("Tell me how to increase its power.", "Option5")
  93. Dialog.Start()
  94. if GetQuestStepProgress(Spawn,485,5) ==0 and not HasItem(Spawn,151067,1) then
  95. GiveQuestItem(TheReturnOfTheLight, Spawn, "I returned to Cannix Silverflame.", 151067)
  96. end
  97. end
  98. function Option5(NPC, Spawn)
  99. SetStepComplete(Spawn, TheReturnOfTheLight, 4)
  100. FaceTarget(NPC, Spawn)
  101. Dialog.New(NPC, Spawn)
  102. Dialog.AddDialog("Listen carefully: The lion has always been a symbol of valor on the battlefield, never retreating from a foe, always protecting his charges. The great beast Rama'nai walks these lands at the head of his pride. Slay him in honorable combat and dip the stone in his blood. Return to me when you're done.")
  103. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame007.mp3", 3631388788, 98718381)
  104. Dialog.AddOption("I will hunt Rama'nai.")
  105. Dialog.Start()
  106. end
  107. function Option6(NPC, Spawn)
  108. SetStepComplete(Spawn, TheReturnOfTheLight, 6)
  109. FaceTarget(NPC, Spawn)
  110. Dialog.New(NPC, Spawn)
  111. Dialog.AddDialog("I see you did as you were told. The stone continues to glow brighter. To increase its power, you must right some wrongs. Find the orc captains Gaer and Ogof. They routinely direct their troops to destroy and rob the graves of the ancient Knights of Truth. You must avenge this defilement of the graves; doing so will increase the power of your stone.")
  112. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame009.mp3", 933092014, 3991745317)
  113. Dialog.AddOption("I will find Gaer and Ogof.")
  114. Dialog.Start()
  115. if HasItem(Spawn, 151067) then
  116. RemoveItem(Spawn, 151067)
  117. end
  118. if GetQuestStepProgress(Spawn,485,6) ==0 and not HasItem(Spawn,144492,1) then
  119. GiveQuestItem(TheReturnOfTheLight, Spawn, "I returned to Cannix Silverflame.", 144492)
  120. end
  121. end
  122. function Option7(NPC, Spawn)
  123. FaceTarget(NPC, Spawn)
  124. Dialog.New(NPC, Spawn)
  125. Dialog.AddDialog("Excellent. Greedy orc scavengers will no longer disturb the buried dead. Your stone grows brighter with each deed done in valor. There is another soul in these lands who needs releasing from the eternal torment that chains him to this realm. Will you free him?")
  126. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame011.mp3", 4172338348, 1148941338)
  127. Dialog.AddOption("Who is this soul?", "Option8")
  128. Dialog.Start()
  129. if HasItem(Spawn, 144492) then
  130. RemoveItem(Spawn, 144492)
  131. end
  132. if GetQuestStepProgress(Spawn,485,10) ==0 and not HasItem(Spawn,180730,1) then
  133. GiveQuestItem(TheReturnOfTheLight, Spawn, "I returned to Cannix Silverflame.", 180730)
  134. end
  135. end
  136. function Option8(NPC, Spawn)
  137. FaceTarget(NPC, Spawn)
  138. Dialog.New(NPC, Spawn)
  139. Dialog.AddDialog("Long ago the Priests of Marr and the Knights of Truth administered to the people of these lands. The current ruler of Freeport despised these people and managed to kill most of them long before the Shattering. The High Priest at the time was first cursed, then executed and then his corpse was tossed out in these lands for the scavengers to feast on. His soul hasn't found deserved rest for centuries.")
  140. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame012.mp3", 1530561048, 1179568761)
  141. Dialog.AddOption("I suppose I am the one to fix all this?", "Option9")
  142. Dialog.Start()
  143. end
  144. function Option9(NPC, Spawn)
  145. SetStepComplete(Spawn, TheReturnOfTheLight, 9)
  146. FaceTarget(NPC, Spawn)
  147. Dialog.New(NPC, Spawn)
  148. Dialog.AddDialog("Yes, you now bear an object that hasn't been seen on Norrath for centuries. You hold the essence of the Greater Lightstone. Defeat the cursed High Priest in battle while the lightstone is in his presence. The powers of Valor and Truth imbued within will free him from his curse. ")
  149. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame013.mp3", 984364583, 3971878128)
  150. Dialog.AddOption("I will release him from his pain.")
  151. Dialog.Start()
  152. end
  153. function Option10(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. Dialog.New(NPC, Spawn)
  156. Dialog.AddDialog("Your lightstone glows brilliantly! Your quest is almost over. I must ask you to complete a final task. If you do this, I can fully imbue your lightstone.")
  157. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame015.mp3", 862085114, 603082398)
  158. Dialog.AddOption("What is it?", "Option11")
  159. Dialog.Start()
  160. if HasItem(Spawn, 180730) then
  161. RemoveItem(Spawn, 180730)
  162. end
  163. if GetQuestStepProgress(Spawn,485,12) ==0 and not HasItem(Spawn,155134,1) then
  164. GiveQuestItem(TheReturnOfTheLight, Spawn, "I returned to Cannix Silverflame.", 155134)
  165. end
  166. end
  167. function Option11(NPC, Spawn)
  168. FaceTarget(NPC, Spawn)
  169. Dialog.New(NPC, Spawn)
  170. Dialog.AddDialog("The elite among the Knights of Truth wielded the magical Swords of Truth. These weapons have been lost for many decades. News has surfaced that an orc holds the hilt and broken edge of one of these lost blades; you must retrieve its remnants. With these ancient saber pieces I shall complete your Greater Lightstone.")
  171. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame016.mp3", 2784277299, 2349442251)
  172. Dialog.AddOption("Where can I find this orc?", "Option12")
  173. Dialog.Start()
  174. end
  175. function Option12(NPC, Spawn)
  176. SetStepComplete(Spawn, TheReturnOfTheLight, 11)
  177. FaceTarget(NPC, Spawn)
  178. Dialog.New(NPC, Spawn)
  179. Dialog.AddDialog("He's a leader among the Bloodskull clan of orcs. Rumors state his camp lies in a hidden valley close to here. Unfortunately, I don't know the location of the camp. You must help me get this sword back into the proper hands; it's sacrilege for such a creature to possess it.")
  180. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame017.mp3", 3813681064, 1372487877)
  181. Dialog.AddOption("I'll get the sword back.")
  182. Dialog.Start()
  183. end
  184. function Option13(NPC, Spawn)
  185. FaceTarget(NPC, Spawn)
  186. Dialog.New(NPC, Spawn)
  187. Dialog.AddDialog("You did it! Now hand me the broken sword and your lightstone, and I will completely empower the stone.")
  188. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame019.mp3", 3694906098, 1804290878)
  189. PlayFlavor(NPC, "", "", "happy", 0, 0, Spawn)
  190. Dialog.AddOption("Here they are.", "Option14")
  191. Dialog.Start()
  192. end
  193. function Option14(NPC, Spawn)
  194. FaceTarget(NPC, Spawn)
  195. Dialog.New(NPC, Spawn)
  196. Dialog.AddDialog("There! The Great Lightstone is fully empowered with the essence of Valor, Truth, and Light! I am truly sorry to have deceived you into thinking you could keep this stone. You must understand, it must stay with my Order. He's returning soon and we must preserve his artifacts to hasten his arrival. It has truly pained me to speak untruthfully to you. I hope you understand the importance of this matter.")
  197. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame020.mp3", 2917051615, 1667743786)
  198. Dialog.AddOption("I am not sure what you mean. I did the work for that, it should be mine!", "Option15")
  199. Dialog.Start()
  200. end
  201. function Option15(NPC, Spawn)
  202. FaceTarget(NPC, Spawn)
  203. Dialog.New(NPC, Spawn)
  204. Dialog.AddDialog("You've been exceptionally brave and valorous in this quest. If it weren't for the dire need of my order to possess this stone, I'd gladly hand it over to you. You must understand ... what was that?")
  205. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame022.mp3", 1925599648, 331494401)
  206. Dialog.AddOption("What?","Finish")
  207. Dialog.Start()
  208. end
  209. function Finish(NPC, Spawn)
  210. zone = GetZone(NPC)
  211. LucanicKnightInitiate = SpawnByLocationID(zone, 300580)
  212. aMilitiaGuard1 = SpawnByLocationID(zone, 300576)
  213. aMilitiaGuard2 = SpawnByLocationID(zone, 300577)
  214. PlayFlavor(NPC, "", "We have uninvited guests! Let's make them feel welcome.", "", 1689589577, 4560189, Spawn)
  215. AddTimer(NPC, 7000, "set_faction", 1,Spawn)
  216. end
  217. function set_faction(NPC, Spawn)
  218. SpawnSet(NPC, "faction", 34)
  219. --AddTimer(NPC, 2000, "deathUpdate", 1,Spawn)
  220. end
  221. function deathUpdate(NPC, Spawn)
  222. if GetQuestStep(Spawn, TheReturnOfTheLight) == 13 then
  223. SetStepComplete(Spawn, TheReturnOfTheLight, 13)
  224. end
  225. end
  226. -- QUEST STEP PROGRESS
  227. function step2or3_progress(NPC, Spawn)
  228. FaceTarget(NPC, Spawn)
  229. Dialog.New(NPC, Spawn)
  230. Dialog.AddDialog("I cannot tell you any more than what I've already said. Seek out the Mourned and the Forgotten.")
  231. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame005.mp3", 892711252, 1320674484)
  232. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  233. Dialog.AddOption("I'm still looking for them!")
  234. Dialog.Start()
  235. end
  236. function step5_progress(NPC, Spawn)
  237. FaceTarget(NPC, Spawn)
  238. Dialog.New(NPC, Spawn)
  239. Dialog.AddDialog("You've not faced the great beast Rama'nai. Seek him out.")
  240. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame008.mp3", 523799042, 3054124923)
  241. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  242. Dialog.AddOption("I will find Rama'nai.")
  243. Dialog.Start()
  244. end
  245. function step7or8_progress(NPC, Spawn)
  246. FaceTarget(NPC, Spawn)
  247. Dialog.New(NPC, Spawn)
  248. Dialog.AddDialog("You haven't defeated both orc captains. They still threaten the sacred graves of the Knights of Truth.")
  249. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame010.mp3", 3774502752, 2904161395)
  250. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  251. Dialog.AddOption("I will find Gaer and Ogof.")
  252. Dialog.Start()
  253. end
  254. function step10_progress(NPC, Spawn)
  255. FaceTarget(NPC, Spawn)
  256. Dialog.New(NPC, Spawn)
  257. Dialog.AddDialog("The cursed High Priest still walks the land. To free him you must defeat him in the presence of the lightstone.")
  258. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame014.mp3", 1292831850, 1992570169)
  259. Dialog.AddOption("I will release him from his curse.")
  260. Dialog.Start()
  261. end
  262. function step12_progress(NPC, Spawn)
  263. FaceTarget(NPC, Spawn)
  264. Dialog.New(NPC, Spawn)
  265. Dialog.AddDialog("I hoped when we met again you would bear the sword the orc leader possesses. Please, recover the sword from that creature.")
  266. Dialog.AddVoiceover("voiceover/english/cannix_silverflame/commonlands/cannixsilverflame018.mp3", 623990960, 1621442579)
  267. Dialog.AddOption("I'm working on it.")
  268. Dialog.Start()
  269. end
  270. function respawn(NPC)
  271. end