CaptainSays.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. --[[
  2. Script Name : Quests/ButcherblockMountains/CaptainSays
  3. Script Purpose : Handles the quest, "Captain Says!"
  4. Script Author : jakejp
  5. Script Date : 6/2/2018
  6. Script Notes :
  7. Zone : Butcherblock Mountains
  8. Quest Giver : Captain Stonnacky
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. local CaptainSays = 267
  13. function Accepted(Quest, QuestGiver, Player)
  14. FaceTarget(NPC, Player)
  15. conversation = CreateConversation()
  16. AddConversationOption(conversation, "Alright, next?", "dlg_4_4")
  17. StartConversation(conversation, QuestGiver, Player, "Go seek out me crew members. First I want ye ta tell Bimine Bowchaser to flemish down the boat falls an' be sure all the lines are coiled correctly!")
  18. end
  19. function Declined(Quest, QuestGiver, Player)
  20. -- Add dialog here for when the quest is declined
  21. end
  22. function Init(Quest)
  23. AddQuestStepChat(Quest, 1, "I need to deliver orders to Bimini Bowchaser.", 1, "I need to speak with several members of Captain Stonnacky's crew.", 11, 1080197)
  24. AddQuestStepChat(Quest, 2, "I need to deliver orders to Mizzen Staysail.", 1, "I need to speak with several members of Captain Stonnacky's crew.", 11, 1081057)
  25. AddQuestStepChat(Quest, 3, "I need to deliver orders to Tally Topgallant.", 1, "I need to speak with several members of Captain Stonnacky's crew.", 11, 1080048)
  26. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  27. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  28. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  29. end
  30. function CheckProgress(Quest, QuestGiver, Player)
  31. if QuestStepIsComplete(Player, CaptainSays, 1) and QuestStepIsComplete(Player, CaptainSays, 2) and QuestStepIsComplete(Player, CaptainSays, 3) then
  32. HandInQuest(Quest, QuestGiver, Player)
  33. end
  34. end
  35. function Step1Complete(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 1, "I have delivered the Captain's orders to Bimini Bowchaser.")
  37. CheckProgress(Quest, QuestGiver, Player)
  38. end
  39. function Step2Complete(Quest, QuestGiver, Player)
  40. UpdateQuestStepDescription(Quest, 2, "I have delivered orders to Mizzen Staysail.")
  41. CheckProgress(Quest, QuestGiver, Player)
  42. end
  43. function Step3Complete(Quest, QuestGiver, Player)
  44. UpdateQuestStepDescription(Quest, 3, "I have delivered orders to Tally Topgallant.")
  45. CheckProgress(Quest, QuestGiver, Player)
  46. end
  47. function HandInQuest(Quest, QuestGiver, Player)
  48. UpdateQuestTaskGroupDescription(Quest, 1, "I have spoken with Captain Stonnacky's crew.")
  49. AddQuestStepChat(Quest, 4, "I need to speak with Captain Stonnacky.", 1, "I need to tell the captain that I've given his crew their orders.", 11, 1081077)
  50. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  51. end
  52. function QuestComplete(Quest, QuestGiver, Player)
  53. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  54. UpdateQuestStepDescription(Quest, 4, "I have spoken with Captain Stonnacky.")
  55. UpdateQuestTaskGroupDescription(Quest, 2, "I spoke with Captain Stonnacky.")
  56. UpdateQuestDescription(Quest, "I successfully delivered the orders to each of the respective crew members. The ship will soon be ready and the crew can pursue the dreaded pirate, Blackguard! I think Captain Stonnacky still believes that I am Bosun Oxeye.")
  57. GiveQuestReward(Quest, Player)
  58. end
  59. function Reload(Quest, QuestGiver, Player, Step)
  60. if Step == 1 then
  61. Step1Complete(Quest, QuestGiver, Player)
  62. elseif Step == 2 then
  63. Step2Complete(Quest, QuestGiver, Player)
  64. elseif Step == 3 then
  65. Step3Complete(Quest, QuestGiver, Player)
  66. elseif Step == 4 then
  67. QuestComplete(Quest, QuestGiver, Player)
  68. end
  69. end