taking_the_bait.lua 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. --[[
  2. Script Name : taking_the_bait.lua
  3. Script Purpose : Handles the quest, "Taking the Bait"
  4. Script Author : Dorbin
  5. Script Date : 5/31/2022
  6. Script Notes :
  7. Zone : Qeynos Harbor
  8. Quest Giver : Sean Wellfayer
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. function Init(Quest)
  13. AddQuestStepKill(Quest, 1, "I must gather five bog faerie wings for Sean.", 5, 80, "I need to head over to the Peat Bog and get five pieces of bog slug meat and five bog faerie wings.", 110, 8290002,8290003,8290052,8290008,8290009,8290010,8290013,8290014,8290011,8290012,8290017,8290018,8290019,8290053,8290044)
  14. AddQuestStepKill(Quest, 2, "I must gather five bog slug meat for Sean.", 5, 80, "I need to head over to the Peat Bog and get five pieces of bog slug meat and five bog faerie wings.", 133, 8290005,8290006,8290031,8290027)
  15. UpdateQuestZone(Quest, "The Peat Bog")
  16. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  17. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  18. end
  19. function Accepted(Quest, QuestGiver, Player)
  20. FaceTarget(QuestGiver, Player)
  21. conversation = CreateConversation()
  22. PlayFlavor(QuestGiver, "", "", "happy", 0, 0, Player)
  23. AddConversationOption(conversation, "I'll be back when I've gathered your bait.")
  24. StartConversation(conversation, QuestGiver, Player, "Great! What I really need for bait is a family secret from the Peat Bog. The fish here love bog fairy wings and slug meat. If you could go gather some, I would be set till the next sunset! I'll be here trying to catch my dinner till you get back, but please hurry!")
  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've gathered the faerie wings Sean needed.")
  34. CheckProgress(Quest, QuestGiver, Player)
  35. end
  36. function Step2Complete(Quest, QuestGiver, Player)
  37. UpdateQuestStepDescription(Quest, 2, "I've gathered the slug meat Sean needed.")
  38. CheckProgress(Quest, QuestGiver, Player)
  39. end
  40. function CheckProgress(Quest, QuestGiver, Player)
  41. if QuestStepIsComplete(Player, 5571, 1) and QuestStepIsComplete(Player, 5571, 2) then
  42. UpdateQuestStepDescription(Quest, "I've gathered the bait supplies Sean needs.")
  43. UpdateQuestTaskGroupDescription(Quest, 2, "I've collected the five pieces of slug meat and five bog faerie wings.")
  44. UpdateQuestZone(Quest, "Qeynos Harbor")
  45. AddQuestStepChat(Quest, 3, "I need to return to Sean Wellfayer on the docks of Qeynos Harbor.", 1, "Sean Wellfayer Should be pleased with this bait once I get it back to him at the harbor.", 11, 2210065)
  46. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  47. end
  48. end
  49. function QuestComplete(Quest, QuestGiver, Player)
  50. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  51. UpdateQuestStepDescription(Quest, 3, "I've given Sean the bait he asked for.")
  52. UpdateQuestTaskGroupDescription(Quest,3, "Sean happily accepted the bait since it saved him from leaving his favorite fishing spot.")
  53. UpdateQuestDescription(Quest, "I got everything Sean needed and he was quite pleased. The pay was decent and perhaps I'll help him get some more bait in the future.")
  54. GiveQuestReward(Quest, Player)
  55. end
  56. function Reload(Quest, QuestGiver, Player, Step)
  57. if Step == 1 then
  58. Step1Complete(Quest, QuestGiver, Player)
  59. elseif Step == 1 then
  60. Step2Complete(Quest, QuestGiver, Player)
  61. elseif Step == 3 then
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. end