FarSeasDirectRequisitionPBG0295.lua 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. AddQuestStepChat(Quest, 3, "I must speak with Tanaira", 1, "I must seek out Tanaira here in the Peat Bog.", 11, TANAIRA_ID)
  48. AddQuestStepCompleteAction(Quest, 3, "QuestComplete")
  49. end
  50. end
  51. function Step1Complete(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 1, "I have collected enough toad legs.")
  53. CheckProgress(Quest, QuestGiver, Player)
  54. end
  55. function Step2Complete(Quest, QuestGiver, Player)
  56. UpdateQuestStepDescription(Quest, 2, "I have slain a silt sucker.")
  57. CheckProgress(Quest, QuestGiver, Player)
  58. end
  59. function QuestComplete(Quest, QuestGiver, Player)
  60. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  61. UpdateQuestStepDescription(Quest, 3, "I spoke to Tanaira.")
  62. UpdateQuestTaskGroupDescription(Quest, 2, "I have delivered the goods to Tanaira.")
  63. 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.")
  64. GiveQuestReward(Quest, Player)
  65. end
  66. function Reload(Quest, QuestGiver, Player, Step)
  67. if Step == 1 then
  68. Step1Complete(Quest, QuestGiver, Player)
  69. elseif Step == 2 then
  70. Step2Complete(Quest, QuestGiver, Player)
  71. elseif Step == 3 then
  72. QuestComplete(Quest, QuestGiver, Player)
  73. end
  74. end
  75. function Accepted(Quest, QuestGiver, Player)
  76. -- Add dialog here for when the quest is accepted
  77. end
  78. function Declined(Quest, QuestGiver, Player)
  79. -- Add dialog here for when the quest is declined
  80. end