the_return_of_the_light.lua 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. --[[
  2. Script Name : Quests/Commonlands/the_return_of_the_light.lua
  3. Script Purpose : Handles the quest, "The Return of the Light"
  4. Script Author : premierio015//Dorbin
  5. Script Date : 30.05.2021
  6. Script Notes : Auto generated with QuestParser.
  7. Zone : Heritage
  8. Quest Giver : Burned Out Lightstone(item)
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. SetQuestRewardStatus(Quest, 23733)
  14. AddQuestStepChat(Quest, 1, "I should find someone interested in this burned out lightstone.", 1, "I need to find someone who I can sell this burned out lightstone to. Someone must be interested in a unique item like this.", 11, 330175)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  16. end
  17. function Accepted(Quest, QuestGiver, Player)
  18. if HasItem(Player,4737,1) then
  19. RemoveItem(Player,4737)
  20. SendMessage(Player,"You place the burned out light stone in your quest satchle.")
  21. end
  22. end
  23. function Declined(Quest, QuestGiver, Player)
  24. -- Add dialog here for when the quest is declined
  25. end
  26. function Deleted(Quest, QuestGiver, Player)
  27. -- Remove any quest specific items here when the quest is deleted
  28. end
  29. function Step1Complete(Quest, QuestGiver, Player)
  30. UpdateQuestStepDescription(Quest, 1, "I showed the lightstone to Cannix Silverflame.")
  31. UpdateQuestTaskGroupDescription(Quest, 1, "A strange man named Cannix Silverflame seems very interested in the lightstone. I'll follow what he says for now to learn more.")
  32. AddQuestStep(Quest, 2, "I need to touch ''the Mourned'' with this lightstone.", 1, 100, "I need to find whatever ''the Mourned'' and ''the Forgotten'' is and touch this lightstone to them.", 1176)
  33. AddQuestStep(Quest, 3, "I need to touch ''the Forgotten'' with this lightstone.", 1, 100, "I need to find whatever ''the Mourned'' and ''the Forgotten'' is and touch this lightstone to them.", 1176)
  34. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  35. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  36. end
  37. function Step2Complete(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 2, "I touched \"the Mourned\" with the lightstone.")
  39. CheckProgress(Quest, QuestGiver, Player)
  40. end
  41. function Step3Complete(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 3, "I touched ''the Forgotten'' with the lightstone.")
  43. CheckProgress(Quest, QuestGiver, Player)
  44. end
  45. function Step4Complete(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 4, "I returned to Cannix Silverflame.")
  47. UpdateQuestTaskGroupDescription(Quest, 3, "I returned to Cannix Silverflame.")
  48. AddQuestStepKill(Quest, 5, "I need to slay the lion Rama'nai.", 1, 100, "I need to find and kill the great beast Rama'nai in honorable combat. He can be found in the Commonlands.", 611, 330088)
  49. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  50. end
  51. function Step5Complete(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 5, "I slew Rama'nai.")
  53. UpdateQuestTaskGroupDescription(Quest, 4, "I defeated the lion Rama'nai in combat and dipped the lightstone in his blood. The stone is glowing brighter now.")
  54. AddQuestStepChat(Quest, 6, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  55. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  56. end
  57. function Step6Complete(Quest, QuestGiver, Player)
  58. UpdateQuestStepDescription(Quest, 6, "I returned to Cannix Silverflame.")
  59. UpdateQuestTaskGroupDescription(Quest, 5, "I returned to Cannix Silverflame.")
  60. AddQuestStepKill(Quest, 7, "I need to slay Captain Ogof.", 1, 100, "I need to find and defeat the orc captains that are defiling and stealing from the ancient graves of the Knights of Truth.", 611, 330266)
  61. AddQuestStepKill(Quest, 8, "I need to slay Captain Gaer.", 1, 100, "I need to find and defeat the orc captains that are defiling and stealing from the ancient graves of the Knights of Truth.", 611, 330264)
  62. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  63. AddQuestStepCompleteAction(Quest, 8, "Step8Complete")
  64. end
  65. function Step7Complete(Quest, QuestGiver, Player)
  66. UpdateQuestStepDescription(Quest, 7, "I defeated Captain Ogof.")
  67. CheckProgress(Quest, QuestGiver, Player)
  68. end
  69. function Step8Complete(Quest, QuestGiver, Player)
  70. UpdateQuestStepDescription(Quest, 8, "I defeated Captain Gaer.")
  71. CheckProgress(Quest, QuestGiver, Player)
  72. end
  73. function Step9Complete(Quest, QuestGiver, Player)
  74. UpdateQuestStepDescription(Quest, 9, "I returned to Cannix Silverflame.")
  75. UpdateQuestTaskGroupDescription(Quest, 7, "I returned to Cannix Silverflame.")
  76. AddQuestStepKill(Quest, 10, "I need to defeat the High Priest of Val'marr.", 1, 100, "I need to release the High Priest of Val'marr from his cursed state and allow him to rest in peace.", 611, 330076)
  77. AddQuestStepCompleteAction(Quest, 10, "Step10Complete")
  78. end
  79. function Step10Complete(Quest, QuestGiver, Player)
  80. UpdateQuestStepDescription(Quest, 10, "I defeated the High Priest of Val'marr.")
  81. UpdateQuestTaskGroupDescription(Quest, 8, "I defeated the High Priest of Val'marr. The lightstone's light increased as the High Priest was finally laid to rest.")
  82. AddQuestStepChat(Quest, 11, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  83. AddQuestStepCompleteAction(Quest, 11, "Step11Complete")
  84. end
  85. function Step11Complete(Quest, QuestGiver, Player)
  86. UpdateQuestStepDescription(Quest, 11, "I returned to Cannix Silverflame.")
  87. UpdateQuestTaskGroupDescription(Quest, 9, "I returned to Cannix Silverflame.")
  88. AddQuestStepKill(Quest, 12, "I need to recover a broken Sword of Truth from General Drull.", 1, 100, "I need to recover a broken Sword of Truth from the orc General Drull. Cannix says he can be found in the Bloodskulls' camp.", 45, 3060020)
  89. AddQuestStepCompleteAction(Quest, 12, "Step12Complete")
  90. end
  91. function Step12Complete(Quest, QuestGiver, Player)
  92. UpdateQuestStepDescription(Quest, 12, "I recovered the broken Sword of Truth from General Drull.")
  93. UpdateQuestTaskGroupDescription(Quest, 10, "I recovered the sword from General Drull. I found him in Bloodskull Valley with the other leaders of the Bloodskull clan.")
  94. AddQuestStepKill(Quest, 13, "I should return to Cannix Silverflame.", 1, 100, "I should return to Cannix Silverflame.", 11,330404)
  95. AddQuestStepCompleteAction(Quest, 13, "QuestComplete")
  96. end
  97. function QuestComplete(Quest, QuestGiver, Player)
  98. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  99. UpdateQuestStepDescription(Quest, 13, "I got my Greater Lightstone back.")
  100. UpdateQuestTaskGroupDescription(Quest, 11, "I got my Greater Lightstone back.")
  101. if HasItem(Player, 155134,1) then
  102. RemoveItem(Player, 155134)
  103. end
  104. UpdateQuestDescription(Quest, "It looks like I now have in my possession a legendary Greater Lightstone. By following the directions of Cannix Silverflame, I was able to increase the power of the lightstone gradually. Cannix says this object has some importance among his people, too bad he isn't around anymore so I can ask him about it...")
  105. GiveQuestReward(Quest, Player)
  106. end
  107. function CheckProgress(Quest, QuestGiver, Player)
  108. if QuestStepIsComplete(Player, 485, 2) and QuestStepIsComplete(Player, 485, 3) and not QuestStepIsComplete(Player,485,4) then
  109. UpdateQuestTaskGroupDescription(Quest, 2, "I touched the lightstone to both of the Cavalier statues ''the Mourned'' and ''the Forgotten''. My lightstone seems to be glowing brighter now.")
  110. AddQuestStepChat(Quest, 4, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  111. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  112. elseif QuestStepIsComplete(Player, 485, 7) and QuestStepIsComplete(Player, 485, 8) then
  113. UpdateQuestTaskGroupDescription(Quest, 6, "I killed the orc captains Ogof and Gaer. The lightstone has grown even brighter with this accomplishment.")
  114. AddQuestStepChat(Quest, 9, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  115. AddQuestStepCompleteAction(Quest, 9, "Step9Complete")
  116. end
  117. end
  118. function Reload(Quest, QuestGiver, Player, Step)
  119. if Step == 1 then
  120. Step1Complete(Quest, QuestGiver, Player)
  121. elseif Step == 2 then
  122. Step2Complete(Quest, QuestGiver, Player)
  123. elseif Step == 3 then
  124. Step3Complete(Quest, QuestGiver, Player)
  125. elseif Step == 4 then
  126. Step4Complete(Quest, QuestGiver, Player)
  127. elseif Step == 5 then
  128. Step5Complete(Quest, QuestGiver, Player)
  129. elseif Step == 6 then
  130. Step6Complete(Quest, QuestGiver, Player)
  131. elseif Step == 7 then
  132. Step7Complete(Quest, QuestGiver, Player)
  133. elseif Step == 8 then
  134. Step8Complete(Quest, QuestGiver, Player)
  135. elseif Step == 9 then
  136. Step9Complete(Quest, QuestGiver, Player)
  137. elseif Step == 10 then
  138. Step10Complete(Quest, QuestGiver, Player)
  139. elseif Step == 11 then
  140. Step11Complete(Quest, QuestGiver, Player)
  141. elseif Step == 12 then
  142. Step12Complete(Quest, QuestGiver, Player)
  143. elseif Step == 13 then
  144. QuestComplete(Quest, QuestGiver, Player)
  145. end
  146. end