9
3

CannixSilverflame.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/CannixSilverflame.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.27 10:02:00
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheReturnOfTheLight = 485
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 20, "InRange")
  11. SetAggroRadius(NPC, 20)
  12. end
  13. function InRange(NPC, Spawn)
  14. if HasCompletedQuest(Spawn, TheReturnOfTheLight) then
  15. RemoveSpawnAccess(NPC, Spawn)
  16. end
  17. end
  18. function hailed(NPC, Spawn)
  19. if not HasQuest(Spawn, TheReturnOfTheLight) then
  20. FaceTarget(NPC, Spawn)
  21. local conversation = CreateConversation()
  22. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame001.mp3", "", "", 3283011934, 1161547540, Spawn)
  23. AddConversationOption(conversation, "Are you a guard or something?", "Option1")
  24. AddConversationOption(conversation, "You're excused. ")
  25. StartConversation(conversation, NPC, Spawn, "Greetings to you as well, traveler. Now if you'll excuse me, I must remain vigilant while this time is appointed unto me.")
  26. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 2 or GetQuestStep(Spawn, TheReturnOfTheLight) == 3 then
  27. step2or3_progress(NPC, Spawn)
  28. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 4 then
  29. Option4(NPC, Spawn)
  30. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 5 then
  31. step5_progress(NPC, Spawn)
  32. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 6 then
  33. Option6(NPC, Spawn)
  34. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 7 or GetQuestStep(Spawn, TheReturnOfTheLight) == 8 then
  35. step7or8_progress(NPC, Spawn)
  36. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 9 then
  37. Option7(NPC, Spawn)
  38. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 10 then
  39. step10_progress(NPC, Spawn)
  40. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 11 then
  41. Option10(NPC, Spawn)
  42. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 12 then
  43. step12_progress(NPC, Spawn)
  44. elseif GetQuestStep(Spawn, TheReturnOfTheLight) == 13 then
  45. Option13(NPC, Spawn)
  46. end
  47. end
  48. function Option1(NPC, Spawn)
  49. FaceTarget(NPC, Spawn)
  50. local conversation = CreateConversation()
  51. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame002.mp3", "", "", 1936975525, 2350985185, Spawn )
  52. AddConversationOption(conversation, "I see. I'll leave you to your thoughts. ")
  53. if GetQuestStep(Spawn, TheReturnOfTheLight) == 1 then
  54. AddConversationOption(conversation, "Maybe a pilgrim would be interested in buying this unique lightstone.", "Option2")
  55. end
  56. StartConversation(conversation, NPC, Spawn, "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?")
  57. end
  58. function Option2(NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. local conversation = CreateConversation()
  61. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame003.mp3", "", "", 514719331, 2019687176, Spawn)
  62. AddConversationOption(conversation, "Yes, I could use a little adventure.", "Option3")
  63. StartConversation(conversation, NPC, Spawn, "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?")
  64. end
  65. function Option3(NPC, Spawn)
  66. SetStepComplete(Spawn, TheReturnOfTheLight, 1)
  67. FaceTarget(NPC, Spawn)
  68. local conversation = CreateConversation()
  69. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame004.mp3", "", "", 997093089, 3927227010, Spawn)
  70. AddConversationOption(conversation, "I will return when it is done. ")
  71. StartConversation(conversation, NPC, Spawn, "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.")
  72. end
  73. function Option4(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. local conversation = CreateConversation()
  76. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame006.mp3", "", "", 2082775910, 3850348152, Spawn)
  77. AddConversationOption(conversation, "Tell me how to increase its power.", "Option5")
  78. StartConversation(conversation, NPC, Spawn, "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. ")
  79. end
  80. function Option5(NPC, Spawn)
  81. SetStepComplete(Spawn, TheReturnOfTheLight, 4)
  82. FaceTarget(NPC, Spawn)
  83. local conversation = CreateConversation()
  84. AddConversationOption(conversation, "I will hunt Rama'nai.")
  85. StartConversation(conversation, NPC, Spawn, "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.")
  86. end
  87. function Option6(NPC, Spawn)
  88. SetStepComplete(Spawn, TheReturnOfTheLight, 6)
  89. FaceTarget(NPC, Spawn)
  90. local conversation = CreateConversation()
  91. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame009.mp3", "", "", 933092014, 3991745317, Spawn)
  92. AddConversationOption(conversation, "I will find Gaer and Ogof.")
  93. StartConversation(conversation, NPC, Spawn, "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.")
  94. end
  95. function Option7(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. local conversation = CreateConversation()
  98. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame011.mp3", "", "", 4172338348, 1148941338, Spawn)
  99. AddConversationOption(conversation, "Who is this soul?", "Option8")
  100. StartConversation(conversation, NPC, Spawn, "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?")
  101. end
  102. function Option8(NPC, Spawn)
  103. FaceTarget(NPC, Spawn)
  104. local conversation = CreateConversation()
  105. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame012.mp3", "", "", 1530561048, 1179568761, Spawn)
  106. AddConversationOption(conversation, "I suppose I am the one to fix all this?", "Option9")
  107. StartConversation(conversation, NPC, Spawn, "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.")
  108. end
  109. function Option9(NPC, Spawn)
  110. SetStepComplete(Spawn, TheReturnOfTheLight, 9)
  111. FaceTarget(NPC, Spawn)
  112. local conversation = CreateConversation()
  113. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame013.mp3", "", "", 984364583, 3971878128, Spawn)
  114. AddConversationOption(conversation, "I will release him from his pain.")
  115. StartConversation(conversation, NPC, Spawn, "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. ")
  116. end
  117. function Option10(NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. local conversation = CreateConversation()
  120. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame015.mp3", "", "", 862085114, 603082398, Spawn)
  121. AddConversationOption(conversation, "What is it?", "Option11")
  122. StartConversation(conversation, NPC, Spawn, "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.")
  123. end
  124. function Option11(NPC, Spawn)
  125. FaceTarget(NPC, Spawn)
  126. local conversation = CreateConversation()
  127. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame016.mp3", "", "", 2784277299, 2349442251, Spawn)
  128. AddConversationOption(conversation, "Where can I find this orc?", "Option12")
  129. StartConversation(conversation, NPC, Spawn, "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.")
  130. end
  131. function Option12(NPC, Spawn)
  132. SetStepComplete(Spawn, TheReturnOfTheLight, 11)
  133. FaceTarget(NPC, Spawn)
  134. local conversation = CreateConversation()
  135. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame017.mp3", "", "", 3813681064, 1372487877, Spawn)
  136. AddConversationOption(conversation, "I'll get the sword back.")
  137. StartConversation(conversation, NPC, Spawn, "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.")
  138. end
  139. function Option13(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. local conversation = CreateConversation()
  142. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame019.mp3", "", "", 3694906098, 1804290878, Spawn)
  143. AddConversationOption(conversation, "Here they are.", "Option14")
  144. StartConversation(conversation, NPC, Spawn, "You did it! Now hand me the broken sword and your lightstone, and I will completely empower the stone.")
  145. end
  146. function Option14(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. local conversation = CreateConversation()
  149. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame020.mp3", "", "", 2917051615, 1667743786, Spawn)
  150. AddConversationOption(conversation, "I am not sure what you mean. I did the work for that, it should be mine!", "Option15")
  151. StartConversation(conversation, NPC, Spawn, "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.")
  152. end
  153. function Option15(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. local conversation = CreateConversation()
  156. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame022.mp3", "", "", 1925599648, 331494401, Spawn)
  157. AddConversationOption(conversation, "What?", "Finish")
  158. StartConversation(conversation, NPC, Spawn, "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?")
  159. end
  160. function Finish(NPC, Spawn)
  161. zone = GetZone(NPC)
  162. LucanicKnightInitiate = SpawnByLocationID(zone, 300580)
  163. aMilitiaGuard1 = SpawnByLocationID(zone, 300576)
  164. aMilitiaGuard2 = SpawnByLocationID(zone, 300577)
  165. PlayFlavor(NPC, "", "We have uninvited guests! Let's make them feel welcome.", "", 1689589577, 4560189, Spawn)
  166. AddTimer(NPC, 7000, "set_faction", 1)
  167. end
  168. function set_faction(NPC, Spawn)
  169. SpawnSet(NPC, "faction", 34)
  170. end
  171. function death(NPC, Spawn)
  172. if GetQuestStep(Spawn, TheReturnOfTheLight) == 13 then
  173. SetStepComplete(Spawn, TheReturnOfTheLight, 13)
  174. end
  175. end
  176. -- QUEST STEP PROGRESS
  177. function step2or3progress(NPC, Spawn)
  178. FaceTarget(NPC, Spawn)
  179. local conversation = CreateConversation()
  180. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame005.mp3", "", "", 892711252, 1320674484, Spawn)
  181. AddConversationOption(conversation, "I'm still looking for them!")
  182. StartConversation(conversation, NPC, Spawn, "I cannot tell you any more than what I've already said. Seek out the Mourned and the Forgotten.")
  183. end
  184. function step5_progress(NPC, Spawn)
  185. FaceTarget(NPC, Spawn)
  186. local conversation = CreateConversation()
  187. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame008.mp3", "", "", 523799042, 3054124923, Spawn)
  188. AddConversationOption(conversation, "I will find Rama'nai.")
  189. StartConversation(conversation, NPC, Spawn, "You've not faced the great beast Rama'nai. Seek him out.")
  190. end
  191. function step7or8_progress(NPC, Spawn)
  192. FaceTarget(NPC, Spawn)
  193. local conversation = CreateConversation()
  194. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame010.mp3", "", "", 3774502752, 2904161395, Spawn)
  195. AddConversationOption(conversation, "I will find Gaer and Ogof.")
  196. StartConversation(conversation, NPC, Spawn, "You haven't defeated both orc captains. They still threaten the sacred graves of the Knights of Truth.")
  197. end
  198. function step10_progress(NPC, Spawn)
  199. FaceTarget(NPC, Spawn)
  200. local conversation = CreateConversation()
  201. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame014.mp3", "", "", 1292831850, 1992570169, Spawn)
  202. AddConversationOption(conversation, "I will release him from his curse.")
  203. StartConversation(conversation, NPC, Spawn, "The cursed High Priest still walks the land. To free him you must defeat him in the presence of the lightstone.")
  204. end
  205. function step12_progress(NPC, Spawn)
  206. FaceTarget(NPC, Spawn)
  207. local conversation = CreateConversation()
  208. PlayFlavor(NPC, "voiceover/english/cannix_silverflame/commonlands/cannixsilverflame018.mp3", "", "", 623990960, 1621442579, Spawn)
  209. AddConversationOption(conversation, "I'm working on it.")
  210. StartConversation(conversation, NPC, Spawn, "I hoped when we met again you would bear the sword the orc leader possesses. Please, recover the sword from that creature.")
  211. end
  212. function respawn(NPC)
  213. end