9
3

an_essential_ingredient.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. --[[
  2. Script Name : Quests/FrostfangSea/an_essential_ingredient.lua
  3. Script Purpose : the quest An Essential Ingredient
  4. Script Author : theFoof
  5. Script Date : 2013.5.20
  6. Zone : Frostfang Sea
  7. Quest Giver : Blorpisa Bogchild
  8. Preceded by : Cod and Chips
  9. Followed by : Field Testing
  10. --]]
  11. local EssentialIngredient = 22
  12. function Accepted(Quest, QuestGiver, Player)
  13. SummonItem(Player, 45388, 1)
  14. FaceTarget(QuestGiver, Player)
  15. conversation = CreateConversation()
  16. PlayFlavor(QuestGiver, "blorpisa_bogchild/halas/gwenevyns_cove/blorpisa_bogchild/blorpisa_bogchild_039.mp3", "", "", 153842278, 3257954458, Player)
  17. AddConversationOption(conversation, "I will return to you once I have collected the elementals.")
  18. StartConversation(conversation, QuestGiver, Player, "Thanks, and good luck!")
  19. end
  20. function Declined(Quest, QuestGiver, Player)
  21. end
  22. function Deleted(Quest, QuestGiver, Player)
  23. end
  24. function Init(Quest)
  25. AddQuestRewardCoin(Quest, math.random(10,90), math.random(2,5), 0, 0)
  26. AddQuestStep(Quest, 1, "I must capture iceflows.", 4, 100, "I must capture iceflows and snowpacks. The iceflows and snowpacks can be found on the Icemane Plains west of Gwenevyn's Cove.", 1203)
  27. AddQuestStep(Quest, 2, "I must capture snowpacks.", 4, 100, "I must capture iceflows and snowpacks. The iceflows and snowpacks can be found on the Icemane Plains west of Gwenevyn's Cove.", 1203)
  28. AddQuestStepCompleteAction(Quest, 1, "GotIceflows")
  29. AddQuestStepCompleteAction(Quest, 2, "GotSnowpacks")
  30. end
  31. function GotIceflows(Quest, QuestGiver, Player)
  32. UpdateQuestStepDescription(Quest, 1, "I have captured the iceflows.")
  33. CheckProgress(Quest, QuestGiver, Player)
  34. end
  35. function GotSnowpacks(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 2, "I have captured the snowpacks.")
  37. CheckProgress(Quest, QuestGiver, Player)
  38. end
  39. function CheckProgress(Quest, QuestGiver, Player)
  40. if QuestStepIsComplete(Player, EssentialIngredient, 1) and QuestStepIsComplete(Player, EssentialIngredient, 2) then
  41. NextStep(Quest, QuestGiver, Player)
  42. end
  43. end
  44. function NextStep(Quest, QuestGiver, Player)
  45. UpdateQuestTaskGroupDescription(Quest, 1, "I have captured enough iceflows and snowpacks.")
  46. AddQuestStepChat(Quest, 3, "I must speak with Blorpisa Bogchild in Gwenevyn's Cove.", 1, "I must return the captured iceflows and snowpacks to Blorpisa Bogchild in Gwenevyn's Cove.", 0, 4700039)
  47. AddQuestStepCompleteAction(Quest, 3, "CompleteQuest")
  48. end
  49. function CompleteQuest(Quest, QuestGiver, Player)
  50. if HasItem(Player, 45388) then
  51. RemoveItem(Player, 45388)
  52. end
  53. GiveQuestReward(Quest, Player)
  54. end
  55. function Reload(Quest, QuestGiver, Player, Step)
  56. if Step == 1 then
  57. GotIceflows(Quest, QuestGiver, Player)
  58. end
  59. if Step == 2 then
  60. GotSnowpacks(Quest, QuestGiver, Player)
  61. end
  62. if Step == 3 then
  63. CompleteQuest(Quest, QuestGiver, Player)
  64. end
  65. end