AHuntersTool.lua 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. --[[
  2. Script Name : Quests/Commonlands/AHuntersTool.lua
  3. Script Purpose : Handles the quest, "A Hunter's Tool"
  4. Script Author : premierio015
  5. Script Date : 11.01.2021
  6. Script Notes : Auto generated with QuestParser.
  7. Zone : Commonlands
  8. Quest Giver :
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepHarvest(Quest, 1, "I need to gather maple from wind felled trees", 5, 100, "J.P. Feterman has asked me to gather some components for him to fix his favorite bow.", 824, 12101)
  14. AddQuestStepHarvest(Quest, 2, "I need to gather tuber strands from desert roots", 3, 100, "J.P. Feterman has asked me to gather some components for him to fix his favorite bow.", 194, 14701)
  15. AddQuestStepKill(Quest, 3, "I need compound bow cams from dervish cutthroats", 2, 100, "J.P. Feterman has asked me to gather some components for him to fix his favorite bow.", 2279, 330092, 330104)
  16. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  17. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  18. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  19. end
  20. function Accepted(Quest, QuestGiver, Player)
  21. FaceTarget(QuestGiver, Player)
  22. conversation = CreateConversation()
  23. AddConversationOption(conversation, "Sure you were.")
  24. StartConversation(conversation, QuestGiver, Player, "Ah, I can imagine using it even now. Greatest ever, I was.")
  25. end
  26. function Declined(Quest, QuestGiver, Player)
  27. -- Add dialog here for when the quest is declined
  28. end
  29. function Deleted(Quest, QuestGiver, Player)
  30. -- Remove any quest specific items here when the quest is deleted
  31. end
  32. function Step1Complete(Quest, QuestGiver, Player)
  33. UpdateQuestStepDescription(Quest, 1, "I have gathered maple for J.P. Feterman.")
  34. UpdateQuestTaskGroupDescription(Quest, 1, "I have gathered maple for J.P. Feterman.")
  35. CheckProgress(Quest, QuestGiver, Player)
  36. end
  37. function Step2Complete(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 2, "I have J.P. Feterman's tuber strands.")
  39. UpdateQuestTaskGroupDescription(Quest, 2, "I have J.P. Feterman's tuber strands.")
  40. CheckProgress(Quest, QuestGiver, Player)
  41. end
  42. function Step3Complete(Quest, QuestGiver, Player)
  43. UpdateQuestStepDescription(Quest, 3, "I have the bow cams for J.P. Feterman.")
  44. CheckProgress(Quest, QuestGiver, Player)
  45. end
  46. function CheckProgress(Quest, QuestGiver, Player)
  47. if QuestStepIsComplete(Player, 418, 1) and QuestStepIsComplete(Player, 418, 2) and QuestStepIsComplete(Player, 418, 3) then
  48. UpdateQuestTaskGroupDescription(Quest, 1, "I have gathered the components and should return to J.P. Feterman.")
  49. AddQuestStepChat(Quest, 4, "I need to return to J.P. Feterman", 1, "I have J.P. Feterman's bow components and should speak with him again.", 9, 330261)
  50. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  51. end
  52. end
  53. function QuestComplete(Quest, QuestGiver, Player)
  54. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  55. UpdateQuestStepDescription(Quest, 4, "I have given J.P. Feterman his bow.")
  56. UpdateQuestTaskGroupDescription(Quest, 2, "I have spoken with J.P. Feterman.")
  57. UpdateQuestDescription(Quest, "I gathered the components that J.P. Feterman needed to reconstruct his bow.")
  58. GiveQuestReward(Quest, Player)
  59. end
  60. function Reload(Quest, QuestGiver, Player, Step)
  61. if Step == 1 then
  62. Step1Complete(Quest, QuestGiver, Player)
  63. elseif Step == 2 then
  64. Step2Complete(Quest, QuestGiver, Player)
  65. elseif Step == 3 then
  66. Step3Complete(Quest, QuestGiver, Player)
  67. elseif Step == 4 then
  68. QuestComplete(Quest, QuestGiver, Player)
  69. end
  70. end