9
3

components_of_growth.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. --[[
  2. Script Name : Quests/Castleview/components_of_growth.lua
  3. Script Purpose : Handles the quest, "Components of Growth"
  4. Script Author : Scatman
  5. Script Date : 2009.10.02
  6. Zone : Castleview Hamlet
  7. Quest Giver: Vindain Greenfaith
  8. Preceded by: None
  9. Followed by: Sowing Beauty (sowing_beauty.lua)
  10. --]]
  11. local ComponentsOfGrowth = 223
  12. function Init(Quest)
  13. -- Green Wisp Seeds
  14. AddQuestStepObtainItem(Quest, 1, "I need to collect Green Wisp seeds from the Green Wisp Bushes near the Fountain of Valor in southwestern Castleview Hamlet.", 1, 100, "I need to collect a number of components. Vindain Greenfaith says they can all be found in Castleview Hamlet.", 2315, 7947)
  15. AddQuestStep(Quest, 2, "I need to collect some blessed water from the Fountain of Valor. I can do this by examining the water flask that Vindain gave me while near the fountain.", 1, 100, "I need to collect a number of components. Vindain Greenfaith says they can all be found in Castleview Hamlet.", 980)
  16. -- Mana-Enriched Soil
  17. AddQuestStepObtainItem(Quest, 3, "I need to gather some enriched soil from the barrel on the northeastern corner of the armor shop.", 1, 100, "I need to collect a number of components. Vindain Greenfaith says they can all be found in Castleview Hamlet.", 342, 9305)
  18. AddQuestStepCompleteAction(Quest, 1, "step1_complete_gotSeeds")
  19. AddQuestStepCompleteAction(Quest, 2, "step2_complete_gotWater")
  20. AddQuestStepCompleteAction(Quest, 3, "step3_complete_gotSoil")
  21. end
  22. function Accepted(Quest, QuestGiver, Player)
  23. FaceTarget(QuestGiver, Player)
  24. conversation = CreateConversation()
  25. -- summon Water Flask
  26. if not HasItem(Player, 15337, 1) then
  27. SummonItem(Player, 15337, 1)
  28. end
  29. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/vindain_greenfaith/qey_village04/quests/vindain/vindain014a.mp3", "", "", 1855493123, 719019896, Player)
  30. AddConversationOption(conversation, "All right.")
  31. StartConversation(conversation, QuestGiver, Player, "Once you've collected the components return to me.")
  32. end
  33. function Declined(Quest, QuestGiver, Player)
  34. end
  35. function step1_complete_gotSeeds(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 1, "I have collected the Green Wisp seeds.")
  37. if QuestIsComplete(Player, ComponentsOfGrowth) then
  38. multiple_steps_complete(Quest, QuestGiver, Player)
  39. end
  40. end
  41. function step2_complete_gotWater(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 2, "I have collected some blessed water.")
  43. if QuestIsComplete(Player, ComponentsOfGrowth) then
  44. multiple_steps_complete(Quest, QuestGiver, Player)
  45. end
  46. end
  47. function step3_complete_gotSoil(Quest, QuestGiver, Player)
  48. UpdateQuestStepDescription(Quest, 3, "I have collected some enriched soil.")
  49. if QuestIsComplete(Player, ComponentsOfGrowth) then
  50. multiple_steps_complete(Quest, QuestGiver, Player)
  51. end
  52. end
  53. function multiple_steps_complete(Quest, QuestGiver, Player)
  54. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected the needed items.")
  55. AddQuestStepChat(Quest, 4, "I should return to Vindain Greenfaith, near the Fountain of Valor.", 1, "Now that I have collected the needed components I should return to Vindain Greenfaith.", 0, 2360007)
  56. AddQuestStepCompleteAction(Quest, 4, "quest_complete")
  57. end
  58. function quest_complete(Quest, QuestGiver, Player)
  59. -- Green Wisp Seeds
  60. while HasItem(Player, 7947) do
  61. RemoveItem(Player, 7947)
  62. end
  63. -- Water Flask
  64. while HasItem(Player, 15337) do
  65. RemoveItem(Player, 15337)
  66. end
  67. -- Mana-Enriched Soil
  68. while HasItem(Player, 9305) do
  69. RemoveItem(Player, 9305)
  70. end
  71. UpdateQuestStepDescription(Quest, 4, "I have spoken to Vindain Greenfaith.")
  72. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Vindain Greenfaith")
  73. UpdateQuestDescription(Quest, "I have collected the needed components to carry out Vindain's plan.")
  74. GiveQuestReward(Quest, Player)
  75. end
  76. function Reload(Quest, QuestGiver, Player, Step)
  77. if Step == 1 then
  78. step1_complete_gotSeeds(Quest, QuestGiver, Player)
  79. elseif Step == 2 then
  80. step2_complete_gotWater(Quest, QuestGiver, Player)
  81. elseif Step == 3 then
  82. step3_complete_gotSoil(Quest, QuestGiver, Player)
  83. end
  84. end