if_i_had_a_hammer.lua 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. --[[
  2. Script Name : Quests/FrostfangSea/if_i_had_a_hammer.lua
  3. Script Purpose : the quest If I Had A Hammer
  4. Script Author : theFoof
  5. Script Date : 2013.5.16
  6. modiifed by :ememjr
  7. Modified Date : 8/21/2022
  8. Modified Notes : add dialog module in accepted section
  9. Zone : Frostfang Sea
  10. Quest Giver : Bull the Craft
  11. Preceded by : Tutorial: Learning to Harvest
  12. Followed by :
  13. --]]
  14. require "SpawnScripts/Generic/DialogModule"
  15. -- reward is "Handbook of the Ravens of the North", 722 tradeskill xp, +250 Ravens of the North faction and 6-8 silver
  16. function Init(Quest)
  17. SetQuestFeatherColor(Quest, 2)
  18. AddQuestStepObtainItem(Quest, 1, "I need to get the recipe from the table.", 1, 100, "Bull the mender has instructed me to get what I'll need for crafting. There is a recipe on the table, sack of coal on the ground, and I'll need some of the tin and lead clusters I harvested earlier.", 0, 32122)
  19. AddQuestStepCompleteAction(Quest, 1, "GotRecipe")
  20. end
  21. function GotRecipe(Quest, QuestGiver, Player)
  22. UpdateQuestStepDescription(Quest, 1, "I picked up the recipe, and should examine it in my inventory to scribe it.")
  23. AddQuestStepObtainItem(Quest, 2, "I need to pick up some coal from the sack.", 1, 100, "Bull the mender has instructed me to get what I'll need for crafting. There is a recipe on the table, sack of coal on the ground, and I'll need some of the tin and lead clusters I harvested earlier.", 0, 5771)
  24. AddQuestStepCompleteAction(Quest, 2, "GotCoal")
  25. end
  26. function GotCoal(Quest, QuestGiver, Player)
  27. UpdateQuestTaskGroupDescription(Quest, 1, "I obtained the supplies I will need.")
  28. AddQuestStepObtainItem(Quest, 3, "I should ensure I have a tin and lead cluster in my bags, then use the mender's anvil to craft.", 1, 100, "I should scribe the recipe book, and ensure I have a lead and tin cluster in my bags. Then click on the anvil in front of the mender to use it. Select the lucky wolf paw recipe and then click 'Create', then 'Begin'.", 0, 163306)
  29. AddQuestStepCompleteAction(Quest, 3, "CraftedPaw")
  30. end
  31. function CraftedPaw(Quest, QuestGiver, Player)
  32. UpdateQuestTaskGroupDescription(Quest, 2, "I created a Lucky Wolf Paw charm.")
  33. AddQuestStepChat(Quest, 4, "I should return to Bull once again.", 1, "Bull the mender is at the wrecked boat on Pilgrims' Landing. I should let him know that I made the lucky wolf paw charm.", 0, 4700009)
  34. AddQuestStepCompleteAction(Quest, 4, "TalkedBull")
  35. end
  36. function TalkedBull(Quest, QuestGiver, Player)
  37. UpdateQuestTaskGroupDescription(Quest, 3, "Bull has suggested that I speak to the tradeskill tutor once I reach Halas to learn more about crafting.")
  38. AddQuestStepChat(Quest, 5, "I should find the tradeskill tutor in the city to learn more about crafting.", 1, "Once I reach Halas, the tradeskill tutor can be found in the crafting area of Ravens' Roost, near the bank and housing.", 0, 4700220)
  39. AddQuestStepCompleteAction(Quest, 5, "CompleteQuest")
  40. end
  41. function CompleteQuest(Quest, QuestGiver, Player)
  42. GiveQuestReward(Quest, Player)
  43. end
  44. function Accepted(Quest, QuestGiver, Player)
  45. FaceTarget(QuestGiver, Player)
  46. Dialog.New(QuestGiver, Player)
  47. Dialog.AddDialog("Pick up a copy of my lucky charm recipe over thereside me, and scribe it into your recipe book. Then grab some coal from the sack. You'll also need one of the tin clusters and lead clusters that you harvested earlier, and make sure you have them with you in your bags.")
  48. Dialog.AddOption("I'll get those items now.")
  49. Dialog.Start()
  50. AddSpawnAccess(GetSpawn(Player, 4701805), Player)
  51. AddSpawnAccess(GetSpawn(Player, 4701804), Player)
  52. if HasItem(Player,32122)then
  53. SetStepComplete(Player, 12, 1)
  54. if HasItem(Player,5771) then
  55. SetStepComplete(Player, 12, 2)
  56. end
  57. end
  58. end
  59. function Declined(Quest, QuestGiver, Player)
  60. end
  61. function Deleted(Quest, QuestGiver, Player)
  62. end
  63. function Reload(Quest, QuestGiver, Player, Step)
  64. if Step == 1 then
  65. GotRecipe(Quest, QuestGiver, Player)
  66. elseif Step == 2 then
  67. GotCoal(Quest, QuestGiver, Player)
  68. elseif Step == 3 then
  69. CraftedPaw(Quest, QuestGiver, Player)
  70. elseif Step == 4 then
  71. TalkedBull(Quest, QuestGiver, Player)
  72. elseif Step == 5 then
  73. CompleteQuest(Quest, QuestGiver, Player)
  74. end
  75. end