repelling_little_critters.lua 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. --[[
  2. Script Name : Quests/FrostfangSea/repelling_little_critters.lua
  3. Script Purpose : the quest Repelling Little Critters
  4. Script Author : theFoof
  5. Script Date : 2013.5.12
  6. Zone : Frostfang Sea
  7. Quest Giver : Arrin Clelland
  8. Preceded by : Crustose Removal
  9. Followed by : Scraggly Foodstuffs
  10. --]]
  11. function Init(Quest)
  12. AddQuestRewardCoin(Quest, math.random(30,60), math.random(0,2), 0, 0)
  13. AddQuestStep(Quest, 1, "Test the new repellent on crustose sporetenders.", 6, 100, "I should test the new repllent in my inventory on the crustose sporetenders wandering amongst the lichen covered stones.", 811)
  14. AddQuestStepCompleteAction(Quest, 1, "SprayedRepellent")
  15. end
  16. function Accepted(Quest, QuestGiver, Player)
  17. SummonItem(Player, 45806, 1)
  18. end
  19. function Declined(Quest, QuestGiver, Player)
  20. end
  21. function Deleted(Quest, QuestGiver, Player)
  22. if HasItem(Player, 45806) then
  23. RemoveItem(Player, 45806)
  24. elseif HasItem(Player, 45805) then
  25. RemoveItem(Player, 45805)
  26. end
  27. end
  28. function SprayedRepellent(Quest, QuestGiver, Player)
  29. UpdateQuestTaskGroupDescription(Quest, 1, "I have tested a new repellent on the crustone sporetenders wandering amongst the lichen covered stones")
  30. AddQuestStepChat(Quest, 2, "Return to Arrin Clelland", 1, "I should return to Arrin Clelland in Pilgrims' Landing.", 0, 4700000)
  31. AddQuestStepCompleteAction(Quest, 2, "TalkedArrin")
  32. end
  33. function TalkedArrin(Quest, QuestGiver, Player)
  34. if HasItem(Player, 45806) then
  35. RemoveItem(Player, 45806)
  36. end
  37. SummonItem(Player, 45805, 1)
  38. UpdateQuestTaskGroupDescription(Quest, 2, "I have returned to Arrin Clelland in Pilgrims' Landing.")
  39. AddQuestStep(Quest, 3, "Apply the crustose repellent to the barrels of provisions.", 1, 100, "The provisions found under the protection of the other half of the ancient ship wreck in the northern section of Pilgrims' Landing are overrun by crustose.", 2285)
  40. AddQuestStepCompleteAction(Quest, 3, "RepelledFood")
  41. end
  42. function RepelledFood(Quest, QuestGiver, Player)
  43. UpdateQuestTaskGroupDescription(Quest, 3, "The crustose were sent running away from the barrles of provisions!")
  44. AddQuestStepChat(Quest, 4, "Return to Arrin Clelland", 1, "I am to return to Arrin Clelland in Pilgrims' Landing.", 0, 4700000)
  45. AddQuestStepCompleteAction(Quest, 4, "CompleteQuest")
  46. end
  47. function CompleteQuest(Quest, QuestGiver, Player)
  48. if HasItem(Player, 45805) then
  49. RemoveItem(Player, 45805)
  50. end
  51. GiveQuestReward(Quest, Player)
  52. end
  53. function Reload(Quest, QuestGiver, Player, Step)
  54. if Step == 1 then
  55. SprayedRepellent(Quest, QuestGiver, Player)
  56. elseif Step == 2 then
  57. TalkedArrin(Quest, QuestGiver, Player)
  58. elseif Step == 3 then
  59. RepelledFood(Quest, QuestGiver, Player)
  60. elseif Step == 4 then
  61. CompleteQuest(Quest, QuestGiver, Player)
  62. end
  63. end