9
3

calling_them_back.lua 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. --[[
  2. Script Name : Quests/FrostfangSea/calling_them_back.lua
  3. Script Purpose : the quest Calling Them Back
  4. Script Author : theFoof
  5. Script Date : 2013.5.28
  6. Script Notes :
  7. Zone : Frostfang Sea
  8. Quest Giver : Dolur Axebeard
  9. Preceded by : Totem Annihilation
  10. Followed by : The Gauntlet
  11. --]]
  12. function Init(Quest)
  13. AddQuestRewardCoin(Quest, math.random(23,90), math.random(13,20), 0, 0)
  14. AddQuestStep(Quest, 1, "I must plant the Azia ward.", 1, 100, "Dolur Axebeard, a coldain shaman stationed at The Great Shelf, has asked for my help in planting wards on the battlefield. These wards act as beacons. The coldain soldiers that fall in battle can follow the signal from these beacons to return to Erollis as vengeful spirits, where they can continue their fight against the Ry'Gorr.", 2990)
  15. AddQuestStep(Quest, 2, "I must plant the Beza ward.", 1, 100, "Dolur Axebeard, a coldain shaman stationed at The Great Shelf, has asked for my help in planting wards on the battlefield. These wards act as beacons. The coldain soldiers that fall in battle can follow the signal from these beacons to return to Erollis as vengeful spirits, where they can continue their fight against the Ry'Gorr.", 2990)
  16. AddQuestStep(Quest, 3, "I must plant the Caza ward.", 1, 100, "Dolur Axebeard, a coldain shaman stationed at The Great Shelf, has asked for my help in planting wards on the battlefield. These wards act as beacons. The coldain soldiers that fall in battle can follow the signal from these beacons to return to Erollis as vengeful spirits, where they can continue their fight against the Ry'Gorr.", 2990)
  17. AddQuestStep(Quest, 4, "I must plant the Dena ward.", 1, 100, "Dolur Axebeard, a coldain shaman stationed at The Great Shelf, has asked for my help in planting wards on the battlefield. These wards act as beacons. The coldain soldiers that fall in battle can follow the signal from these beacons to return to Erollis as vengeful spirits, where they can continue their fight against the Ry'Gorr.", 2990)
  18. AddQuestStep(Quest, 5, "I must plant the Ena ward.", 1, 100, "Dolur Axebeard, a coldain shaman stationed at The Great Shelf, has asked for my help in planting wards on the battlefield. These wards act as beacons. The coldain soldiers that fall in battle can follow the signal from these beacons to return to Erollis as vengeful spirits, where they can continue their fight against the Ry'Gorr.", 2990)
  19. AddQuestStepCompleteAction(Quest, 1, "PlantedAzia")
  20. AddQuestStepCompleteAction(Quest, 2, "PlantedBeza")
  21. AddQuestStepCompleteAction(Quest, 3, "PlantedCaza")
  22. AddQuestStepCompleteAction(Quest, 4, "PlantedDena")
  23. AddQuestStepCompleteAction(Quest, 5, "PlantedEna")
  24. end
  25. function Accepted(Quest, QuestGiver, Player)
  26. if not HasItem(Player, 45448) then
  27. SummonItem(Player, 45448, 1)
  28. end
  29. FaceTarget(QuestGiver, Player)
  30. conversation = CreateConversation()
  31. PlayFlavor(QuestGiver, "dolur_axebeard/halas/great_shelf/dolur_axebeard/dolur_axebeard059.mp3", "", "", 118933813, 3206945922, Player)
  32. AddConversationOption(conversation, "I understand.")
  33. AddConversationOption(conversation, "Shouldn't be a problem.")
  34. StartConversation(conversation, QuestGiver, Player, "Here are the wards. Head to the south, where the fighting is heaviest and poke around. Ye'll want to keep an eye out for arcane patterns drawn in the snow. Those designs indicate the best locations to place the wards.")
  35. end
  36. function Deleted(Quest, QuestGiver, Player)
  37. RemoveItem(Player, 45448)
  38. local zone = GetZone(Player)
  39. RemoveSpawnAccess(GetSpawnByLocationID(zone, 572695), Player)
  40. RemoveSpawnAccess(GetSpawnByLocationID(zone, 572694), Player)
  41. RemoveSpawnAccess(GetSpawnByLocationID(zone, 572693), Player)
  42. RemoveSpawnAccess(GetSpawnByLocationID(zone, 572692), Player)
  43. RemoveSpawnAccess(GetSpawnByLocationID(zone, 572696), Player)
  44. end
  45. function Declined(Quest, QuestGiver, Player)
  46. end
  47. function PlantedAzia(Quest, QuestGiver, Player)
  48. local zone = GetZone(Player)
  49. local runes = GetSpawnByLocationID(zone, 572693)
  50. local X = GetX(runes)
  51. local Y = GetY(runes)
  52. local Z = GetZ(runes)
  53. local heading = GetHeading(runes)
  54. local ward = SpawnMob(zone, 4701741, 1, X + math.random(-3,3), Y, Z + math.random(-3,3), heading)
  55. AddSpawnAccess(ward, Player)
  56. UpdateQuestStepDescription(Quest, 1, "I have planted the Azia ward.")
  57. SendMessage(Player, "You place the Azia ward.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. RemoveSpawnAccess(runes, Player)
  60. end
  61. function PlantedBeza(Quest, QuestGiver, Player)
  62. local zone = GetZone(Player)
  63. local runes = GetSpawnByLocationID(zone, 572694)
  64. local X = GetX(runes)
  65. local Y = GetY(runes)
  66. local Z = GetZ(runes)
  67. local heading = GetHeading(runes)
  68. local ward = SpawnMob(zone, 4701741, 1, X + math.random(-3,3), Y, Z + math.random(-3,3), heading)
  69. AddSpawnAccess(ward, Player)
  70. UpdateQuestStepDescription(Quest, 2, "I have planted the Beza ward.")
  71. SendMessage(Player, "You place the Beza ward.")
  72. CheckProgress(Quest, QuestGiver, Player)
  73. RemoveSpawnAccess(runes, Player)
  74. end
  75. function PlantedCaza(Quest, QuestGiver, Player)
  76. local zone = GetZone(Player)
  77. local runes = GetSpawnByLocationID(zone, 572695)
  78. local X = GetX(runes)
  79. local Y = GetY(runes)
  80. local Z = GetZ(runes)
  81. local heading = GetHeading(runes)
  82. local ward = SpawnMob(zone, 4701741, 1, X + math.random(-3,3), Y, Z + math.random(-3,3), heading)
  83. AddSpawnAccess(ward, Player)
  84. UpdateQuestStepDescription(Quest, 3, "I have planted the Caza ward.")
  85. SendMessage(Player, "You place the Caza ward.")
  86. CheckProgress(Quest, QuestGiver, Player)
  87. RemoveSpawnAccess(runes, Player)
  88. end
  89. function PlantedDena(Quest, QuestGiver, Player)
  90. local zone = GetZone(Player)
  91. local runes = GetSpawnByLocationID(zone, 572692)
  92. local X = GetX(runes)
  93. local Y = GetY(runes)
  94. local Z = GetZ(runes)
  95. local heading = GetHeading(runes)
  96. local ward = SpawnMob(zone, 4701741, 1, X + math.random(-3,3), Y, Z + math.random(-3,3), heading)
  97. AddSpawnAccess(ward, Player)
  98. UpdateQuestStepDescription(Quest, 4, "I have planted the Dena ward.")
  99. SendMessage(Player, "You place the Dena ward.")
  100. CheckProgress(Quest, QuestGiver, Player)
  101. RemoveSpawnAccess(runes, Player)
  102. end
  103. function PlantedEna(Quest, QuestGiver, Player)
  104. local zone = GetZone(Player)
  105. local runes = GetSpawnByLocationID(zone, 572696)
  106. local X = GetX(runes)
  107. local Y = GetY(runes)
  108. local Z = GetZ(runes)
  109. local heading = GetHeading(runes)
  110. local ward = SpawnMob(zone, 4701741, 1, X + math.random(-3,3), Y, Z + math.random(-3,3), heading)
  111. AddSpawnAccess(ward, Player)
  112. UpdateQuestStepDescription(Quest, 5, "I have planted the Ena ward.")
  113. SendMessage(Player, "You place the Ena ward.")
  114. CheckProgress(Quest, QuestGiver, Player)
  115. RemoveSpawnAccess(runes, Player)
  116. end
  117. function CheckProgress(Quest, QuestGiver, Player)
  118. if QuestStepIsComplete(Player, 35, 1) and QuestStepIsComplete(Player, 35, 2) and QuestStepIsComplete(Player, 35, 3) and QuestStepIsComplete(Player, 35, 4) and QuestStepIsComplete(Player, 35, 5) then
  119. AddStep6(Quest, QuestGiver, Player)
  120. end
  121. end
  122. function AddStep6(Quest, QuestGiver, Player)
  123. UpdateQuestTaskGroupDescription(Quest, 1, "I have placed the spirit wards.")
  124. AddQuestStepChat(Quest, 6, "I must speak with Dolur Axebeard.", 1, "I must speak with Dolur Axebeard, who can be found in the cave at the Great Shelf.", 0, 4700078)
  125. AddQuestStepCompleteAction(Quest, 6, "CompleteQuest")
  126. end
  127. function CompleteQuest(Quest, QuestGiver, Player)
  128. GiveQuestReward(Quest, Player)
  129. RemoveItem(Player, 45448)
  130. end
  131. function Reload(Quest, QuestGiver, Player, Step)
  132. if QuestStepIsComplete(Player, 35, 1) then
  133. PlantedAzia(Quest, QuestGiver, Player)
  134. end
  135. if QuestStepIsComplete(Player, 35, 2) then
  136. PlantedBeza(Quest, QuestGiver, Player)
  137. end
  138. if QuestStepIsComplete(Player, 35, 3) then
  139. PlantedCaza(Quest, QuestGiver, Player)
  140. end
  141. if QuestStepIsComplete(Player, 35, 4) then
  142. PlantedDena(Quest, QuestGiver, Player)
  143. end
  144. if QuestStepIsComplete(Player, 35, 5) then
  145. PlantedEna(Quest, QuestGiver, Player)
  146. end
  147. if QuestStepIsComplete(Player, 35, 1) and QuestStepIsComplete(Player, 35, 2) and QuestStepIsComplete(Player, 35, 3) and QuestStepIsComplete(Player, 35, 4) and QuestStepIsComplete(Player, 35, 5) then
  148. AddStep6(Quest, QuestGiver, Player)
  149. end
  150. end