Skip to content

Commit

Permalink
Fix the Memory Puzzle in Lunar Diplomacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoinkwiz committed Oct 1, 2023
1 parent 4b25978 commit 14a9c8f
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ public void setupConditions()
public void setupSteps()
{
talkToLokar = new NpcStep(this, NpcID.LOKAR_SEARUNNER_6648, new WorldPoint(2620, 3693, 0), "Talk to Lokar Searunner on Rellekka's docks.");
talkToLokar.addDialogSteps("You've been away from these parts a while?", "Why did you leave?", "Why not, I've always wondered what the state of my innards are!");
talkToLokar.addDialogSteps("Yes.", "You've been away from these parts a while?", "Why did you leave?", "Why not, I've always wondered what the state of my innards are!");

talkToBrundt = new NpcStep(this, NpcID.BRUNDT_THE_CHIEFTAIN_9263, new WorldPoint(2658, 3667, 0), "Talk to Brundt in Rellekka's longhall.");
talkToBrundt.addDialogStep("Ask about a Seal of Passage.");
Expand Down Expand Up @@ -699,26 +699,30 @@ public void setupSteps()
useOnAir = new ObjectStep(this, ObjectID.ALTAR_34760, new WorldPoint(2844, 4834, 0),
"Use the staff on the altar.", dramenStaffHighlighted);
useOnAir.addIcon(ItemID.DRAMEN_STAFF);
enterAirAltar.addSubSteps(useOnAir);

enterFireAltar = new ObjectStep(this, NullObjectID.NULL_34817, new WorldPoint(3313, 3255, 0),
"Enter the Fire Altar and use a partially made lunar staff on it.", fireTalisman, lunarStaffP1);
enterFireAltar.addIcon(ItemID.FIRE_TALISMAN);
useOnFire = new ObjectStep(this, ObjectID.ALTAR_34764, new WorldPoint(2585, 4838, 0),
"Use the staff on the altar.", lunarStaffP1Highlighted);
useOnFire.addIcon(ItemID.LUNAR_STAFF__PT1);
enterFireAltar.addSubSteps(useOnFire);

enterWaterAltar = new ObjectStep(this, NullObjectID.NULL_34815, new WorldPoint(3185, 3165, 0),
"Enter the Water Altar and use the partially made lunar staff on it.", waterTalisman, lunarStaffP2);
enterWaterAltar.addIcon(ItemID.WATER_TALISMAN);
useOnWater = new ObjectStep(this, ObjectID.ALTAR_34762, new WorldPoint(2716, 4836, 0), "Use the staff on the altar.", lunarStaffP2Highlighted);
useOnWater.addIcon(ItemID.LUNAR_STAFF__PT2);
enterWaterAltar.addSubSteps(useOnWater);

enterEarthAltar = new ObjectStep(this, NullObjectID.NULL_34816, new WorldPoint(3306, 3474, 0),
"Enter the Earth Altar and use a partially made lunar staff on it.", earthTalisman, lunarStaffP3);
enterEarthAltar.addIcon(ItemID.EARTH_TALISMAN);
useOnEarth = new ObjectStep(this, ObjectID.ALTAR_34763, new WorldPoint(2658, 4841, 0),
"Use the staff on the altar.", lunarStaffP3Highlighted);
useOnEarth.addIcon(ItemID.LUNAR_STAFF__PT3);
enterEarthAltar.addSubSteps(useOnEarth);

talkToOneiromancerWithStaff = new NpcStep(this, NpcID.ONEIROMANCER, new WorldPoint(2151, 3867, 0), "Bring the staff to the Oneiromancer in the south east of Lunar Isle.", sealOfPassage, lunarStaff);

Expand All @@ -727,6 +731,7 @@ public void setupSteps()
mineOre.addAlternateObjects(ObjectID.STALAGMITES_15250);
smeltBar = new DetailedQuestStep(this, "Smelt the ore at a furnace.", lunarOre);
makeHelmet = new DetailedQuestStep(this, "Make the lunar helmet on an anvil.", lunarBar, hammer);
makeHelmet.addDialogStep("Yes.");
talkToPauline = new NpcStep(this, NpcID.PAULINE_POLARIS, new WorldPoint(2070, 3917, 0), "Talk to Pauline Polaris in the west of Lunar Isle's town.", sealOfPassage);
talkToPauline.addDialogSteps("Pauline?", "Jane Blud-Hagic-Maid");
talkToMeteora = new NpcStep(this, NpcID.METEORA, new WorldPoint(2083, 3890, 0), "Talk to Meteora in the south of Lunar Isle's town.", sealOfPassage);
Expand Down Expand Up @@ -934,7 +939,7 @@ public List<PanelDetails> getPanels()
List<PanelDetails> allSteps = new ArrayList<>();
allSteps.add(new PanelDetails("Investigating", Arrays.asList(talkToLokar, talkToBrundt, talkToLokarAgain, climbLadder, talkToBentley),
bullseyeLantern, tinderboxHighlighted));
allSteps.add(new PanelDetails("The curse", Arrays.asList(climbDownSouthStairs, climbUpSouthStairs, goUpToShultz, goDownToBurns1, goUpToLee1,
allSteps.add(new PanelDetails("The curse", Arrays.asList(climbDownSouthStairs, climbUpSouthStairs, goDownToJackAgain, goUpToShultz, goDownToBurns1, goUpToLee1,
goDownToDavey, goUpToCabinBoy, replaceLens, lightLantern, goUpToCannon1, goDownToChart, useLanternOnChest, useLanternOnPillar, useLanternOnCrate,
talkToBentleyToSail), bullseyeLantern, tinderboxHighlighted));
allSteps.add(new PanelDetails("Starting diplomacy", Arrays.asList(
Expand Down Expand Up @@ -972,9 +977,9 @@ public List<PanelDetails> getPanels()
bringItemsToOneiromancer)));

allSteps.add(new PanelDetails("Entering the Dreamland", Arrays.asList(
useVialOnKindling, lightBrazier, useKindlingOnBrazier, talkToEthereal)));
useVialOnKindling, lightBrazier, useKindlingOnBrazier, talkToEthereal), tinderboxHighlighted));
allSteps.add(new PanelDetails("Racing challenge", Arrays.asList(goToRace, startRace, doRaceChallenge)));
allSteps.add(new PanelDetails("Number challenge", Arrays.asList(goToNumbers, doNumberChallenge)));
allSteps.add(new PanelDetails("Number challenge", Arrays.asList(goToNumbers, startNumber, doNumberChallenge)));
allSteps.add(new PanelDetails("Mimic challenge", Arrays.asList(goToMimic, doMimicChallenge)));
allSteps.add(new PanelDetails("Chance challenge", Arrays.asList(goToChance, doChanceChallenge)));
allSteps.add(new PanelDetails("Memory challenge", Arrays.asList(goToMemory, doMemoryChallenge)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public void onGameTick(GameTick event)
return;
}

if (lastPos + 1 == wps.size())
{
return;
}

// If start of path, check first point in legit path
if (currentPath.size() == 0)
{
Expand All @@ -79,7 +84,7 @@ public void onGameTick(GameTick event)
// If started path, check furthest we've reached in path
WorldPoint lastPoint = currentPath.get(currentPath.size() - 1);

WorldPoint instanceWp = QuestPerspective.getInstanceWorldPointFromReal(client, wps.get(lastPos));
WorldPoint instanceWp = wps.get(lastPos);
if (instanceWp == null)
{
return;
Expand All @@ -94,11 +99,12 @@ public void onGameTick(GameTick event)
public void checkNextTile(int wpsPos)
{
WorldPoint instanceWp = QuestPerspective.getInstanceWorldPointFromReal(client, wps.get(wpsPos));
System.out.println(instanceWp);
if (instanceWp == null)
{
return;
}

System.out.println(client.getLocalPlayer().getWorldLocation());
// If on same tiles as wpsPos
if (client.getLocalPlayer() != null &&
client.getLocalPlayer().getWorldLocation().distanceTo(instanceWp) == 0)
Expand All @@ -124,6 +130,7 @@ public void setupPaths()
current4 == column4
)
{
System.out.println("COLUMN RIP");
return;
}

Expand All @@ -135,35 +142,66 @@ public void setupPaths()
setLinePoints(new ArrayList<>());
currentPath = new ArrayList<>();

// Facing south to north
// Go from lowest to highest
// west to east is 2412->2415

// Path 1
if (client.getVarbitValue(2414) == 83)
// TODO: Maybe make this dynamic?
// Convert to an array of tiles. Find start tile, find neighbour
// Go to neighbour, discount previous tile
// Move to next neighbour, etc

// Path 1 (confirmed)
if (client.getVarbitValue(2415) == 123)
{
wps = Arrays.asList(
new WorldPoint(1731, 5106, 2),
new WorldPoint(1731, 5103, 2),
new WorldPoint(1734, 5108, 2),
new WorldPoint(1734, 5106, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1740, 5103, 2),
new WorldPoint(1740, 5100, 2),
new WorldPoint(1740, 5097, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1734, 5097, 2),
new WorldPoint(1731, 5097, 2),
new WorldPoint(1740, 5094, 2),
new WorldPoint(1737, 5094, 2),
new WorldPoint(1734, 5094, 2),
new WorldPoint(1731, 5094, 2),
new WorldPoint(1731, 5091, 2),
new WorldPoint(1731, 5088, 2),
new WorldPoint(1734, 5088, 2),
new WorldPoint(1737, 5088, 2),
new WorldPoint(1737, 5085, 2),
new WorldPoint(1737, 5083, 2)
new WorldPoint(1740, 5088, 2),
new WorldPoint(1740, 5085, 2),
new WorldPoint(1740, 5083, 2)
);
setWorldPoint(1737, 5083, 2);
setWorldPoint(1740, 5083, 2);
}
// Path 2
// Path 2 (updated)
else if (client.getVarbitValue(2413) == 3)
{
wps = Arrays.asList(
new WorldPoint(1740, 5108, 2),
new WorldPoint(1740, 5106, 2),
new WorldPoint(1740, 5103, 2),
new WorldPoint(1740, 5100, 2),
new WorldPoint(1737, 5100, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1737, 5094, 2),
new WorldPoint(1740, 5094, 2),
new WorldPoint(1740, 5091, 2),
new WorldPoint(1740, 5088, 2),
new WorldPoint(1737, 5088, 2),
new WorldPoint(1734, 5088, 2),
new WorldPoint(1734, 5085, 2),
new WorldPoint(1734, 5083, 2)
);
setWorldPoint(1734, 5083, 2);
}
// Path 3
else if (client.getVarbitValue(2414) == 192)
{
wps = Arrays.asList(
new WorldPoint(1737, 5108, 2),
new WorldPoint(1737, 5106, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1734, 5103, 2),
Expand All @@ -180,33 +218,11 @@ else if (client.getVarbitValue(2414) == 192)
);
setWorldPoint(1731, 5083, 2);
}
// Path 3
else if (client.getVarbitValue(2415) == 7)
{
wps = Arrays.asList(
new WorldPoint(1731, 5106, 2),
new WorldPoint(1731, 5103, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1737, 5100, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1734, 5097, 2),
new WorldPoint(1731, 5097, 2),
new WorldPoint(1731, 5094, 2),
new WorldPoint(1731, 5091, 2),
new WorldPoint(1734, 5091, 2),
new WorldPoint(1737, 5091, 2),
new WorldPoint(1740, 5091, 2),
new WorldPoint(1740, 5088, 2),
new WorldPoint(1740, 5085, 2),
new WorldPoint(1740, 5083, 2)
);
setWorldPoint(1740, 5083, 2);
}
// Path 4, shared varbit with 3 but will 3 has already passed
else if (client.getVarbitValue(2412) == 28)
{
wps = Arrays.asList(
new WorldPoint(1734, 5108, 2),
new WorldPoint(1734, 5106, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
Expand All @@ -225,33 +241,59 @@ else if (client.getVarbitValue(2412) == 28)
setWorldPoint(1731, 5083, 2);
}
// Path 5
else if (client.getVarbitValue(2415) == 123)
else if (client.getVarbitValue(2414) == 83)
{
wps = Arrays.asList(
new WorldPoint(1734, 5106, 2),
new WorldPoint(1731, 5108, 2),
new WorldPoint(1731, 5106, 2),
new WorldPoint(1731, 5103, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1740, 5103, 2),
new WorldPoint(1740, 5100, 2),
new WorldPoint(1740, 5097, 2),
new WorldPoint(1740, 5094, 2),
new WorldPoint(1737, 5094, 2),
new WorldPoint(1734, 5094, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1734, 5097, 2),
new WorldPoint(1731, 5097, 2),
new WorldPoint(1731, 5094, 2),
new WorldPoint(1731, 5091, 2),
new WorldPoint(1731, 5088, 2),
new WorldPoint(1734, 5088, 2),
new WorldPoint(1737, 5088, 2),
new WorldPoint(1737, 5085, 2),
new WorldPoint(1737, 5083, 2)
);
setWorldPoint(1737, 5083, 2);
}
// Path 6 (confirmed)
else if (client.getVarbitValue(2415) == 7)
{
wps = Arrays.asList(
new WorldPoint(1731, 5108, 2),
new WorldPoint(1731, 5106, 2),
new WorldPoint(1731, 5103, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1737, 5100, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1734, 5097, 2),
new WorldPoint(1731, 5097, 2),
new WorldPoint(1731, 5094, 2),
new WorldPoint(1731, 5091, 2),
new WorldPoint(1734, 5091, 2),
new WorldPoint(1737, 5091, 2),
new WorldPoint(1740, 5091, 2),
new WorldPoint(1740, 5088, 2),
new WorldPoint(1740, 5085, 2),
new WorldPoint(1740, 5083, 2)
);
setWorldPoint(1740, 5083, 2);
}
// Path 6
// Path 7
else if (client.getVarbitValue(2414) == 42)
{
wps = Arrays.asList(
new WorldPoint(1731, 5108, 2),
new WorldPoint(1731, 5106, 2),
new WorldPoint(1731, 5103, 2),
new WorldPoint(1731, 5100, 2),
Expand All @@ -271,31 +313,11 @@ else if (client.getVarbitValue(2414) == 42)
);
setWorldPoint(1740, 5083, 2);
}
// Path 7
else if (client.getVarbitValue(2413) == 218)
{
wps = Arrays.asList(
new WorldPoint(1734, 5106, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1737, 5100, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1734, 5097, 2),
new WorldPoint(1734, 5094, 2),
new WorldPoint(1731, 5094, 2),
new WorldPoint(1731, 5091, 2),
new WorldPoint(1731, 5088, 2),
new WorldPoint(1734, 5088, 2),
new WorldPoint(1737, 5088, 2),
new WorldPoint(1737, 5085, 2),
new WorldPoint(1737, 5083, 2)
);
setWorldPoint(1737, 5083, 2);
}
// Path 8
else if (client.getVarbitValue(2414) == 91)
{
wps = Arrays.asList(
new WorldPoint(1734, 5108, 2),
new WorldPoint(1734, 5106, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
Expand All @@ -313,30 +335,33 @@ else if (client.getVarbitValue(2414) == 91)
);
setWorldPoint(1737, 5083, 2);
}
// Path 9
else if (client.getVarbitValue(2413) == 3)
// Path 9 (confirmed)
else if (client.getVarbitValue(2413) == 218)
{
wps = Arrays.asList(
new WorldPoint(1740, 5106, 2),
new WorldPoint(1740, 5103, 2),
new WorldPoint(1740, 5100, 2),
new WorldPoint(1734, 5108, 2),
new WorldPoint(1734, 5106, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
new WorldPoint(1737, 5100, 2),
new WorldPoint(1737, 5097, 2),
new WorldPoint(1737, 5094, 2),
new WorldPoint(1740, 5094, 2),
new WorldPoint(1740, 5091, 2),
new WorldPoint(1740, 5088, 2),
new WorldPoint(1737, 5088, 2),
new WorldPoint(1734, 5097, 2),
new WorldPoint(1734, 5094, 2),
new WorldPoint(1731, 5094, 2),
new WorldPoint(1731, 5091, 2),
new WorldPoint(1731, 5088, 2),
new WorldPoint(1734, 5088, 2),
new WorldPoint(1734, 5085, 2),
new WorldPoint(1734, 5083, 2)
new WorldPoint(1737, 5088, 2),
new WorldPoint(1737, 5085, 2),
new WorldPoint(1737, 5083, 2)
);
setWorldPoint(1734, 5083, 2);
setWorldPoint(1737, 5083, 2);
}
// Path 10
else if (client.getVarbitValue(2412) == 30)
else if (client.getVarbitValue(2415) == 120)
{
wps = Arrays.asList(
new WorldPoint(1734, 5108, 2),
new WorldPoint(1734, 5106, 2),
new WorldPoint(1734, 5103, 2),
new WorldPoint(1737, 5103, 2),
Expand Down

0 comments on commit 14a9c8f

Please sign in to comment.