9
3

wisdom_in_the_wild.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. --[[
  2. Script Name : Quests/WillowWood/wisdom_in_the_wild.lua
  3. Script Purpose : Handles the quest, "Wisdom in the Wild"
  4. Script Author : Scatman
  5. Script Date : 2009.09.26
  6. Zone : The Willow Wood
  7. Quest Giver: Daelyn Twinstar
  8. Preceded by: A Joined Heritage (a_joined_heritage.lua)
  9. Followed by: A Task for Daelyn (a_task_for_daelyn.lua)
  10. --]]
  11. local WisdomInTheWind = 220
  12. function Init(Quest)
  13. AddQuestStep(Quest, 1, "I need to find page 3.", 1, 100, "I need to collect 5 missing pages from Daelyn's essay.", 0)
  14. AddQuestStep(Quest, 2, "I need to find page 4.", 1, 100, "I need to collect 5 missing pages from Daelyn's essay.", 0)
  15. AddQuestStep(Quest, 3, "I need to find page 7.", 1, 100, "I need to collect 5 missing pages from Daelyn's essay.", 0)
  16. AddQuestStep(Quest, 4, "I need to find page 11.", 1, 100, "I need to collect 5 missing pages from Daelyn's essay.", 0)
  17. AddQuestStep(Quest, 5, "I need to find page 12.", 1, 100, "I need to collect 5 missing pages from Daelyn's essay.", 0)
  18. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_FoundPage3")
  19. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_FoundPage4")
  20. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_FoundPage7")
  21. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_FoundPage11")
  22. AddQuestStepCompleteAction(Quest, 5, "Step5_Complete_FoundPage12")
  23. end
  24. function Accepted(Quest, QuestGiver, Player)
  25. FaceTarget(QuestGiver, Player)
  26. conversation = CreateConversation()
  27. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/daelyn_twinstar/qey_village05/quests/daelyn_twinstar/daelyn_twinstar025.mp3", "", "", 3754562839, 1931475436, Player)
  28. AddConversationOption(conversation, "I'm sure I can find them.")
  29. StartConversation(conversation, QuestGiver, Player, "Wonderful, I knew I could count on you. This will save me a lot of time. It looks like there are five pages missing, assuming they're not destroyed. They could be anywhere in the village by now.")
  30. end
  31. function Declined(Quest, QuestGiver, Player)
  32. end
  33. function Step1_Complete_FoundPage3(Quest, QuestGiver, Player)
  34. UpdateQuestStepDescription(Quest, 1, "I found page 3.")
  35. if QuestIsComplete(Player, WisdomInTheWind) then
  36. FoundAllPages(Quest, QuestGiver, Player)
  37. end
  38. end
  39. function Step2_Complete_FoundPage4(Quest, QuestGiver, Player)
  40. UpdateQuestStepDescription(Quest, 2, "I found page 4.")
  41. if QuestIsComplete(Player, WisdomInTheWind) then
  42. FoundAllPages(Quest, QuestGiver, Player)
  43. end
  44. end
  45. function Step3_Complete_FoundPage7(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 3, "I found page 7.")
  47. if QuestIsComplete(Player, WisdomInTheWind) then
  48. FoundAllPages(Quest, QuestGiver, Player)
  49. end
  50. end
  51. function Step4_Complete_FoundPage11(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 4, "I found page 11.")
  53. if QuestIsComplete(Player, WisdomInTheWind) then
  54. FoundAllPages(Quest, QuestGiver, Player)
  55. end
  56. end
  57. function Step5_Complete_FoundPage12(Quest, QuestGiver, Player)
  58. UpdateQuestStepDescription(Quest, 5, "I found page 12.")
  59. if QuestIsComplete(Player, WisdomInTheWind) then
  60. FoundAllPages(Quest, QuestGiver, Player)
  61. end
  62. end
  63. function FoundAllPages(Quest, QuestGiver, Player)
  64. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected the 5 missing pages from Daelyn's essay.")
  65. AddQuestStepChat(Quest, 6, "I must speak with Daelyn.", 1, "Now that I have collected the missing pages I need to return to Daelyn and speak to him about Milo and Lyssia.", 0, 2370037)
  66. AddQuestStepCompleteAction(Quest, 6, "Quest_Complete")
  67. end
  68. function Quest_Complete(Quest, QuestGiver, Player)
  69. UpdateQuestStepDescription(Quest, 6, "I have spoken with Daelyn.")
  70. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with Daelyn.")
  71. UpdateQuestDescription(Quest, "I have found the missing pages of Daelyn Twinstar's essay and we have spoken of Milo and Lyssia.")
  72. GiveQuestReward(Quest, Player)
  73. end
  74. function Reload(Quest, QuestGiver, Player, Step)
  75. if Step == 1 then
  76. Step1_Complete_FoundPage3(Quest, QuestGiver, Player)
  77. elseif Step == 2 then
  78. Step2_Complete_FoundPage4(Quest, QuestGiver, Player)
  79. elseif Step == 3 then
  80. Step3_Complete_FoundPage7(Quest, QuestGiver, Player)
  81. elseif Step == 4 then
  82. Step4_Complete_FoundPage11(Quest, QuestGiver, Player)
  83. elseif Step == 5 then
  84. Step5_Complete_FoundPage12(Quest, QuestGiver, Player)
  85. end
  86. end