Favors.lua 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. --[[
  2. Script Name : Favors.lua
  3. Script Purpose : Handles the quest, "Favors"
  4. Script Author : Shatou
  5. Script Date : 1/10/2020
  6. Script Notes :
  7. Zone : Forest Ruins
  8. Quest Giver : Lieutenant Germain
  9. Preceded by : News for Germain
  10. Followed by : Returning to the Disturbance
  11. --]]
  12. local FAVORS_QUEST_ID = 521
  13. local POKO_ZING_ID = 1960003
  14. local LIEUTENAT_GERMAIN_ID = 1960005
  15. local A_FALLEN_BRANCH_ID = 1960178
  16. function Init(Quest)
  17. AddQuestStepChat(Quest, 1, "I need to speak with Poko Zing and have him analyze the leaf sample I gathered.", 1, "Lieutenant Germain has asked that I speak with Poko Zing to get the leaf analyzed.", 2098, POKO_ZING_ID)
  18. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  19. end
  20. function Step1Complete(Quest, QuestGiver, Player)
  21. UpdateQuestStepDescription(Quest, 1, "I have spoken with Poko Zing.")
  22. UpdateQuestTaskGroupDescription(Quest, 1, "I have spoken with Poko Zing.")
  23. AddQuestStep(Quest, 2, "I need some samples of the rubble from the ruins.", 4, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 11729)
  24. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  25. AddQuestStepHarvest(Quest, 3, "I need to collect a bark sample from one of the trees south of the river and outside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  26. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  27. AddQuestStepHarvest(Quest, 4, "I need to collect a bark sample from one of the trees north of the river and outside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  28. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  29. AddQuestStepHarvest(Quest, 5, "I need to collect a bark sample from one of the trees south of the river and inside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  30. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  31. AddQuestStepHarvest(Quest, 6, "I need to collect a bark sample from one of the trees north of the river and inside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  32. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  33. end
  34. function Step2Complete(Quest, QuestGiver, Player)
  35. UpdateQuestStepDescription(Quest, 2, "I have collected some rubble.")
  36. CheckProgress(Quest, QuestGiver, Player)
  37. --AddQuestStepHarvest(Quest, 3, "I need to collect a bark sample from one of the trees south of the river and outside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  38. --AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  39. --AddQuestStepHarvest(Quest, 4, "I need to collect a bark sample from one of the trees north of the river and outside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  40. --AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  41. --AddQuestStepHarvest(Quest, 5, "I need to collect a bark sample from one of the trees south of the river and inside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  42. --AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  43. --AddQuestStepHarvest(Quest, 6, "I need to collect a bark sample from one of the trees north of the river and inside the ruins.", 1, 100, "Poko has agreed to help, but has asked that I do a favor for him.", 834, A_FALLEN_BRANCH_ID)
  44. --AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  45. end
  46. function CheckProgress(Quest, QuestGiver, Player)
  47. if QuestStepIsComplete(Player, FAVORS_QUEST_ID, 3) and QuestStepIsComplete(Player, FAVORS_QUEST_ID, 4) and QuestStepIsComplete(Player, FAVORS_QUEST_ID, 5) and QuestStepIsComplete(Player, FAVORS_QUEST_ID, 6) then
  48. UpdateQuestTaskGroupDescription(Quest, 2, "I have collected what Poko has asked for.")
  49. AddQuestStepChat(Quest, 7, "I need to return to Poko Zing.", 1, "I need to return to Poko Zing now that I have collected all that he has asked for.", 11, POKO_ZING_ID)
  50. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  51. end
  52. end
  53. function Step3Complete(Quest, QuestGiver, Player)
  54. UpdateQuestStepDescription(Quest, 3, "I have collected a bark sample from one of the trees south of the river and outside the ruins.")
  55. CheckProgress(Quest, QuestGiver, Player)
  56. end
  57. function Step4Complete(Quest, QuestGiver, Player)
  58. UpdateQuestStepDescription(Quest, 4, "I have collected a bark sample from one of the trees north of the river and outside the ruins.")
  59. CheckProgress(Quest, QuestGiver, Player)
  60. end
  61. function Step5Complete(Quest, QuestGiver, Player)
  62. UpdateQuestStepDescription(Quest, 5, "I have collected a bark sample from one of the trees south of the river and inside the ruins.")
  63. CheckProgress(Quest, QuestGiver, Player)
  64. end
  65. function Step6Complete(Quest, QuestGiver, Player)
  66. UpdateQuestStepDescription(Quest, 6, "I have collected a bark sample from one of the trees north of the river and inside the ruins.")
  67. CheckProgress(Quest, QuestGiver, Player)
  68. end
  69. function Step7Complete(Quest, QuestGiver, Player)
  70. UpdateQuestStepDescription(Quest, 7, "I have spoken with Poko Zing.")
  71. AddQuestStepChat(Quest, 8, "I need to speak with Lieutenant Germain again.", 1, "I need to return to Poko Zing now that I have collected all that he has asked for.", 11, LIEUTENAT_GERMAIN_ID)
  72. AddQuestStepCompleteAction(Quest, 8, "QuestComplete")
  73. end
  74. function QuestComplete(Quest, QuestGiver, Player)
  75. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  76. UpdateQuestStepDescription(Quest, 8, "I have spoken with Lieutenant Germain.")
  77. UpdateQuestTaskGroupDescription(Quest, 3, "I have spoken with Poko Zing.")
  78. UpdateQuestDescription(Quest, "I collected the rubble and bark samples as Poko asked. His findings regarding the leaf suggest that it has been magically altered to hide something.")
  79. GiveQuestReward(Quest, Player)
  80. end
  81. function Reload(Quest, QuestGiver, Player, Step)
  82. if Step == 1 then
  83. Step1Complete(Quest, QuestGiver, Player)
  84. elseif Step == 2 then
  85. Step2Complete(Quest, QuestGiver, Player)
  86. elseif Step == 3 then
  87. Step3Complete(Quest, QuestGiver, Player)
  88. elseif Step == 4 then
  89. Step4Complete(Quest, QuestGiver, Player)
  90. elseif Step == 5 then
  91. Step5Complete(Quest, QuestGiver, Player)
  92. elseif Step == 6 then
  93. Step6Complete(Quest, QuestGiver, Player)
  94. elseif Step == 7 then
  95. Step7Complete(Quest, QuestGiver, Player)
  96. elseif Step == 8 then
  97. QuestComplete(Quest, QuestGiver, Player)
  98. end
  99. end
  100. function Accepted(Quest, QuestGiver, Player)
  101. -- Add dialog here for when the quest is accepted
  102. end
  103. function Declined(Quest, QuestGiver, Player)
  104. -- Add dialog here for when the quest is declined
  105. end