regrowth.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. --[[
  2. Script Name : Quests/Castleview/regrowth.lua
  3. Script Purpose : Handles the quest, "Regrowth"
  4. Script Author : Scatman
  5. Script Date : 2009.10.02
  6. Zone : Oakmyst Forest
  7. Quest Giver: Adalin Emerael
  8. Preceded by: None
  9. Followed by: None
  10. --]]
  11. function Init(Quest)
  12. AddQuestStep(Quest, 1, "I need to cleanse the tree west of the gates to Castleview Hamlet.", 1, 100, "Adalin has asked for my help in cleansing a number of trees in the Oakmyst Forest.", 0)
  13. AddQuestStep(Quest, 2, "I need to cleanse the tree east of the Western Falls, west of the first tree.", 1, 100, "Adalin has asked for my help in cleansing a number of trees in the Oakmyst Forest.", 0)
  14. AddQuestStep(Quest, 3, "I need to cleanse the tree east of the entrance to the docks.", 1, 100, "Adalin has asked for my help in cleansing a number of trees in the Oakmyst Forest.", 0)
  15. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_Tree1")
  16. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_Tree2")
  17. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_Tree3")
  18. end
  19. function Accepted(Quest, QuestGiver, Player)
  20. FaceTarget(QuestGiver, Player)
  21. conversation = CreateConversation()
  22. -- cleansing salve
  23. if not HasItem(Player, 4386, 1) then
  24. SummonItem(Player, 4386, 1)
  25. end
  26. AddConversationOption(conversation, "I will, thank you.")
  27. StartConversation(conversation, QuestGiver, Player, "This salve should allow you to cleanse them easily enough. May tunare be with you.")
  28. end
  29. function Declined(Quest, QuestGiver, Player)
  30. end
  31. function Step1_Complete_Tree1(Quest, QuestGiver, Player)
  32. UpdateQuestStepDescription(Quest, 1, "I have cleansed the tree west of the gates to Castleview Hamlet.")
  33. if QuestIsComplete(Player, 294) then
  34. TreesCleansed(Quest, QuestGiver, Player)
  35. end
  36. end
  37. function Step2_Complete_Tree2(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 2, "I have cleansed the tree east of the Western Falls.")
  39. if QuestIsComplete(Player, 294) then
  40. TreesCleansed(Quest, QuestGiver, Player)
  41. end
  42. end
  43. function Step3_Complete_Tree3(Quest, QuestGiver, Player)
  44. UpdateQuestStepDescription(Quest, 3, "I have cleansed the tree east of the entrance to the docks.")
  45. if QuestIsComplete(Player, 294) then
  46. TreesCleansed(Quest, QuestGiver, Player)
  47. end
  48. end
  49. function TreesCleansed(Quest, QuestGiver, Player)
  50. UpdateQuestTaskGroupDescription(Quest, 1, "I have cleansed the plants that Adalin has asked me to cleanse.")
  51. AddQuestStepChat(Quest, 4, "I need to return to Adalin and tell him of the gnoll attack.", 1, "I need to return to Adalin and tell him of the gnoll attack while cleansing.", 0, 1950005)
  52. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_SpokeWithAdalin")
  53. end
  54. function Step4_Complete_SpokeWithAdalin(Quest, QuestGiver, Player)
  55. UpdateQuestStepDescription(Quest, 4, "I have spoken with Adalin.")
  56. AddQuestStepChat(Quest, 5, "I need to bring the news of the gnoll presence to Lieutenant Charlin.", 1, "I need to return to Adalin and tell him of the gnoll attack while cleansing.", 0, 1950015)
  57. AddQuestStepCompleteAction(Quest, 5, "Quest_Complete")
  58. end
  59. function Quest_Complete(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 5, "I have spoken with Lieutenant Charlin.")
  61. UpdateQuestTaskGroupDescription(Quest, 2, "I have informed Lieutenant Charlin of the gnoll presence in Oakmyst Forest.")
  62. UpdateQuestDescription(Quest, "In helping Adalin Emerael cleanse some of the trees in Oakmyst Forest I was attacked by a gnoll. With the gnoll's paw as proof Lieutenant Charlin has agreed that a possible gnoll threat needs to be looked in to.")
  63. GiveQuestReward(Quest, Player)
  64. end
  65. function Reload(Quest, QuestGiver, Player, Step)
  66. if Step == 1 then
  67. Step1_Complete_Tree1(Quest, QuestGiver, Player)
  68. elseif Step == 2 then
  69. Step2_Complete_Tree2(Quest, QuestGiver, Player)
  70. elseif Step == 3 then
  71. Step3_Complete_Tree3(Quest, QuestGiver, Player)
  72. elseif Step == 4 then
  73. Step4_Complete_SpokeWithAdalin(Quest, QuestGiver, Player)
  74. end
  75. end