9
3

the_secret_valley.lua 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. --[[
  2. Script Name : Quests/TheCommonlands/the_secret_valley.lua
  3. Script Purpose : Handles the quest, "The Secret Valley"
  4. Script Author : premierio015
  5. Script Date : 25.05.2021
  6. Script Notes : Auto generated with QuestParser.
  7. Zone : Commonlands
  8. Quest Giver : wwanted poster in Crossroads
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepChat(Quest, 1, "I need to speak with Merchant Marcus in The Commonlands.", 1, "I should find and speak with Merchant Marcus in The Commonlands to find out what this poster is all about.", 11, 330331)
  14. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  15. CheckProgress(Quest, QuestGiver, Player)
  16. end
  17. function Accepted(Quest, QuestGiver, Player)
  18. -- Add dialog here for when the quest is accepted
  19. end
  20. function Declined(Quest, QuestGiver, Player)
  21. -- Add dialog here for when the quest is declined
  22. end
  23. function Deleted(Quest, QuestGiver, Player)
  24. -- Remove any quest specific items here when the quest is deleted
  25. end
  26. function Step1Complete(Quest, QuestGiver, Player)
  27. UpdateQuestStepDescription(Quest, 1, "I have spoken with Merchant Marcus and have been given a list of ingredients to gather for the potion.")
  28. UpdateQuestTaskGroupDescription(Quest, 1, "It seems that a group of evil Antonican magi have taken refuge in a nearby valley that has been blocked off by a landslide. In order to reach it I will need an Earthwalking Potion from Merchant Marcus. He has given me a list of ingredients to gather for the potion, it looks like they will be easy enough to get.")
  29. AddQuestStepHarvest(Quest, 2, "I need to gather 5 black tea leaves.", 5, 100, "In order to access the valley where the Antonican magi have taken refuge I will need to acquire a potion of Earthwalking from Merchant Marcus. He has given me a list of ingredients he needs me to gather and although they do not seem to have anything to do with magic potions to me, I will gather them and see what comes.", 338, 4310)
  30. AddQuestStepHarvest(Quest, 3, "I need to gather 5 antonican coffee beans.", 5, 100, "In order to access the valley where the Antonican magi have taken refuge I will need to acquire a potion of Earthwalking from Merchant Marcus. He has given me a list of ingredients he needs me to gather and although they do not seem to have anything to do with magic potions to me, I will gather them and see what comes.", 2321, 3899)
  31. AddQuestStepHarvest(Quest, 4, "I need to gather 5 murdunk oranges.", 5, 100, "In order to access the valley where the Antonican magi have taken refuge I will need to acquire a potion of Earthwalking from Merchant Marcus. He has given me a list of ingredients he needs me to gather and although they do not seem to have anything to do with magic potions to me, I will gather them and see what comes.", 791, 9927)
  32. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  33. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  34. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  35. CheckProgress(Quest, QuestGiver, Player)
  36. end
  37. function Step2Complete(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 2, "I have gathered 5 black tea leaves.")
  39. CheckProgress(Quest, QuestGiver, Player)
  40. end
  41. function Step3Complete(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 3, "I have gathered 5 antonican coffee beans.")
  43. CheckProgress(Quest, QuestGiver, Player)
  44. end
  45. function Step4Complete(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 4, "I have gathered 5 murdunk oranges.")
  47. CheckProgress(Quest, QuestGiver, Player)
  48. end
  49. function CheckProgress(Quest, QuestGiver, Player)
  50. if QuestStepIsComplete(Player, 5234, 1) and QuestStepIsComplete(Player, 5234, 2) and QuestStepIsComplete(Player, 5234, 3) and QuestStepIsComplete(Player, 5234, 4) then
  51. AddQuestStepChat(Quest, 5, "I should give these ingredients to Merchant Marcus in The Commonlands.", 1, "I should give these "ingredients" to Merchant Marcus so that I can enter this valley he has told me of.", 11, 330331)
  52. AddQuestStepCompleteAction(Quest, 5, "QuestComplete")
  53. UpdateQuestTaskGroupDescription(Quest, 2, "Now that I have gathered the "ingredients" for the "magic potion" I should return to Merchant Marcus and see what happens.")
  54. end
  55. end
  56. function QuestComplete(Quest, QuestGiver, Player)
  57. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  58. UpdateQuestStepDescription(Quest, 5, "I have given Merchant Marcus the ingredients.")
  59. UpdateQuestTaskGroupDescription(Quest, 3, "Despite my doubts Merchant Marcus has indeed given me a potion of some sort. I should take a closer look to see if this is really a Potion of Earthwalking as he said.")
  60. UpdateQuestDescription(Quest, "Now that I have the Potion of Earthwalking I should be able to enter the Valley of the Rogue Magi.")
  61. GiveQuestReward(Quest, Player)
  62. end
  63. function Reload(Quest, QuestGiver, Player, Step)
  64. if Step == 1 then
  65. Step1Complete(Quest, QuestGiver, Player)
  66. elseif Step == 2 then
  67. Step2Complete(Quest, QuestGiver, Player)
  68. elseif Step == 3 then
  69. Step3Complete(Quest, QuestGiver, Player)
  70. elseif Step == 4 then
  71. Step4Complete(Quest, QuestGiver, Player)
  72. elseif Step == 5 then
  73. QuestComplete(Quest, QuestGiver, Player)
  74. end
  75. end