diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/RubbleMiner.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/RubbleMiner.java deleted file mode 100644 index 339f0b8518..0000000000 --- a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/RubbleMiner.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.questhelper.helpers.quests.thecurseofarrav; - -import com.questhelper.helpers.quests.thepathofglouphrie.DiscInsertionStep; -import com.questhelper.requirements.Requirement; -import com.questhelper.requirements.conditional.Conditions; -import com.questhelper.requirements.conditional.ObjectCondition; -import com.questhelper.requirements.item.ItemRequirement; -import com.questhelper.requirements.util.LogicType; -import com.questhelper.requirements.widget.WidgetPresenceRequirement; -import com.questhelper.steps.*; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import javax.annotation.Nullable; -import javax.inject.Inject; - -import com.questhelper.steps.tools.QuestPerspective; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.*; -import net.runelite.api.coords.Direction; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.events.GameTick; -import net.runelite.client.eventbus.Subscribe; -import org.apache.commons.lang3.tuple.Pair; - -import static com.questhelper.requirements.util.LogicHelper.and; -import static com.questhelper.requirements.util.LogicHelper.nor; - -@Slf4j -public class RubbleMiner extends DetailedOwnerStep { - @Inject - Client client; - - private List mineSteps; - private List conditions; - private ConditionalStep conditionalStep; - - private int operation; - - public RubbleMiner(TheCurseOfArrav theCurseOfArrav) { - super(theCurseOfArrav, "Make your way through the Trollweiss cave, mining rubble with your pickaxe."); - } - - - private void addMineRubbleStep(int x, int y, RubbleLevel rubbleLevel, Direction direction) { - var validObjectIDs = rubbleLevel.getObjectIDs(); - assert !validObjectIDs.isEmpty(); - - var validIDSet = new HashSet<>(validObjectIDs); - - var wp = new WorldPoint(x, y, 0); - var operation = this.operation++; - var text = String.format("[%d] Mine the rubble from the %s side", operation, direction.toString().toLowerCase()); - log.info("setting up mine rubble step: {}: {}", operation, text); - var mainObjectID = validObjectIDs.get(0); - var step = new ObjectStep(getQuestHelper(), mainObjectID, wp, text); - var offsetX = x; - var offsetY = y; - switch (direction) { - case NORTH: - offsetY += 1; - break; - case SOUTH: - offsetY -= 1; - break; - case WEST: - offsetX -= 1; - break; - case EAST: - offsetX += 1; - break; - } - var posWp = new WorldPoint(offsetX, offsetY, 0); - step.addTileMarker(posWp, SpriteID.SKILL_MINING); - for (var alternateIDs : validObjectIDs) { - // todo this adds the first object again xd - step.addAlternateObjects(alternateIDs); - } - - var conditionText = String.format("[%d] Rubble mined from the %s side", operation, direction.toString().toLowerCase()); - var conditionThatThisStepHasBeenDone = new ObjectCondition(validIDSet, wp); - conditionThatThisStepHasBeenDone.setText(text); - - this.mineSteps.add(step); - this.conditions.add(conditionThatThisStepHasBeenDone); - } - - @Subscribe - public void onGameTick(GameTick event) { - updateSteps(); - } - - @Override - public void startUp() { - updateSteps(); - } - - @Override - protected void setupSteps() { - this.operation = 1; - this.mineSteps = new ArrayList<>(); - this.conditions = new ArrayList<>(); - - var todo = new DetailedQuestStep(getQuestHelper(), "todo"); - - this.addMineRubbleStep(2764, 10266, RubbleLevel.Two, Direction.SOUTH); - this.addMineRubbleStep(2775, 10258, RubbleLevel.One, Direction.SOUTH); - this.addMineRubbleStep(2764, 10266, RubbleLevel.One, Direction.EAST); - this.addMineRubbleStep(2764, 10267, RubbleLevel.One, Direction.SOUTH); - - // after reversing - // mineStep 0: mine C - // mineStep 1: mine B - // mineStep 2: mine A - - // condition 0: A is not at the given state - // condition 1: B is not at the given state - // condition 2: C is not at the given state - - // i = 0: Mine C, if B and A are mined - // i = 1: Mine B, if A is mined - // i = 2: Mine A, with no condition - - conditionalStep = new ConditionalStep(getQuestHelper(), todo); - Collections.reverse(mineSteps); - - assert this.mineSteps.size() == this.conditions.size(); - - { - var allDone = new DetailedQuestStep(getQuestHelper(), "you are all done lol"); - var conditionList = new ArrayList(); - for (var condition : this.conditions) { - var xd2 = new Conditions(LogicType.NAND, condition); - xd2.setText(condition.getDisplayText()); - allDone.addRequirement(xd2); - } - var xd = new Conditions(LogicType.NAND, conditionList); - conditionalStep.addStep(xd, allDone); - } - for (var i = 0; i < mineSteps.size(); i++) { - var mineStep = mineSteps.get(i); - var conditionList = new ArrayList(); - StringBuilder text = new StringBuilder(); - for (var j = 0; j < this.conditions.size() - i - 1; j++) { - conditionList.add(this.conditions.get(j)); - text.append(this.conditions.get(j).getDisplayText()); - var xd2 = new Conditions(LogicType.NAND, this.conditions.get(j)); - xd2.setText(this.conditions.get(j).getDisplayText()); - mineStep.addRequirement(xd2); - } - - var xd = new Conditions(LogicType.NOR, conditionList); - xd.setText(text.toString()); - - conditionalStep.addStep(xd, mineStep); - } - } - - protected void updateSteps() { - startUpStep(this.conditionalStep); - } - - @Override - public List getSteps() { - var steps = new ArrayList(); - - steps.add(this.conditionalStep); - for (var step : this.mineSteps) { - steps.add(step); - } - - return steps; - } - - @Getter - enum RubbleLevel { - Three(123), - Two(ObjectID.RUBBLE_50598), - One(ObjectID.RUBBLE_50587, ObjectID.RUBBLE_50589); - - private final List objectIDs; - - RubbleLevel(Integer... possibleObjectIDs) { - this.objectIDs = new ArrayList(); - for (var xd : possibleObjectIDs) { - this.objectIDs.add(xd); - } - // Collections.addAll(this.objectIDs, possibleObjectIDs); - } - } -} diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java index 468bf6f3ed..09df79ae04 100644 --- a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java +++ b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java @@ -26,11 +26,13 @@ import com.questhelper.bank.banktab.BankSlotIcons; import com.questhelper.collections.ItemCollections; +import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverOne; +import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverThree; +import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverTwo; import com.questhelper.panel.PanelDetails; import com.questhelper.questhelpers.BasicQuestHelper; import com.questhelper.questinfo.QuestHelperQuest; import com.questhelper.requirements.Requirement; -import com.questhelper.requirements.conditional.ObjectCondition; import com.questhelper.requirements.item.ItemRequirement; import com.questhelper.requirements.item.TeleportItemRequirement; import com.questhelper.requirements.player.CombatLevelRequirement; @@ -141,7 +143,9 @@ public class TheCurseOfArrav extends BasicQuestHelper private QuestStep unsortedStep54; private QuestStep unsortedStep56; private QuestStep unsortedStep58; - private PuzzleWrapperStep rubbleMiner; + private PuzzleWrapperStep rubbleMiner1; + private PuzzleWrapperStep rubbleMiner2; + private PuzzleWrapperStep rubbleMiner3; @Override @@ -374,15 +378,25 @@ public void setupSteps() // mineRubble2FromSouth.addTileMarker(new WorldPoint(2775, 10257, 0), whereToStandSprite); // mineRubble2FromSouth.setLinePoints(List.of(new WorldPoint(2763, 10264, 0), new WorldPoint(2769, 10254, 0), new WorldPoint(2775, 10255, 0))); - rubbleMiner = new RubbleMiner(this).puzzleWrapStep("make your way through the mine"); + rubbleMiner1 = new RubbleSolverOne(this).puzzleWrapStep("Mine the rubble and make your way through the cave."); + rubbleMiner2 = new RubbleSolverTwo(this).puzzleWrapStep("Mine the rubble and make your way through the cave."); + rubbleMiner3 = new RubbleSolverThree(this).puzzleWrapStep("Mine the rubble and make your way through the cave."); unsortedStep20 = new ConditionalStep(this, headToTrollheim); - ((ConditionalStep) unsortedStep20).addStep(inTrollweissCave, rubbleMiner); + ((ConditionalStep) unsortedStep20).addStep(inTrollweissCave, rubbleMiner1); ((ConditionalStep) unsortedStep20).addStep(onTrollweissMountain, enterTrollweissCave); ((ConditionalStep) unsortedStep20).addStep(inTrollheimCave, continueThroughTrollheimCave); - unsortedStep22 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 22"); - unsortedStep24 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 24"); + unsortedStep24 = new ConditionalStep(this, headToTrollheim); + ((ConditionalStep) unsortedStep24).addStep(inTrollweissCave, rubbleMiner2); + ((ConditionalStep) unsortedStep24).addStep(onTrollweissMountain, enterTrollweissCave); + ((ConditionalStep) unsortedStep24).addStep(inTrollheimCave, continueThroughTrollheimCave); + + unsortedStep26 = new ConditionalStep(this, headToTrollheim); + ((ConditionalStep) unsortedStep26).addStep(inTrollweissCave, rubbleMiner3); + ((ConditionalStep) unsortedStep26).addStep(onTrollweissMountain, enterTrollweissCave); + ((ConditionalStep) unsortedStep26).addStep(inTrollheimCave, continueThroughTrollheimCave); + unsortedStep26 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 26"); unsortedStep28 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 28"); unsortedStep30 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 30"); @@ -508,7 +522,7 @@ public List getPanels() ))); panels.add(new PanelDetails("Fort Invasion", List.of( unsortedStep20, - rubbleMiner, + rubbleMiner1, unsortedStep22, unsortedStep24, unsortedStep26, diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java new file mode 100644 index 0000000000..b19f20da62 --- /dev/null +++ b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java @@ -0,0 +1,227 @@ +package com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers; + +import com.questhelper.helpers.quests.thecurseofarrav.TheCurseOfArrav; +import com.questhelper.requirements.Requirement; +import com.questhelper.requirements.conditional.Conditions; +import com.questhelper.requirements.conditional.ObjectCondition; +import com.questhelper.requirements.util.LogicType; +import com.questhelper.steps.*; + +import java.util.*; +import javax.inject.Inject; + +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.*; +import net.runelite.api.coords.Direction; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.GameTick; +import net.runelite.client.eventbus.Subscribe; + +@Slf4j +public abstract class RubbleSolver extends DetailedOwnerStep { + @Inject + protected Client client; + + private List mineSteps; + private List conditions; + private List inverseConditions; + private ConditionalStep conditionalStep; + + private int stepCounter; + + public RubbleSolver(TheCurseOfArrav theCurseOfArrav) { + super(theCurseOfArrav, "Make your way through the Trollweiss cave, mining rubble with your pickaxe."); + } + + protected void addMineRubbleStep(int x, int y, RubbleType rubbleType, Direction direction) { + var validObjectIDs = rubbleType.getObjectIDs(); + assert !validObjectIDs.isEmpty(); + + var validIDSet = new HashSet<>(validObjectIDs); + + var wp = new WorldPoint(x, y, 0); + var stepCounter = this.stepCounter++; + var text = String.format("[%d] Mine the rubble from the %s side", stepCounter, direction.toString().toLowerCase()); + log.info("setting up mine rubble step: {}: {}", stepCounter, text); + var mainObjectID = validObjectIDs.get(0); + var step = new ObjectStep(getQuestHelper(), mainObjectID, wp, text); + var offsetX = x; + var offsetY = y; + switch (direction) { + case NORTH: + offsetY += 1; + break; + case SOUTH: + offsetY -= 1; + break; + case WEST: + offsetX -= 1; + break; + case EAST: + offsetX += 1; + break; + } + var posWp = new WorldPoint(offsetX, offsetY, 0); + step.addTileMarker(posWp, SpriteID.SKILL_MINING); + for (var alternateIDs : validObjectIDs) { + // todo this adds the first object again xd + step.addAlternateObjects(alternateIDs); + } + + var conditionText = String.format("[%d] Rubble mined from the %s side", stepCounter, direction.toString().toLowerCase()); + var inverseConditionText = String.format("[%d] Rubble needs to be mined from the %s side", stepCounter, direction.toString().toLowerCase()); + var conditionThatRubbleIsStillThere = new ObjectCondition(validIDSet, wp); + var conditionThatRubbleHasBeenMined = new Conditions(LogicType.NAND, conditionThatRubbleIsStillThere); + conditionThatRubbleIsStillThere.setText(inverseConditionText); + conditionThatRubbleHasBeenMined.setText(conditionText); + + this.mineSteps.add(step); + this.conditions.add(conditionThatRubbleHasBeenMined); + this.inverseConditions.add(conditionThatRubbleIsStillThere); + } + + @Subscribe + public void onGameTick(GameTick event) { + updateSteps(); + } + + @Override + public void startUp() { + updateSteps(); + } + + protected abstract void setupRubbleSteps(); + + @Override + protected void setupSteps() { + this.stepCounter = 1; + this.mineSteps = new ArrayList<>(); + this.conditions = new ArrayList<>(); + this.inverseConditions = new ArrayList<>(); + + var todo = new DetailedQuestStep(getQuestHelper(), "todo"); + + this.setupRubbleSteps(); + + // Roadblock 1 (when quest state varbit is 22) + this.addMineRubbleStep(2764, 10266, RubbleType.Two, Direction.SOUTH); // 1 + this.addMineRubbleStep(2775, 10258, RubbleType.One, Direction.SOUTH); // 2 + this.addMineRubbleStep(2764, 10266, RubbleType.One, Direction.EAST); // 3 + this.addMineRubbleStep(2764, 10267, RubbleType.One, Direction.SOUTH); // 4 + + // Roadblock 2 (when quest state varbit is 24) + this.addMineRubbleStep(2766, 10279, RubbleType.Three, Direction.WEST); // 5 + this.addMineRubbleStep(2766, 10280, RubbleType.One, Direction.WEST); // 6 + this.addMineRubbleStep(2767, 10281, RubbleType.Two, Direction.WEST); // 7 + this.addMineRubbleStep(2766, 10279, RubbleType.Two, Direction.NORTH); // 8 + this.addMineRubbleStep(2766, 10278, RubbleType.Two, Direction.WEST); // 9 + this.addMineRubbleStep(2766, 10278, RubbleType.One, Direction.SOUTH); // 10 + this.addMineRubbleStep(2766, 10279, RubbleType.One, Direction.SOUTH); // 11 + this.addMineRubbleStep(2767, 10278, RubbleType.One, Direction.WEST); // 12 + this.addMineRubbleStep(2767, 10279, RubbleType.Two, Direction.WEST); // 13 + this.addMineRubbleStep(2768, 10279, RubbleType.One, Direction.WEST); // 14 + this.addMineRubbleStep(2767, 10279, RubbleType.One, Direction.SOUTH); // 15 + this.addMineRubbleStep(2768, 10280, RubbleType.Three, Direction.SOUTH); // 16: THIS TRIGGERS A STONE FALL OR SOMETHING :) + this.addMineRubbleStep(2768, 10281, RubbleType.One, Direction.SOUTH); // 17 + this.addMineRubbleStep(2769, 10281, RubbleType.Two, Direction.WEST); // 18 + this.addMineRubbleStep(2767, 10281, RubbleType.One, Direction.EAST); // 19 + this.addMineRubbleStep(2767, 10282, RubbleType.One, Direction.SOUTH); // 20 + this.addMineRubbleStep(2769, 10281, RubbleType.One, Direction.NORTH); // 21 + this.addMineRubbleStep(2770, 10281, RubbleType.One, Direction.WEST); // 22 + + // Roadblock 3 + this.addMineRubbleStep(2787, 10267, RubbleType.Three, Direction.WEST); // 23 + this.addMineRubbleStep(2787, 10266, RubbleType.Three, Direction.WEST); // 24 + this.addMineRubbleStep(2787, 10267, RubbleType.Two, Direction.SOUTH); // 25 + + this.addMineRubbleStep(2789, 10286, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.NORTH); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.WEST); + + this.addMineRubbleStep(2789, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10284, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.SOUTH); + this.addMineRubbleStep(2790, 10285, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10283, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2790, 10283, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2790, 10282, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2791, 10282, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2791, 10285, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2793, 10285, RubbleType.Two, Direction.WEST); + + this.addMineRubbleStep(2787, 10267, RubbleType.One, Direction.NORTH); // 26 (or when??) + + // after reversing + // mineStep 0: mine C + // mineStep 1: mine B + // mineStep 2: mine A + + // condition 0: A is mined + // condition 1: B is mined + // condition 2: C is mined + + // i = 0: Mine C, if B and A are mined, and C is not mined + // i = 1: Mine B, if A is mined + // i = 2: Mine A, with no condition + + conditionalStep = new ConditionalStep(getQuestHelper(), todo); + Collections.reverse(this.mineSteps); + Collections.reverse(this.inverseConditions); + + assert this.mineSteps.size() == this.conditions.size(); + assert this.mineSteps.size() == this.inverseConditions.size(); + + // { + // var allDone = new DetailedQuestStep(getQuestHelper(), "you are all done lol"); + // var conditionList = new ArrayList(); + // for (var condition : this.conditions) { + // allDone.addRequirement(condition); + // } + // var xd = new Conditions(LogicType.AND, conditionList); + // conditionalStep.addStep(xd, allDone); + // } + for (var i = 0; i < mineSteps.size(); i++) { + var mineStep = mineSteps.get(i); + + var conditionList = new ArrayList(); + + mineStep.addRequirement(this.inverseConditions.get(i)); + conditionList.add(this.inverseConditions.get(i)); + + StringBuilder text = new StringBuilder(); + for (var j = 0; j < this.conditions.size() - i - 1; j++) { + var condition = this.conditions.get(j); + conditionList.add(condition); + text.append(this.conditions.get(j).getDisplayText()); + mineStep.addRequirement(condition); + } + + var xd = new Conditions(LogicType.AND, conditionList); + xd.setText(text.toString()); + + conditionalStep.addStep(xd, mineStep); + } + } + + protected void updateSteps() { + startUpStep(this.conditionalStep); + } + + @Override + public List getSteps() { + var steps = new ArrayList(); + + steps.add(this.conditionalStep); + for (var step : this.mineSteps) { + steps.add(step); + } + + return steps; + } + +} diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverOne.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverOne.java new file mode 100644 index 0000000000..7cc50bc87f --- /dev/null +++ b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverOne.java @@ -0,0 +1,84 @@ +package com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers; + +import com.questhelper.helpers.quests.thecurseofarrav.TheCurseOfArrav; +import com.questhelper.requirements.Requirement; +import com.questhelper.requirements.conditional.Conditions; +import com.questhelper.requirements.conditional.ObjectCondition; +import com.questhelper.requirements.util.LogicType; +import com.questhelper.steps.*; + +import java.util.*; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.*; +import net.runelite.api.coords.Direction; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.GameTick; +import net.runelite.client.eventbus.Subscribe; + +/** + * This class describes the rubble mining steps required for Roadblock 1 (when quest state varbit is 22) + */ +@Slf4j +public class RubbleSolverOne extends RubbleSolver +{ + public RubbleSolverOne(TheCurseOfArrav theCurseOfArrav) { + super(theCurseOfArrav); + } + + @Override + protected void setupRubbleSteps() { + this.addMineRubbleStep(2764, 10266, RubbleType.Two, Direction.SOUTH); // 1 + this.addMineRubbleStep(2775, 10258, RubbleType.One, Direction.SOUTH); // 2 + this.addMineRubbleStep(2764, 10266, RubbleType.One, Direction.EAST); // 3 + this.addMineRubbleStep(2764, 10267, RubbleType.One, Direction.SOUTH); // 4 + + // Roadblock 2 (when quest state varbit is 24) + this.addMineRubbleStep(2766, 10279, RubbleType.Three, Direction.WEST); // 5 + this.addMineRubbleStep(2766, 10280, RubbleType.One, Direction.WEST); // 6 + this.addMineRubbleStep(2767, 10281, RubbleType.Two, Direction.WEST); // 7 + this.addMineRubbleStep(2766, 10279, RubbleType.Two, Direction.NORTH); // 8 + this.addMineRubbleStep(2766, 10278, RubbleType.Two, Direction.WEST); // 9 + this.addMineRubbleStep(2766, 10278, RubbleType.One, Direction.SOUTH); // 10 + this.addMineRubbleStep(2766, 10279, RubbleType.One, Direction.SOUTH); // 11 + this.addMineRubbleStep(2767, 10278, RubbleType.One, Direction.WEST); // 12 + this.addMineRubbleStep(2767, 10279, RubbleType.Two, Direction.WEST); // 13 + this.addMineRubbleStep(2768, 10279, RubbleType.One, Direction.WEST); // 14 + this.addMineRubbleStep(2767, 10279, RubbleType.One, Direction.SOUTH); // 15 + this.addMineRubbleStep(2768, 10280, RubbleType.Three, Direction.SOUTH); // 16: THIS TRIGGERS A STONE FALL OR SOMETHING :) + this.addMineRubbleStep(2768, 10281, RubbleType.One, Direction.SOUTH); // 17 + this.addMineRubbleStep(2769, 10281, RubbleType.Two, Direction.WEST); // 18 + this.addMineRubbleStep(2767, 10281, RubbleType.One, Direction.EAST); // 19 + this.addMineRubbleStep(2767, 10282, RubbleType.One, Direction.SOUTH); // 20 + this.addMineRubbleStep(2769, 10281, RubbleType.One, Direction.NORTH); // 21 + this.addMineRubbleStep(2770, 10281, RubbleType.One, Direction.WEST); // 22 + + // Roadblock 3 + this.addMineRubbleStep(2787, 10267, RubbleType.Three, Direction.WEST); // 23 + this.addMineRubbleStep(2787, 10266, RubbleType.Three, Direction.WEST); // 24 + this.addMineRubbleStep(2787, 10267, RubbleType.Two, Direction.SOUTH); // 25 + + this.addMineRubbleStep(2789, 10286, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.NORTH); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.WEST); + + this.addMineRubbleStep(2789, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10284, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.SOUTH); + this.addMineRubbleStep(2790, 10285, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10283, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2790, 10283, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2790, 10282, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2791, 10282, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2791, 10285, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2793, 10285, RubbleType.Two, Direction.WEST); + + this.addMineRubbleStep(2787, 10267, RubbleType.One, Direction.NORTH); // 26 (or when??) + } +} diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverThree.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverThree.java new file mode 100644 index 0000000000..67f16e89e1 --- /dev/null +++ b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverThree.java @@ -0,0 +1,71 @@ +package com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers; + +import com.questhelper.helpers.quests.thecurseofarrav.TheCurseOfArrav; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.coords.Direction; + +/** + * This class describes the rubble mining steps required for Roadblock 1 (when quest state varbit is 22) + */ +@Slf4j +public class RubbleSolverThree extends RubbleSolver +{ + public RubbleSolverThree(TheCurseOfArrav theCurseOfArrav) { + super(theCurseOfArrav); + } + + @Override + protected void setupRubbleSteps() { + this.addMineRubbleStep(2764, 10266, RubbleType.Two, Direction.SOUTH); // 1 + this.addMineRubbleStep(2775, 10258, RubbleType.One, Direction.SOUTH); // 2 + this.addMineRubbleStep(2764, 10266, RubbleType.One, Direction.EAST); // 3 + this.addMineRubbleStep(2764, 10267, RubbleType.One, Direction.SOUTH); // 4 + + // Roadblock 2 (when quest state varbit is 24) + this.addMineRubbleStep(2766, 10279, RubbleType.Three, Direction.WEST); // 5 + this.addMineRubbleStep(2766, 10280, RubbleType.One, Direction.WEST); // 6 + this.addMineRubbleStep(2767, 10281, RubbleType.Two, Direction.WEST); // 7 + this.addMineRubbleStep(2766, 10279, RubbleType.Two, Direction.NORTH); // 8 + this.addMineRubbleStep(2766, 10278, RubbleType.Two, Direction.WEST); // 9 + this.addMineRubbleStep(2766, 10278, RubbleType.One, Direction.SOUTH); // 10 + this.addMineRubbleStep(2766, 10279, RubbleType.One, Direction.SOUTH); // 11 + this.addMineRubbleStep(2767, 10278, RubbleType.One, Direction.WEST); // 12 + this.addMineRubbleStep(2767, 10279, RubbleType.Two, Direction.WEST); // 13 + this.addMineRubbleStep(2768, 10279, RubbleType.One, Direction.WEST); // 14 + this.addMineRubbleStep(2767, 10279, RubbleType.One, Direction.SOUTH); // 15 + this.addMineRubbleStep(2768, 10280, RubbleType.Three, Direction.SOUTH); // 16: THIS TRIGGERS A STONE FALL OR SOMETHING :) + this.addMineRubbleStep(2768, 10281, RubbleType.One, Direction.SOUTH); // 17 + this.addMineRubbleStep(2769, 10281, RubbleType.Two, Direction.WEST); // 18 + this.addMineRubbleStep(2767, 10281, RubbleType.One, Direction.EAST); // 19 + this.addMineRubbleStep(2767, 10282, RubbleType.One, Direction.SOUTH); // 20 + this.addMineRubbleStep(2769, 10281, RubbleType.One, Direction.NORTH); // 21 + this.addMineRubbleStep(2770, 10281, RubbleType.One, Direction.WEST); // 22 + + // Roadblock 3 + this.addMineRubbleStep(2787, 10267, RubbleType.Three, Direction.WEST); // 23 + this.addMineRubbleStep(2787, 10266, RubbleType.Three, Direction.WEST); // 24 + this.addMineRubbleStep(2787, 10267, RubbleType.Two, Direction.SOUTH); // 25 + + this.addMineRubbleStep(2789, 10286, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.NORTH); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.WEST); + + this.addMineRubbleStep(2789, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10284, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.SOUTH); + this.addMineRubbleStep(2790, 10285, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10283, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2790, 10283, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2790, 10282, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2791, 10282, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2791, 10285, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2793, 10285, RubbleType.Two, Direction.WEST); + + this.addMineRubbleStep(2787, 10267, RubbleType.One, Direction.NORTH); // 26 (or when??) + } +} diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverTwo.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverTwo.java new file mode 100644 index 0000000000..bd7b4118d6 --- /dev/null +++ b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolverTwo.java @@ -0,0 +1,71 @@ +package com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers; + +import com.questhelper.helpers.quests.thecurseofarrav.TheCurseOfArrav; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.coords.Direction; + +/** + * This class describes the rubble mining steps required for Roadblock 1 (when quest state varbit is 22) + */ +@Slf4j +public class RubbleSolverTwo extends RubbleSolver +{ + public RubbleSolverTwo(TheCurseOfArrav theCurseOfArrav) { + super(theCurseOfArrav); + } + + @Override + protected void setupRubbleSteps() { + this.addMineRubbleStep(2764, 10266, RubbleType.Two, Direction.SOUTH); // 1 + this.addMineRubbleStep(2775, 10258, RubbleType.One, Direction.SOUTH); // 2 + this.addMineRubbleStep(2764, 10266, RubbleType.One, Direction.EAST); // 3 + this.addMineRubbleStep(2764, 10267, RubbleType.One, Direction.SOUTH); // 4 + + // Roadblock 2 (when quest state varbit is 24) + this.addMineRubbleStep(2766, 10279, RubbleType.Three, Direction.WEST); // 5 + this.addMineRubbleStep(2766, 10280, RubbleType.One, Direction.WEST); // 6 + this.addMineRubbleStep(2767, 10281, RubbleType.Two, Direction.WEST); // 7 + this.addMineRubbleStep(2766, 10279, RubbleType.Two, Direction.NORTH); // 8 + this.addMineRubbleStep(2766, 10278, RubbleType.Two, Direction.WEST); // 9 + this.addMineRubbleStep(2766, 10278, RubbleType.One, Direction.SOUTH); // 10 + this.addMineRubbleStep(2766, 10279, RubbleType.One, Direction.SOUTH); // 11 + this.addMineRubbleStep(2767, 10278, RubbleType.One, Direction.WEST); // 12 + this.addMineRubbleStep(2767, 10279, RubbleType.Two, Direction.WEST); // 13 + this.addMineRubbleStep(2768, 10279, RubbleType.One, Direction.WEST); // 14 + this.addMineRubbleStep(2767, 10279, RubbleType.One, Direction.SOUTH); // 15 + this.addMineRubbleStep(2768, 10280, RubbleType.Three, Direction.SOUTH); // 16: THIS TRIGGERS A STONE FALL OR SOMETHING :) + this.addMineRubbleStep(2768, 10281, RubbleType.One, Direction.SOUTH); // 17 + this.addMineRubbleStep(2769, 10281, RubbleType.Two, Direction.WEST); // 18 + this.addMineRubbleStep(2767, 10281, RubbleType.One, Direction.EAST); // 19 + this.addMineRubbleStep(2767, 10282, RubbleType.One, Direction.SOUTH); // 20 + this.addMineRubbleStep(2769, 10281, RubbleType.One, Direction.NORTH); // 21 + this.addMineRubbleStep(2770, 10281, RubbleType.One, Direction.WEST); // 22 + + // Roadblock 3 + this.addMineRubbleStep(2787, 10267, RubbleType.Three, Direction.WEST); // 23 + this.addMineRubbleStep(2787, 10266, RubbleType.Three, Direction.WEST); // 24 + this.addMineRubbleStep(2787, 10267, RubbleType.Two, Direction.SOUTH); // 25 + + this.addMineRubbleStep(2789, 10286, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.NORTH); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.WEST); + + this.addMineRubbleStep(2789, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10284, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.SOUTH); + this.addMineRubbleStep(2790, 10285, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2789, 10283, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2790, 10283, RubbleType.One, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2790, 10282, RubbleType.One, Direction.NORTH); + this.addMineRubbleStep(2791, 10282, RubbleType.Three, Direction.WEST); + this.addMineRubbleStep(2791, 10283, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2791, 10285, RubbleType.One, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.SOUTH); + this.addMineRubbleStep(2792, 10285, RubbleType.Two, Direction.WEST); + this.addMineRubbleStep(2793, 10285, RubbleType.Two, Direction.WEST); + + this.addMineRubbleStep(2787, 10267, RubbleType.One, Direction.NORTH); // 26 (or when??) + } +} diff --git a/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleType.java b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleType.java new file mode 100644 index 0000000000..0d636f3361 --- /dev/null +++ b/src/main/java/com/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleType.java @@ -0,0 +1,24 @@ +package com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers; + +import lombok.Getter; +import net.runelite.api.ObjectID; +import java.util.ArrayList; +import java.util.List; + +@Getter +public enum RubbleType +{ + Three(ObjectID.RUBBLE_50603, ObjectID.RUBBLE_50604), + Two(ObjectID.RUBBLE_50598, ObjectID.RUBBLE_50602), + One(ObjectID.RUBBLE_50587, ObjectID.RUBBLE_50589, ObjectID.RUBBLE_50590, ObjectID.RUBBLE_50594, ObjectID.RUBBLE_50597); + + private final List objectIDs; + + RubbleType(Integer... possibleObjectIDs) { + this.objectIDs = new ArrayList(); + for (var xd : possibleObjectIDs) { + this.objectIDs.add(xd); + } + // Collections.addAll(this.objectIDs, possibleObjectIDs); + } +}