snapper_shells.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --[[
  2. Script Name : snapper_shells.lua
  3. Script Purpose : Handles the quest, "Snapper Shells"
  4. Script Author : Dorbin
  5. Script Date : 2/23/2022
  6. Script Notes :
  7. Zone : Forest Ruins
  8. Quest Giver : Therven Senshun
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepKill(Quest, 1, "I need six leathershell snapper shells.", 6, 100, "Therven would like shells from the turtles in the Forest Ruins.", 158, 1960012)
  14. AddQuestStepKill(Quest, 2, "I need six stoneshell snapper shells.", 6, 100, "Therven would like shells from the turtles in the Forest Ruins.", 170, 1960009)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  16. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  17. end
  18. function Accepted(Quest, QuestGiver, Player)
  19. -- Add dialog here for when the quest is accepted
  20. end
  21. function Declined(Quest, QuestGiver, Player)
  22. -- Add dialog here for when the quest is declined
  23. end
  24. function Deleted(Quest, QuestGiver, Player)
  25. -- Remove any quest specific items here when the quest is deleted
  26. end
  27. function Step1Complete(Quest, QuestGiver, Player)
  28. UpdateQuestStepDescription(Quest, 1, "I have collected six leathershell snapper shells.")
  29. CheckProgress(Quest, QuestGiver, Player)
  30. end
  31. function Step2Complete(Quest, QuestGiver, Player)
  32. UpdateQuestStepDescription(Quest, 2, "I have collected six stoneshell snapper shells.")
  33. CheckProgress(Quest, QuestGiver, Player)
  34. end
  35. function CheckProgress(Quest, QuestGiver, Player)
  36. if QuestStepIsComplete(Player, 5487, 1) and QuestStepIsComplete(Player, 5487, 2) then
  37. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected the shells Therven wanted.")
  38. AddQuestStepChat(Quest, 3, "I must speak with Therven.", 1, "I need to bring these turtle shells back to Therven.", 158, 1960010)
  39. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  40. end
  41. end
  42. function QuestComplete(Quest, QuestGiver, Player)
  43. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  44. UpdateQuestStepDescription(Quest, 3, "I have spoken with Therven.")
  45. UpdateQuestTaskGroupDescription(Quest, 2, "I have given Therven his shells.")
  46. UpdateQuestDescription(Quest, "I gave Therven the turtle shells he asked for. He was very thankful.")
  47. GiveQuestReward(Quest, Player)
  48. end
  49. function Reload(Quest, QuestGiver, Player, Step)
  50. if Step == 1 then
  51. Step1Complete(Quest, QuestGiver, Player)
  52. elseif Step == 2 then
  53. Step2Complete(Quest, QuestGiver, Player)
  54. elseif Step == 3 then
  55. QuestComplete(Quest, QuestGiver, Player)
  56. end
  57. end