cellar_cleanup.lua 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. --[[
  2. Script Name : Quests/Hallmark/cellar_cleanup.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.09.22 03:09:42
  5. Script Purpose :
  6. Zone : Hallmark
  7. Quest Giver: Assistant Dreak (3250167)
  8. Preceded by: None
  9. Followed by:
  10. --]]
  11. require "SpawnScripts/Generic/DialogModule"
  12. function Init(Quest)
  13. AddQuestStep(Quest, 1, "I need to move the table to a better location.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 568)
  14. AddQuestStep(Quest, 2, "I need to move the chair to a better location.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 560)
  15. AddQuestStep(Quest, 3, "I need to get rid of the burned barrel.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 915)
  16. AddQuestStep(Quest, 4, "I need to pick up the mirror and put it back on the wall.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 995)
  17. AddQuestStep(Quest, 5, "I need to find a better place for the bed.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 567)
  18. AddQuestStep(Quest, 6, "I need to clean up the crushed rock by harvesting it.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 1087)
  19. AddQuestStep(Quest, 7, "I need to clean up the fallen log by harvesting it.", 1, 100, "I need to straighten up the mess in Mizan's Cellar made by Dreak's mishap.", 197)
  20. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  21. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  22. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  23. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  24. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  25. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  26. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  27. UpdateQuestZone(Quest,"Mizan's Cellar")
  28. end
  29. function Accepted(Quest, QuestGiver, Player)
  30. FaceTarget(QuestGiver, Player)
  31. Dialog.New(QuestGiver, Player)
  32. Dialog.AddDialog("Wonderful! Here's a list of instructions on what needs to be done down there. Just go through the cellar door here, and you should find everything you need. Just come back and see me once you've got everything straightened out. Oh, and thanks again!")
  33. Dialog.AddVoiceover("voiceover/english/assistant_dreak/tutorial_island02/assistant_dreak004.mp3",246435936,3107615538)
  34. PlayFlavor(QuestGiver,"","","smile",0,0, Player)
  35. Dialog.AddOption("Very well then.")
  36. Dialog.Start()
  37. end
  38. function Declined(Quest, QuestGiver, Player)
  39. -- Add dialog here for when the quest is declined
  40. end
  41. function Deleted(Quest, QuestGiver, Player)
  42. -- Remove any quest specific items here when the quest is deleted
  43. end
  44. function Step1Complete(Quest, QuestGiver, Player)
  45. UpdateQuestStepDescription(Quest, 1, "I've found a better location to move the table to.")
  46. CheckProgress(Quest, QuestGiver, Player)
  47. end
  48. function Step2Complete(Quest, QuestGiver, Player)
  49. UpdateQuestStepDescription(Quest, 2, "I've moved the chair to a better location.")
  50. CheckProgress(Quest, QuestGiver, Player)
  51. end
  52. function Step3Complete(Quest, QuestGiver, Player)
  53. UpdateQuestStepDescription(Quest, 3, "I got rid of the burned barrel.")
  54. CheckProgress(Quest, QuestGiver, Player)
  55. end
  56. function Step4Complete(Quest, QuestGiver, Player)
  57. UpdateQuestStepDescription(Quest, 4, "I put the mirror back on the wall.")
  58. CheckProgress(Quest, QuestGiver, Player)
  59. end
  60. function Step5Complete(Quest, QuestGiver, Player)
  61. UpdateQuestStepDescription(Quest, 5, "I moved the bed to a better location")
  62. CheckProgress(Quest, QuestGiver, Player)
  63. end
  64. function Step6Complete(Quest, QuestGiver, Player)
  65. UpdateQuestStepDescription(Quest, 6, "I harvested the crushed rock.")
  66. CheckProgress(Quest, QuestGiver, Player)
  67. end
  68. function Step7Complete(Quest, QuestGiver, Player)
  69. UpdateQuestStepDescription(Quest, 7, "I harvested the fallen log.")
  70. CheckProgress(Quest, QuestGiver, Player)
  71. end
  72. function CheckProgress(Quest, QuestGiver, Player)
  73. if QuestStepIsComplete(Player, 5749, 1) and QuestStepIsComplete(Player, 5749, 2) and QuestStepIsComplete(Player, 5749, 3) and QuestStepIsComplete(Player, 5749, 4) and QuestStepIsComplete(Player, 5749, 5) and QuestStepIsComplete(Player, 5749, 6) and QuestStepIsComplete(Player, 5749, 7) then
  74. UpdateQuestTaskGroupDescription(Quest, 1, "I was able to straighten up the mess that Dreak left in the cellar.")
  75. UpdateQuestZone(Quest,"Isle of Refuge")
  76. AddQuestStepChat(Quest, 8, "I need to speak with Assistant Dreak.", 1, "I should go speak with Assistant Dreak about the cellar cleanup.", 11, 3250167)
  77. AddQuestStepCompleteAction(Quest, 8, "Step8Complete")
  78. end
  79. end
  80. function Step8Complete(Quest, QuestGiver, Player)
  81. UpdateQuestStepDescription(Quest, 8, "I spoke with Assistant Dreak.")
  82. UpdateQuestTaskGroupDescription(Quest, 2, "I told Assistant Dreak that the cellar is clean.")
  83. UpdateQuestZone(Quest,"Mizan's Cellar")
  84. if not HasItem(Player,20708,1) and GetTradeskillLevel(Player) <2 then
  85. SummonItem(Player,1030001,1)
  86. GiveQuestItem(Quest, Player, "", 20708,4142,4142,4142,7391,7391,7391)
  87. end
  88. if GetTradeskillLevel(Player) <2 then
  89. SetTradeskillLevel(Player,2)
  90. end
  91. -- GiveQuestItem(Quest, Player, "", 4142)
  92. -- GiveQuestItem(Quest, Player, "", 4142)
  93. -- GiveQuestItem(Quest, Player, "", 4142)
  94. -- GiveQuestItem(Quest, Player, "", 7391)
  95. -- GiveQuestItem(Quest, Player, "", 7391)
  96. -- GiveQuestItem(Quest, Player, "", 7391)
  97. AddQuestStepCraft(Quest, 9, "Use the forge to create a tin bar using a fossil temper, a tin cluster and some fuel.", 1, 100, "I need to make Assistant Dreak a simple tin spike to block entrance to the cellar.", 775, 14460,12502,6055,11039)
  98. AddQuestStepCompleteAction(Quest, 9, "Step9Complete")
  99. end
  100. function Step9Complete(Quest, QuestGiver, Player)
  101. UpdateQuestStepDescription(Quest, 9, "I created a tin bar for use in making the tin spike.")
  102. AddQuestStepCraft(Quest, 10, "Use the forge to create a simple form tin spike using a fossil temper, a tin bar and some fuel.", 1, 100, "I need to make Assistant Dreak a simple tin spike to block entrance to the cellar.", 681, 14474,12513,6066,11049)
  103. AddQuestStepCompleteAction(Quest, 10, "Step10Complete")
  104. end
  105. function Step10Complete(Quest, QuestGiver, Player)
  106. UpdateQuestStepDescription(Quest, 10, "I have completed making a tin spike to hold the cellar door closed!")
  107. UpdateQuestTaskGroupDescription(Quest, 3, "I made Assistant Dreak a tin spike to cover the door.")
  108. UpdateQuestZone(Quest,"Isle of Refuge")
  109. if HasItem(Player,14474) then
  110. RemoveItem(Player,14474,1)
  111. end
  112. if HasItem(Player,12513) then
  113. RemoveItem(Player,12513,1)
  114. end
  115. if HasItem(Player,6066) then
  116. RemoveItem(Player,6066,1)
  117. end
  118. if HasItem(Player,11049) then
  119. RemoveItem(Player,11049,1)
  120. end
  121. SendMessage(Player,"You place the tin spike in your quest satchle.","yellow")
  122. AddQuestStepChat(Quest, 11, "I need to speak to Assistant Dreak.", 1, "I need to return with the spike that I made for Assistant Dreak.", 681, 3250167)
  123. AddQuestStepCompleteAction(Quest, 11, "QuestComplete")
  124. end
  125. function QuestComplete(Quest, QuestGiver, Player)
  126. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  127. UpdateQuestStepDescription(Quest, 11, "I spoke with Assistant Dreak.")
  128. UpdateQuestTaskGroupDescription(Quest, 4, "I gave the spike that I made to Assistant Dreak.")
  129. UpdateQuestDescription(Quest, "Assistant Dreak was quite pleased with the work I did both in cleaning the cellar and making a bar to keep people out of it. He's now granted me full access to the cellar to work on any items I wish to.")
  130. GiveQuestReward(Quest, Player)
  131. end
  132. function Reload(Quest, QuestGiver, Player, Step)
  133. if Step == 1 then
  134. Step1Complete(Quest, QuestGiver, Player)
  135. elseif Step == 2 then
  136. Step2Complete(Quest, QuestGiver, Player)
  137. elseif Step == 3 then
  138. Step3Complete(Quest, QuestGiver, Player)
  139. elseif Step == 4 then
  140. Step4Complete(Quest, QuestGiver, Player)
  141. elseif Step == 5 then
  142. Step5Complete(Quest, QuestGiver, Player)
  143. elseif Step == 6 then
  144. Step6Complete(Quest, QuestGiver, Player)
  145. elseif Step == 7 then
  146. Step7Complete(Quest, QuestGiver, Player)
  147. elseif Step == 8 then
  148. Step8Complete(Quest, QuestGiver, Player)
  149. elseif Step == 9 then
  150. Step9Complete(Quest, QuestGiver, Player)
  151. elseif Step == 10 then
  152. Step10Complete(Quest, QuestGiver, Player)
  153. elseif Step == 11 then
  154. QuestComplete(Quest, QuestGiver, Player)
  155. end
  156. end