working_the_down_below.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. --[[
  2. Script Name : Quests/TheDownBelow/working_the_down_below.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.09.27 06:09:27
  5. Script Purpose :
  6. Zone : TheDownBelow
  7. Quest Giver:
  8. Preceded by: None
  9. Followed by:
  10. --]]
  11. require "SpawnScripts/Generic/DialogModule"
  12. function Init(Quest)
  13. local RandomChoice = MakeRandomInt(1, 3)
  14. SetQuestFeatherColor(Quest, 3)
  15. SetQuestRepeatable(Quest)
  16. if RandomChoice == 1 then
  17. AddQuestStepKill(Quest, 1, "Get four forgotten soul rib cages.", 4, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 90, 8340029)
  18. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  19. AddQuestStepKill(Quest, 2, "Get four tortured soul rib cages.", 4, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 90, 8340048)
  20. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  21. AddQuestStepKill(Quest, 3, "Get four venomous watcher fangs.", 4, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 163, 8340051)
  22. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  23. elseif RandomChoice == 2 then
  24. AddQuestStepKill(Quest, 1, "Get four venomous keeper fangs.", 4, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 163, 8340050)
  25. AddQuestStepCompleteAction(Quest, 1, "Step1_1Complete")
  26. AddQuestStepKill(Quest, 2, "Get four frenzied watcher fangs.", 4, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 163, 8340030)
  27. AddQuestStepCompleteAction(Quest, 2, "Step1_2Complete")
  28. AddQuestStepKill(Quest, 3, "Get five vials of venom from frenzied watchers.", 5, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 178, 8340030)
  29. AddQuestStepCompleteAction(Quest, 3, "Step1_3Complete")
  30. elseif RandomChoice == 3 then
  31. AddQuestStepKill(Quest, 1, "Get five vials of venom from frenzied watchers.", 5, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 178, 8340030)
  32. AddQuestStepCompleteAction(Quest, 1, "Step3_1Complete")
  33. AddQuestStepKill(Quest, 2, "Get five vials of venom from rabid shrillers.", 5, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 178, 8340035)
  34. AddQuestStepCompleteAction(Quest, 2, "Step3_2Complete")
  35. AddQuestStepKill(Quest, 3, "Get five vials of venom from putrid vermin.", 5, 100, "I've agreed to help merchant Adair Barnes gather items she intends on selling to her buyers in the Down Below.", 178, 1990008, 1990010, 8340033)
  36. AddQuestStepCompleteAction(Quest, 3, "Step3_3Complete")
  37. end
  38. end
  39. function Accepted(Quest, QuestGiver, Player)
  40. FaceTarget(NPC, Spawn)
  41. Dialog.New(NPC, Spawn)
  42. Dialog.AddDialog("Good. Let me write down in your journal what I need you to get. Now hurry up, this stuff needs to stay fresh, got it?")
  43. Dialog.AddVoiceover("voiceover/english/merchant_adair_barnes/qey_catacomb01/merchant_barnes/merchant_barnes003.mp3", 800334803, 2767782322)
  44. Dialog.AddOption("Got it.")
  45. Dialog.Start()
  46. end
  47. function Declined(Quest, QuestGiver, Player)
  48. -- Add dialog here for when the quest is declined
  49. end
  50. function Deleted(Quest, QuestGiver, Player)
  51. -- Remove any quest specific items here when the quest is deleted
  52. end
  53. function Step1Complete(Quest, QuestGiver, Player)
  54. UpdateQuestStepDescription(Quest, 1, "I've got four forgotten soul rib cages.")
  55. Progress(Quest, QuestGiver, Player)
  56. end
  57. function Step2Complete(Quest, QuestGiver, Player)
  58. UpdateQuestStepDescription(Quest, 2, "I've got tortured soul rib cages.")
  59. Progress(Quest, QuestGiver, Player)
  60. end
  61. function Step3Complete(Quest, QuestGiver, Player)
  62. UpdateQuestStepDescription(Quest, 3, "I've got four venomous watcher fangs.")
  63. Progress(Quest, QuestGiver, Player)
  64. end
  65. function Step1_1Complete(Quest, QuestGiver, Player)
  66. UpdateQuestStepDescription(Quest, 1, "I've got four venomous keeper fangs.")
  67. Progress(Quest, QuestGiver, Player)
  68. end
  69. function Step1_2Complete(Quest, QuestGiver, Player)
  70. UpdateQuestStepDescription(Quest, 2, "I've got four frenzied watcher fangs.")
  71. Progress(Quest, QuestGiver, Player)
  72. end
  73. function Step1_3Complete(Quest, QuestGiver, Player)
  74. UpdateQuestStepDescription(Quest, 3, "I've got five vials of venom.")
  75. Progress(Quest, QuestGiver, Player)
  76. end
  77. function Step3_1Complete(Quest, QuestGiver, Player)
  78. UpdateQuestStepDescription(Quest, 1, "I've got five vials of venom.")
  79. Progress(Quest, QuestGiver, Player)
  80. end
  81. function Step3_2Complete(Quest, QuestGiver, Player)
  82. UpdateQuestStepDescription(Quest, 2, "I've got five vials of venom from rabid shrillers.")
  83. Progress(Quest, QuestGiver, Player)
  84. end
  85. function Step3_3Complete(Quest, QuestGiver, Player)
  86. UpdateQuestStepDescription(Quest, 3, "I've got five vials of venom from putrid vermin.")
  87. Progress(Quest, QuestGiver, Player)
  88. end
  89. function Progress(Quest, QuestGiver, Player)
  90. if QuestStepIsComplete(Player, 5365, 1) and QuestStepIsComplete(Player, 5365, 2) and QuestStepIsComplete(Player, 5365, 3) then
  91. UpdateQuestTaskGroupDescription(Quest, 2, "I've got all of the items merchant Barnes asked me to obtain. I should get them back to her as soon as possible.")
  92. AddQuestStepChat(Quest, 4, "I need to get this stuff to merchant Barnes.", 1, "I need to get these items back to merchant Barnes, here in the Down Below.", 11, 8340001)
  93. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  94. end
  95. end
  96. function QuestComplete(Quest, QuestGiver, Player)
  97. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  98. UpdateQuestStepDescription(Quest, 4, "I've spoken with merchant Barnes.")
  99. UpdateQuestTaskGroupDescription(Quest, 2, "I've spoken with and given merchant Barnes the items.")
  100. UpdateQuestDescription(Quest, "I've helped merchant Adair Barnes gather a bunch of items for her customers in the Down Below. If I'm going to be in the area for a while perhaps she would like some more help.")
  101. GiveQuestReward(Quest, Player)
  102. end
  103. function Reload(Quest, QuestGiver, Player, Step)
  104. local RandomChoice = MakeRandomInt(1, 3)
  105. if Step == 1 then
  106. if RandomChoice == 1 then
  107. Step1Complete(Quest, QuestGiver, Player)
  108. elseif RandomChoice == 2 then
  109. Step1_1Complete(Quest, QuestGiver, Player)
  110. elseif RandomChoice == 3 then
  111. Step3_1Complete(Quest, QuestGiver, Player)
  112. end
  113. elseif Step == 2 then
  114. if RandomChoice == 1 then
  115. Step2Complete(Quest, QuestGiver, Player)
  116. elseif RandomChoice == 2 then
  117. Step1_2Complete(Quest, QuestGiver, Player)
  118. elseif RandomChoice == 3 then
  119. Step3_2Complete(Quest, QuestGiver, Player)
  120. end
  121. elseif Step == 3 then
  122. if RandomChoice == 1 then
  123. Step3Complete(Quest, QuestGiver, Player)
  124. elseif RandomChoice == 2 then
  125. Step1_3Complete(Quest, QuestGiver, Player)
  126. elseif RandomChoice == 3 then
  127. Step3_3Complete(Quest, QuestGiver, Player)
  128. end
  129. elseif Step == 4 then
  130. QuestComplete(Quest, QuestGiver, Player)
  131. end
  132. end