tutorial_learning_to_harvest.lua 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. modified date : 8-19-22
  7. modified by : ememjr
  8. modified notes : update conversion to dialog module
  9. Zone : Unknown (global)
  10. Quest Giver : Trainer Hawk Dunlop (and other harvesting tutors will add as I get to those zones)
  11. Preceded by : None
  12. Followed by : "If I Had a Hammer" & "Tutorial: Forging Ahead"
  13. --]]
  14. require "SpawnScripts/Generic/DialogModule"
  15. local HarvestTutorial = 11
  16. function Init(Quest)
  17. 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)
  18. 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)
  19. 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)
  20. 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)
  21. 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)
  22. 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)
  23. 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)
  24. AddQuestStepCompleteAction(Quest, 1, "Lumber")
  25. AddQuestStepCompleteAction(Quest, 2, "Root")
  26. AddQuestStepCompleteAction(Quest, 3, "TinCluster")
  27. AddQuestStepCompleteAction(Quest, 4, "LeadCluster")
  28. AddQuestStepCompleteAction(Quest, 5, "Sunfish")
  29. AddQuestStepCompleteAction(Quest, 6, "Jumjum")
  30. AddQuestStepCompleteAction(Quest, 7, "RawhidePelt")
  31. end
  32. function CheckProgress(Quest, QuestGiver, Player)
  33. 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
  34. UpdateQuestTaskGroupDescription(Quest, 1, "I harvested some crafting supplies.")
  35. AddStep8(Quest, QuestGiver, Player)
  36. end
  37. end
  38. function AddStep8(Quest, QuestGiver, Player)
  39. SetCompleteFlag(Quest)
  40. 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))
  41. AddQuestStepCompleteAction(Quest, 8, "CompleteQuest")
  42. say(QuestGiver,GetName(QuestGiver))
  43. end
  44. function Root(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 2, "I have gathered some roots.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function Lumber(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 1, "I have harvested some elm lumber.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function TinCluster(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 3, "I have mined some tin clusters.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function LeadCluster(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 4, "I harvested some lead clusters.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function Sunfish(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 5, "I have harvested some sunfish.")
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. function Jumjum(Quest, QuestGiver, Player)
  65. UpdateQuestStepDescription(Quest, 6, "I have gathered some jumjum.")
  66. CheckProgress(Quest, QuestGiver, Player)
  67. end
  68. function RawhidePelt(Quest, QuestGiver, Player)
  69. UpdateQuestStepDescription(Quest, 7, "I have trapped a number of pelts.")
  70. CheckProgress(Quest, QuestGiver, Player)
  71. end
  72. function CompleteQuest(Quest, QuestGiver, Player)
  73. GiveQuestReward(Quest, Player)
  74. end
  75. function Accepted(Quest, QuestGiver, Player)
  76. if not HasItem(Player, 20747, 1) then
  77. SummonItem(Player, 20747)
  78. end
  79. --if GetName(QuestGiver) == "Glin Hammerhelm" then
  80. conversation = CreateConversation()
  81. FaceTarget(QuestGiver, Player)
  82. Dialog.New(QuestGiver,Player)
  83. Dialog.AddDialog("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.")
  84. Dialog.AddOption("I'll get right on it.")
  85. Dialog.Start()
  86. -- end
  87. end
  88. function Declined(Quest, QuestGiver, Player)
  89. end
  90. function Deleted(Quest, QuestGiver, Player)
  91. end
  92. function Reload(Quest, QuestGiver, Player, Step)
  93. if QuestStepIsComplete(Player, HarvestTutorial, 1) then
  94. Lumber(Quest, QuestGiver, Player)
  95. end
  96. if QuestStepIsComplete(Player, HarvestTutorial, 2) then
  97. Root(Quest, QuestGiver, Player)
  98. end
  99. if QuestStepIsComplete(Player, HarvestTutorial, 3) then
  100. TinCluster(Quest, QuestGiver, Player)
  101. end
  102. if QuestStepIsComplete(Player, HarvestTutorial, 4) then
  103. LeadCluster(Quest, QuestGiver, Player)
  104. end
  105. if QuestStepIsComplete(Player, HarvestTutorial, 5) then
  106. Sunfish(Quest, QuestGiver, Player)
  107. end
  108. if QuestStepIsComplete(Player, HarvestTutorial, 6) then
  109. Jumjum(Quest, QuestGiver, Player)
  110. end
  111. if QuestStepIsComplete(Player, HarvestTutorial, 7) then
  112. RawhidePelt(Quest, QuestGiver, Player)
  113. end
  114. end