working_the_down_below.lua 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. function Init(Quest)
  12. local RandomChoice = MakeRandomInt(1, 3)
  13. SetQuestFeatherColor(Quest, 3)
  14. SetQuestRepeatable(Quest)
  15. if RandomChoice == 1 then
  16. 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, 1990032)
  17. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  18. 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, 1990038)
  19. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  20. 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, 1990036)
  21. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  22. elseif RandomChoice == 2 then
  23. 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, 1990037)
  24. AddQuestStepCompleteAction(Quest, 1, "Step1_1Complete")
  25. 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, 1990039)
  26. AddQuestStepCompleteAction(Quest, 2, "Step1_2Complete")
  27. 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, 1990039)
  28. AddQuestStepCompleteAction(Quest, 3, "Step1_3Complete")
  29. elseif RandomChoice == 3 then
  30. 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, 1990039)
  31. AddQuestStepCompleteAction(Quest, 1, "Step3_1Complete")
  32. 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, 1990001)
  33. AddQuestStepCompleteAction(Quest, 2, "Step3_2Complete")
  34. 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)
  35. AddQuestStepCompleteAction(Quest, 3, "Step3_3Complete")
  36. end
  37. end
  38. function Accepted(Quest, QuestGiver, Player)
  39. FaceTarget(QuestGiver, Player)
  40. local conversation = CreateConversation()
  41. PlayFlavor(NPC, "voiceover/english/merchant_adair_barnes/qey_catacomb01/merchant_barnes/merchant_barnes003.mp3", "", "", 800334803, 2767782322, Spawn)
  42. AddConversationOption(conversation, "Got it.")
  43. StartConversation(conversation, QuestGiver, Player, "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?")
  44. end
  45. function Declined(Quest, QuestGiver, Player)
  46. -- Add dialog here for when the quest is declined
  47. end
  48. function Deleted(Quest, QuestGiver, Player)
  49. -- Remove any quest specific items here when the quest is deleted
  50. end
  51. function Step1Complete(Quest, QuestGiver, Player)
  52. UpdateQuestStepDescription(Quest, 1, "I've got four forgotten soul rib cages.")
  53. Progress(Quest, QuestGiver, Player)
  54. end
  55. function Step2Complete(Quest, QuestGiver, Player)
  56. UpdateQuestStepDescription(Quest, 2, "I've got tortured soul rib cages.")
  57. Progress(Quest, QuestGiver, Player)
  58. end
  59. function Step3Complete(Quest, QuestGiver, Player)
  60. UpdateQuestStepDescription(Quest, 3, "I've got four venomous watcher fangs.")
  61. Progress(Quest, QuestGiver, Player)
  62. end
  63. function Step1_1Complete(Quest, QuestGiver, Player)
  64. UpdateQuestStepDescription(Quest, 1, "I've got four venomous keeper fangs.")
  65. Progress(Quest, QuestGiver, Player)
  66. end
  67. function Step1_2Complete(Quest, QuestGiver, Player)
  68. UpdateQuestStepDescription(Quest, 2, "I've got four frenzied watcher fangs.")
  69. Progress(Quest, QuestGiver, Player)
  70. end
  71. function Step1_3Complete(Quest, QuestGiver, Player)
  72. UpdateQuestStepDescription(Quest, 3, "I've got five vials of venom.")
  73. Progress(Quest, QuestGiver, Player)
  74. end
  75. function Step3_1Complete(Quest, QuestGiver, Player)
  76. UpdateQuestStepDescription(Quest, 1, "I've got five vials of venom.")
  77. Progress(Quest, QuestGiver, Player)
  78. end
  79. function Step3_2Complete(Quest, QuestGiver, Player)
  80. UpdateQuestStepDescription(Quest, 2, "I've got five vials of venom from rabid shrillers.")
  81. Progress(Quest, QuestGiver, Player)
  82. end
  83. function Step3_3Complete(Quest, QuestGiver, Player)
  84. UpdateQuestStepDescription(Quest, 3, "I've got five vials of venom from putrid vermin.")
  85. Progress(Quest, QuestGiver, Player)
  86. end
  87. function Progress(Quest, QuestGiver, Player)
  88. if QuestStepIsComplete(Player, 5365, 1) and QuestStepIsComplete(Player, 5365, 2) and QuestStepIsComplete(Player, 5365, 3) then
  89. 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.")
  90. 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, 1990011)
  91. AddQuestStepCompleteAction(Quest, 4, "QuestComplete")
  92. end
  93. end
  94. function QuestComplete(Quest, QuestGiver, Player)
  95. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  96. UpdateQuestStepDescription(Quest, 4, "I've spoken with merchant Barnes.")
  97. UpdateQuestTaskGroupDescription(Quest, 2, "I've spoken with and given merchant Barnes the items.")
  98. 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.")
  99. GiveQuestReward(Quest, Player)
  100. end
  101. function Reload(Quest, QuestGiver, Player, Step)
  102. local RandomChoice = MakeRandomInt(1, 3)
  103. if Step == 1 then
  104. if RandomChoice == 1 then
  105. Step1Complete(Quest, QuestGiver, Player)
  106. elseif RandomChoice == 2 then
  107. Step1_1Complete(Quest, QuestGiver, Player)
  108. elseif RandomChoice == 3 then
  109. Step3_1Complete(Quest, QuestGiver, Player)
  110. end
  111. elseif Step == 2 then
  112. if RandomChoice == 1 then
  113. Step2Complete(Quest, QuestGiver, Player)
  114. elseif RandomChoice == 2 then
  115. Step1_2Complete(Quest, QuestGiver, Player)
  116. elseif RandomChoice == 3 then
  117. Step3_2Complete(Quest, QuestGiver, Player)
  118. end
  119. elseif Step == 3 then
  120. if RandomChoice == 1 then
  121. Step3Complete(Quest, QuestGiver, Player)
  122. elseif RandomChoice == 2 then
  123. Step1_3Complete(Quest, QuestGiver, Player)
  124. elseif RandomChoice == 3 then
  125. Step3_3Complete(Quest, QuestGiver, Player)
  126. end
  127. elseif Step == 4 then
  128. QuestComplete(Quest, QuestGiver, Player)
  129. end
  130. end