PublicService.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --[[
  2. Script Name : Quests/Darklight/PublicService.lua
  3. Script Purpose : Handles the quest, "Public Service"
  4. Script Author : Cynnar
  5. Script Date : 8/30/2015
  6. Script Notes :
  7. Zone : Darklight Wood
  8. Quest Giver : Laexyra Y'Barriath
  9. Preceded by : Purposeful Trinkets
  10. Followed by : A Friendly Reminder
  11. --]]
  12. local PublicService = 150
  13. function Init(Quest)
  14. AddQuestStepKill(Quest, 1, "Destroy several purulent defenders", 8, 100, "I need to destroy a number of the undead soldiers north of T'Vatar Post.", 611, 340085)
  15. AddQuestStepKill(Quest, 2, "Destroy several moldering soldiers", 5, 100, "I need to destroy a number of the undead soldiers north of T'Vatar Post.", 611, 340084)
  16. AddQuestStepCompleteAction(Quest, 1, "PurulentDefenders")
  17. AddQuestStepCompleteAction(Quest, 2, "MolderingSoldiers")
  18. end
  19. function PurulentDefenders(Quest, QuestGiver, Player)
  20. UpdateQuestStepDescription(Quest, 1, "I have slain the purulent defenders")
  21. CheckProgress(Quest, QuestGiver, Player)
  22. end
  23. function MolderingSoldiers(Quest, QuestGiver, Player)
  24. UpdateQuestStepDescription(Quest, 2, "I have slain the moldering soldiers")
  25. CheckProgress(Quest, QuestGiver, Player)
  26. end
  27. function CheckProgress(Quest, QuestGiver, Player)
  28. if QuestStepIsComplete(Player, PublicService, 1) and QuestStepIsComplete(Player, PublicService, 2) then
  29. UpdateQuestTaskGroupDescription(Quest, 1, "I have killed the undead soldiers for Laexyra.")
  30. UndeadSoldiersComplete(Quest, QuestGiver, Player)
  31. end
  32. end
  33. function UndeadSoldiersComplete(Quest, QuestGiver, Player)
  34. SetCompleteFlag(Quest)
  35. AddQuestStepChat(Quest, 3, "Speak with Laexyra Y'Barriath", 1, "I should return to Laexyra Y'Barriath now that I have thinned out the undead.", 11, 340075)
  36. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  37. end
  38. function QuestComplete(Quest, QuestGiver, Player)
  39. UpdateQuestDescription(Quest, "I have thinned out the undead population north of T'Vatar Post.")
  40. GiveQuestReward(Quest, Player)
  41. end
  42. function Reload(Quest, QuestGiver, Player, Step)
  43. if QuestStepIsComplete(Player, PublicService, 1) then
  44. PurulentDefenders(Quest, QuestGiver, Player)
  45. end
  46. if QuestStepIsComplete(Player, PublicService, 2) then
  47. MolderingSoldiers(Quest, QuestGiver, Player)
  48. end
  49. if Step == 3 then
  50. QuestComplete(Quest, QuestGiver, Player)
  51. end
  52. end
  53. function Accepted(Quest, QuestGiver, Player)
  54. Say(QuestGiver, "Return to me when you are finished.")
  55. end
  56. function Declined(Quest, QuestGiver, Player)
  57. -- Add dialog here for when the quest is declined
  58. end