tutorial_learning_to_harvest.lua 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. --[[
  2. Script Name : Quests/FrostfangSea/tutorial_learning_to_harvest.lua
  3. Script Purpose : the quest Tutorial: Learning to Harvest
  4. Script Author : theFoof
  5. Script Date : 2013.5.15
  6. Zone : Unknown (global)
  7. Quest Giver : Trainer Hawk Dunlop (and other harvesting tutors will add as I get to those zones)
  8. Preceded by : None
  9. Followed by : "If I Had a Hammer" & "Tutorial: Forging Ahead"
  10. --]]
  11. local HarvestTutorial = 11
  12. function Init(Quest)
  13. AddQuestStepHarvest(Quest, 1, "Harvest some elm lumber.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 826, 12098)
  14. AddQuestStepHarvest(Quest, 2, "Harvest some roots.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 200, 11637)
  15. AddQuestStepHarvest(Quest, 3, "Mine some tin clusters.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 3391, 14463)
  16. AddQuestStepHarvest(Quest, 4, "Mine some lead clusters.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 1086, 8808)
  17. AddQuestStepHarvest(Quest, 5, "Fish up some sunfish.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 2540, 13586)
  18. AddQuestStepHarvest(Quest, 6, "Harvest jumjum from a shrub or garden.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 816, 8486)
  19. AddQuestStepHarvest(Quest, 7, "Trap some rawhide leather pelts from an animal den.", 3, 100, "I must harvest some crafting supplies in a nearby low-risk adventure area. Harvest nodes can generally be found on the ground in most outdoor adventure regions.", 125 , 11280, 11267)
  20. AddQuestStepCompleteAction(Quest, 1, "Lumber")
  21. AddQuestStepCompleteAction(Quest, 2, "Root")
  22. AddQuestStepCompleteAction(Quest, 3, "TinCluster")
  23. AddQuestStepCompleteAction(Quest, 4, "LeadCluster")
  24. AddQuestStepCompleteAction(Quest, 5, "Sunfish")
  25. AddQuestStepCompleteAction(Quest, 6, "Jumjum")
  26. AddQuestStepCompleteAction(Quest, 7, "RawhidePelt")
  27. end
  28. function CheckProgress(Quest, QuestGiver, Player)
  29. if QuestStepIsComplete(Player, HarvestTutorial, 1) and QuestStepIsComplete(Player, HarvestTutorial, 2) and QuestStepIsComplete(Player, HarvestTutorial, 3) and QuestStepIsComplete(Player, HarvestTutorial, 4) and QuestStepIsComplete(Player, HarvestTutorial, 5) and QuestStepIsComplete(Player, HarvestTutorial, 6) and QuestStepIsComplete(Player, HarvestTutorial, 7) then
  30. UpdateQuestTaskGroupDescription(Quest, 1, "I harvested some crafting supplies.")
  31. AddStep8(Quest, QuestGiver, Player)
  32. end
  33. end
  34. function AddStep8(Quest, QuestGiver, Player)
  35. SetCompleteFlag(Quest)
  36. AddQuestStepChat(Quest, 8, "I must return to the trainer with the harvested items.", 1, "I must return to the trainer who sent me out harvesting.", 0, GetSpawnID(QuestGiver))
  37. AddQuestStepCompleteAction(Quest, 8, "CompleteQuest")
  38. end
  39. function Root(Quest, QuestGiver, Player)
  40. UpdateQuestStepDescription(Quest, 2, "I have gathered some roots.")
  41. CheckProgress(Quest, QuestGiver, Player)
  42. end
  43. function Lumber(Quest, QuestGiver, Player)
  44. UpdateQuestStepDescription(Quest, 1, "I have harvested some elm lumber.")
  45. CheckProgress(Quest, QuestGiver, Player)
  46. end
  47. function TinCluster(Quest, QuestGiver, Player)
  48. UpdateQuestStepDescription(Quest, 3, "I have mined some tin clusters.")
  49. CheckProgress(Quest, QuestGiver, Player)
  50. end
  51. function LeadCluster(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 4, "I harvested some lead clusters.")
  53. CheckProgress(Quest, QuestGiver, Player)
  54. end
  55. function Sunfish(Quest, QuestGiver, Player)
  56. UpdateQuestStepDescription(Quest, 5, "I have harvested some sunfish.")
  57. CheckProgress(Quest, QuestGiver, Player)
  58. end
  59. function Jumjum(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 6, "I have gathered some jumjum.")
  61. CheckProgress(Quest, QuestGiver, Player)
  62. end
  63. function RawhidePelt(Quest, QuestGiver, Player)
  64. UpdateQuestStepDescription(Quest, 7, "I have trapped a number of pelts.")
  65. CheckProgress(Quest, QuestGiver, Player)
  66. end
  67. function CompleteQuest(Quest, QuestGiver, Player)
  68. GiveQuestReward(Quest, Player)
  69. end
  70. function Accepted(Quest, QuestGiver, Player)
  71. if not HasItem(Player, 20747, 1) then
  72. SummonItem(Player, 20747)
  73. end
  74. if GetName(QuestGiver) == "Glin Hammerhelm" then
  75. conversation = CreateConversation()
  76. FaceTarget(QuestGiver, Player)
  77. AddConversationOption(conversation, "I'll get right on it.")
  78. StartConversation(conversation, QuestGiver, Player, "Harvesting resources tend to be segregated by areas - for example, you'll be able to harvest items (often also called nodes) for making equipment for level 1-9 adventurers, in the same areas where you'll find level 1-9 adventurers hunting. There are seven types of harvestable item: wood, roots, ore, soft metal, animal dens, shrubs, and fish. I'd like you to get a few harvests from each type of harvestable item.")
  79. end
  80. end
  81. function Declined(Quest, QuestGiver, Player)
  82. end
  83. function Deleted(Quest, QuestGiver, Player)
  84. end
  85. function Reload(Quest, QuestGiver, Player, Step)
  86. if QuestStepIsComplete(Player, HarvestTutorial, 1) then
  87. Lumber(Quest, QuestGiver, Player)
  88. end
  89. if QuestStepIsComplete(Player, HarvestTutorial, 2) then
  90. Root(Quest, QuestGiver, Player)
  91. end
  92. if QuestStepIsComplete(Player, HarvestTutorial, 3) then
  93. TinCluster(Quest, QuestGiver, Player)
  94. end
  95. if QuestStepIsComplete(Player, HarvestTutorial, 4) then
  96. LeadCluster(Quest, QuestGiver, Player)
  97. end
  98. if QuestStepIsComplete(Player, HarvestTutorial, 5) then
  99. Sunfish(Quest, QuestGiver, Player)
  100. end
  101. if QuestStepIsComplete(Player, HarvestTutorial, 6) then
  102. Jumjum(Quest, QuestGiver, Player)
  103. end
  104. if QuestStepIsComplete(Player, HarvestTutorial, 7) then
  105. RawhidePelt(Quest, QuestGiver, Player)
  106. end
  107. end