9
3

tutorial_learning_to_harvest.lua 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. say(QuestGiver,GetName(QuestGiver))
  39. end
  40. function Root(Quest, QuestGiver, Player)
  41. UpdateQuestStepDescription(Quest, 2, "I have gathered some roots.")
  42. CheckProgress(Quest, QuestGiver, Player)
  43. end
  44. function Lumber(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 1, "I have harvested some elm lumber.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function TinCluster(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 3, "I have mined some tin clusters.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function LeadCluster(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 4, "I harvested some lead clusters.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function Sunfish(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 5, "I have harvested some sunfish.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function Jumjum(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 6, "I have gathered some jumjum.")
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. function RawhidePelt(Quest, QuestGiver, Player)
  65. UpdateQuestStepDescription(Quest, 7, "I have trapped a number of pelts.")
  66. CheckProgress(Quest, QuestGiver, Player)
  67. end
  68. function CompleteQuest(Quest, QuestGiver, Player)
  69. GiveQuestReward(Quest, Player)
  70. end
  71. function Accepted(Quest, QuestGiver, Player)
  72. if not HasItem(Player, 20747, 1) then
  73. SummonItem(Player, 20747)
  74. end
  75. if GetName(QuestGiver) == "Glin Hammerhelm" then
  76. conversation = CreateConversation()
  77. FaceTarget(QuestGiver, Player)
  78. AddConversationOption(conversation, "I'll get right on it.")
  79. 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.")
  80. end
  81. end
  82. function Declined(Quest, QuestGiver, Player)
  83. end
  84. function Deleted(Quest, QuestGiver, Player)
  85. end
  86. function Reload(Quest, QuestGiver, Player, Step)
  87. if QuestStepIsComplete(Player, HarvestTutorial, 1) then
  88. Lumber(Quest, QuestGiver, Player)
  89. end
  90. if QuestStepIsComplete(Player, HarvestTutorial, 2) then
  91. Root(Quest, QuestGiver, Player)
  92. end
  93. if QuestStepIsComplete(Player, HarvestTutorial, 3) then
  94. TinCluster(Quest, QuestGiver, Player)
  95. end
  96. if QuestStepIsComplete(Player, HarvestTutorial, 4) then
  97. LeadCluster(Quest, QuestGiver, Player)
  98. end
  99. if QuestStepIsComplete(Player, HarvestTutorial, 5) then
  100. Sunfish(Quest, QuestGiver, Player)
  101. end
  102. if QuestStepIsComplete(Player, HarvestTutorial, 6) then
  103. Jumjum(Quest, QuestGiver, Player)
  104. end
  105. if QuestStepIsComplete(Player, HarvestTutorial, 7) then
  106. RawhidePelt(Quest, QuestGiver, Player)
  107. end
  108. end