9
3

FarSeasDirectRequisitionPBG0295.lua 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. --[[
  2. Script Name : FarSeasDirectRequisitionPBG0295.lua
  3. Script Purpose : Handles the quest, "Far Seas Direct Requisition PBG0295"
  4. Script Author : Shatou
  5. Script Date : 1/8/2020
  6. Script Notes :
  7. Zone : Peat Bog
  8. Quest Giver : FSDRPBG0295 Examine Item
  9. Preceded by : None
  10. Followed by : None
  11. --]]
  12. local FAR_SEAS_DR_PBG0295_QUEST_ID = 516
  13. local TANAIRA_ID = 2340040
  14. local MUCK_TOAD_ID = 8290024
  15. local SILT_SUCKER_ID = 8290029
  16. local MARINER_STITCHED_BRACERS_ID = 164053
  17. local MARINER_STITCHED_SHAWL_ID = 164058
  18. local MARINER_STITCHED_SLIPPERS_ID = 164059
  19. local MARINER_STITCHED_GLOVES_ID = 164055
  20. local MARINER_STITCHED_GOWN_ID = 164056
  21. local MARINER_STITCHED_LEGGINGS_ID = 164057
  22. function Init(Quest)
  23. local chance = math.random(1, 6)
  24. if chance == 1 then
  25. AddQuestRewardItem(Quest, MARINER_STITCHED_BRACERS_ID)
  26. elseif chance == 2 then
  27. AddQuestRewardItem(Quest, MARINER_STITCHED_SHAWL_ID)
  28. elseif chance == 3 then
  29. AddQuestRewardItem(Quest, MARINER_STITCHED_SLIPPERS_ID)
  30. elseif chance == 4 then
  31. AddQuestRewardItem(Quest, MARINER_STITCHED_GLOVES_ID)
  32. elseif chance == 5 then
  33. AddQuestRewardItem(Quest, MARINER_STITCHED_GOWN_ID)
  34. elseif chance == 6 then
  35. AddQuestRewardItem(Quest, MARINER_STITCHED_LEGGINGS_ID)
  36. end
  37. SetQuestFeatherColor(Quest, 3)
  38. SetQuestRepeatable(Quest)
  39. AddQuestStepKill(Quest, 1, "I must collect six pairs of toad legs", 6, 100, "I must hunt down the creatures in the Peat Bog to fill the requisition.", 139, MUCK_TOAD_ID)
  40. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  41. AddQuestStepKill(Quest, 2, "I must hunt down a silt sucker", 1, 100, "I must hunt down the creatures in the Peat Bog to fill the requisition.", 345, SILT_SUCKER_ID)
  42. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  43. end
  44. function CheckProgress(Quest, QuestGiver, Player)
  45. if QuestStepIsComplete(Player, FAR_SEAS_DR_PBG0295_QUEST_ID, 1) and QuestStepIsComplete(Player, FAR_SEAS_DR_PBG0295_QUEST_ID, 2) then
  46. UpdateQuestTaskGroupDescription(Quest, 1, "I have hunted down all the resources to fill the requisition.")
  47. UpdateQuestZone(Quest,"Starcrest")
  48. AddQuestStepChat(Quest, 3, "I must speak with Tanaira", 1, "I must seek out Tanaira here in Starcrest Commune.", 11, TANAIRA_ID)
  49. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  50. end
  51. end
  52. function Step1Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 1, "I have collected enough toad legs.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function Step2Complete(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 2, "I have slain a silt sucker.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function QuestComplete(Quest, QuestGiver, Player)
  61. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  62. UpdateQuestStepDescription(Quest, 3, "I spoke to Tanaira.")
  63. UpdateQuestTaskGroupDescription(Quest, 2, "I have delivered the goods to Tanaira.")
  64. UpdateQuestDescription(Quest, "I filled the Far Seas Requisition and delivered the goods to the client in the Peat Bog. I have been paid in full for this work, but the order was late.")
  65. GiveQuestReward(Quest, Player)
  66. if HasItem(Player,7081) then
  67. RemoveItem(Player,7081,1)
  68. end
  69. end
  70. function Reload(Quest, QuestGiver, Player, Step)
  71. if Step == 1 then
  72. Step1Complete(Quest, QuestGiver, Player)
  73. elseif Step == 2 then
  74. Step2Complete(Quest, QuestGiver, Player)
  75. elseif Step == 3 then
  76. QuestComplete(Quest, QuestGiver, Player)
  77. end
  78. end
  79. function Accepted(Quest, QuestGiver, Player)
  80. -- Add dialog here for when the quest is accepted
  81. end
  82. function Declined(Quest, QuestGiver, Player)
  83. -- Add dialog here for when the quest is declined
  84. end