Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed Nov 9, 2024
1 parent 65e3f38 commit 59f0ef8
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import com.questhelper.bank.banktab.BankSlotIcons;
import com.questhelper.collections.ItemCollections;
import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverFour;
import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverOne;
import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverThree;
import com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers.RubbleSolverTwo;
Expand Down Expand Up @@ -144,6 +145,7 @@ public class TheCurseOfArrav extends BasicQuestHelper
private PuzzleWrapperStep rubbleMiner1;
private PuzzleWrapperStep rubbleMiner2;
private PuzzleWrapperStep rubbleMiner3;
private PuzzleWrapperStep rubbleMiner4;


@Override
Expand Down Expand Up @@ -379,6 +381,9 @@ public void setupSteps()
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.");
rubbleMiner4 = new RubbleSolverFour(this).puzzleWrapStep("Mine the rubble and make your way through the cave.");

rubbleMiner1.addSubSteps(rubbleMiner2, rubbleMiner3, rubbleMiner4);

unsortedStep20 = new ConditionalStep(this, headToTrollheim);
((ConditionalStep) unsortedStep20).addStep(inTrollweissCave, rubbleMiner1);
Expand All @@ -395,10 +400,40 @@ public void setupSteps()
((ConditionalStep) unsortedStep26).addStep(onTrollweissMountain, enterTrollweissCave);
((ConditionalStep) unsortedStep26).addStep(inTrollheimCave, continueThroughTrollheimCave);

unsortedStep28 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 28");
unsortedStep30 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 30");
unsortedStep32 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 32");
unsortedStep34 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 34");
unsortedStep28 = new ConditionalStep(this, headToTrollheim);
((ConditionalStep) unsortedStep28).addStep(inTrollweissCave, rubbleMiner4);
((ConditionalStep) unsortedStep28).addStep(onTrollweissMountain, enterTrollweissCave);
((ConditionalStep) unsortedStep28).addStep(inTrollheimCave, continueThroughTrollheimCave);


var climbUpstairsAndTalkToArrav = new ObjectStep(this, ObjectID.STAIRS_50508, new WorldPoint(2811, 10267, 0), "Climb up the stairs in the room with the red tile floor and talk to Arrav.");
unsortedStep30 = new ConditionalStep(this, headToTrollheim);
((ConditionalStep) unsortedStep30).addStep(inTrollweissCave, climbUpstairsAndTalkToArrav);
((ConditionalStep) unsortedStep30).addStep(onTrollweissMountain, enterTrollweissCave);
((ConditionalStep) unsortedStep30).addStep(inTrollheimCave, continueThroughTrollheimCave);

var arravHouseFirstRoom = new Zone(new WorldPoint(2848, 3868, 0), new WorldPoint(2858, 3873, 0));
var inArravHouseFirstRoom = new ZoneRequirement(arravHouseFirstRoom);
var talkToArrav = new NpcStep(this, NpcID.ARRAV_14129, new WorldPoint(2856, 3871, 0), "Talk to Arrav.");

unsortedStep32 = new ConditionalStep(this, headToTrollheim);
((ConditionalStep) unsortedStep32).addStep(inArravHouseFirstRoom, talkToArrav);
((ConditionalStep) unsortedStep32).addStep(inTrollweissCave, climbUpstairsAndTalkToArrav);
((ConditionalStep) unsortedStep32).addStep(onTrollweissMountain, enterTrollweissCave);
((ConditionalStep) unsortedStep32).addStep(inTrollheimCave, continueThroughTrollheimCave);

var arravHouseSecondRoom = new Zone(new WorldPoint(2859, 2873, 0), new WorldPoint(2863, 3865, 0));
var inArravHouseSecondRoom = new ZoneRequirement(arravHouseSecondRoom);

var goToNextRoom = new ObjectStep(this, ObjectID.DOOR_50514, new WorldPoint(2859, 3870, 0), "Enter the room to your east and search the tapestry for ?.");
var searchTapestry = new ObjectStep(this, ObjectID.TAPESTRY_50516, new WorldPoint(2861, 3865, 0), "Search the tapestry in the south of the room.");
unsortedStep34 = new ConditionalStep(this, headToTrollheim);
((ConditionalStep) unsortedStep34).addStep(inArravHouseSecondRoom, searchTapestry);
((ConditionalStep) unsortedStep34).addStep(inArravHouseFirstRoom, goToNextRoom);
((ConditionalStep) unsortedStep34).addStep(inTrollweissCave, climbUpstairsAndTalkToArrav);
((ConditionalStep) unsortedStep34).addStep(onTrollweissMountain, enterTrollweissCave);
((ConditionalStep) unsortedStep34).addStep(inTrollheimCave, continueThroughTrollheimCave);

unsortedStep36 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 36");
unsortedStep38 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 38");
unsortedStep40 = new NpcStep(this, NpcID.YELLOW_FORTUNE_SECRETARY, "Step 40");
Expand Down Expand Up @@ -522,9 +557,7 @@ public List<PanelDetails> getPanels()
rubbleMiner1,
rubbleMiner2,
rubbleMiner3,
unsortedStep24,
unsortedStep26,
unsortedStep28,
rubbleMiner4,
unsortedStep30,
unsortedStep32,
unsortedStep34,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public abstract class RubbleSolver extends DetailedOwnerStep {

private int stepCounter;

public RubbleSolver(TheCurseOfArrav theCurseOfArrav) {
super(theCurseOfArrav, "Make your way through the Trollweiss cave, mining rubble with your pickaxe.");
public RubbleSolver(TheCurseOfArrav theCurseOfArrav, String number) {
super(theCurseOfArrav, "Make your way through the Trollweiss cave, mining rubble with your pickaxe. " + number);
}

protected void addMineRubbleStep(int x, int y, RubbleType rubbleType, Direction direction) {
Expand Down Expand Up @@ -103,59 +103,6 @@ protected void setupSteps() {

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
Expand All @@ -170,8 +117,8 @@ protected void setupSteps() {
// i = 2: Mine A, with no condition

conditionalStep = new ConditionalStep(getQuestHelper(), todo);
Collections.reverse(this.mineSteps);
Collections.reverse(this.inverseConditions);
// Collections.reverse(this.mineSteps);
// Collections.reverse(this.inverseConditions);

assert this.mineSteps.size() == this.conditions.size();
assert this.mineSteps.size() == this.inverseConditions.size();
Expand All @@ -187,22 +134,23 @@ protected void setupSteps() {
// }
for (var i = 0; i < mineSteps.size(); i++) {
var mineStep = mineSteps.get(i);
var inverseCondition = this.inverseConditions.get(i);

var conditionList = new ArrayList<Requirement>();
// var conditionList = new ArrayList<Requirement>();

mineStep.addRequirement(this.inverseConditions.get(i));
conditionList.add(this.inverseConditions.get(i));
mineStep.addRequirement(inverseCondition);
// 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);
}
// 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(true, LogicType.AND, conditionList);
xd.setText(text.toString());
var xd = new Conditions(LogicType.AND, inverseCondition);
xd.setText(inverseCondition.getDisplayText());

conditionalStep.addStep(xd, mineStep);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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 3 (when quest state varbit is 26)
*/
@Slf4j
public class RubbleSolverFour extends RubbleSolver
{
public RubbleSolverFour(TheCurseOfArrav theCurseOfArrav) {
super(theCurseOfArrav, "4");
}

@Override
protected void setupRubbleSteps() {
this.addMineRubbleStep(2787, 10267, RubbleType.Three, Direction.WEST); // 1
this.addMineRubbleStep(2787, 10266, RubbleType.Three, Direction.WEST); // 2
this.addMineRubbleStep(2787, 10267, RubbleType.Two, Direction.SOUTH); // 3
this.addMineRubbleStep(2788, 10267, RubbleType.Two, Direction.NORTH); // 4
this.addMineRubbleStep(2787, 10267, RubbleType.One, Direction.NORTH); // 5
this.addMineRubbleStep(2788, 10267, RubbleType.One, Direction.WEST); // 6

// Last part from south
this.addMineRubbleStep(2803, 10264, RubbleType.Three, Direction.SOUTH); // 7
this.addMineRubbleStep(2803, 10265, RubbleType.Two, Direction.SOUTH); // 8

// Last part from north
this.addMineRubbleStep(2803, 10267, RubbleType.One, Direction.NORTH); // 9
this.addMineRubbleStep(2803, 10266, RubbleType.Three, Direction.NORTH); // 10
this.addMineRubbleStep(2804, 10266, RubbleType.Two, Direction.NORTH); // 11

// Last part from west
this.addMineRubbleStep(2802, 10266, RubbleType.Two, Direction.WEST); // 12
this.addMineRubbleStep(2801, 10265, RubbleType.One, Direction.NORTH); // 13
this.addMineRubbleStep(2802, 10265, RubbleType.One, Direction.WEST); // 14
this.addMineRubbleStep(2803, 10265, RubbleType.One, Direction.WEST); // 15
this.addMineRubbleStep(2802, 10266, RubbleType.One, Direction.SOUTH); // 16
this.addMineRubbleStep(2803, 10266, RubbleType.Two, Direction.WEST); // 17
this.addMineRubbleStep(2804, 10265, RubbleType.Two, Direction.WEST); // 18
this.addMineRubbleStep(2803, 10266, RubbleType.One, Direction.SOUTH); // 19
this.addMineRubbleStep(2804, 10266, RubbleType.One, Direction.WEST); // 20
this.addMineRubbleStep(2804, 10265, RubbleType.One, Direction.NORTH); // 21
this.addMineRubbleStep(2805, 10265, RubbleType.One, Direction.WEST); // 22
this.addMineRubbleStep(2806, 10265, RubbleType.One, Direction.WEST); // 23
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class RubbleSolverOne extends RubbleSolver
{
public RubbleSolverOne(TheCurseOfArrav theCurseOfArrav) {
super(theCurseOfArrav);
super(theCurseOfArrav, "1");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@
public class RubbleSolverThree extends RubbleSolver
{
public RubbleSolverThree(TheCurseOfArrav theCurseOfArrav) {
super(theCurseOfArrav);
super(theCurseOfArrav, "3");
}

@Override
protected void setupRubbleSteps() {
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
// These 3 steps are technically part of the next solver, but it's better to get these done asap
this.addMineRubbleStep(2787, 10267, RubbleType.Three, Direction.WEST); // 1
this.addMineRubbleStep(2787, 10266, RubbleType.Three, Direction.WEST); // 2
this.addMineRubbleStep(2787, 10267, RubbleType.Two, Direction.SOUTH); // 3

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, 10286, RubbleType.One, Direction.WEST); // 4
this.addMineRubbleStep(2789, 10285, RubbleType.Three, Direction.NORTH); // 5
this.addMineRubbleStep(2789, 10285, RubbleType.Two, Direction.WEST); // 6

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(2789, 10285, RubbleType.One, 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);
Expand All @@ -37,8 +38,8 @@ protected void setupRubbleSteps() {
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(2792, 10285, RubbleType.One, Direction.WEST);
this.addMineRubbleStep(2793, 10285, RubbleType.One, Direction.WEST);

this.addMineRubbleStep(2787, 10267, RubbleType.One, Direction.NORTH); // 26 (or when??)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class RubbleSolverTwo extends RubbleSolver
{
public RubbleSolverTwo(TheCurseOfArrav theCurseOfArrav) {
super(theCurseOfArrav);
super(theCurseOfArrav, "2");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
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);
Two(ObjectID.RUBBLE_50598, ObjectID.RUBBLE_50602, ObjectID.RUBBLE_50601, ObjectID.RUBBLE_50599),
One(ObjectID.RUBBLE_50587, ObjectID.RUBBLE_50589, ObjectID.RUBBLE_50590, ObjectID.RUBBLE_50594, ObjectID.RUBBLE_50597, ObjectID.RUBBLE_50588);

private final List<Integer> objectIDs;

Expand Down

0 comments on commit 59f0ef8

Please sign in to comment.