the_return_of_the_light.lua 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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
  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. -- Add dialog here for when the quest is accepted
  19. end
  20. function Declined(Quest, QuestGiver, Player)
  21. -- Add dialog here for when the quest is declined
  22. end
  23. function Deleted(Quest, QuestGiver, Player)
  24. -- Remove any quest specific items here when the quest is deleted
  25. end
  26. function Step1Complete(Quest, QuestGiver, Player)
  27. UpdateQuestStepDescription(Quest, 1, "I showed the lightstone to Cannix Silverflame.")
  28. 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.")
  29. 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)
  30. 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)
  31. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  32. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  33. end
  34. function Step2Complete(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I touched "the Mourned" with the lightstone.")
  36. CheckProgress(Quest, QuestGiver, Player)
  37. end
  38. function Step3Complete(Quest, QuestGiver, Player)
  39. UpdateQuestStepDescription(Quest, 3, "I touched ''the Forgotten'' with the lightstone.")
  40. CheckProgress(Quest, QuestGiver, Player)
  41. end
  42. function Step4Complete(Quest, QuestGiver, Player)
  43. UpdateQuestStepDescription(Quest, 4, "I returned to Cannix Silverflame.")
  44. UpdateQuestTaskGroupDescription(Quest, 3, "I returned to Cannix Silverflame.")
  45. GiveQuestItem(Quest, Player, "I returned to Cannix Silverflame.", 151067)
  46. 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)
  47. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  48. end
  49. function Step5Complete(Quest, QuestGiver, Player)
  50. UpdateQuestStepDescription(Quest, 5, "I slew Rama'nai.")
  51. UpdateQuestTaskGroupDescription(Quest, 4, "I defeated the lion Rama'nai in combat and dipped the lightstone in his blood. The stone is glowing brighter now.")
  52. if HasItem(Player, 151067) then
  53. RemoveItem(Player, 151067)
  54. end
  55. GiveQuestItem(Quest, Player, "I returned to Cannix Silverflame.", 144492)
  56. AddQuestStepChat(Quest, 6, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  57. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  58. end
  59. function Step6Complete(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 6, "I returned to Cannix Silverflame.")
  61. UpdateQuestTaskGroupDescription(Quest, 5, "I returned to Cannix Silverflame.")
  62. 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)
  63. 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)
  64. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  65. AddQuestStepCompleteAction(Quest, 8, "Step8Complete")
  66. end
  67. function Step7Complete(Quest, QuestGiver, Player)
  68. UpdateQuestStepDescription(Quest, 7, "I defeated Captain Ogof.")
  69. CheckProgress(Quest, QuestGiver, Player)
  70. end
  71. function Step8Complete(Quest, QuestGiver, Player)
  72. UpdateQuestStepDescription(Quest, 8, "I defeated Captain Gaer.")
  73. CheckProgress(Quest, QuestGiver, Player)
  74. end
  75. function Step9Complete(Quest, QuestGiver, Player)
  76. UpdateQuestStepDescription(Quest, 9, "I returned to Cannix Silverflame.")
  77. UpdateQuestTaskGroupDescription(Quest, 7, "I returned to Cannix Silverflame.")
  78. if HasItem(Player, 144492) then
  79. RemoveItem(Player, 144492)
  80. end
  81. GiveQuestItem(Quest, Player, "I returned to Cannix Silverflame.", 180730)
  82. 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)
  83. AddQuestStepCompleteAction(Quest, 10, "Step10Complete")
  84. end
  85. function Step10Complete(Quest, QuestGiver, Player)
  86. UpdateQuestStepDescription(Quest, 10, "I defeated the High Priest of Val'marr.")
  87. 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.")
  88. AddQuestStepChat(Quest, 11, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  89. AddQuestStepCompleteAction(Quest, 11, "Step11Complete")
  90. end
  91. function Step11Complete(Quest, QuestGiver, Player)
  92. UpdateQuestStepDescription(Quest, 11, "I returned to Cannix Silverflame.")
  93. UpdateQuestTaskGroupDescription(Quest, 9, "I returned to Cannix Silverflame.")
  94. if HasItem(Player, 180730) then
  95. RemoveItem(Player, 180730)
  96. end
  97. GiveQuestItem(Quest, Player, "I returned to Cannix Silverflame.", 155134)
  98. 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)
  99. AddQuestStepCompleteAction(Quest, 12, "Step12Complete")
  100. end
  101. function Step12Complete(Quest, QuestGiver, Player)
  102. UpdateQuestStepDescription(Quest, 12, "I recovered the broken Sword of Truth from General Drull.")
  103. UpdateQuestTaskGroupDescription(Quest, 10, "I recovered the sword from General Drull. I found him in Bloodskull Valley with the other leaders of the Bloodskull clan.")
  104. AddQuestStep(Quest, 13, "I should return to Cannix Silverflame.", 1, 100, "I should return to Cannix Silverflame.", 11)
  105. AddQuestStepCompleteAction(Quest, 13, "QuestComplete")
  106. end
  107. function QuestComplete(Quest, QuestGiver, Player)
  108. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  109. UpdateQuestStepDescription(Quest, 13, "I got my Greater Lightstone back.")
  110. UpdateQuestTaskGroupDescription(Quest, 11, "I got my Greater Lightstone back.")
  111. 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...")
  112. GiveQuestReward(Quest, Player)
  113. end
  114. function CheckProgress(Quest, QuestGiver, Player)
  115. if QuestStepIsComplete(Player, 485, 2) and QuestStepIsComplete(Player, 485, 3) then
  116. 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.")
  117. AddQuestStepChat(Quest, 4, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  118. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  119. elseif QuestStepIsComplete(Player, 485, 7) and QuestStepIsComplete(Player, 485, 8) then
  120. UpdateQuestTaskGroupDescription(Quest, 6, "I killed the orc captains Ogof and Gaer. The lightstone has grown even brighter with this accomplishment.")
  121. AddQuestStepChat(Quest, 9, "I should return to Cannix Silverflame.", 1, "I should return to Cannix Silverflame.", 11, 330175)
  122. AddQuestStepCompleteAction(Quest, 9, "Step9Complete")
  123. end
  124. end
  125. function Reload(Quest, QuestGiver, Player, Step)
  126. if Step == 1 then
  127. Step1Complete(Quest, QuestGiver, Player)
  128. elseif Step == 2 then
  129. Step2Complete(Quest, QuestGiver, Player)
  130. elseif Step == 3 then
  131. Step3Complete(Quest, QuestGiver, Player)
  132. elseif Step == 4 then
  133. Step4Complete(Quest, QuestGiver, Player)
  134. elseif Step == 5 then
  135. Step5Complete(Quest, QuestGiver, Player)
  136. elseif Step == 6 then
  137. Step6Complete(Quest, QuestGiver, Player)
  138. elseif Step == 7 then
  139. Step7Complete(Quest, QuestGiver, Player)
  140. elseif Step == 8 then
  141. Step8Complete(Quest, QuestGiver, Player)
  142. elseif Step == 9 then
  143. Step9Complete(Quest, QuestGiver, Player)
  144. elseif Step == 10 then
  145. Step10Complete(Quest, QuestGiver, Player)
  146. elseif Step == 11 then
  147. Step11Complete(Quest, QuestGiver, Player)
  148. elseif Step == 12 then
  149. Step12Complete(Quest, QuestGiver, Player)
  150. elseif Step == 13 then
  151. QuestComplete(Quest, QuestGiver, Player)
  152. end
  153. end