Favors.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.", 11)
  24. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  25. end
  26. function Step2Complete(Quest, QuestGiver, Player)
  27. UpdateQuestStepDescription(Quest, 2, "I have collected some rubble.")
  28. 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)
  29. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  30. 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)
  31. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  32. 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)
  33. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  34. 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)
  35. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  36. end
  37. function CheckProgress(Quest, QuestGiver, Player)
  38. 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
  39. UpdateQuestTaskGroupDescription(Quest, 2, "I have collected what Poko has asked for.")
  40. 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)
  41. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  42. end
  43. end
  44. function Step3Complete(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 3, "I have collected a bark sample from one of the trees south of the river and outside the ruins.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function Step4Complete(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 4, "I have collected a bark sample from one of the trees north of the river and outside the ruins.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function Step5Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 5, "I have collected a bark sample from one of the trees south of the river and inside the ruins.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function Step6Complete(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 6, "I have collected a bark sample from one of the trees north of the river and inside the ruins.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function Step7Complete(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 7, "I have spoken with Poko Zing.")
  62. 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)
  63. AddQuestStepCompleteAction(Quest, 8, "QuestComplete")
  64. end
  65. function QuestComplete(Quest, QuestGiver, Player)
  66. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  67. UpdateQuestStepDescription(Quest, 8, "I have spoken with Lieutenant Germain.")
  68. UpdateQuestTaskGroupDescription(Quest, 3, "I have spoken with Poko Zing.")
  69. 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.")
  70. GiveQuestReward(Quest, Player)
  71. end
  72. function Reload(Quest, QuestGiver, Player, Step)
  73. if Step == 1 then
  74. Step1Complete(Quest, QuestGiver, Player)
  75. elseif Step == 2 then
  76. Step2Complete(Quest, QuestGiver, Player)
  77. elseif Step == 3 then
  78. Step3Complete(Quest, QuestGiver, Player)
  79. elseif Step == 4 then
  80. Step4Complete(Quest, QuestGiver, Player)
  81. elseif Step == 5 then
  82. Step5Complete(Quest, QuestGiver, Player)
  83. elseif Step == 6 then
  84. Step6Complete(Quest, QuestGiver, Player)
  85. elseif Step == 7 then
  86. Step7Complete(Quest, QuestGiver, Player)
  87. elseif Step == 8 then
  88. QuestComplete(Quest, QuestGiver, Player)
  89. end
  90. end
  91. function Accepted(Quest, QuestGiver, Player)
  92. -- Add dialog here for when the quest is accepted
  93. end
  94. function Declined(Quest, QuestGiver, Player)
  95. -- Add dialog here for when the quest is declined
  96. end