9
3

cellar_cleanup.lua 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. Notes : updated coal given to classic version 1001034
  11. --]]
  12. require "SpawnScripts/Generic/DialogModule"
  13. function Init(Quest)
  14. 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)
  15. 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)
  16. 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)
  17. 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)
  18. 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)
  19. 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)
  20. 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)
  21. AddQuestStepCompleteAction(Quest, 1, "Step1Complete")
  22. AddQuestStepCompleteAction(Quest, 2, "Step2Complete")
  23. AddQuestStepCompleteAction(Quest, 3, "Step3Complete")
  24. AddQuestStepCompleteAction(Quest, 4, "Step4Complete")
  25. AddQuestStepCompleteAction(Quest, 5, "Step5Complete")
  26. AddQuestStepCompleteAction(Quest, 6, "Step6Complete")
  27. AddQuestStepCompleteAction(Quest, 7, "Step7Complete")
  28. UpdateQuestZone(Quest,"Mizan's Cellar")
  29. end
  30. function Accepted(Quest, QuestGiver, Player)
  31. FaceTarget(QuestGiver, Player)
  32. Dialog.New(QuestGiver, Player)
  33. 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!")
  34. Dialog.AddVoiceover("voiceover/english/assistant_dreak/tutorial_island02/assistant_dreak004.mp3",246435936,3107615538)
  35. PlayFlavor(QuestGiver,"","","smile",0,0, Player)
  36. Dialog.AddOption("Very well then.")
  37. Dialog.Start()
  38. end
  39. function Declined(Quest, QuestGiver, Player)
  40. -- Add dialog here for when the quest is declined
  41. end
  42. function Deleted(Quest, QuestGiver, Player)
  43. -- Remove any quest specific items here when the quest is deleted
  44. end
  45. function Step1Complete(Quest, QuestGiver, Player)
  46. UpdateQuestStepDescription(Quest, 1, "I've found a better location to move the table to.")
  47. CheckProgress(Quest, QuestGiver, Player)
  48. end
  49. function Step2Complete(Quest, QuestGiver, Player)
  50. UpdateQuestStepDescription(Quest, 2, "I've moved the chair to a better location.")
  51. CheckProgress(Quest, QuestGiver, Player)
  52. end
  53. function Step3Complete(Quest, QuestGiver, Player)
  54. UpdateQuestStepDescription(Quest, 3, "I got rid of the burned barrel.")
  55. CheckProgress(Quest, QuestGiver, Player)
  56. end
  57. function Step4Complete(Quest, QuestGiver, Player)
  58. UpdateQuestStepDescription(Quest, 4, "I put the mirror back on the wall.")
  59. CheckProgress(Quest, QuestGiver, Player)
  60. end
  61. function Step5Complete(Quest, QuestGiver, Player)
  62. UpdateQuestStepDescription(Quest, 5, "I moved the bed to a better location")
  63. CheckProgress(Quest, QuestGiver, Player)
  64. end
  65. function Step6Complete(Quest, QuestGiver, Player)
  66. UpdateQuestStepDescription(Quest, 6, "I harvested the crushed rock.")
  67. CheckProgress(Quest, QuestGiver, Player)
  68. end
  69. function Step7Complete(Quest, QuestGiver, Player)
  70. UpdateQuestStepDescription(Quest, 7, "I harvested the fallen log.")
  71. CheckProgress(Quest, QuestGiver, Player)
  72. end
  73. function CheckProgress(Quest, QuestGiver, Player)
  74. 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
  75. UpdateQuestTaskGroupDescription(Quest, 1, "I was able to straighten up the mess that Dreak left in the cellar.")
  76. UpdateQuestZone(Quest,"Isle of Refuge")
  77. AddQuestStepChat(Quest, 8, "I need to speak with Assistant Dreak.", 1, "I should go speak with Assistant Dreak about the cellar cleanup.", 11, 3250167)
  78. AddQuestStepCompleteAction(Quest, 8, "Step8Complete")
  79. end
  80. end
  81. function Step8Complete(Quest, QuestGiver, Player)
  82. UpdateQuestStepDescription(Quest, 8, "I spoke with Assistant Dreak.")
  83. UpdateQuestTaskGroupDescription(Quest, 2, "I told Assistant Dreak that the cellar is clean.")
  84. UpdateQuestZone(Quest,"Mizan's Cellar")
  85. if not HasItem(Player,20708,1) and GetTradeskillLevel(Player) <2 then
  86. SummonItem(Player,1030001,1)
  87. GiveQuestItem(Quest, Player, "", 20708,1001034,1001034,1001034,7391,7391,7391)
  88. end
  89. if GetTradeskillLevel(Player) <2 then
  90. SetTradeskillLevel(Player,2)
  91. end
  92. -- GiveQuestItem(Quest, Player, "", 4142)
  93. -- GiveQuestItem(Quest, Player, "", 4142)
  94. -- GiveQuestItem(Quest, Player, "", 4142)
  95. -- GiveQuestItem(Quest, Player, "", 7391)
  96. -- GiveQuestItem(Quest, Player, "", 7391)
  97. -- GiveQuestItem(Quest, Player, "", 7391)
  98. 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)
  99. AddQuestStepCompleteAction(Quest, 9, "Step9Complete")
  100. end
  101. function Step9Complete(Quest, QuestGiver, Player)
  102. UpdateQuestStepDescription(Quest, 9, "I created a tin bar for use in making the tin spike.")
  103. 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)
  104. AddQuestStepCompleteAction(Quest, 10, "Step10Complete")
  105. end
  106. function Step10Complete(Quest, QuestGiver, Player)
  107. UpdateQuestStepDescription(Quest, 10, "I have completed making a tin spike to hold the cellar door closed!")
  108. UpdateQuestTaskGroupDescription(Quest, 3, "I made Assistant Dreak a tin spike to cover the door.")
  109. UpdateQuestZone(Quest,"Isle of Refuge")
  110. if HasItem(Player,14474) then
  111. RemoveItem(Player,14474,1)
  112. end
  113. if HasItem(Player,12513) then
  114. RemoveItem(Player,12513,1)
  115. end
  116. if HasItem(Player,6066) then
  117. RemoveItem(Player,6066,1)
  118. end
  119. if HasItem(Player,11049) then
  120. RemoveItem(Player,11049,1)
  121. end
  122. SendMessage(Player,"You place the tin spike in your quest satchle.","yellow")
  123. 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)
  124. AddQuestStepCompleteAction(Quest, 11, "QuestComplete")
  125. end
  126. function QuestComplete(Quest, QuestGiver, Player)
  127. -- The following UpdateQuestStepDescription and UpdateTaskGroupDescription are not needed, parser adds them for completion in case stuff needs to be moved around
  128. UpdateQuestStepDescription(Quest, 11, "I spoke with Assistant Dreak.")
  129. UpdateQuestTaskGroupDescription(Quest, 4, "I gave the spike that I made to Assistant Dreak.")
  130. 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.")
  131. GiveQuestReward(Quest, Player)
  132. end
  133. function Reload(Quest, QuestGiver, Player, Step)
  134. if Step == 1 then
  135. Step1Complete(Quest, QuestGiver, Player)
  136. elseif Step == 2 then
  137. Step2Complete(Quest, QuestGiver, Player)
  138. elseif Step == 3 then
  139. Step3Complete(Quest, QuestGiver, Player)
  140. elseif Step == 4 then
  141. Step4Complete(Quest, QuestGiver, Player)
  142. elseif Step == 5 then
  143. Step5Complete(Quest, QuestGiver, Player)
  144. elseif Step == 6 then
  145. Step6Complete(Quest, QuestGiver, Player)
  146. elseif Step == 7 then
  147. Step7Complete(Quest, QuestGiver, Player)
  148. elseif Step == 8 then
  149. Step8Complete(Quest, QuestGiver, Player)
  150. elseif Step == 9 then
  151. Step9Complete(Quest, QuestGiver, Player)
  152. elseif Step == 10 then
  153. Step10Complete(Quest, QuestGiver, Player)
  154. elseif Step == 11 then
  155. QuestComplete(Quest, QuestGiver, Player)
  156. end
  157. end