TheUnfortunateEarth.lua 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. --[[
  2. Script Name : TheUnfortunateEarth.lua
  3. Script Purpose : Handles the quest, "The Unfortunate Earth"
  4. Script Author : Shatou
  5. Script Date : 1/9/2020
  6. Script Notes : **NEED LOGS FOR BOTANIST LITH***
  7. Zone : Peat Bog
  8. Quest Giver : Botanist Lith
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. local UNFORTUNATE_EARTH_QUEST_ID = 518
  13. local BOG_MUD_ID = 1980110
  14. local BOG_SLUG_ID = 1980018
  15. local BOG_SLUDGE_ID = 1980002
  16. local BOTANIST_LITH_ID = 1980001
  17. local LIEUTENANT_DAWSON_ID = 1980012
  18. function Init(Quest)
  19. AddQuestStepHarvest(Quest, 1, "I need to collect some mud samples from the Peat Bog.", 4, 100, "I need to collect the stomach contents of some of the creatures within the Peat Bog along with some mud samples.", 415, BOG_MUD_ID)
  20. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  21. AddQuestStepKill(Quest, 2, "I need to collect the stomach contents of bog slugs.", 4, 75, "I need to collect the stomach contents of some of the creatures within the Peat Bog along with some mud samples.", 162, BOG_SLUG_ID)
  22. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  23. AddQuestStepKill(Quest, 3, "I need to collect the stomach contents of bog sludges.", 4, 75, "I need to collect the stomach contents of some of the creatures within the Peat Bog along with some mud samples.", 170, BOG_SLUDGE_ID)
  24. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  25. end
  26. function CheckProgress(Quest, QuestGiver, Player)
  27. if QuestStepIsComplete(Player, UNFORTUNATE_EARTH_QUEST_ID, 1) and QuestStepIsComplete(Player, UNFORTUNATE_EARTH_QUEST_ID, 2) and QuestStepIsComplete(Player, UNFORTUNATE_EARTH_QUEST_ID, 3) then
  28. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected what Nareh Lith requested.")
  29. AddQuestStepChat(Quest, 4, "I need to speak with Nareh Lith near the entrance to Nettleville.", 1, "I need to return these items to Nareh Lith.", 11, BOTANIST_LITH_ID)
  30. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  31. end
  32. end
  33. function Step1Complete(Quest, QuestGiver, Player)
  34. UpdateQuestStepDescription(Quest, 1, "I have collected some mud samples.")
  35. CheckProgress(Quest, QuestGiver, Player)
  36. end
  37. function Step2Complete(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 2, "I have collected the stomach contents of some bog slugs.")
  39. CheckProgress(Quest, QuestGiver, Player)
  40. end
  41. function Step3Complete(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 3, "I have collected the stomach contents of some bog sludges.")
  43. CheckProgress(Quest, QuestGiver, Player)
  44. end
  45. function Step4Complete(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 4, "I have spoken with Nareh Lith.")
  47. AddQuestStepChat(Quest, 5, "I need to speak with Lieutenant Dawson near the gates to Nettleville.", 1, "I need to return these items to Nareh Lith.", 11, LIEUTENANT_DAWSON_ID)
  48. AddQuestStepCompleteAction(Quest, 5, "QuestComplete")
  49. end
  50. function QuestComplete(Quest, QuestGiver, Player)
  51. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  52. UpdateQuestStepDescription(Quest, 5, "I have spoken with Lieutenant Dawson.")
  53. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Nareh Lith.")
  54. UpdateQuestDescription(Quest, "I have given Nareh Lith what he requested. A quick test on the substances worried Nareh, he believes he's found minerals that suggest foreign substances being introduced into the environment of the Peat Bog. Nareh is worried that these substances originated in the Caves.")
  55. GiveQuestReward(Quest, Player)
  56. end
  57. function Reload(Quest, QuestGiver, Player, Step)
  58. if Step == 1 then
  59. Step1Complete(Quest, QuestGiver, Player)
  60. elseif Step == 2 then
  61. Step2Complete(Quest, QuestGiver, Player)
  62. elseif Step == 3 then
  63. Step3Complete(Quest, QuestGiver, Player)
  64. elseif Step == 4 then
  65. Step4Complete(Quest, QuestGiver, Player)
  66. elseif Step == 5 then
  67. QuestComplete(Quest, QuestGiver, Player)
  68. end
  69. end
  70. function Accepted(Quest, QuestGiver, Player)
  71. -- Add dialog here for when the quest is accepted
  72. end
  73. function Declined(Quest, QuestGiver, Player)
  74. -- Add dialog here for when the quest is declined
  75. end