9
3

nothing_to_waste.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : Quests/FrostfangSea/nothing_to_waste.lua
  3. Script Purpose : for the quest Nothing to Waste
  4. Script Author : theFoof
  5. Script Date : 2013.6.10
  6. Script Notes :
  7. Zone : Frostfang Sea
  8. Quest Giver : Thirin Veliumdelver
  9. Preceded by : None
  10. Followed by : Roughing Up The Reinforcements
  11. --]]
  12. function Init(Quest)
  13. AddQuestRewardCoin(Quest, math.random(5,90), math.random(13,25), 0, 0)
  14. AddQuestStepObtainItem(Quest, 1, "I must collect some Ry'Gorr Invader helmets.", 3, 100, "I must collect Ry'Gorr helmets, chestguards, and warhammers from the Ry'Gorr Invaders.", 1541, 11818)
  15. AddQuestStepObtainItem(Quest, 2, "I must collect some Ry'Gorr Invader chestguards.", 3, 100, "I must collect Ry'Gorr helmets, chestguards, and warhammers from the Ry'Gorr Invaders.", 1537, 11817)
  16. AddQuestStepObtainItem(Quest, 3, "I must collect some Ry'Gorr Invader warhammers.", 3, 100, "I must collect Ry'Gorr helmets, chestguards, and warhammers from the Ry'Gorr Invaders.", 1658, 11824)
  17. AddQuestStepCompleteAction(Quest, 1, "GotHelmets")
  18. AddQuestStepCompleteAction(Quest, 2, "GotChestguards")
  19. AddQuestStepCompleteAction(Quest, 3, "GotHammers")
  20. end
  21. function Accepted(Quest, QuestGiver, Player)
  22. local thirin = GetSpawnByLocationID(GetZone(Player), 14520)
  23. FaceTarget(thirin, Player)
  24. local conversation = CreateConversation()
  25. PlayFlavor(thirin, "thirin_veliumdelver/halas/thirin_veliumdelver/thirin_veliumdelver007.mp3", "", "", 3327550252, 85419352, Player)
  26. AddConversationOption(conversation, "Did you say useless?")
  27. StartConversation(conversation, thirin, Player, "Good. The orcs are attacking from the south beach, so seek them out there. Do some good around here and I may think of you as more than useless.")
  28. end
  29. function Deleted(Quest, QuestGiver, Player)
  30. while HasItem(Player, 11818) do
  31. RemoveItem(Player, 11818)
  32. end
  33. while HasItem(Player, 11817) do
  34. RemoveItem(Player, 11817)
  35. end
  36. while HasItem(Player, 11824) do
  37. RemoveItem(Player, 11824)
  38. end
  39. end
  40. function Declined(Quest, QuestGiver, Player)
  41. end
  42. function GotHelmets(Quest, QuestGiver, Player)
  43. UpdateQuestStepDescription(Quest, 1, "I have collected some Ry'Gorr Invader helmets.")
  44. CheckProgress(Quest, QuestGiver, Player)
  45. end
  46. function GotChestguards(Quest, QuestGiver, Player)
  47. UpdateQuestStepDescription(Quest, 2, "I have collected some Ry'Gorr Invader chestguards.")
  48. CheckProgress(Quest, QuestGiver, Player)
  49. end
  50. function GotHammers(Quest, QuestGiver, Player)
  51. UpdateQuestStepDescription(Quest, 3, "I have collected some Ry'Gorr Invader warhammers.")
  52. CheckProgress(Quest, QuestGiver, Player)
  53. end
  54. function CheckProgress(Quest, QuestGiver, Player)
  55. if QuestStepIsComplete(Player, 56, 1) and QuestStepIsComplete(Player, 56, 2) and QuestStepIsComplete(Player, 56, 3) then
  56. AddStep4(Quest, QuestGiver, Player)
  57. end
  58. end
  59. function AddStep4(Quest, QuestGiver, Player)
  60. UpdateQuestTaskGroupDescription(Quest, 1, "I have collected Ry'Gorr helmets, chestguards, and warhammers from the Ry'Gorr Invaders.")
  61. AddQuestStepChat(Quest, 4, "I must speak with Thirin Veliumdelver.", 1, "With the items collected, I should return them to Thirin Veliumdelver at the Cragged Spine.", 0, 4700112)
  62. AddQuestStepCompleteAction(Quest, 4, "CompleteQuest")
  63. end
  64. function CompleteQuest(Quest, QuestGiver, Player)
  65. while HasItem(Player, 11818) do
  66. RemoveItem(Player, 11818)
  67. end
  68. while HasItem(Player, 11817) do
  69. RemoveItem(Player, 11817)
  70. end
  71. while HasItem(Player, 11824) do
  72. RemoveItem(Player, 11824)
  73. end
  74. GiveQuestReward(Quest, Player)
  75. end
  76. function Reload(Quest, QuestGiver, Player, Step)
  77. if QuestStepIsComplete(Player, 56, 1) then
  78. GotHelmets(Quest, QuestGiver, Player)
  79. end
  80. if QuestStepIsComplete(Player, 56, 2) then
  81. GotChestguards(Quest, QuestGiver, Player)
  82. end
  83. if QuestStepIsComplete(Player, 56, 3) then
  84. GotHammers(Quest, QuestGiver, Player)
  85. end
  86. end