the_stolen_artifacts_of_thex.lua 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. --[[
  2. Script Name : the_stolen_artifacts_of_thex.lua
  3. Script Purpose : Handles the quest, "The Stolen Artifacts of Thex"
  4. Script Author : torsten
  5. Script Date : 20.07.2022
  6. Script Notes :
  7. Zone : Longshadow Alley
  8. Quest Giver : Kylanith D`Lar
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. local TheStolenArtifactsofThex = 5683
  13. function Init(Quest)
  14. AddQuestStep(Quest, 1, "Inspect the Thex monument", 1, 100, "I must go to Big Bend and find all five of the Thex artifacts relocated there.", 11)
  15. AddQuestStep(Quest, 2, "Inspect the Thex monument", 1, 100, "I must go to Big Bend and find all five of the Thex artifacts relocated there.", 11)
  16. AddQuestStep(Quest, 3, "Inspect the Thex monument", 1, 100, "I must go to Big Bend and find all five of the Thex artifacts relocated there.", 11)
  17. AddQuestStep(Quest, 4, "Inspect the Thex monument", 1, 100, "I must go to Big Bend and find all five of the Thex artifacts relocated there.", 11)
  18. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  19. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  20. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  21. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  22. end
  23. function Step1Complete(Quest, QuestGiver, Player)
  24. UpdateQuestStepDescription(Quest, 1, "Inspected the Thex monument.")
  25. CheckProgress(Quest, QuestGiver, Player)
  26. end
  27. function Step2Complete(Quest, QuestGiver, Player)
  28. UpdateQuestStepDescription(Quest, 2, "Inspected the Thex monument.")
  29. CheckProgress(Quest, QuestGiver, Player)
  30. end
  31. function Step3Complete(Quest, QuestGiver, Player)
  32. UpdateQuestStepDescription(Quest, 3, "Inspected the Thex monument.")
  33. CheckProgress(Quest, QuestGiver, Player)
  34. end
  35. function Step4Complete(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 4, "Inspected the Thex monument.")
  37. CheckProgress(Quest, QuestGiver, Player)
  38. end
  39. function CheckProgress(Quest, QuestGiver, Player)
  40. if QuestStepIsComplete(Player, TheStolenArtifactsofThex, 1) and QuestStepIsComplete(Player, TheStolenArtifactsofThex, 2) and QuestStepIsComplete(Player, TheStolenArtifactsofThex, 3) and QuestStepIsComplete(Player, TheStolenArtifactsofThex, 4) then
  41. UpdateQuestTaskGroupDescription(Quest, 1, "I went to Big Bend and could only find four Thex artifacts.")
  42. AddQuestStepChat(Quest, 5, "Speak to Kylanith D'Lar", 1, "I must report back to Kylanith D'Lar in Longshadow Alley.", 11, 1380032)
  43. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  44. end
  45. end
  46. function Step5Complete(Quest, QuestGiver, Player)
  47. UpdateQuestStepDescription(Quest, 5, "Spoke to Kylanith D'Lar.")
  48. UpdateQuestTaskGroupDescription(Quest, 2, "I reported back to Kylanith D'Lar in Longshadow Alley.")
  49. AddQuestStep(Quest, 6, "Inspect the Thex monument", 1, 100, "I must go to the Freeport Graveyard to find the fifth Thex artifact. I can reach the Graveyard by using any of the bells in and around the City of Freeport.", 11)
  50. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  51. end
  52. function Step6Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 6, "Inspected the Thex monument.")
  54. UpdateQuestTaskGroupDescription(Quest, 3, "I went to the Freeport graveyard to find the fifth Thex artifact.")
  55. AddQuestStepChat(Quest, 7, "Speak to Kylanith D'Lar", 1, "I must report back to Kylanith D'Lar in Longshadow Alley.", 11, 1380032)
  56. AddQuestStepCompleteAction(Quest, 7, "QuestComplete")
  57. end
  58. function QuestComplete(Quest, QuestGiver, Player)
  59. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  60. UpdateQuestStepDescription(Quest, 7, "Spoke to Kylanith D'Lar.")
  61. UpdateQuestTaskGroupDescription(Quest, 4, "I reported back to Kylanith D'Lar in Longshadow Alley.")
  62. UpdateQuestDescription(Quest, "I discovered all five relocated Thex artifacts in Freeport. Kylanith D'Lar in Longshadow Alley was pleased with my report.")
  63. GiveQuestReward(Quest, Player)
  64. end
  65. function Accepted(Quest, QuestGiver, Player)
  66. -- Add dialog here for when the quest is accepted
  67. end
  68. function Declined(Quest, QuestGiver, Player)
  69. -- Add dialog here for when the quest is declined
  70. end
  71. function Deleted(Quest, QuestGiver, Player)
  72. -- Remove any quest specific items here when the quest is deleted
  73. end
  74. function Reload(Quest, QuestGiver, Player, Step)
  75. if Step == 1 then
  76. Step1Complete(Quest, QuestGiver, Player)
  77. elseif Step == 2 then
  78. Step2Complete(Quest, QuestGiver, Player)
  79. elseif Step == 3 then
  80. Step3Complete(Quest, QuestGiver, Player)
  81. elseif Step == 4 then
  82. Step4Complete(Quest, QuestGiver, Player)
  83. elseif Step == 5 then
  84. Step5Complete(Quest, QuestGiver, Player)
  85. elseif Step == 6 then
  86. Step6Complete(Quest, QuestGiver, Player)
  87. elseif Step == 7 then
  88. QuestComplete(Quest, QuestGiver, Player)
  89. end
  90. end