BrokenEquipment.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. --[[
  2. Script Name : Quests/Commonlands/BrokenEquipment.lua
  3. Script Purpose : Handles the quest, "Broken Equipment"
  4. Script Author : premierio015
  5. Script Date : 12.05.2021
  6. Script Notes : Auto generated with QuestParser.
  7. Zone : Commonlands
  8. Quest Giver : Tecera Valnos
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepObtainItem(Quest, 1, "I need to collect an essence injector from the houses south of the Ruins of Val'marr", 1, 100, "I need to retrieve an essence injector from the supplies in the houses south of the Ruins of Val'marr.", 2215, 6857)
  14. AddQuestStep(Quest, 2, "I need to repair the northwestern arcanic sentry", 1, 100, "I need to repair each of the six sentries in the Ruins of Val'marr. I will need to collect an undying essence from the undead of the ruins for each sentry I plan on repairing.", 11)
  15. AddQuestStep(Quest, 3, "I need to repair the western arcanic sentry", 1, 100, "I need to repair each of the six sentries in the Ruins of Val'marr. I will need to collect an undying essence from the undead of the ruins for each sentry I plan on repairing.", 11)
  16. AddQuestStep(Quest, 4, "I need to repair the southwestern arcanic sentry", 1, 100, "I need to repair each of the six sentries in the Ruins of Val'marr. I will need to collect an undying essence from the undead of the ruins for each sentry I plan on repairing.", 11)
  17. AddQuestStep(Quest, 5, "I need to repair the northeastern arcanic sentry", 1, 100, "I need to repair each of the six sentries in the Ruins of Val'marr. I will need to collect an undying essence from the undead of the ruins for each sentry I plan on repairing.", 11)
  18. AddQuestStep(Quest, 6, "I need to repair the eastern arcanic sentry", 1, 100, "I need to repair each of the six sentries in the Ruins of Val'marr. I will need to collect an undying essence from the undead of the ruins for each sentry I plan on repairing.", 11)
  19. AddQuestStep(Quest, 7, "I need to repair the southeastern arcanic sentry", 1, 100, "I need to repair each of the six sentries in the Ruins of Val'marr. I will need to collect an undying essence from the undead of the ruins for each sentry I plan on repairing.", 11)
  20. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  21. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  22. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  23. AddQuestStepCompleteAction(Quest, 4 , "Step4Complete")
  24. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  25. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  26. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  27. end
  28. function Accepted(Quest, QuestGiver, Player)
  29. local conversation = CreateConversation()
  30. AddConversationOption(conversation, "All right.")
  31. StartConversation(conversation, QuestGiver, Player, "Good. Return to me once they're all repaired.")
  32. end
  33. function Declined(Quest, QuestGiver, Player)
  34. -- Add dialog here for when the quest is declined
  35. end
  36. function Deleted(Quest, QuestGiver, Player)
  37. -- Remove any quest specific items here when the quest is deleted
  38. end
  39. function Step1Complete(Quest, QuestGiver, Player)
  40. UpdateQuestStepDescription(Quest, 1, "I have collected an essence injector.")
  41. UpdateQuestTaskGroupDescription(Quest, 1, "I have obtained an essence injector.")
  42. CheckProgress(Quest, QuestGiver, Player)
  43. end
  44. function Step2Complete(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 2, "I have repaired the northwestern arcanic sentry.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function Step3Complete(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 3, "I have repaired the western arcanic sentry.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function Step4Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 4, "I have repaired the southwestern arcanic sentry.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function Step5Complete(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 5, "I have repaired the northeastern arcanic sentry.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function Step6Complete(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 6, "I have repaired the eastern arcanic sentry.")
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. function Step7Complete(Quest, QuestGiver, Player)
  65. UpdateQuestStepDescription(Quest, 7, "I have repaired the southeastern arcanic sentry.")
  66. CheckProgress(Quest, QuestGiver, Player)
  67. end
  68. function QuestComplete(Quest, QuestGiver, Player)
  69. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  70. UpdateQuestStepDescription(Quest, 8, "I have spoken with Tecera.")
  71. UpdateQuestTaskGroupDescription(Quest, 3, "I have spoken with Tecera.")
  72. UpdateQuestDescription(Quest, "I have repaired and concealed all of the sentries. Tecera was very thankful.")
  73. GiveQuestReward(Quest, Player)
  74. end
  75. function CheckProgress(Quest, QuestGiver, Player)
  76. if QuestStepIsComplete(Player, 415, 1) and QuestStepIsComplete(Player, 415, 2) and QuestStepIsComplete(Player, 415, 3) and QuestStepIsComplete(Player, 415, 4) and QuestStepIsComplete(Player, 415, 5) and QuestStepIsComplete(Player, 415, 6) and QuestStepIsComplete(Player, 415 , 7) then
  77. UpdateQuestStepDescription(Quest, 7, "I have repaired the southeastern arcanic sentry.")
  78. UpdateQuestTaskGroupDescription(Quest, 2, "I have repaired all the sentries.")
  79. AddQuestStepChat(Quest, 8, "I need to return to Tecera", 1, "Now that all the sentries are working again I need to return to Tecera.", 11, 330199)
  80. AddQuestStepCompleteAction(Quest, 8, "QuestComplete")
  81. end
  82. end
  83. function Reload(Quest, QuestGiver, Player, Step)
  84. if Step == 1 then
  85. Step1Complete(Quest, QuestGiver, Player)
  86. elseif Step == 2 then
  87. Step2Complete(Quest, QuestGiver, Player)
  88. elseif Step == 3 then
  89. Step3Complete(Quest, QuestGiver, Player)
  90. elseif Step == 4 then
  91. Step4Complete(Quest, QuestGiver, Player)
  92. elseif Step == 5 then
  93. Step5Complete(Quest, QuestGiver, Player)
  94. elseif Step == 6 then
  95. Step6Complete(Quest, QuestGiver, Player)
  96. elseif Step == 7 then
  97. Step7Complete(Quest, QuestGiver, Player)
  98. elseif Step == 8 then
  99. QuestComplete(Quest, QuestGiver, Player)
  100. end
  101. end