a_split_heritage.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. --[[
  2. Script Name : Quests/WillowWood/a_split_heritage.lua
  3. Script Purpose : Handles the quest, "A Split Heritage"
  4. Script Author : Scatman
  5. Script Date : 2009.09.20
  6. Zone : The Willow Wood
  7. Quest Giver: Daelyn Twinstar
  8. Preceded by: None
  9. Followed by: A Joined Heritage (a_joined_heritage.lua)
  10. --]]
  11. local ASplitHeritage = 218
  12. function Init(Quest)
  13. AddQuestStepChat(Quest, 1, "I need to speak with Gar Smolten behind the inn.", 1, "I need to speak with a human named Gar Smolten. Daelyn said he should be behind the inn.", 0, 2370026)
  14. AddQuestStepCompleteAction(Quest, 1, "Step1_Complete_SpokeWithGar")
  15. end
  16. function Accepted(Quest, QuestGiver, Player)
  17. FaceTarget(QuestGiver, Player)
  18. conversation = CreateConversation()
  19. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/daelyn_twinstar/qey_village05/quests/daelyn_twinstar/daelyn_twinstar015.mp3", "", "", 1728941496, 2387813278, Player)
  20. AddConversationOption(conversation, "Very well.")
  21. StartConversation(conversation, QuestGiver, Player, "I'm glad to hear it. Return to me when you have spoken to them.")
  22. end
  23. function Declined(Quest, QuestGiver, Player)
  24. end
  25. function Step1_Complete_SpokeWithGar(Quest, QuestGiver, Player)
  26. UpdateQuestStepDescription(Quest, 1, "I have spoken with Gar Smolten.")
  27. UpdateQuestTaskGroupDescription(Quest, 1, "I have spoken with Gar Smolten.")
  28. AddQuestStepChat(Quest, 2, "I need to speak with Gar Smolten once I know the contents of the boxes.", 1, "I should speak with Gar Smolten behind the inn again when I know which boxes contain what.", 0, 2370026)
  29. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_SpokeWithGar")
  30. end
  31. function Step2_Complete_SpokeWithGar(Quest, QuestGiver, Player)
  32. UpdateQuestStepDescription(Quest, 2, "I have spoken with Gar Smolten.")
  33. UpdateQuestTaskGroupDescription(Quest, 2, "I have completed the task for Gar.")
  34. AddQuestStepChat(Quest, 3, "I need to speak with Lia Serene near the entrance to the Elddar Grove.", 1, "I need to speak with an elf named Lia Serene. Daelyn said she should be near the entrance to the Elddar Grove.", 0, 2370030)
  35. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_SpokeWithLia")
  36. end
  37. function Step3_Complete_SpokeWithLia(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 3, "I have spoken with Lia Serene.")
  39. UpdateQuestTaskGroupDescription(Quest, 3, "I have spoken with Lia Serene.")
  40. AddQuestStep(Quest, 4, "I need to check under the north-east corner of the inn-roof for a nest or eggs.", 1, 100, "I need to go check the spots in the Willow Wood that Lia mentioned may have eggs or nests near them.", 0)
  41. AddQuestStep(Quest, 5, "I need to check under the tree near the entrance to the docks for a nest or eggs.", 1, 100, "I need to go check the spots in the Willow Wood that Lia mentioned may have eggs or nests near them.", 0)
  42. AddQuestStep(Quest, 6, "I need to check under the tree on the path to the entrance to the Forest Ruins for a nest or eggs.", 1, 100, "I need to go check the spots in the Willow Wood that Lia mentioned may have eggs or nests near them.", 0)
  43. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_FoundEgg")
  44. AddQuestStepCompleteAction(Quest, 5, "Step5_Complete_FoundEgg")
  45. AddQuestStepCompleteAction(Quest, 6, "Step6_Complete_FoundEgg")
  46. end
  47. function Step4_Complete_FoundEgg(Quest, QuestGiver, Player)
  48. UpdateQuestStepDescription(Quest, 4, "I have found an egg near the inn.")
  49. if QuestIsComplete(Player, ASplitHeritage) then
  50. FoundAllEggs(Quest, QuestGiver, Player)
  51. end
  52. end
  53. function Step5_Complete_FoundEgg(Quest, QuestGiver, Player)
  54. UpdateQuestStepDescription(Quest, 5, "I have found an egg from under the tree near the entrance to the docks.")
  55. if QuestIsComplete(Player, ASplitHeritage) then
  56. FoundAllEggs(Quest, QuestGiver, Player)
  57. end
  58. end
  59. function Step6_Complete_FoundEgg(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 6, "I have found an egg from the tree on the path to the Forest Ruins.")
  61. if QuestIsComplete(Player, ASplitHeritage) then
  62. FoundAllEggs(Quest, QuestGiver, Player)
  63. end
  64. end
  65. function FoundAllEggs(Quest, QuestGiver, Player)
  66. local egg1 = SpawnMob(GetZone(QuestGiver), 2370105, 0, 815.854, -19.6821, -585.67, 257)
  67. local egg2 = SpawnMob(GetZone(QuestGiver), 2370105, 0, 815.888, -19.6638, -585.578, 155)
  68. local egg3 = SpawnMob(GetZone(QuestGiver), 2370105, 0, 815.941, -19.6429, -585.632, 221)
  69. Despawn(egg1, 300000)
  70. Despawn(egg2, 300000)
  71. Despawn(egg3, 300000)
  72. UpdateQuestTaskGroupDescription(Quest, 4, "I have collected eggs from the spots Lia mentioned.")
  73. AddQuestStepChat(Quest, 7, "I need to speak with Lia Serene again.", 1, "I should speak with Lia near the entrance to the Elddar Grove again and give her these eggs.", 0, 2370030)
  74. AddQuestStepCompleteAction(Quest, 7, "Step7_Complete_SpokeWithLia")
  75. end
  76. function Step7_Complete_SpokeWithLia(Quest, QuestGiver, Player)
  77. UpdateQuestStepDescription(Quest, 7, "I have spoken with Lia Serene again.")
  78. UpdateQuestTaskGroupDescription(Quest, 5, "I have completed the task for Lia.")
  79. AddQuestStepChat(Quest, 8, "I need to speak with Daelyn.", 1, "I should return to Daelyn Twinstar now that I have done what he asked of me.", 0, 2370037)
  80. AddQuestStepCompleteAction(Quest, 8, "Quest_Complete")
  81. end
  82. function Quest_Complete(Quest, QuestGiver, Player)
  83. UpdateQuestStepDescription(Quest, 8, "I have spoken with Daelyn.")
  84. UpdateQuestTaskGroupDescription(Quest, 6, "I have spoken with Daelyn Twinstar.")
  85. UpdateQuestDescription(Quest, "After speaking with Gar and Lia I returned to Daelyn, he asked about how they treated me.")
  86. GiveQuestReward(Quest, Player)
  87. end
  88. function Reload(Quest, QuestGiver, Player, Step)
  89. if Step == 1 then
  90. Step1_Complete_SpokeWithGar(Quest, QuestGiver, Player)
  91. elseif Step == 2 then
  92. Step2_Complete_SpokeWithGar(Quest, QuestGiver, Player)
  93. elseif Step == 3 then
  94. Step3_Complete_SpokeWithLia(Quest, QuestGiver, Player)
  95. elseif Step == 4 then
  96. Step4_Complete_FoundEgg(Quest, QuestGiver, Player)
  97. elseif Step == 5 then
  98. Step5_Complete_FoundEgg(Quest, QuestGiver, Player)
  99. elseif Step == 6 then
  100. Step6_Complete_FoundEgg(Quest, QuestGiver, Player)
  101. elseif Step == 7 then
  102. Step7_Complete_SpokeWithLia(Quest, QuestGiver, Player)
  103. end
  104. end