TheUnfortunateEarth.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 = 4457
  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 Accepted(Quest, QuestGiver, Player)
  27. FaceTarget(NPC, Spawn)
  28. local conversation = CreateConversation()
  29. PlayFlavor(NPC,"voiceover/english/tutorial_revamp/botanist_lith/qey_adv04_bog/quests/nareh/nareh004a.mp3","","nod",599099993, 3790757088,Spawn)
  30. AddConversationOption(conversation, "Ok.")
  31. StartConversation(conversation, NPC, Spawn, "Try not to smash them up too much, please.")
  32. end
  33. function CheckProgress(Quest, QuestGiver, Player)
  34. 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
  35. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected what Nareh Lith requested.")
  36. 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)
  37. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  38. end
  39. end
  40. function Step1Complete(Quest, QuestGiver, Player)
  41. UpdateQuestStepDescription(Quest, 1, "I have collected some mud samples.")
  42. CheckProgress(Quest, QuestGiver, Player)
  43. end
  44. function Step2Complete(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 2, "I have collected the stomach contents of some bog slugs.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function Step3Complete(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 3, "I have collected the stomach contents of some bog sludges.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function Step4Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 4, "I have spoken with Nareh Lith.")
  54. 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)
  55. AddQuestStepCompleteAction(Quest, 5, "QuestComplete")
  56. end
  57. function QuestComplete(Quest, QuestGiver, Player)
  58. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  59. UpdateQuestStepDescription(Quest, 5, "I have spoken with Lieutenant Dawson.")
  60. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Nareh Lith.")
  61. 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.")
  62. GiveQuestReward(Quest, Player)
  63. end
  64. function Reload(Quest, QuestGiver, Player, Step)
  65. if Step == 1 then
  66. Step1Complete(Quest, QuestGiver, Player)
  67. elseif Step == 2 then
  68. Step2Complete(Quest, QuestGiver, Player)
  69. elseif Step == 3 then
  70. Step3Complete(Quest, QuestGiver, Player)
  71. elseif Step == 4 then
  72. Step4Complete(Quest, QuestGiver, Player)
  73. elseif Step == 5 then
  74. QuestComplete(Quest, QuestGiver, Player)
  75. end
  76. end
  77. function Accepted(Quest, QuestGiver, Player)
  78. -- Add dialog here for when the quest is accepted
  79. end
  80. function Declined(Quest, QuestGiver, Player)
  81. -- Add dialog here for when the quest is declined
  82. end