9
3

crate_and_barrel.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. --[[
  2. Script Name : Quests/Nettleville/crate_and_barrel.lua
  3. Script Purpose : Handles the quest, "Crate and Barrel"
  4. Script Author : Scatman
  5. Script Date : 2008.09.28
  6. Zone : Nettleville
  7. Quest Giver: Johfrit Gythell
  8. Preceded by: Looking for Work is Hard Work (looking_for_work_is_hard_work.lua)
  9. Followed by: A Budding Hunter (a_budding_hunter.lua)
  10. --]]
  11. -- Item ID's
  12. local WATERLOGGED_CRATE = 15346
  13. local WATERPROOF_BARREL = 15348
  14. function Init(Quest)
  15. AddQuestStepHarvest(Quest, 1, "Get the crate that fell into the waterways at the Mariner's Bell", 1, 100, "Johfrit has asked me to pick up some items that are underwater at the Mariner's Bell.", 655, WATERLOGGED_CRATE)
  16. AddQuestStepCompleteAction(Quest, 1, "Step1_complete_ObtainedCrate")
  17. end
  18. function Accepted(Quest, QuestGiver, Player)
  19. FaceTarget(QuestGiver, Player)
  20. conversation = CreateConversation()
  21. PlayFlavor(QuestGiver, "voiceover/english/tutorial_revamp/johfrit_gythell/qey_village01/johfritgythell016.mp3", "", "", 3784629349, 1480348336, Player)
  22. AddConversationOption(conversation, "I do need the work. I'll be back with them soon!")
  23. StartConversation(conversation, QuestGiver, Player, "It is the only task I have at hand. Retrieve both items and you will get paid for your work.")
  24. end
  25. function Declined(Quest, QuestGiver, Player)
  26. end
  27. function Step1_complete_ObtainedCrate(Quest, QuestGiver, Player)
  28. UpdateQuestStepDescription(Quest, 1, "I have obtained the crate.")
  29. AddQuestStepHarvest(Quest, 2, "Get the barrel that is also underwater at the Mariner's Bell.", 1, 100, "Johfrit has asked me to pick up some items that are underwater at the Mariner's Bell.", 2285, WATERPROOF_BARREL)
  30. AddQuestStepCompleteAction(Quest, 2, "Step2_Complete_ObtainedBarrel")
  31. end
  32. function Step2_Complete_ObtainedBarrel(Quest, QuestGiver, Player)
  33. UpdateQuestStepDescription(Quest, 2, "I have obtained the barrel.")
  34. AddQuestStepChat(Quest, 3, "Return to Johfrit Gythell near The Golden Scabbard armory.", 1, "Johfrit has asked me to pick up some items that are underwater at the Mariner's Bell.", 0, 2330033)
  35. AddQuestStepCompleteAction(Quest, 3, "Step3_Complete_TalkedToJohfrit")
  36. end
  37. function Step3_Complete_TalkedToJohfrit(Quest, QuestGiver, Player)
  38. UpdateQuestStepDescription(Quest, 3, "I returned to Johfrit with both items.")
  39. UpdateQuestTaskGroupDescription(Quest, 1, "I obtained the stinky crate and barrel for Johfrit.")
  40. AddQuestStepChat(Quest, 4, "I am to deliver the crate to Amazu Kharliko here, in town.", 1, "I am to deliver the barrel and crate for some coin.", 397, 2330015)
  41. AddQuestStepCompleteAction(Quest, 4, "Step4_Complete_TalkedToAmazu")
  42. end
  43. function Step4_Complete_TalkedToAmazu(Quest, QuestGiver, Player)
  44. UpdateQuestStepDescription(Quest, 4, "I delivered the fish-smelling crate to Amazu.")
  45. -- a waterlogged crate
  46. while HasItem(Player, WATERLOGGED_CRATE, 1) do
  47. RemoveItem(Player, WATERLOGGED_CRATE)
  48. end
  49. AddQuestStepChat(Quest, 5, "I should take Luadine Shardalow her barrel. She is in the bank.", 1, "I am to deliver the barrel and crate for some coin.", 397, 2330013)
  50. AddQuestStepCompleteAction(Quest, 5, "Step5_Complete_TalkedToLuadine")
  51. end
  52. function Step5_Complete_TalkedToLuadine(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 5, "I delivered the barrel to Laudine.")
  54. -- a waterproof barrel
  55. while HasItem(Player, WATERPROOF_BARREL, 1) do
  56. RemoveItem(Player, WATERPROOF_BARREL)
  57. end
  58. AddQuestStepChat(Quest, 6, "Return to Johfrit Gythell with the money from Amazu and Laudine.", 1, "I am to deliver the barrel and crate for some coin.", 0, 2330033)
  59. AddQuestStepCompleteAction(Quest, 6, "Quest_Complete")
  60. end
  61. function Quest_Complete(Quest, QuestGiver, Player)
  62. UpdateQuestDescription(Quest, "Johfrit paid me for the work that I was able to do for him.")
  63. GiveQuestReward(Quest, Player)
  64. end
  65. function Reload(Quest, QuestGiver, Player, Step)
  66. if Step == 1 then
  67. Step1_complete_ObtainedCrate(Quest, QuestGiver, Player)
  68. elseif Step == 2 then
  69. Step2_Complete_ObtainedBarrel(Quest, QuestGiver, Player)
  70. elseif Step == 3 then
  71. Step3_Complete_TalkedToJohfrit(Quest, QuestGiver, Player)
  72. elseif Step == 4 then
  73. Step4_Complete_TalkedToAmazu(Quest, QuestGiver, Player)
  74. elseif Step == 5 then
  75. Step5_Complete_TalkedToLuadine(Quest, QuestGiver, Player)
  76. end
  77. end