QuenchingTheirThirst.lua 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. --[[
  2. Script Name : Quests/TheCommonlands/QuenchingTheirThirst.lua
  3. Script Purpose : Handles the quest, "Quenching Their Thirst"
  4. Script Author : premierio015
  5. Script Date : 17.05.2021
  6. Script Notes : Auto generated with QuestParser.
  7. Zone : Commonlands
  8. Quest Giver : Madam Vi
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepLocation(Quest, 1, "I need to fill a flask with water from a freshwater lake far to the west", 5 , "Madam Vi wants me to fill three flasks: one with water from a freshwater lake, one from a river, and one from the sea.", 310, 537.02, -49.98, -398.14)
  14. AddQuestStepLocation(Quest, 2, "I need to fill a flask with water from a nearby river west of the Crossroads", 5, "Madam Vi wants me to fill three flasks: one with water from a freshwater lake, one from a river, and one from the sea.", 310, -12.00, -46.80, -417.76)
  15. AddQuestStepLocation(Quest, 3, "I need to fill a flask with water from the sea to the northeast", 5, "Madam Vi wants me to fill three flasks: one with water from a freshwater lake, one from a river, and one from the sea.", 310, -1056.41, -145.45, -634.32)
  16. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  17. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  18. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  19. end
  20. function Accepted(Quest, QuestGiver, Player)
  21. FaceTarget(QuestGiver, Player)
  22. local conversation = CreateConversation()
  23. AddConversationOption(conversation, "Of course.")
  24. StartConversation(conversation, QuestGiver, Player, "Do make sure there are no parasites in the water.")
  25. end
  26. function Declined(Quest, QuestGiver, Player)
  27. -- Add dialog here for when the quest is declined
  28. end
  29. function Deleted(Quest, QuestGiver, Player)
  30. -- Remove any quest specific items here when the quest is deleted
  31. end
  32. function Step1Complete(Quest, QuestGiver, Player)
  33. UpdateQuestStepDescription(Quest, 1, "I have filled a flask with lake water.")
  34. CheckProgress(Quest, QuestGiver, Player)
  35. end
  36. function Step2Complete(Quest, QuestGiver, Player)
  37. UpdateQuestStepDescription(Quest, 2, "I have filled a flask with water from a nearby river.")
  38. CheckProgress(Quest, QuestGiver, Player)
  39. end
  40. function Step3Complete(Quest, QuestGiver, Player)
  41. UpdateQuestStepDescription(Quest, 3, "I have filled a flask with water from the sea.")
  42. CheckProgress(Quest, QuestGiver, Player)
  43. end
  44. function CheckProgress(Quest, QuestGiver, Player)
  45. if QuestStepIsComplete(Player, 5222, 1) and QuestStepIsComplete(Player, 5222, 2) and QuestStepIsComplete(Player, 5222, 3) then
  46. UpdateQuestTaskGroupDescription(Quest, 1, "I have the three filled flasks for Madam Vi at the Crossroads.")
  47. AddQuestStepChat(Quest, 4, "I should return to Madam Vi at the Crossroads", 1, "I have filled the flasks for Madam Vi.", 310, 330179)
  48. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  49. end
  50. end
  51. function QuestComplete(Quest, QuestGiver, Player)
  52. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  53. UpdateQuestStepDescription(Quest, 4, "I have filled the flasks and returned them to Madam Vi.")
  54. UpdateQuestTaskGroupDescription(Quest, 2, "I have returned the three flasks to Madam Vi at the Crossroads.")
  55. UpdateQuestDescription(Quest, "I filled the three flasks for Madam Vi.")
  56. GiveQuestReward(Quest, Player)
  57. end
  58. function Reload(Quest, QuestGiver, Player, Step)
  59. if Step == 1 then
  60. Step1Complete(Quest, QuestGiver, Player)
  61. elseif Step == 2 then
  62. Step2Complete(Quest, QuestGiver, Player)
  63. elseif Step == 3 then
  64. Step3Complete(Quest, QuestGiver, Player)
  65. elseif Step == 4 then
  66. QuestComplete(Quest, QuestGiver, Player)
  67. end
  68. end