in_the_drink.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --[[
  2. Script Name : Quests/Graystone/in_the_drink.lua
  3. Script Purpose : Handles the quest, "In the Drink"
  4. Script Author : Scatman
  5. Script Date : 2009.09.27
  6. Zone : Graystone Yard
  7. Quest Giver: Shipping Coordinator
  8. Preceded by: Late Shipment (late_shipment.lua)
  9. Followed by: Visiting a Friend (visiting_a_friend.lua)
  10. --]]
  11. -- Quest ID's
  12. local IN_THE_DRINK = 291
  13. -- Item ID's
  14. local LOCATION_BUOYS = 9109
  15. function Init(Quest)
  16. AddQuestStep(Quest, 1, "I need to attatch a location buoy to the first crate lost in the water", 1, 100, "I need to attatch a location buoy to each of the three lost boxes in the water.", 0)
  17. AddQuestStep(Quest, 2, "I need to attatch a location buoy to the second crate lost in the water", 1, 100, "I need to attatch a location buoy to each of the three lost boxes in the water.", 0)
  18. AddQuestStep(Quest, 3, "I need to attatch a location buoy to the third crate lost in the water", 1, 100, "I need to attatch a location buoy to each of the three lost boxes in the water.", 0)
  19. AddQuestStepCompleteAction(Quest, 1, "step1_complete_buoy1Attatched")
  20. AddQuestStepCompleteAction(Quest, 2, "step2_complete_buoy2Attatched")
  21. AddQuestStepCompleteAction(Quest, 3, "step3_complete_buoy3Attatched")
  22. end
  23. function Accepted(Quest, QuestGiver, Player)
  24. FaceTarget(QuestGiver, Player)
  25. conversation = CreateConversation()
  26. -- Location Buoys
  27. if not HasItem(Player, LOCATION_BUOYS, 1) then
  28. SummonItem(Player, LOCATION_BUOYS, 1)
  29. end
  30. AddConversationOption(conversation, "Ok.")
  31. StartConversation(conversation, QuestGiver, Player, "Come back as soon as you've connected the last of them.")
  32. end
  33. function Declined(Quest, QuestGiver, Player)
  34. end
  35. function step1_complete_buoy1Attatched(Quest, QuestGiver, Player)
  36. UpdateQuestStepDescription(Quest, 1, "I have attached a location buoy to the first crate.")
  37. if QuestIsComplete(Player, IN_THE_DRINK) then
  38. all_buoys_placed(Quest, QuestGiver, Player)
  39. end
  40. end
  41. function step2_complete_buoy2Attatched(Quest, QuestGiver, Player)
  42. UpdateQuestStepDescription(Quest, 2, "I have attached a location buoy to the second crate.")
  43. if QuestIsComplete(Player, IN_THE_DRINK) then
  44. all_buoys_placed(Quest, QuestGiver, Player)
  45. end
  46. end
  47. function step3_complete_buoy3Attatched(Quest, QuestGiver, Player)
  48. UpdateQuestStepDescription(Quest, 3, "I have attached a location buoy to the third crate.")
  49. if QuestIsComplete(Player, IN_THE_DRINK) then
  50. all_buoys_placed(Quest, QuestGiver, Player)
  51. end
  52. end
  53. function all_buoys_placed(Quest, QuestGiver, Player)
  54. UpdateQuestTaskGroupDescription(Quest, 1, "I have attatched a location buoy to each of the lost boxes.")
  55. -- Location Buoys
  56. while HasItem(Player, LOCATION_BUOYS) do
  57. RemoveItem(Player, LOCATION_BUOYS)
  58. end
  59. AddQuestStepChat(Quest, 4, "I need to tell the Shipping Coordinator that everything is hooked up.", 1, "I have recovered Burk's package, along with other portions of the missing shipment, from the water.", 0, 2350004)
  60. AddQuestStepCompleteAction(Quest, 4, "step4_complete_talkedToCoordinator")
  61. end
  62. function step4_complete_talkedToCoordinator(Quest, QuestGiver, Player)
  63. UpdateQuestStepDescription(Quest, 4, "I have spoken to the Shipping Coordinator.")
  64. AddQuestStepChat(Quest, 5, "I need to give Burk his package.", 1, "I have recovered Burk's package, along with other portions of the missing shipment, from the water.", 0, 2350007)
  65. AddQuestStepCompleteAction(Quest, 5, "quest_complete")
  66. end
  67. function quest_complete(Quest, QuestGiver, Player)
  68. UpdateQuestStepDescription(Quest, 5, "I have given Burk his package.")
  69. UpdateQuestTaskGroupDescription(Quest, 2, "I have given Burk his package.")
  70. UpdateQuestDescription(Quest, "I helped the Shipping Coordinator take care of the sunk cargo. I also found Burk's shipment and got it to him.")
  71. GiveQuestReward(Quest, Player)
  72. end
  73. function Reload(Quest, QuestGiver, Player, Step)
  74. if Step == 1 then
  75. step1_complete_buoy1Attatched(Quest, QuestGiver, Player)
  76. elseif Step == 2 then
  77. step2_complete_buoy2Attatched(Quest, QuestGiver, Player)
  78. elseif Step == 3 then
  79. step3_complete_buoy3Attatched(Quest, QuestGiver, Player)
  80. elseif Step == 4 then
  81. step4_complete_talkedToCoordinator(Quest, QuestGiver, Player)
  82. end
  83. end