diff --git a/AGENTS.md b/AGENTS.md index b3c50bf73d3..968dedadd23 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,95 +1,33 @@ -# Microbot Agent Guide - -Guidance for AI agents building Microbot scripts with the new `microbot/api` queryable layer. +# Microbot API Guide (for Claude) ## Scope & Paths - Primary plugin code: `runelite-client/src/main/java/net/runelite/client/plugins/microbot`. - Queryable API docs: `.../microbot/api/QUERYABLE_API.md`; quick read: `api/README.md`. - Keep new scripts inside the microbot plugin; share helpers under `microbot/util`. - -## Build & Test -- Fast build: `mvn -pl runelite-client -am package` (jar in `runelite-client/target/`). -- Unit tests: `mvn -pl runelite-client test`. -- CI parity: `./ci/build.sh` (runs `mvn verify --settings ci/settings.xml`). - -## Style Rules -- Java 11 target, tabs for indentation, braces match `MicrobotPlugin.java`, prefer <120 chars/line. -- Name types in UpperCamelCase, members in lowerCamelCase; configs prefixed with plugin name (e.g., `ExampleConfig`). - -## Script Pattern -Pair a RuneLite `Plugin` with a `Script` that runs on a background thread; never sleep on the client thread. - -```java -@PluginDescriptor(name = "Gathering Demo") -public class GatheringPlugin extends Plugin { - @Inject private GatheringScript script; - @Override protected void startUp() { script.run(); } - @Override protected void shutDown() { script.shutdown(); } -} - -@Slf4j -public class GatheringScript extends Script { - @Override - public boolean run() { - mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> { - try { - if (!Microbot.isLoggedIn() || !super.run()) return; - - Rs2TileObjectModel tree = new Rs2TileObjectQueryable() - .withName("Tree") - .where(obj -> !Rs2Player.isAnimating()) - .nearest(); - - if (tree != null) { - tree.click("Chop down"); - sleepUntil(() -> Rs2Player.isAnimating(), 3000); - } - } catch (Exception e) { - log.error("Loop error", e); - } - }, 0, 600, TimeUnit.MILLISECONDS); // ~1 tick - return true; - } -} -``` - -## Queryable API Cheatsheet -- **NPCs** - ```java - Rs2NpcModel banker = new Rs2NpcQueryable() - .withNames("Banker", "Bank clerk") - .where(npc -> !npc.isInteracting()) - .nearest(15); - if (banker != null) banker.click("Bank"); - ``` -- **Ground items** - ```java - Rs2TileItemModel loot = new Rs2TileItemQueryable() - .where(Rs2TileItemModel::isLootAble) - .where(item -> item.getTotalGeValue() >= 3000) - .nearest(10); - if (loot != null) loot.pickup(); - ``` -- **Tile objects** - ```java - Rs2TileObjectModel bankChest = new Rs2TileObjectQueryable() - .withNames("Bank chest", "Bank booth") - .nearest(20); - if (bankChest != null && !Rs2Bank.isOpen()) { - bankChest.click("Bank"); - sleepUntil(Rs2Bank::isOpen, 5000); - } - ``` -- **Players** - ```java - Rs2PlayerModel ally = new Rs2PlayerQueryable() - .where(Rs2PlayerModel::isFriend) - .within(20) - .nearest(); - ``` - -## Safety & Timing -- Always guard logic with `Microbot.isLoggedIn()` and `super.run()`; bail early when paused. -- Use `sleep`/`sleepUntil` only on script threads; wrap client access with `Microbot.getClientThread().runOnClientThread(...)` when needed. -- Wait for state changes after interactions (`Rs2Bank.isOpen()`, `Rs2Player.isAnimating()`, inventory/bank counts). -- Limit query radius with `.within(...)` to reduce overhead and cache results inside a loop when reused. +- Config UI for microbot plugins is rendered via `plugins/microbot/ui/MicrobotConfigPanel` (not the default RuneLite config panel); put config UI changes there. + +## Paths & Builds +- Plugin sources live in `runelite-client/src/main/java/net/runelite/client/plugins/microbot`. +- The queryable API lives in `.../microbot/api`; full guide: `.../microbot/api/QUERYABLE_API.md`. +- Quick builds: `mvn -pl runelite-client -am package`; tests: `mvn -pl runelite-client test`. + +## Queryable API Quick Reference +Prefer the queryable API over legacy util calls. + +## Interaction & Timing Tips +- Never sleep on the RuneLite client thread; use the script thread with `sleep(...)` / `sleepUntil(...)`. +- After interactions, wait for state changes (e.g., `Rs2Bank.isOpen()`, `Rs2Player.isAnimating()`). +- Limit search radius with `.within(...)` to reduce overhead, and cache query results when reusing in a loop. + +## Helpful References +- Example templates: `runelite-client/src/main/java/net/runelite/client/plugins/microbot/example/`. +- API examples: `api/*/` directories contain `*ApiExample.java` files for NPCs, tile items, players, and objects. +- Core utilities (legacy but still useful): `microbot/util` (e.g., `Rs2Inventory`, `Rs2Bank`, `Rs2Walker`). + +## QuestScript Loop (Quest Helper) +- `QuestScript.run(config, plugin)` sets a 400–1000ms fixed-delay loop; exits early if quest helper is toggled off, not logged in, paused (`super.run()`), or no quest is selected, and waits out player animations. +- Captures the active `QuestStep`, marks when dialogue starts, auto-chooses matching dialogue options, and clicks highlighted widgets (special shop buy for Pirate's Treasure). +- Runs quest-specific logic via `QuestRegistry.getQuest(...).executeCustomLogic()` (Pirate's Treasure gets the plugin injected). +- While incomplete: handles dialogue quirks (Cook's Assistant/Pirate's Treasure), exits cutscenes, clears walk targets when talking, and manages reachability flags. +- Requirement phase: equips required items, warns on missing items (rate-limited), and attempts to acquire them by looting nearby or walking toward the defined point; prioritizes item-on-item detailed steps before other step types. +- Dispatch order: `ConditionalStep` → `NpcStep` → `ObjectStep` → `DigStep` → `PuzzleStep`; per-type handlers choose the correct menu action, manage line-of-sight and walkable tiles, and call `sleepUntil` to wait for movement/animation/interactions before looping. diff --git a/CLAUDE.MD b/CLAUDE.MD index 35bdf4c3252..6667dfcbab4 100644 --- a/CLAUDE.MD +++ b/CLAUDE.MD @@ -7,84 +7,9 @@ Short notes for writing automation scripts with the Microbot plugin inside RuneL - The queryable API lives in `.../microbot/api`; full guide: `.../microbot/api/QUERYABLE_API.md`. - Quick builds: `mvn -pl runelite-client -am package`; tests: `mvn -pl runelite-client test`. -## Script Skeleton -Use a Plugin + Script pair. Keep sleeps off the client thread and always check login state. - -```java -@PluginDescriptor(name = "Goblin Demo", description = "Queryable API example") -public class GoblinDemoPlugin extends Plugin { - @Inject private GoblinDemoScript script; - - @Override protected void startUp() { script.run(); } - @Override protected void shutDown() { script.shutdown(); } -} - -@Slf4j -public class GoblinDemoScript extends Script { - @Override - public boolean run() { - mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> { - try { - if (!Microbot.isLoggedIn() || !super.run()) return; - - Rs2NpcModel target = new Rs2NpcQueryable() - .withName("Goblin") - .where(npc -> !npc.isInteracting()) - .nearest(10); - - if (target != null && !Rs2Player.isInCombat()) { - target.click("Attack"); - sleepUntil(() -> Rs2Player.isInCombat(), 2000); - } - } catch (Exception e) { - log.error("Loop error", e); - } - }, 0, 600, TimeUnit.MILLISECONDS); // ~1 game tick - return true; - } -} -``` - ## Queryable API Quick Reference Prefer the queryable API over legacy util calls. -- **NPCs** - ```java - Rs2NpcModel banker = new Rs2NpcQueryable() - .withNames("Banker", "Bank clerk") - .where(npc -> !npc.isInteracting()) - .nearest(15); - if (banker != null) banker.click("Bank"); - ``` - -- **Ground items** - ```java - Rs2TileItemModel loot = new Rs2TileItemQueryable() - .where(Rs2TileItemModel::isLootAble) - .where(item -> item.getTotalGeValue() >= 5000) - .nearest(10); - if (loot != null) loot.pickup(); - ``` - -- **Tile objects** - ```java - Rs2TileObjectModel tree = new Rs2TileObjectQueryable() - .where(obj -> obj.getName() != null && obj.getName().contains("Tree")) - .nearest(); - if (tree != null && !Rs2Player.isAnimating()) { - tree.click("Chop down"); - sleepUntil(() -> Rs2Player.isAnimating(), 3000); - } - ``` - -- **Players** - ```java - Rs2PlayerModel teammate = new Rs2PlayerQueryable() - .where(Rs2PlayerModel::isFriend) - .within(20) - .nearest(); - ``` - ## Interaction & Timing Tips - Never sleep on the RuneLite client thread; use the script thread with `sleep(...)` / `sleepUntil(...)`. - After interactions, wait for state changes (e.g., `Rs2Bank.isOpen()`, `Rs2Player.isAnimating()`). @@ -94,3 +19,11 @@ Prefer the queryable API over legacy util calls. - Example templates: `runelite-client/src/main/java/net/runelite/client/plugins/microbot/example/`. - API examples: `api/*/` directories contain `*ApiExample.java` files for NPCs, tile items, players, and objects. - Core utilities (legacy but still useful): `microbot/util` (e.g., `Rs2Inventory`, `Rs2Bank`, `Rs2Walker`). + +## QuestScript Loop (Quest Helper) +- `QuestScript.run(config, plugin)` sets a 400–1000ms fixed-delay loop; exits early if quest helper is toggled off, not logged in, paused (`super.run()`), or no quest is selected, and waits out player animations. +- Captures the active `QuestStep`, marks when dialogue starts, auto-chooses matching dialogue options, and clicks highlighted widgets (special shop buy for Pirate's Treasure). +- Runs quest-specific logic via `QuestRegistry.getQuest(...).executeCustomLogic()` (Pirate's Treasure gets the plugin injected). +- While incomplete: handles dialogue quirks (Cook's Assistant/Pirate's Treasure), exits cutscenes, clears walk targets when talking, and manages reachability flags. +- Requirement phase: equips required items, warns on missing items (rate-limited), and attempts to acquire them by looting nearby or walking toward the defined point; prioritizes item-on-item detailed steps before other step types. +- Dispatch order: `ConditionalStep` → `NpcStep` → `ObjectStep` → `DigStep` → `PuzzleStep`; per-type handlers choose the correct menu action, manage line-of-sight and walkable tiles, and call `sleepUntil` to wait for movement/animation/interactions before looping. diff --git a/docs/api/MouseMacroRecorder.md b/docs/api/MouseMacroRecorder.md new file mode 100644 index 00000000000..13deea51389 --- /dev/null +++ b/docs/api/MouseMacroRecorder.md @@ -0,0 +1,55 @@ +# Mouse Macro Recorder + +The Mouse Macro Recorder plugin captures mouse movements and menu entry clicks in the client so you can reuse the +sequence later (e.g., for scripting or diagnostics). + +## Plugin Configuration +Use the plugin configuration toggles to control recording: +- **Recording enabled**: clears existing events and begins capturing moves/clicks. +- **Clear recording**: removes all recorded events. +- **Export JSON to clipboard**: formats the current recording as JSON and copies it to the clipboard. + +## Recorded format +Each event includes a timestamp offset, canvas coordinates, and (for clicks) the clicked `MenuEntry` metadata. + +```json +{ + "startedAtEpochMs": 1716220000000, + "events": [ + { + "type": "MOVE", + "offsetMs": 120, + "x": 512, + "y": 338, + "menuEntry": null + }, + { + "type": "CLICK", + "offsetMs": 420, + "x": 516, + "y": 340, + "menuEntry": { + "option": "Chop down", + "target": "Tree", + "type": "GAME_OBJECT_FIRST_OPTION", + "identifier": 1276, + "param0": 48, + "param1": 57, + "itemId": -1, + "itemOp": 0, + "worldViewId": 0, + "forceLeftClick": false, + "deprioritized": false, + "widgetId": null + } + } + ] +} +``` + +## Configuration +Movement sampling controls live under **Recording** in the plugin config: +- **Record mouse movement**: enable or disable movement tracking. +- **Movement sample interval (ms)**: minimum time between recorded move events. +- **Movement min distance**: minimum pixel distance for a movement sample to be kept. +- **Max recorded events**: stops recording after reaching the limit. diff --git a/docs/development.md b/docs/development.md index 525e0f8b20c..1de59921791 100644 --- a/docs/development.md +++ b/docs/development.md @@ -52,6 +52,7 @@ Everything that will help you make scripts is under the **util** folder ### [Rs2MiniMap](api/Rs2MiniMap.md) ### [Rs2Widget](api/Rs2Widget.md) ### [Rs2Tile](api/Rs2Tile.md) +### [MouseMacroRecorder](api/MouseMacroRecorder.md) --- @@ -215,4 +216,3 @@ Coming soon! --- **Are you stuck? Join our [Discord](https://discord.gg/zaGrfqFEWE) server.** - diff --git a/gradle.properties b/gradle.properties index a8cac513ae9..31c43f8095f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,7 @@ project.build.group=net.runelite project.build.version=1.12.10 glslang.path= -microbot.version=2.1.5 +microbot.version=2.1.6 microbot.commit.sha=nogit microbot.repo.url=http://138.201.81.246:8081/repository/microbot-snapshot/ microbot.repo.username= diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigButton.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigButton.java new file mode 100644 index 00000000000..6529d816749 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigButton.java @@ -0,0 +1,44 @@ +package net.runelite.client.config; + +import java.util.Objects; +import java.util.UUID; +import lombok.Getter; +import lombok.NoArgsConstructor; +import net.runelite.client.config.ConfigSerializer; + +/** + * Marker type for rendering a clickable button in the config panel. + */ +@Getter +@NoArgsConstructor +@ConfigSerializer(ConfigButtonSerializer.class) +public class ConfigButton +{ + private String id = UUID.randomUUID().toString(); + + public ConfigButton(String id) + { + this.id = id; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ConfigButton)) + { + return false; + } + ConfigButton that = (ConfigButton) o; + return Objects.equals(id, that.id); + } + + @Override + public int hashCode() + { + return Objects.hash(id); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigButtonSerializer.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigButtonSerializer.java new file mode 100644 index 00000000000..deff0dc53ee --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigButtonSerializer.java @@ -0,0 +1,16 @@ +package net.runelite.client.config; + +public class ConfigButtonSerializer implements Serializer +{ + @Override + public String serialize(ConfigButton configButton) + { + return configButton != null ? configButton.getId() : null; + } + + @Override + public ConfigButton deserialize(String string) + { + return string == null ? new ConfigButton() : new ConfigButton(string); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md index eabc2195757..59a438589f4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/CLAUDE.md @@ -10,6 +10,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co This is a multi-module Maven project with Java 11 as the target version. The main automation code lives in `runelite-client/src/main/java/net/runelite/client/plugins/microbot/`. +**Config UI note:** Microbot plugins use the custom `MicrobotConfigPanel` (under `plugins/microbot/ui`) for config rendering. Any Microbot config UI tweaks—buttons, layouts, or controls—belong there rather than RuneLite’s default config panel. + --- ## Build and Test Commands diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/npc/models/Rs2NpcModel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/npc/models/Rs2NpcModel.java index d3e392f0035..e5b3e8cc22b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/npc/models/Rs2NpcModel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/npc/models/Rs2NpcModel.java @@ -39,6 +39,11 @@ public int getId() return npc.getId(); } + public int getIndex() + { + return npc.getIndex(); + } + // Enhanced utility methods for cache operations diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java index b1503fe1cf6..f8d65c15668 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/breakhandler/breakhandlerv2/BreakHandlerV2Script.java @@ -90,6 +90,7 @@ public boolean run(BreakHandlerV2Config config) { // Detect unexpected logout while waiting for break detectUnexpectedLogout(); + enforceLogoutDuringActiveBreak(); updateWindowTitle(); // Main state machine @@ -521,6 +522,26 @@ private void detectUnexpectedLogout() { } } + /** + * Ensures we are logged out while a break timer is active. + */ + private void enforceLogoutDuringActiveBreak() { + long breakRemainingSeconds = getBreakTimeRemaining(); + + if (breakRemainingSeconds <= 0 || !Microbot.isLoggedIn()) { + return; + } + + BreakHandlerV2State state = BreakHandlerV2State.getCurrentState(); + + if (state != BreakHandlerV2State.LOGOUT_REQUESTED && + state != BreakHandlerV2State.INITIATING_BREAK) { + log.warn("[BreakHandlerV2] Break active ({}s remaining) but player is logged in; forcing logout", + breakRemainingSeconds); + transitionToState(BreakHandlerV2State.LOGOUT_REQUESTED); + } + } + /** * Select world based on configuration and profile */ diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MenuEntrySnapshot.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MenuEntrySnapshot.java new file mode 100644 index 00000000000..1794fd2de67 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MenuEntrySnapshot.java @@ -0,0 +1,40 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +import lombok.Getter; +import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; +import net.runelite.api.widgets.Widget; + +@Getter +public class MenuEntrySnapshot +{ + private final String option; + private final String target; + private final MenuAction type; + private final int identifier; + private final int param0; + private final int param1; + private final int itemId; + private final int itemOp; + private final int worldViewId; + private final boolean forceLeftClick; + private final boolean deprioritized; + private final Integer widgetId; + + public MenuEntrySnapshot(MenuEntry entry) + { + this.option = entry.getOption(); + this.target = entry.getTarget(); + this.type = entry.getType(); + this.identifier = entry.getIdentifier(); + this.param0 = entry.getParam0(); + this.param1 = entry.getParam1(); + this.itemId = entry.getItemId(); + this.itemOp = entry.getItemOp(); + this.worldViewId = entry.getWorldViewId(); + this.forceLeftClick = entry.isForceLeftClick(); + this.deprioritized = entry.isDeprioritized(); + Widget widget = entry.getWidget(); + this.widgetId = widget != null ? widget.getId() : null; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseButton.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseButton.java new file mode 100644 index 00000000000..3339654530a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseButton.java @@ -0,0 +1,8 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +public enum MouseButton +{ + LEFT, + MIDDLE, + RIGHT +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroEvent.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroEvent.java new file mode 100644 index 00000000000..003ef31c6c4 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroEvent.java @@ -0,0 +1,39 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +import lombok.Getter; + +@Getter +public class MouseMacroEvent +{ + private final MouseMacroEventType type; + private final long offsetMs; + private final int x; + private final int y; + private final MouseButton button; + private final MouseModifiers modifiers; + private final Integer scrollDeltaX; + private final Integer scrollDeltaY; + private final MenuEntrySnapshot menuEntry; + + public MouseMacroEvent( + MouseMacroEventType type, + long offsetMs, + int x, + int y, + MouseButton button, + MouseModifiers modifiers, + Integer scrollDeltaX, + Integer scrollDeltaY, + MenuEntrySnapshot menuEntry) + { + this.type = type; + this.offsetMs = offsetMs; + this.x = x; + this.y = y; + this.button = button; + this.modifiers = modifiers; + this.scrollDeltaX = scrollDeltaX; + this.scrollDeltaY = scrollDeltaY; + this.menuEntry = menuEntry; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroEventType.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroEventType.java new file mode 100644 index 00000000000..5bfee89ea34 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroEventType.java @@ -0,0 +1,9 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +public enum MouseMacroEventType +{ + MOVE, + DOWN, + UP, + SCROLL +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderConfig.java new file mode 100644 index 00000000000..f7e12fd538e --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderConfig.java @@ -0,0 +1,83 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +import net.runelite.client.config.Config; +import net.runelite.client.config.ConfigButton; +import net.runelite.client.config.ConfigGroup; +import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; +import net.runelite.client.config.Range; + +@ConfigGroup(MouseMacroRecorderConfig.CONFIG_GROUP) +public interface MouseMacroRecorderConfig extends Config +{ + String CONFIG_GROUP = "mouseMacroRecorder"; + + @ConfigSection( + name = "Recording", + description = "Configure how movement samples are recorded", + position = 0 + ) + String recordingSection = "recording"; + + @ConfigItem( + keyName = "recordingEnabled", + name = "Recording enabled", + description = "Toggle to start or stop recording", + position = 0, + section = recordingSection + ) + default boolean recordingEnabled() + { + return false; + } + + @ConfigItem( + keyName = "recordMouseMovement", + name = "Record mouse movement", + description = "Capture mouse move/drag events", + position = 1, + section = recordingSection + ) + default boolean recordMouseMovement() + { + return true; + } + + @ConfigItem( + keyName = "movementSampleIntervalMs", + name = "Movement sample interval (ms)", + description = "Minimum time between recorded mouse movement samples", + position = 2, + section = recordingSection + ) + @Range(min = 5, max = 500) + default int movementSampleIntervalMs() + { + return 30; + } + + @ConfigItem( + keyName = "movementMinDistance", + name = "Movement min distance", + description = "Minimum pixel distance before recording a move", + position = 3, + section = recordingSection + ) + @Range(min = 0, max = 50) + default int movementMinDistance() + { + return 2; + } + + @ConfigItem( + keyName = "openRecordingsFolder", + name = "Open recordings folder", + description = "Open the folder containing JSONL mouse macro recordings", + position = 4, + section = recordingSection + ) + default ConfigButton openRecordingsFolder() + { + return new ConfigButton(); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderOverlay.java new file mode 100644 index 00000000000..2082c8d3ce8 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderOverlay.java @@ -0,0 +1,43 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +import net.runelite.client.ui.overlay.OverlayPanel; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.components.LineComponent; + +import javax.inject.Inject; +import java.awt.Dimension; +import java.awt.Graphics2D; + +public class MouseMacroRecorderOverlay extends OverlayPanel +{ + private final MouseMacroRecorderPlugin plugin; + + @Inject + private MouseMacroRecorderOverlay(MouseMacroRecorderPlugin plugin) + { + super(plugin); + this.plugin = plugin; + setPosition(OverlayPosition.ABOVE_CHATBOX_RIGHT); + } + + @Override + public Dimension render(Graphics2D graphics) + { + if (!plugin.isRecording()) + { + return null; + } + + panelComponent.getChildren().clear(); + panelComponent.getChildren().add(LineComponent.builder() + .left("Mouse") + .right("Recording") + .build()); + panelComponent.getChildren().add(LineComponent.builder() + .left("Events") + .right(Integer.toString(plugin.getRecordedEventCount())) + .build()); + + return super.render(graphics); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderPlugin.java new file mode 100644 index 00000000000..43fb4e0cc34 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseMacroRecorderPlugin.java @@ -0,0 +1,548 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +import com.google.gson.Gson; +import com.google.inject.Provides; +import lombok.extern.slf4j.Slf4j; +import net.runelite.api.Client; +import net.runelite.api.KeyCode; +import net.runelite.api.Point; +import net.runelite.api.events.MenuOptionClicked; +import net.runelite.client.RuneLite; +import net.runelite.client.config.ConfigManager; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; +import net.runelite.client.input.MouseListener; +import net.runelite.client.input.MouseManager; +import net.runelite.client.input.MouseWheelListener; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.ui.overlay.OverlayManager; + +import javax.inject.Inject; +import java.awt.Desktop; +import java.awt.event.InputEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseWheelEvent; +import java.util.ArrayList; +import java.util.List; +import java.io.BufferedWriter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.UUID; +import java.awt.Dimension; +import java.awt.Toolkit; + +@PluginDescriptor( + name = "Mouse Macro Recorder", + description = "Record mouse movements and clicked menu entries", + tags = {"mouse", "macro", "recorder", "microbot"} +) +@Slf4j +public class MouseMacroRecorderPlugin extends Plugin implements MouseListener, MouseWheelListener +{ + private static final Gson GSON = new Gson(); + public static final String CONFIG_GROUP = "mouseMacroRecorder"; + private static final Path RECORDINGS_DIR = RuneLite.RUNELITE_DIR.toPath().resolve("mouse-macro-recordings"); + private static final DateTimeFormatter FILE_NAME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd-HHmmss"); + private static final int RECORD_VERSION = 1; + + @Inject + private Client client; + + @Inject + private MouseManager mouseManager; + + @Inject + private MouseMacroRecorderConfig config; + + @Inject + private ConfigManager configManager; + + @Inject + private OverlayManager overlayManager; + + @Inject + private MouseMacroRecorderOverlay overlay; + + private final Object lock = new Object(); + private final List events = new ArrayList<>(); + private long recordingStartMs; + private long lastMoveTimeMs; + private java.awt.Point lastMovePoint; + private boolean recording; + private BufferedWriter jsonlWriter; + private Path currentRecordingPath; + private boolean jsonlWriterFailed; + private String sessionId; + + @Provides + MouseMacroRecorderConfig provideConfig(ConfigManager configManager) + { + return configManager.getConfig(MouseMacroRecorderConfig.class); + } + + @Override + protected void startUp() + { + mouseManager.registerMouseListener(this); + mouseManager.registerMouseWheelListener(this); + overlayManager.add(overlay); + if (config.recordingEnabled()) + { + startRecording(); + } + } + + @Override + protected void shutDown() + { + mouseManager.unregisterMouseListener(this); + mouseManager.unregisterMouseWheelListener(this); + overlayManager.remove(overlay); + stopRecording(); + } + + public void startRecording() + { + synchronized (lock) + { + closeJsonlWriterLocked(); + events.clear(); + recordingStartMs = System.currentTimeMillis(); + lastMoveTimeMs = 0; + lastMovePoint = null; + jsonlWriterFailed = false; + sessionId = UUID.randomUUID().toString(); + openJsonlWriterLocked(recordingStartMs); + recording = true; + } + } + + public void stopRecording() + { + synchronized (lock) + { + recording = false; + closeJsonlWriterLocked(); + } + } + + @Subscribe + public void onConfigChanged(ConfigChanged event) + { + if (!MouseMacroRecorderConfig.CONFIG_GROUP.equals(event.getGroup())) + { + return; + } + + String key = event.getKey(); + if ("recordingEnabled".equals(key)) + { + if (config.recordingEnabled()) + { + startRecording(); + } + else + { + stopRecording(); + } + } + else if ("openRecordingsFolder".equals(key)) + { + openRecordingsFolder(); + } + } + + @Subscribe + public void onMenuOptionClicked(MenuOptionClicked event) + { + if (!recording) + { + return; + } + + if (!recordEvent()) + { + return; + } + + Point mousePosition = client.getMouseCanvasPosition(); + recordEvent(MouseMacroEventType.UP, mousePosition.getX(), mousePosition.getY(), MouseButton.LEFT, modifiersFromClient(), null, null, new MenuEntrySnapshot(event.getMenuEntry())); + } + + @Override + public MouseEvent mouseMoved(MouseEvent mouseEvent) + { + recordMouseMove(mouseEvent); + return mouseEvent; + } + + @Override + public MouseEvent mouseDragged(MouseEvent mouseEvent) + { + recordMouseMove(mouseEvent); + return mouseEvent; + } + + @Override + public MouseEvent mouseClicked(MouseEvent mouseEvent) + { + return mouseEvent; + } + + @Override + public MouseEvent mousePressed(MouseEvent mouseEvent) + { + recordMouseButton(mouseEvent, MouseMacroEventType.DOWN); + return mouseEvent; + } + + @Override + public MouseEvent mouseReleased(MouseEvent mouseEvent) + { + recordMouseButton(mouseEvent, MouseMacroEventType.UP); + return mouseEvent; + } + + @Override + public MouseEvent mouseEntered(MouseEvent mouseEvent) + { + return mouseEvent; + } + + @Override + public MouseEvent mouseExited(MouseEvent mouseEvent) + { + return mouseEvent; + } + + @Override + public MouseWheelEvent mouseWheelMoved(MouseWheelEvent mouseWheelEvent) + { + recordMouseScroll(mouseWheelEvent); + return mouseWheelEvent; + } + + private void recordMouseMove(MouseEvent mouseEvent) + { + if (!recording || !config.recordMouseMovement()) + { + return; + } + + long now = System.currentTimeMillis(); + if (now - lastMoveTimeMs < config.movementSampleIntervalMs()) + { + return; + } + + int minDistance = config.movementMinDistance(); + java.awt.Point point = mouseEvent.getPoint(); + if (lastMovePoint != null && minDistance > 0) + { + int dx = point.x - lastMovePoint.x; + int dy = point.y - lastMovePoint.y; + if (dx * dx + dy * dy < minDistance * minDistance) + { + return; + } + } + + if (!recordEvent()) + { + return; + } + + recordEvent(MouseMacroEventType.MOVE, point.x, point.y, buttonFromModifiers(mouseEvent.getModifiersEx()), modifiersFromMouseEvent(mouseEvent), null, null, null); + lastMoveTimeMs = now; + lastMovePoint = point; + } + + private void recordMouseButton(MouseEvent mouseEvent, MouseMacroEventType type) + { + if (!recordEvent()) + { + return; + } + + MouseButton button = buttonFromMouseEvent(mouseEvent); + MouseModifiers modifiers = modifiersFromMouseEvent(mouseEvent); + recordEvent(type, mouseEvent.getX(), mouseEvent.getY(), button, modifiers, null, null, null); + } + + private void recordMouseScroll(MouseWheelEvent mouseWheelEvent) + { + if (!recordEvent()) + { + return; + } + + MouseModifiers modifiers = modifiersFromMouseEvent(mouseWheelEvent); + int deltaY = (int) Math.round(mouseWheelEvent.getPreciseWheelRotation() * mouseWheelEvent.getScrollAmount()); + recordEvent(MouseMacroEventType.SCROLL, mouseWheelEvent.getX(), mouseWheelEvent.getY(), null, modifiers, + null, deltaY, null); + } + + private boolean recordEvent() + { + return recording; + } + + private void recordEvent( + MouseMacroEventType type, + int x, + int y, + MouseButton button, + MouseModifiers modifiers, + Integer scrollDeltaX, + Integer scrollDeltaY, + MenuEntrySnapshot menuEntry) + { + long now = System.currentTimeMillis(); + MouseMacroEvent event = new MouseMacroEvent(type, now - recordingStartMs, x, y, button, modifiers, scrollDeltaX, scrollDeltaY, menuEntry); + synchronized (lock) + { + events.add(event); + writeJsonlEventLocked(event); + } + } + + private void openJsonlWriterLocked(long startedAtEpochMs) + { + try + { + Files.createDirectories(RECORDINGS_DIR); + String filename = "mouse-macro-recording-" + FILE_NAME_FORMATTER.format( + Instant.ofEpochMilli(startedAtEpochMs).atZone(ZoneId.systemDefault()) + ) + ".jsonl"; + currentRecordingPath = RECORDINGS_DIR.resolve(filename); + jsonlWriter = Files.newBufferedWriter(currentRecordingPath, StandardCharsets.UTF_8, + StandardOpenOption.CREATE, StandardOpenOption.APPEND); + writeMetadataLineLocked(startedAtEpochMs); + } + catch (IOException e) + { + jsonlWriterFailed = true; + jsonlWriter = null; + currentRecordingPath = null; + log.warn("Failed to open mouse macro JSONL writer", e); + } + } + + private void writeMetadataLineLocked(long startedAtEpochMs) + { + if (jsonlWriter == null) + { + return; + } + + try + { + jsonlWriter.write(GSON.toJson(buildStartRecord(startedAtEpochMs))); + jsonlWriter.newLine(); + jsonlWriter.flush(); + } + catch (IOException e) + { + jsonlWriterFailed = true; + log.warn("Failed to write mouse macro recording metadata to JSONL", e); + closeJsonlWriterLocked(); + } + } + + private void writeJsonlEventLocked(MouseMacroEvent event) + { + if (jsonlWriter == null || jsonlWriterFailed) + { + return; + } + + try + { + jsonlWriter.write(GSON.toJson(new JsonlEventRecord(sessionId, recordingStartMs, event))); + jsonlWriter.newLine(); + jsonlWriter.flush(); + } + catch (IOException e) + { + jsonlWriterFailed = true; + log.warn("Failed to write mouse macro event to JSONL {}", currentRecordingPath, e); + closeJsonlWriterLocked(); + } + } + + private void openRecordingsFolder() + { + openRecordingsFolderStatic(); + } + + int getRecordedEventCount() + { + synchronized (lock) + { + return events.size(); + } + } + + boolean isRecording() + { + return recording; + } + + public static void openRecordingsFolderStatic() + { + try + { + Files.createDirectories(RECORDINGS_DIR); + if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) + { + Desktop.getDesktop().open(RECORDINGS_DIR.toFile()); + } + else + { + log.warn("Desktop OPEN action not supported; cannot open recordings folder"); + } + } + catch (IOException e) + { + log.warn("Failed to open mouse macro recordings folder {}", RECORDINGS_DIR, e); + } + } + + private JsonlStartRecord buildStartRecord(long startedAtEpochMs) + { + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + return new JsonlStartRecord( + RECORD_VERSION, + sessionId, + startedAtEpochMs, + screen.width, + screen.height, + client.getCanvasWidth(), + client.getCanvasHeight(), + client.getScale() + ); + } + + private MouseButton buttonFromMouseEvent(MouseEvent event) + { + switch (event.getButton()) + { + case MouseEvent.BUTTON1: + return MouseButton.LEFT; + case MouseEvent.BUTTON2: + return MouseButton.MIDDLE; + case MouseEvent.BUTTON3: + return MouseButton.RIGHT; + default: + return null; + } + } + + private MouseButton buttonFromModifiers(int modifiersEx) + { + if ((modifiersEx & InputEvent.BUTTON1_DOWN_MASK) != 0) + { + return MouseButton.LEFT; + } + if ((modifiersEx & InputEvent.BUTTON2_DOWN_MASK) != 0) + { + return MouseButton.MIDDLE; + } + if ((modifiersEx & InputEvent.BUTTON3_DOWN_MASK) != 0) + { + return MouseButton.RIGHT; + } + return null; + } + + private MouseModifiers modifiersFromMouseEvent(MouseEvent mouseEvent) + { + return new MouseModifiers(mouseEvent.isShiftDown(), mouseEvent.isControlDown(), mouseEvent.isAltDown()); + } + + private MouseModifiers modifiersFromClient() + { + return new MouseModifiers( + client.isKeyPressed(KeyCode.KC_SHIFT), + client.isKeyPressed(KeyCode.KC_CONTROL), + client.isKeyPressed(KeyCode.KC_ALT) + ); + } + + private void closeJsonlWriterLocked() + { + if (jsonlWriter == null) + { + return; + } + + try + { + jsonlWriter.close(); + } + catch (IOException e) + { + log.warn("Failed to close mouse macro JSONL writer", e); + } + finally + { + jsonlWriter = null; + currentRecordingPath = null; + } + } + + private static class JsonlStartRecord + { + private final String recordType = "start"; + private final int recordVersion; + private final String sessionId; + private final long startedAtEpochMs; + private final int screenWidth; + private final int screenHeight; + private final int canvasWidth; + private final int canvasHeight; + private final int clientScale; + + private JsonlStartRecord( + int recordVersion, + String sessionId, + long startedAtEpochMs, + int screenWidth, + int screenHeight, + int canvasWidth, + int canvasHeight, + int clientScale) + { + this.recordVersion = recordVersion; + this.sessionId = sessionId; + this.startedAtEpochMs = startedAtEpochMs; + this.screenWidth = screenWidth; + this.screenHeight = screenHeight; + this.canvasWidth = canvasWidth; + this.canvasHeight = canvasHeight; + this.clientScale = clientScale; + } + } + + private static class JsonlEventRecord + { + private final String recordType = "event"; + private final String sessionId; + private final long startedAtEpochMs; + private final MouseMacroEvent event; + + private JsonlEventRecord(String sessionId, long startedAtEpochMs, MouseMacroEvent event) + { + this.sessionId = sessionId; + this.startedAtEpochMs = startedAtEpochMs; + this.event = event; + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseModifiers.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseModifiers.java new file mode 100644 index 00000000000..39dc6e808e2 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/mouserecorder/MouseModifiers.java @@ -0,0 +1,18 @@ +package net.runelite.client.plugins.microbot.mouserecorder; + +import lombok.Getter; + +@Getter +public class MouseModifiers +{ + private final boolean shift; + private final boolean ctrl; + private final boolean alt; + + public MouseModifiers(boolean shift, boolean ctrl, boolean alt) + { + this.shift = shift; + this.ctrl = ctrl; + this.alt = alt; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperConfig.java index 5bd2b7f2aee..4a131c7db85 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperConfig.java @@ -24,11 +24,11 @@ */ package net.runelite.client.plugins.microbot.questhelper; -import lombok.Getter; -import net.runelite.client.config.*; import net.runelite.client.plugins.microbot.questhelper.panel.questorders.QuestOrders; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import lombok.Getter; +import net.runelite.client.config.*; import net.runelite.client.util.Text; import java.awt.*; @@ -40,661 +40,685 @@ import java.util.stream.Collectors; @ConfigGroup("questhelper") -public interface QuestHelperConfig extends Config { - String QUEST_HELPER_GROUP = "questhelper"; - String QUEST_BACKGROUND_GROUP = "questhelpervars"; - String QUEST_HELPER_SIDEBAR_ORDER_KEY_START = "quest-sidebar-order-"; - - enum QuestOrdering implements Comparator { - /** - * Sort quests in alphabetical order - */ - A_TO_Z(QuestOrders.sortAToZ(), QuestFilter.QUEST, QuestFilter.MINIQUEST, QuestFilter.ACHIEVEMENT_DIARY, - QuestFilter.SKILL_HELPER, QuestFilter.GENERIC_HELPER, QuestFilter.PLAYER_MADE_QUESTS), - /** - * Sort quests in reverse alphabetical order - */ - Z_TO_A(QuestOrders.sortZToA(), QuestFilter.QUEST, QuestFilter.MINIQUEST, QuestFilter.ACHIEVEMENT_DIARY, - QuestFilter.SKILL_HELPER, QuestFilter.GENERIC_HELPER, QuestFilter.PLAYER_MADE_QUESTS), - /** - * Sort quests according to the Optimal Quest Guide (https://oldschool.runescape.wiki/w/Optimal_quest_guide) - */ - OPTIMAL(QuestOrders.sortOptimalOrder(), QuestFilter.OPTIMAL, QuestFilter.GENERIC_HELPER), - /** - * Sort quests according to the Optimal Quest Guide (Ironman version) (https://oldschool.runescape.wiki/w/Optimal_quest_guide/Ironman) - */ - OPTIMAL_IRONMAN(QuestOrders.sortOptimalIronmanOrder(), QuestFilter.OPTIMAL, QuestFilter.GENERIC_HELPER), - /** - * Sort quest by their release date (https://oldschool.runescape.wiki/w/Quests/Release_dates) - */ - RELEASE_DATE(QuestOrders.sortByRelease(), QuestFilter.QUEST, QuestFilter.MINIQUEST), - - QUEST_POINTS_ASC(QuestOrders.sortByQuestPointRewardAscending(), QuestFilter.QUEST), - QUEST_POINTS_DESC(QuestOrders.sortByQuestPointRewardDescending(), QuestFilter.QUEST); - - private final Comparator comparator; - @Getter - private final QuestFilter[] sections; - - QuestOrdering(Comparator comparator, QuestFilter... sections) { - this.comparator = comparator; - this.sections = sections; - - } - - public List sort(Collection list) { - return list.stream().sorted(this).collect(Collectors.toList()); - } - - @Override - public int compare(QuestHelper o1, QuestHelper o2) { - return comparator.compare(o1, o2); - } - } - - enum QuestFilter implements Predicate { - /** - * Show all quests - */ - SHOW_ALL(q -> true), - /** - * Show quests where the client meets the quest requirements - */ - SHOW_MEETS_REQS(QuestHelper::clientMeetsRequirements), - /** - * Show all except generic helpers - */ - OPTIMAL("Optimal ordering", - q -> q.getQuest().getQuestType() == QuestDetails.Type.P2P || - q.getQuest().getQuestType() == QuestDetails.Type.F2P || - q.getQuest().getQuestType() == QuestDetails.Type.MINIQUEST || - q.getQuest().getQuestType() == QuestDetails.Type.ACHIEVEMENT_DIARY, - false), - /** - * Show all free-to-play quests - */ - FREE_TO_PLAY(QuestDetails.Type.F2P), - /** - * Show all members' quests - */ - MEMBERS(QuestDetails.Type.P2P), - /** - * Show all quests - */ - QUEST("Quests", q -> q.getQuest().getQuestType() == QuestDetails.Type.P2P || - q.getQuest().getQuestType() == QuestDetails.Type.F2P), - /** - * Show all miniquests (all miniquests are members' only) - */ - MINIQUEST("Miniquests", QuestDetails.Type.MINIQUEST), - /** - * Show all achievement diaries - */ - ACHIEVEMENT_DIARY("Achievement diaries", QuestDetails.Type.ACHIEVEMENT_DIARY), - /** - * Show all generic helpers - */ - GENERIC_HELPER("Generic helpers", QuestDetails.Type.GENERIC), - /** - * Show all skills - */ - SKILL_HELPER("Skill helpers", q -> q.getQuest().getQuestType() == QuestDetails.Type.SKILL_P2P || - q.getQuest().getQuestType() == QuestDetails.Type.SKILL_F2P), - /** - * Show all free-to-play skills - */ - SKILL_FREE_TO_PLAY(QuestDetails.Type.SKILL_F2P), - /** - * Show all members' skills - */ - SKILL_MEMBERS(QuestDetails.Type.SKILL_P2P), - - PLAYER_MADE_QUESTS("Player-made quests", q -> q.getQuest().getQuestType() == QuestDetails.Type.PLAYER_QUEST); - - - private final Predicate predicate; - - @Getter - private final String displayName; - - private final boolean shouldDisplay; - - QuestFilter(Predicate predicate) { - this.predicate = predicate; - this.displayName = Text.titleCase(this); - this.shouldDisplay = true; - } - - QuestFilter(String displayName, Predicate predicate) { - this.predicate = predicate; - this.displayName = displayName; - this.shouldDisplay = true; - } - - QuestFilter(String displayName, Predicate predicate, boolean shouldDisplay) { - this.predicate = predicate; - this.displayName = displayName; - this.shouldDisplay = shouldDisplay; - } - - @Override - public boolean test(QuestHelper quest) { - return predicate.test(quest); - } - - public List test(Collection helpers) { - - return helpers.stream().filter(this).collect(Collectors.toList()); - } - - public static QuestFilter[] displayFilters() { - return Arrays.stream(QuestFilter.values()).filter((questFilter -> questFilter.shouldDisplay)).toArray(QuestFilter[]::new); - } - } - - enum NpcHighlightStyle { - NONE, - OUTLINE, - CONVEX_HULL, - TILE - } - - enum ObjectHighlightStyle { - NONE, - CLICK_BOX, - OUTLINE, - } - - enum GroundItemHighlightStyle { - NONE, - CLICK_BOX, - OUTLINE, - TILE - } - - enum InventoryItemHighlightStyle { - NONE, - SQUARE, - OUTLINE, - FILLED_OUTLINE - } - - @ConfigSection( - position = 0, - name = "Microbot", - description = "Microbot Options", - closedByDefault = false - ) - String microbotSection = "microbotSection"; - - - @ConfigItem( - keyName = "TurnOn", - name = "Enable QuestHelper", - description = "Enable the quest helper that will automatically help with quests.", - section = microbotSection - ) - default boolean startStopQuestHelper() { - return true; - } - - @ConfigSection( - position = 0, - name = "QuestHelper", - description = "QuestHelper Options", - closedByDefault = false - ) - String generalSection = "General"; - - - @ConfigItem( - keyName = "autostartQuests", - name = "Auto start helper", - description = "Automatically start the quest helper when you start a quest", - section = generalSection - ) - default boolean autoStartQuests() { - return true; - } - - @ConfigItem( - keyName = "autoOpenSidebar", - name = "Auto open sidebar", - description = "Automatically opens the quest helper sidebar when you start a quest", - section = generalSection - ) - default boolean autoOpenSidebar() { - return true; - } - - @ConfigItem( - keyName = "showOverlayPanel", - name = "Display overlay on screen", - description = "Chose whether the overlay should be displayed on screen", - section = generalSection - ) - default boolean showOverlay() { - return true; - } - - @ConfigItem( - keyName = "stewBoostsPanel", - name = "Use Spicy stew for boosts", - description = "Raises the boost maximum boost for certain skills to 5", - section = generalSection - ) - default boolean stewBoosts() { - return false; - } - - @ConfigItem( - keyName = "showFan", - name = "Fan appears on quest completion", - description = "Have someone appear to celebrate whenever you complete a quest", - section = generalSection - ) - default boolean showFan() { - return false; - } - - @ConfigItem( - keyName = "showRuneliteObjects", - name = "Show player-made quest rewards", - description = "Choose whether changes from player-made quests are displayed", - section = generalSection - ) - default boolean showRuneliteObjects() { - return true; - } - - @ConfigSection( - position = 0, - name = "Unfinished quest highlights", - description = "Highlight things you will need for quests you have not yet completed" - ) - String itemSection = "itemSection"; - - @ConfigItem( - position = 0, - keyName = "highlightItemsBackground", - name = "Highlight missing items", - description = "Highlight items on the ground you might need for future quests or achievement diaries.
The settings below can be used to control if you want to show items from unfinished quests, miniquests, or diaries", - section = itemSection - ) - default boolean highlightItemsBackground() { - return false; - } - - @ConfigItem( - position = 1, - keyName = "highlightNeededQuestItems", - name = "Include quest items", - description = "Highlight every uncompleted quest's items you're missing on the floor.
Requires the Highlight missing items to be enabled", - section = itemSection - ) - default boolean highlightNeededQuestItems() { - return true; - } - - @ConfigItem( - position = 2, - keyName = "highlightNeededMiniquestItems", - name = "Include miniquest items", - description = "Highlight every uncompleted miniquest's items you're missing on the floor.
Requires the Highlight missing items to be enabled", - section = itemSection - ) - default boolean highlightNeededMiniquestItems() { - return true; - } - - @ConfigItem( - position = 3, - keyName = "highlightNeededAchievementDiaryItems", - name = "Include achievement diary items", - description = "Highlight every uncompleted achievement diary's items you're missing on the floor.
Requires the Highlight missing items to be enabled", - section = itemSection - ) - default boolean highlightNeededAchievementDiaryItems() { - return true; - } - - @ConfigSection( - position = 1, - name = "Sidebar details", - description = "Determines sidebar rendering" - ) - String sidebarDetailsSection = "sidebarDetailsSection"; - - @ConfigItem( - keyName = "showFullRequirements", - name = "Show full quest requirements", - description = "Show all quest requirements, including requirements for sub-quests", - section = sidebarDetailsSection - ) - default boolean showFullRequirements() { - return false; - } - - @ConfigItem( - keyName = "hideQuestRewards", - name = "Hide quest rewards", - description = "Enable this config if you want to hide quest rewards.
If you already had a quest helper open, you need to
restart it to hide the quest rewards.", - section = sidebarDetailsSection - ) - default boolean hideQuestRewards() { - return false; - } - - @ConfigSection( - position = 2, - name = "Quest Hints", - description = "Determines what hints should be shown" - ) - String hintsSection = "hintsSection"; - - @ConfigItem( - keyName = "showTextHighlight", - name = "Highlight correct dialog", - description = "Highlight correct dialog choices", - section = hintsSection - ) - default boolean showTextHighlight() { - return true; - } - - @ConfigItem( - keyName = "showSymbolOverlay", - name = "Display icons on NPCs and objects", - description = "Choose whether NPCs should have icons marking them as the current target or not", - section = hintsSection - ) - default boolean showSymbolOverlay() { - return true; - } - - @ConfigItem( - keyName = "highlightStyleNpcs", - name = "Highlight style NPCs", - description = "Choose the highlight style of the target NPCs", - section = hintsSection - ) - default NpcHighlightStyle highlightStyleNpcs() { - return NpcHighlightStyle.OUTLINE; - } - - @ConfigItem( - keyName = "highlightStyleObjects", - name = "Highlight style objects", - description = "Choose the highlight style of the target objects", - section = hintsSection - ) - default ObjectHighlightStyle highlightStyleObjects() { - return ObjectHighlightStyle.OUTLINE; - } - - @ConfigItem( - keyName = "highlightStyleGroundItems", - name = "Highlight style ground items", - description = "Choose the highlight style of the target items", - section = hintsSection - ) - default GroundItemHighlightStyle highlightStyleGroundItems() { - return GroundItemHighlightStyle.OUTLINE; - } - - @ConfigItem( - keyName = "highlightStyleInventoryItems", - name = "Highlight style inventory items", - description = "Choose the highlight style of the target inventory items", - section = hintsSection - ) - default InventoryItemHighlightStyle highlightStyleInventoryItems() { - return InventoryItemHighlightStyle.FILLED_OUTLINE; - } - - @Range( - min = 0, - max = 50 - ) - @ConfigItem( - keyName = "outlineThickness", - name = "Outline thickness", - description = "Choose the thickness of target model outlines", - section = hintsSection - ) - default int outlineThickness() { - return 4; - } - - @Range( - min = 0, - max = 4 - ) - @ConfigItem( - keyName = "outlineFeathering", - name = "Outline feathering", - description = "Choose how the model outline is faded out", - section = hintsSection - ) - default int outlineFeathering() { - return 4; - } - - @ConfigItem( - keyName = "showMiniMapArrow", - name = "Display arrows on the mini-map and overworld", - description = "Choose whether flashing arrows point to the next objective", - section = hintsSection - ) - default boolean showMiniMapArrow() { - return true; - } - - @ConfigItem( - keyName = "haveMinimapArrowFlash", - name = "Have the minimap arrow flash", - description = "Choose whether the minimap direction arrow flashes", - section = hintsSection - ) - default boolean haveMinimapArrowFlash() { - return true; - } - - @ConfigItem( - keyName = "showWorldLines", - name = "Display navigation paths", - description = "Choose whether navigation paths are drawn to the next objective", - section = hintsSection - ) - default boolean showWorldLines() { - return true; - } - - @ConfigItem( - keyName = "showWidgetHints", - name = "Display widget hints", - description = "Choose whether important widget actions are highlighted", - section = hintsSection - ) - default boolean showWidgetHints() { - return true; - } - - @ConfigItem( - keyName = "solvePuzzles", - name = "Show Puzzle Solutions", - description = "Shows the solutions to quest puzzles", - section = hintsSection - ) - default boolean solvePuzzles() { - return true; - } - - @ConfigItem( - keyName = "showWorldMapPoint", - name = "Display world map point", - description = "Choose whether the arrow & icon of your current step should be visible on the world map.
Changing this will take effect next time your quest step updates.", - section = hintsSection - ) - default boolean showWorldMapPoint() { - return true; - } - - @ConfigItem( - keyName = "useShortestPath", - name = "Use 'Shortest Path' plugin", - description = "If you have the 'Shortest Path' plugin downloaded, it will be used to show routes to locations", - section = hintsSection - ) - default boolean useShortestPath() { - return false; - } - - @ConfigSection( - position = 3, - name = "Colours", - description = "What colour each option can be" - ) - String colorSection = "colorSection"; - - @ConfigItem( - keyName = "textHighlightColor", - name = "Text highlight colour", - description = "Change the colour of dialog choices highlighted by the helper", - section = colorSection - ) - default Color textHighlightColor() { - return Color.BLUE; - } - - @ConfigItem( - keyName = "targetOverlayColor", - name = "Color of target overlay", - description = "Change the colour which target NPCs/Objects will be highlighted with", - section = colorSection - ) - default Color targetOverlayColor() { - return Color.CYAN; - } - - @ConfigItem( - keyName = "passColour", - name = "Colour of passed requirements/checks", - description = "Change the colour that will indicate a check has passed", - section = colorSection - ) - default Color passColour() { - return Color.GREEN; - } - - @ConfigItem( - keyName = "failColour", - name = "Colour of failed requirements/checks", - description = "Change the colour that will indicate a check has failed", - section = colorSection - ) - default Color failColour() { - return Color.RED; - } - - @ConfigItem( - keyName = "partialSuccessColour", - name = "Colour of partially passed requirements/checks", - description = "Change the colour that will indicate a check has partially passed (such as item is in your bank)", - section = colorSection - ) - default Color partialSuccessColour() { - return Color.WHITE; - } - - @ConfigItem( - keyName = "boostColour", - name = "Colour of boostable skill", - description = "Change the colour that will indicate a skill level check has passed", - section = colorSection - ) - default Color boostColour() { - return Color.ORANGE; - } - - @ConfigItem( - keyName = "debugColor", - name = "Debug Colour", - description = "debug", - hidden = true, - section = colorSection - ) - default Color debugColor() { - return Color.MAGENTA; - } - - @ConfigSection( - position = 4, - name = "Quest Filters", - description = "Determines which quests should be shown via the selected filter(s)" - ) - String filterSection = "filterSection"; - - @ConfigItem( - keyName = "orderListBy", - name = "Quest order", - description = "Configures which way to order the quest list", - position = 3, - section = filterSection - ) - default QuestOrdering orderListBy() { - return QuestOrdering.A_TO_Z; - } - - @ConfigItem( - keyName = "filterListBy", - name = "Filter", - description = "Configures what to filter in the quest list", - position = 1, - section = filterSection - ) - default QuestFilter filterListBy() { - return QuestFilter.SHOW_ALL; - } - - @ConfigItem( - keyName = "questDifficulty", - name = "Difficulty", - description = "Configures what quest difficulty to show", - position = 2, - section = filterSection - ) - default QuestDetails.Difficulty difficulty() { - return QuestDetails.Difficulty.ALL; - } - - @ConfigItem( - keyName = "showCompletedQuests", - name = "Show Completed Quests", - description = "Will include completed quests in the other filter(s) that are chosen", - position = 4, - section = filterSection - ) - default boolean showCompletedQuests() { - return false; - } - - @ConfigSection( - position = 5, - name = "Development", - description = "Options that configure the quest helper development experience", - closedByDefault = true - ) - String developmentSection = "developmentSection"; - - @ConfigItem( - keyName = "devShowOverlayOnLaunch", - name = "Show overlay on launch", - description = "Show the dev overlay (::questhelperdebug) on launch", - position = 4, - section = developmentSection - ) - default boolean devShowOverlayOnLaunch() { - return false; - } +public interface QuestHelperConfig extends Config +{ + String QUEST_HELPER_GROUP = "questhelper"; + String QUEST_BACKGROUND_GROUP = "questhelpervars"; + String QUEST_HELPER_SIDEBAR_ORDER_KEY_START = "quest-sidebar-order-"; + + enum QuestOrdering implements Comparator + { + /** + * Sort quests in alphabetical order + */ + A_TO_Z(QuestOrders.sortAToZ(), QuestFilter.QUEST, QuestFilter.MINIQUEST, QuestFilter.ACHIEVEMENT_DIARY, + QuestFilter.SKILL_HELPER, QuestFilter.GENERIC_HELPER, QuestFilter.PLAYER_MADE_QUESTS), + /** + * Sort quests in reverse alphabetical order + */ + Z_TO_A(QuestOrders.sortZToA(), QuestFilter.QUEST, QuestFilter.MINIQUEST, QuestFilter.ACHIEVEMENT_DIARY, + QuestFilter.SKILL_HELPER, QuestFilter.GENERIC_HELPER, QuestFilter.PLAYER_MADE_QUESTS), + /** + * Sort quests according to the Optimal Quest Guide (https://oldschool.runescape.wiki/w/Optimal_quest_guide) + */ + OPTIMAL(QuestOrders.sortOptimalOrder(), QuestFilter.OPTIMAL, QuestFilter.GENERIC_HELPER), + /** + * Sort quests according to the Optimal Quest Guide (Ironman version) (https://oldschool.runescape.wiki/w/Optimal_quest_guide/Ironman) + */ + OPTIMAL_IRONMAN(QuestOrders.sortOptimalIronmanOrder(), QuestFilter.OPTIMAL, QuestFilter.GENERIC_HELPER), + /** + * Sort quest by their release date (https://oldschool.runescape.wiki/w/Quests/Release_dates) + */ + RELEASE_DATE(QuestOrders.sortByRelease(), QuestFilter.QUEST, QuestFilter.MINIQUEST), + + QUEST_POINTS_ASC(QuestOrders.sortByQuestPointRewardAscending(), QuestFilter.QUEST), + QUEST_POINTS_DESC(QuestOrders.sortByQuestPointRewardDescending(), QuestFilter.QUEST); + + private final Comparator comparator; + @Getter + private final QuestFilter[] sections; + + QuestOrdering(Comparator comparator, QuestFilter... sections) + { + this.comparator = comparator; + this.sections = sections; + + } + + public List sort(Collection list) + { + return list.stream().sorted(this).collect(Collectors.toList()); + } + + @Override + public int compare(QuestHelper o1, QuestHelper o2) + { + return comparator.compare(o1, o2); + } + } + + enum QuestFilter implements Predicate + { + /** + * Show all quests + */ + SHOW_ALL(q -> true), + /** + * Show quests where the client meets the quest requirements + */ + SHOW_MEETS_REQS(QuestHelper::clientMeetsRequirements), + /** + * Show all except generic helpers + */ + OPTIMAL("Optimal ordering", + q -> q.getQuest().getQuestType() == QuestDetails.Type.P2P || + q.getQuest().getQuestType() == QuestDetails.Type.F2P || + q.getQuest().getQuestType() == QuestDetails.Type.MINIQUEST || + q.getQuest().getQuestType() == QuestDetails.Type.ACHIEVEMENT_DIARY, + false), + /** + * Show all free-to-play quests + */ + FREE_TO_PLAY(QuestDetails.Type.F2P), + /** + * Show all members' quests + */ + MEMBERS(QuestDetails.Type.P2P), + /** + * Show all quests + */ + QUEST("Quests", q -> q.getQuest().getQuestType() == QuestDetails.Type.P2P || + q.getQuest().getQuestType() == QuestDetails.Type.F2P), + /** + * Show all miniquests (all miniquests are members' only) + */ + MINIQUEST("Miniquests", QuestDetails.Type.MINIQUEST), + /** + * Show all achievement diaries + */ + ACHIEVEMENT_DIARY("Achievement diaries", QuestDetails.Type.ACHIEVEMENT_DIARY), + /** + * Show all generic helpers + */ + GENERIC_HELPER("Generic helpers", QuestDetails.Type.GENERIC), + /** + * Show all skills + */ + SKILL_HELPER("Skill helpers", q -> q.getQuest().getQuestType() == QuestDetails.Type.SKILL_P2P || + q.getQuest().getQuestType() == QuestDetails.Type.SKILL_F2P), + /** + * Show all free-to-play skills + */ + SKILL_FREE_TO_PLAY(QuestDetails.Type.SKILL_F2P), + /** + * Show all members' skills + */ + SKILL_MEMBERS(QuestDetails.Type.SKILL_P2P), + + PLAYER_MADE_QUESTS("Player-made quests", q -> q.getQuest().getQuestType() == QuestDetails.Type.PLAYER_QUEST); + + + private final Predicate predicate; + + @Getter + private final String displayName; + + private final boolean shouldDisplay; + + QuestFilter(Predicate predicate) + { + this.predicate = predicate; + this.displayName = Text.titleCase(this); + this.shouldDisplay = true; + } + + QuestFilter(String displayName, Predicate predicate) + { + this.predicate = predicate; + this.displayName = displayName; + this.shouldDisplay = true; + } + + QuestFilter(String displayName, Predicate predicate, boolean shouldDisplay) + { + this.predicate = predicate; + this.displayName = displayName; + this.shouldDisplay = shouldDisplay; + } + + @Override + public boolean test(QuestHelper quest) + { + return predicate.test(quest); + } + + public List test(Collection helpers) + { + + return helpers.stream().filter(this).collect(Collectors.toList()); + } + + public static QuestFilter[] displayFilters() + { + return Arrays.stream(QuestFilter.values()).filter((questFilter -> questFilter.shouldDisplay)).toArray(QuestFilter[]::new); + } + } + + enum NpcHighlightStyle + { + NONE, + OUTLINE, + CONVEX_HULL, + TILE + } + + enum ObjectHighlightStyle + { + NONE, + CLICK_BOX, + OUTLINE, + } + + enum GroundItemHighlightStyle + { + NONE, + CLICK_BOX, + OUTLINE, + TILE + } + + enum InventoryItemHighlightStyle + { + NONE, + SQUARE, + OUTLINE, + FILLED_OUTLINE + } + + @ConfigSection( + position = 0, + name = "Microbot", + description = "Microbot Options", + closedByDefault = false + ) + String microbotSection = "microbotSection"; + + + @ConfigItem( + keyName = "TurnOn", + name = "Enable QuestHelper", + description = "Enable the quest helper that will automatically help with quests.", + section = microbotSection + ) + default boolean startStopQuestHelper() { + return true; + } + + @ConfigItem( + keyName = "autostartQuests", + name = "Auto start helper", + description = "Automatically start the quest helper when you start a quest" + ) + default boolean autoStartQuests() + { + return true; + } + + @ConfigItem( + keyName = "autoOpenSidebar", + name = "Auto open sidebar", + description = "Automatically opens the quest helper sidebar when you start a quest" + ) + default boolean autoOpenSidebar() + { + return true; + } + + @ConfigItem( + keyName = "showOverlayPanel", + name = "Display overlay on screen", + description = "Chose whether the overlay should be displayed on screen" + ) + default boolean showOverlay() + { + return true; + } + + @ConfigItem( + keyName = "stewBoostsPanel", + name = "Use Spicy stew for boosts", + description = "Raises the boost maximum boost for certain skills to 5" + ) + default boolean stewBoosts() + { + return false; + } + + @ConfigItem( + keyName = "showFan", + name = "Fan appears on quest completion", + description = "Have someone appear to celebrate whenever you complete a quest" + ) + default boolean showFan() + { + return false; + } + + @ConfigSection( + position = 0, + name = "Unfinished quest highlights", + description = "Highlight things you will need for quests you have not yet completed" + ) + String itemSection = "itemSection"; + + @ConfigItem( + position = 0, + keyName = "highlightItemsBackground", + name = "Highlight missing items", + description = "Highlight items on the ground you might need for future quests or achievement diaries.
The settings below can be used to control if you want to show items from unfinished quests, miniquests, or diaries", + section = itemSection + ) + default boolean highlightItemsBackground() + { + return false; + } + + @ConfigItem( + position = 1, + keyName = "highlightNeededQuestItems", + name = "Include quest items", + description = "Highlight every uncompleted quest's items you're missing on the floor.
Requires the Highlight missing items to be enabled", + section = itemSection + ) + default boolean highlightNeededQuestItems() + { + return true; + } + + @ConfigItem( + position = 2, + keyName = "highlightNeededMiniquestItems", + name = "Include miniquest items", + description = "Highlight every uncompleted miniquest's items you're missing on the floor.
Requires the Highlight missing items to be enabled", + section = itemSection + ) + default boolean highlightNeededMiniquestItems() + { + return true; + } + + @ConfigItem( + position = 3, + keyName = "highlightNeededAchievementDiaryItems", + name = "Include achievement diary items", + description = "Highlight every uncompleted achievement diary's items you're missing on the floor.
Requires the Highlight missing items to be enabled", + section = itemSection + ) + default boolean highlightNeededAchievementDiaryItems() + { + return true; + } + + @ConfigSection( + position = 1, + name = "Sidebar details", + description = "Determines sidebar rendering" + ) + String sidebarDetailsSection = "sidebarDetailsSection"; + + @ConfigItem( + keyName = "showFullRequirements", + name = "Show full quest requirements", + description = "Show all quest requirements, including requirements for sub-quests", + section = sidebarDetailsSection + ) + default boolean showFullRequirements() + { + return false; + } + + @ConfigItem( + keyName = "hideQuestRewards", + name = "Hide quest rewards", + description = "Enable this config if you want to hide quest rewards.
If you already had a quest helper open, you need to
restart it to hide the quest rewards.", + section = sidebarDetailsSection + ) + default boolean hideQuestRewards() + { + return false; + } + + @ConfigSection( + position = 2, + name = "Quest Hints", + description = "Determines what hints should be shown" + ) + String hintsSection = "hintsSection"; + + @ConfigItem( + keyName = "showTextHighlight", + name = "Highlight correct dialog", + description = "Highlight correct dialog choices", + section = hintsSection + ) + default boolean showTextHighlight() + { + return true; + } + + @ConfigItem( + keyName = "showSymbolOverlay", + name = "Display icons on NPCs and objects", + description = "Choose whether NPCs should have icons marking them as the current target or not", + section = hintsSection + ) + default boolean showSymbolOverlay() + { + return true; + } + + @ConfigItem( + keyName = "highlightStyleNpcs", + name = "Highlight style NPCs", + description = "Choose the highlight style of the target NPCs", + section = hintsSection + ) + default NpcHighlightStyle highlightStyleNpcs() + { + return NpcHighlightStyle.OUTLINE; + } + + @ConfigItem( + keyName = "highlightStyleObjects", + name = "Highlight style objects", + description = "Choose the highlight style of the target objects", + section = hintsSection + ) + default ObjectHighlightStyle highlightStyleObjects() + { + return ObjectHighlightStyle.OUTLINE; + } + + @ConfigItem( + keyName = "highlightStyleGroundItems", + name = "Highlight style ground items", + description = "Choose the highlight style of the target items", + section = hintsSection + ) + default GroundItemHighlightStyle highlightStyleGroundItems() + { + return GroundItemHighlightStyle.OUTLINE; + } + + @ConfigItem( + keyName = "highlightStyleInventoryItems", + name = "Highlight style inventory items", + description = "Choose the highlight style of the target inventory items", + section = hintsSection + ) + default InventoryItemHighlightStyle highlightStyleInventoryItems() + { + return InventoryItemHighlightStyle.FILLED_OUTLINE; + } + + @Range( + min = 0, + max = 50 + ) + @ConfigItem( + keyName = "outlineThickness", + name = "Outline thickness", + description = "Choose the thickness of target model outlines", + section = hintsSection + ) + default int outlineThickness() + { + return 4; + } + + @Range( + min = 0, + max = 4 + ) + @ConfigItem( + keyName = "outlineFeathering", + name = "Outline feathering", + description = "Choose how the model outline is faded out", + section = hintsSection + ) + default int outlineFeathering() + { + return 4; + } + + @ConfigItem( + keyName = "showMiniMapArrow", + name = "Display arrows on the mini-map and overworld", + description = "Choose whether flashing arrows point to the next objective", + section = hintsSection + ) + default boolean showMiniMapArrow() + { + return true; + } + + @ConfigItem( + keyName = "haveMinimapArrowFlash", + name = "Have the minimap arrow flash", + description = "Choose whether the minimap direction arrow flashes", + section = hintsSection + ) + default boolean haveMinimapArrowFlash() + { + return true; + } + + @ConfigItem( + keyName = "showWorldLines", + name = "Display navigation paths", + description = "Choose whether navigation paths are drawn to the next objective", + section = hintsSection + ) + default boolean showWorldLines() + { + return true; + } + + @ConfigItem( + keyName = "showWidgetHints", + name = "Display widget hints", + description = "Choose whether important widget actions are highlighted", + section = hintsSection + ) + default boolean showWidgetHints() + { + return true; + } + + @ConfigItem( + keyName = "solvePuzzles", + name = "Show Puzzle Solutions", + description = "Shows the solutions to quest puzzles", + section = hintsSection + ) + default boolean solvePuzzles() { return true; } + + @ConfigItem( + keyName = "showWorldMapPoint", + name = "Display world map point", + description = "Choose whether the arrow & icon of your current step should be visible on the world map.
Changing this will take effect next time your quest step updates.", + section = hintsSection + ) + default boolean showWorldMapPoint() + { + return true; + } + + @ConfigItem( + keyName = "useShortestPath", + name = "Use 'Shortest Path' plugin", + description = "If you have the 'Shortest Path' plugin downloaded, it will be used to show routes to locations", + section = hintsSection + ) + default boolean useShortestPath() { return false; } + + @ConfigSection( + position = 3, + name = "Colours", + description = "What colour each option can be" + ) + String colorSection = "colorSection"; + + @ConfigItem( + keyName = "textHighlightColor", + name = "Text highlight colour", + description = "Change the colour of dialog choices highlighted by the helper", + section = colorSection + ) + default Color textHighlightColor() + { + return Color.BLUE; + } + + @ConfigItem( + keyName = "targetOverlayColor", + name = "Color of target overlay", + description = "Change the colour which target NPCs/Objects will be highlighted with", + section = colorSection + ) + default Color targetOverlayColor() + { + return Color.CYAN; + } + + @ConfigItem( + keyName = "passColour", + name = "Colour of passed requirements/checks", + description = "Change the colour that will indicate a check has passed", + section = colorSection + ) + default Color passColour() + { + return Color.GREEN; + } + + @ConfigItem( + keyName = "failColour", + name = "Colour of failed requirements/checks", + description = "Change the colour that will indicate a check has failed", + section = colorSection + ) + default Color failColour() + { + return Color.RED; + } + + @ConfigItem( + keyName = "partialSuccessColour", + name = "Colour of partially passed requirements/checks", + description = "Change the colour that will indicate a check has partially passed (such as item is in your bank)", + section = colorSection + ) + default Color partialSuccessColour() + { + return Color.WHITE; + } + + @ConfigItem( + keyName = "boostColour", + name = "Colour of boostable skill", + description = "Change the colour that will indicate a skill level check has passed", + section = colorSection + ) + default Color boostColour() + { + return Color.ORANGE; + } + + @ConfigItem( + keyName = "debugColor", + name = "Debug Colour", + description = "debug", + hidden = true, + section = colorSection + ) + default Color debugColor() + { + return Color.MAGENTA; + } + + @ConfigSection( + position = 4, + name = "Quest Filters", + description = "Determines which quests should be shown via the selected filter(s)" + ) + String filterSection = "filterSection"; + + @ConfigItem( + keyName = "orderListBy", + name = "Quest order", + description = "Configures which way to order the quest list", + position = 3, + section = filterSection + ) + default QuestOrdering orderListBy() + { + return QuestOrdering.A_TO_Z; + } + + @ConfigItem( + keyName = "filterListBy", + name = "Filter", + description = "Configures what to filter in the quest list", + position = 1, + section = filterSection + ) + default QuestFilter filterListBy() + { + return QuestFilter.SHOW_ALL; + } + + @ConfigItem( + keyName = "questDifficulty", + name = "Difficulty", + description = "Configures what quest difficulty to show", + position = 2, + section = filterSection + ) + default QuestDetails.Difficulty difficulty() + { + return QuestDetails.Difficulty.ALL; + } + + @ConfigItem( + keyName = "showCompletedQuests", + name = "Show Completed Quests", + description = "Will include completed quests in the other filter(s) that are chosen", + position = 4, + section = filterSection + ) + default boolean showCompletedQuests() + { + return false; + } + + @ConfigSection( + position = 5, + name = "Development", + description = "Options that configure the quest helper development experience", + closedByDefault = true + ) + String developmentSection = "developmentSection"; + + @ConfigItem( + keyName = "devShowOverlayOnLaunch", + name = "Show overlay on launch", + description = "Show the dev overlay (::questhelperdebug) on launch", + position = 4, + section = developmentSection + ) + default boolean devShowOverlayOnLaunch() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperPlugin.java index bbff0e383de..3544c5ceaf6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestHelperPlugin.java @@ -29,11 +29,27 @@ import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.Provides; +import net.runelite.client.plugins.microbot.Microbot; +import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankTabItems; +import net.runelite.client.plugins.microbot.questhelper.bank.banktab.PotionStorage; +import net.runelite.client.plugins.microbot.questhelper.managers.*; +import net.runelite.client.plugins.microbot.questhelper.panel.QuestHelperPanel; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.Cheerer; +import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.GlobalFakeObjects; +import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects.RuneliteObjectManager; +import net.runelite.client.plugins.microbot.questhelper.statemanagement.PlayerStateManager; +import net.runelite.client.plugins.microbot.questhelper.tools.Icon; +import net.runelite.client.plugins.microbot.questhelper.util.worldmap.WorldMapAreaManager; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.*; import net.runelite.api.events.*; import net.runelite.api.gameval.InventoryID; +import net.runelite.api.gameval.VarPlayerID; +import net.runelite.client.RuneLite; import net.runelite.client.callback.ClientThread; import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.config.ConfigManager; @@ -47,21 +63,6 @@ import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.bank.BankSearch; -import net.runelite.client.plugins.microbot.Microbot; -import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankTabItems; -import net.runelite.client.plugins.microbot.questhelper.bank.banktab.PotionStorage; -import net.runelite.client.plugins.microbot.questhelper.managers.*; -import net.runelite.client.plugins.microbot.questhelper.panel.QuestHelperPanel; -import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; -import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; -import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.Cheerer; -import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.GlobalFakeObjects; -import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.RuneliteConfigSetter; -import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects.RuneliteObjectManager; -import net.runelite.client.plugins.microbot.questhelper.statemanagement.PlayerStateManager; -import net.runelite.client.plugins.microbot.questhelper.tools.Icon; -import net.runelite.client.plugins.microbot.questhelper.util.worldmap.WorldMapAreaManager; import net.runelite.client.ui.ClientToolbar; import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.components.colorpicker.ColorPickerManager; @@ -169,6 +170,9 @@ public class QuestHelperPlugin extends Plugin private final Collection configEvents = Arrays.asList("orderListBy", "filterListBy", "questDifficulty", "showCompletedQuests"); private final Collection configItemEvents = Arrays.asList("highlightNeededQuestItems", "highlightNeededMiniquestItems", "highlightNeededAchievementDiaryItems"); + public boolean fullCrate; + @Inject + QuestScript questScript; @Provides QuestHelperConfig getConfig(ConfigManager configManager) @@ -176,12 +180,6 @@ QuestHelperConfig getConfig(ConfigManager configManager) return configManager.getConfig(QuestHelperConfig.class); } - // Microbot - public boolean fullCrate = false; - @Inject - QuestScript questScript; - - @Override protected void startUp() throws IOException { @@ -350,7 +348,7 @@ public void onVarbitChanged(VarbitChanged event) } if (client.getWorldType().contains(WorldType.QUEST_SPEEDRUNNING) - && event.getVarpId() == VarPlayer.IN_RAID_PARTY + && event.getVarpId() == VarPlayerID.RAIDS_PARTY_GROUPHOLDER && event.getValue() == 0 && client.getGameState() == GameState.LOGGED_IN) { @@ -378,20 +376,6 @@ public void onConfigChanged(ConfigChanged event) return; } - if (event.getKey().equals("showRuneliteObjects") && client.getGameState() == GameState.LOGGED_IN) - { - clientThread.invokeLater(() -> { - if (config.showRuneliteObjects()) - { - GlobalFakeObjects.createNpcs(client, runeliteObjectManager, configManager, config); - } - else - { - GlobalFakeObjects.disableNpcs(runeliteObjectManager); - } - }); - } - if (configEvents.contains(event.getKey()) || event.getKey().contains("skillfilter")) { clientThread.invokeLater(questManager::updateQuestList); @@ -455,11 +439,6 @@ else if ((Arrays.stream(commandExecuted.getArguments()).toArray()[0]).equals("en questOverlayManager.addDebugOverlay(); } } - else if (developerMode && commandExecuted.getCommand().equals("reset-cooks-helper")) - { - String step = (String) (Arrays.stream(commandExecuted.getArguments()).toArray()[0]); - new RuneliteConfigSetter(configManager, QuestHelperQuest.COOKS_HELPER.getPlayerQuests().getConfigValue(), step).setConfigValue(); - } else if (developerMode && commandExecuted.getCommand().equals("qh-inv")) { ItemContainer inventory = client.getItemContainer(InventoryID.INV); @@ -615,4 +594,36 @@ public List loadSidebarOrder(QuestHelper currentQuest) .map(Integer::parseInt) .collect(Collectors.toList()); } + + public void resetSidebarOrderForSection(QuestHelper currentQuest, List sectionIds) + { + if (currentQuest == null || currentQuest.getQuest() == null || sectionIds == null || sectionIds.isEmpty()) + { + return; + } + + List currentOrder = loadSidebarOrder(currentQuest); + if (currentOrder == null || currentOrder.isEmpty()) + { + return; + } + + // Remove all IDs belonging to this section from the order + List updatedOrder = currentOrder.stream() + .filter(id -> !sectionIds.contains(id)) + .collect(Collectors.toList()); + + // If the order is now empty, remove the config entry (set to null) to use default order + // Otherwise save the updated order + if (updatedOrder.isEmpty()) + { + configManager.unsetRSProfileConfiguration(QuestHelperConfig.QUEST_HELPER_GROUP, + QuestHelperConfig.QUEST_HELPER_SIDEBAR_ORDER_KEY_START + currentQuest.getQuest().name()); + } + else + { + saveSidebarOrder(currentQuest, updatedOrder); + } + questManager.startUpQuest(currentQuest, true); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestScript.java index 9a99d0bd817..4bd18e00917 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestScript.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/QuestScript.java @@ -8,9 +8,11 @@ import net.runelite.api.widgets.Widget; import net.runelite.client.plugins.microbot.Microbot; import net.runelite.client.plugins.microbot.Script; +import net.runelite.client.plugins.microbot.api.tileobject.models.TileObjectType; import net.runelite.client.plugins.microbot.questhelper.logic.PiratesTreasure; import net.runelite.client.plugins.microbot.questhelper.logic.QuestRegistry; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; +import net.runelite.client.plugins.microbot.questhelper.managers.QuestContainerManager; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; @@ -21,31 +23,41 @@ import net.runelite.client.plugins.microbot.util.combat.Rs2Combat; import net.runelite.client.plugins.microbot.util.dialogues.Rs2Dialogue; import net.runelite.client.plugins.microbot.util.equipment.Rs2Equipment; -import net.runelite.client.plugins.microbot.util.gameobject.Rs2GameObject; -import net.runelite.client.plugins.microbot.util.grounditem.Rs2GroundItem; import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory; import net.runelite.client.plugins.microbot.util.keyboard.Rs2Keyboard; import net.runelite.client.plugins.microbot.util.math.Rs2Random; import net.runelite.client.plugins.microbot.util.menu.NewMenuEntry; -import net.runelite.client.plugins.microbot.util.npc.Rs2Npc; -import net.runelite.client.plugins.microbot.util.npc.Rs2NpcModel; import net.runelite.client.plugins.microbot.util.player.Rs2Player; import net.runelite.client.plugins.microbot.util.shop.Rs2Shop; import net.runelite.client.plugins.microbot.util.tile.Rs2Tile; import net.runelite.client.plugins.microbot.util.walker.Rs2Walker; import net.runelite.client.plugins.microbot.util.widget.Rs2Widget; +import net.runelite.client.plugins.microbot.api.npc.models.Rs2NpcModel; +import net.runelite.client.plugins.microbot.api.tileobject.Rs2TileObjectQueryable; +import net.runelite.client.plugins.microbot.api.tileobject.models.Rs2TileObjectModel; +import net.runelite.client.plugins.microbot.api.tileitem.Rs2TileItemQueryable; +import net.runelite.client.plugins.microbot.api.tileitem.models.Rs2TileItemModel; import java.awt.*; import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +import org.slf4j.event.Level; +import net.runelite.api.coords.WorldArea; public class QuestScript extends Script { public static double version = 0.3; + private static final long MISSING_REQUIREMENT_NOTIFY_INTERVAL_MS = 10_000L; + private static final Map lastMissingRequirementNotice = new HashMap<>(); public static List itemRequirements = new ArrayList<>(); @@ -57,8 +69,8 @@ public class QuestScript extends Script { private QuestHelperConfig config; private QuestHelperPlugin mQuestPlugin; - private static ArrayList npcsHandled = new ArrayList<>(); - private static ArrayList objectsHandeled = new ArrayList<>(); + private static Set npcsHandled = new HashSet<>(); + private static Set objectsHandeled = new HashSet<>(); QuestStep dialogueStartedStep = null; @@ -121,9 +133,13 @@ public boolean run(QuestHelperConfig config, QuestHelperPlugin mQuestPlugin) { return; } } else { - Rs2Widget.clickWidget(widget.getId()); - if (Rs2Shop.isOpen() && getQuestHelperPlugin().getSelectedQuest().getQuest().getId() == Quest.PIRATES_TREASURE.getId()) { - Rs2Shop.buyItemOptimally("karamjan rum", 1); + if (widgetHighlight.getNameToCheckFor() != null && !widgetHighlight.getNameToCheckFor().isEmpty()) { + Rs2Widget.clickWidget(widgetHighlight.getNameToCheckFor()); + } else { + Rs2Widget.clickWidget(widget.getId()); + if (Rs2Shop.isOpen() && getQuestHelperPlugin().getSelectedQuest().getQuest().getId() == Quest.PIRATES_TREASURE.getId()) { + Rs2Shop.buyItemOptimally("karamjan rum", 1); + } } return; } @@ -189,16 +205,20 @@ public boolean run(QuestHelperConfig config, QuestHelperPlugin mQuestPlugin) { return; } - if (questStep instanceof DetailedQuestStep && handleRequirements((DetailedQuestStep) questStep)) { - sleep(500, 1000); - return; - } + if (questStep instanceof DetailedQuestStep && handleRequirements((DetailedQuestStep) questStep)) { + sleep(500, 1000); + return; + } + + if (questStep instanceof DetailedQuestStep && handleMissingItemRequirements((DetailedQuestStep) questStep)) { + return; + } - /** - * This portion is needed when using item on another item in your inventory. - * If we do not prioritize this, the script will think we are missing items - */ - if (questStep instanceof DetailedQuestStep && !(questStep instanceof NpcStep || questStep instanceof ObjectStep || questStep instanceof DigStep)) { + /** + * This portion is needed when using item on another item in your inventory. + * If we do not prioritize this, the script will think we are missing items + */ + if (questStep instanceof DetailedQuestStep && !(questStep instanceof NpcStep || questStep instanceof ObjectStep || questStep instanceof DigStep)) { boolean result = applyDetailedQuestStep((DetailedQuestStep) getQuestHelperPlugin().getSelectedQuest().getCurrentStep().getActiveStep()); if (result) { sleepUntil(() -> Rs2Player.isInteracting() || Rs2Player.isMoving() || Rs2Player.isAnimating() || Rs2Dialogue.isInDialogue(), 500); @@ -232,34 +252,130 @@ public boolean run(QuestHelperConfig config, QuestHelperPlugin mQuestPlugin) { return true; } - private boolean handleRequirements(DetailedQuestStep questStep) { - var requirements = questStep.getRequirements(); - - for (var requirement : requirements) { - if (requirement instanceof ItemRequirement) { - var itemRequirement = (ItemRequirement) requirement; - - if (itemRequirement.isEquip() && Rs2Inventory.contains(itemRequirement.getAllIds().stream().mapToInt(i -> i).toArray()) - && itemRequirement.getAllIds().stream().noneMatch(Rs2Equipment::isWearing)) { - Rs2Inventory.wear(itemRequirement.getAllIds().stream().filter(Rs2Inventory::contains).findFirst().orElse(-1)); - return true; - } - } - } - - return false; - } - - @Override - public void shutdown() { - super.shutdown(); - reset(); - } + private boolean handleRequirements(DetailedQuestStep questStep) { + var requirements = questStep.getRequirements(); + + for (var requirement : requirements) { + if (requirement instanceof ItemRequirement) { + var itemRequirement = (ItemRequirement) requirement; + + if (itemRequirement.mustBeEquipped()) { + if (!hasItemRequirementOnPlayer(itemRequirement)) { + notifyMissingRequirement(itemRequirement); + continue; + } + + if (itemRequirement.getAllIds().stream().noneMatch(Rs2Equipment::isWearing)) { + Rs2Inventory.wear(itemRequirement.getAllIds().stream().filter(Rs2Inventory::contains).findFirst().orElse(-1)); + return true; + } + } + } + } + + return false; + } + + private boolean handleMissingItemRequirements(DetailedQuestStep questStep) { + for (Requirement requirement : questStep.getRequirements()) { + if (!(requirement instanceof ItemRequirement)) { + continue; + } + + ItemRequirement itemRequirement = (ItemRequirement) requirement; + + if (itemRequirement.mustBeEquipped() + && Rs2Inventory.contains(itemRequirement.getAllIds().stream().mapToInt(i -> i).toArray()) + && itemRequirement.getAllIds().stream().noneMatch(Rs2Equipment::isWearing)) { + Rs2Inventory.wear(itemRequirement.getAllIds().stream().filter(Rs2Inventory::contains).findFirst().orElse(-1)); + return true; + } + + if (hasItemRequirementOnPlayer(itemRequirement)) { + continue; + } + + return attemptToAcquireRequirementItem(questStep, itemRequirement); + } + + return false; + } + + private boolean hasItemRequirementOnPlayer(ItemRequirement itemRequirement) { + if (itemRequirement.mustBeEquipped()) { + return itemRequirement.checkContainers(QuestContainerManager.getEquippedData()); + } + + return itemRequirement.checkContainers( + QuestContainerManager.getEquippedData(), + QuestContainerManager.getInventoryData()); + } + + private boolean attemptToAcquireRequirementItem(DetailedQuestStep questStep, ItemRequirement itemRequirement) { + notifyMissingRequirement(itemRequirement); + + WorldPoint worldPoint = questStep.getDefinedPoint() != null ? questStep.getDefinedPoint().getWorldPoint() : null; + int targetItemId = itemRequirement.getAllIds().stream().findFirst().orElse(itemRequirement.getId()); + + if (worldPoint != null) { + if ((Rs2Walker.canReach(worldPoint) && worldPoint.distanceTo(Rs2Player.getWorldLocation()) < 2) + || worldPoint.toWorldArea().hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), Microbot.getClient().getLocalPlayer().getWorldLocation().toWorldArea()) + && Rs2Camera.isTileOnScreen(LocalPoint.fromWorld(Microbot.getClient().getTopLevelWorldView(), worldPoint))) { + lootGroundItem(targetItemId, 10); + } else { + Rs2Walker.walkTo(worldPoint, 2); + } + } else { + lootGroundItem(targetItemId, 20); + } + + return true; + } + + private void notifyMissingRequirement(ItemRequirement itemRequirement) { + int key = itemRequirement.getAllIds().stream().findFirst().orElse(itemRequirement.getId()); + long now = System.currentTimeMillis(); + Long lastNotified = lastMissingRequirementNotice.get(key); + + if (lastNotified != null && now - lastNotified < MISSING_REQUIREMENT_NOTIFY_INTERVAL_MS) { + return; + } + + lastMissingRequirementNotice.put(key, now); + + String itemName = itemRequirement.getName() != null && !itemRequirement.getName().isEmpty() + ? itemRequirement.getName() + : "Item " + key; + int quantity = Math.max(itemRequirement.getQuantity(), 1); + + Microbot.status = "Missing: " + itemName; + Microbot.log(String.format("Quest helper missing required item: %s x%d", itemName, quantity), Level.WARN); + } + + private boolean lootGroundItem(int itemId, int radius) { + Rs2TileItemModel item = new Rs2TileItemQueryable() + .withId(itemId) + .within(radius) + .nearest(); + + if (item == null) { + return false; + } + + return item.click(""); + } + + @Override + public void shutdown() { + super.shutdown(); + reset(); + } public static void reset() { itemsMissing = new ArrayList<>(); itemRequirements = new ArrayList<>(); grandExchangeItems = new ArrayList<>(); + lastMissingRequirementNotice.clear(); } public boolean applyStep(QuestStep step) { @@ -282,25 +398,28 @@ public boolean applyStep(QuestStep step) { } public boolean applyNpcStep(NpcStep step) { - List npcs = step.getNpcs().stream().map(Rs2NpcModel::new).collect(Collectors.toList()); - var npc = npcs.stream().findFirst().orElse(null); + List npcs = step.getNpcs().stream() + .map(Rs2NpcModel::new) + .collect(Collectors.toList()); + Rs2NpcModel npc = npcs.stream().findFirst().orElse(null); if (step.isAllowMultipleHighlights()) { - if (npcs.stream().anyMatch(x -> !npcsHandled.contains(x))) - npc = npcs.stream().filter(x -> !npcsHandled.contains(x)).findFirst().orElse(null); - else - npc = npcs.stream().min(Comparator.comparing(x -> Rs2Player.getWorldLocation().distanceTo(x.getWorldLocation()))).orElse(null); + npc = npcs.stream() + .filter(x -> !npcsHandled.contains(x.getIndex())) + .findFirst() + .orElseGet(() -> npcs.stream() + .min(Comparator.comparing(x -> Rs2Player.getWorldLocation().distanceTo(x.getWorldLocation()))) + .orElse(null)); } - // Workaround for instances - if (npc != null && Rs2Camera.isTileOnScreen(npc.getLocalLocation()) && (Microbot.getClient().isInInstancedRegion() || Rs2Npc.canWalkTo(npc, 10))) { - // Stop pathing + if (npc != null && npc.getLocalLocation() != null && Rs2Camera.isTileOnScreen(npc.getLocalLocation()) + && (Microbot.getClient().isInInstancedRegion() || Rs2Walker.canReach(npc.getWorldLocation()))) { Rs2Walker.setTarget(null); if (step.getText().stream().anyMatch(x -> x.toLowerCase().contains("kill"))) { - if (!Rs2Combat.inCombat()) - Rs2Npc.interact(npc, "Attack"); - + if (!Rs2Combat.inCombat()) { + npc.click("Attack"); + } return true; } @@ -331,22 +450,22 @@ public boolean applyNpcStep(NpcStep step) { var itemId = step.getIconItemID(); if (itemId != -1) { Rs2Inventory.use(itemId); - Rs2Npc.interact(npc); - } else - Rs2Npc.interact(npc, chooseCorrectNPCOption(step, npc)); + npc.click(""); + } else { + npc.click(chooseCorrectNPCOption(step, npc)); + } if (step.isAllowMultipleHighlights()) { - npcsHandled.add(npc); - // Might open up a dialog + npcsHandled.add(npc.getIndex()); sleepUntil(Rs2Dialogue::isInDialogue); } - } else if (npc != null && !Rs2Camera.isTileOnScreen(npc.getLocalLocation())) { + } else if (npc != null && npc.getLocalLocation() != null && !Rs2Camera.isTileOnScreen(npc.getLocalLocation())) { Rs2Walker.walkTo(npc.getWorldLocation(), 2); - } else if (npc != null && (!Rs2Npc.hasLineOfSight(npc) || !Rs2Npc.canWalkTo(npc, 10))) { + } else if (npc != null && (!npc.hasLineOfSight() || !Rs2Walker.canReach(npc.getWorldLocation()))) { Rs2Walker.walkTo(npc.getWorldLocation(), 2); } else { - if (step.getWorldPoint().distanceTo(Microbot.getClient().getLocalPlayer().getWorldLocation()) > 3) { - Rs2Walker.walkTo(step.getWorldPoint(), 2); + if (step.getDefinedPoint().getWorldPoint().distanceTo(Microbot.getClient().getLocalPlayer().getWorldLocation()) > 3) { + Rs2Walker.walkTo(step.getDefinedPoint().getWorldPoint(), 2); return false; } } @@ -355,18 +474,30 @@ public boolean applyNpcStep(NpcStep step) { public boolean applyObjectStep(ObjectStep step) { - var object = step.getObjects().stream().findFirst().orElse(null); + Rs2TileObjectModel object = step.getObjects().stream() + .filter(Objects::nonNull) + .map(Rs2TileObjectModel::new) + .findFirst().orElse(null); var itemId = step.getIconItemID(); - if (step.getObjects().size() > 1) { - if (step.getObjects().stream().anyMatch(x -> !objectsHandeled.contains(x))) - object = step.getObjects().stream().filter(x -> !objectsHandeled.contains(x)).findFirst().orElse(null); - else - object = step.getObjects().stream().min(Comparator.comparing(x -> Rs2Player.getWorldLocation().distanceTo(x.getWorldLocation()))).orElse(null); + List stepObjects = step.getObjects().stream() + .filter(Objects::nonNull) + .map(Rs2TileObjectModel::new) + .collect(Collectors.toList()); + + if (stepObjects.size() > 1) { + object = stepObjects.stream() + .filter(x -> !objectsHandeled.contains(x.getHash())) + .findFirst() + .orElseGet(() -> stepObjects.stream() + .min(Comparator.comparing(x -> Rs2Player.getWorldLocation().distanceTo(x.getWorldLocation()))) + .orElse(null)); } if (object != null && unreachableTarget) { - var tileObjects = Rs2GameObject.getTileObjects().stream().filter(x -> x instanceof WallObject).collect(Collectors.toList()); + var tileObjects = new Rs2TileObjectQueryable() + .where(x -> x.getTileObjectType() == TileObjectType.WALL) + .toList(); for (var tile : Rs2Tile.getWalkableTilesAroundTile(object.getWorldLocation(), unreachableTargetCheckDist)) { if (tileObjects.stream().noneMatch(x -> x.getWorldLocation().equals(tile))) { @@ -386,64 +517,58 @@ public boolean applyObjectStep(ObjectStep step) { return false; } - /** - * TODO: rework this block of code to handle walking closer to an object before interacting with it - */ - if (step.getWorldPoint() != null && Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo2D(step.getWorldPoint()) > 1 - && !Rs2GameObject.canWalkTo(object, 10)) { + if (step.getDefinedPoint().getWorldPoint() != null && Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo2D(step.getDefinedPoint().getWorldPoint()) > 1 + && (object == null || !Rs2Walker.canReach(object.getWorldLocation()))) { WorldPoint targetTile = null; - WorldPoint stepLocation = object == null ? step.getWorldPoint() : object.getWorldLocation(); + WorldPoint stepLocation = object == null ? step.getDefinedPoint().getWorldPoint() : object.getWorldLocation(); int radius = 0; while (targetTile == null) { if (mainScheduledFuture.isCancelled()) break; radius++; - TileObject finalObject = object; + Rs2TileObjectModel finalObject = object; targetTile = Rs2Tile.getWalkableTilesAroundTile(stepLocation, radius) - .stream().filter(x -> Rs2GameObject.hasLineOfSight(x, finalObject)) + .stream().filter(x -> hasLineOfSightFrom(x, finalObject)) .sorted(Comparator.comparing(x -> x.distanceTo(Rs2Player.getWorldLocation()))).findFirst().orElse(null); if (radius > 10 && targetTile == null) targetTile = stepLocation; } - //target distance set to 3, because some npcs walk away from a player - //so it can take a while to interact with the npc Rs2Walker.walkTo(targetTile, 3); if (ShortestPathPlugin.getPathfinder() != null) { var path = ShortestPathPlugin.getPathfinder().getPath(); - if (path.get(path.size() - 1).distanceTo(step.getWorldPoint()) <= 1) + if (path.get(path.size() - 1).distanceTo(step.getDefinedPoint().getWorldPoint()) <= 1) return false; } else return false; } - if (Rs2GameObject.hasLineOfSight(object) || object != null && (Rs2Camera.isTileOnScreen(object) || object.getCanvasLocation() != null)) { - // Stop pathing + if (hasLineOfSightToObject(object) || object != null && (Rs2Camera.isTileOnScreen(object.getLocalLocation()) || object.getCanvasLocation() != null)) { Rs2Walker.setTarget(null); if (itemId == -1) - Rs2GameObject.interact(object, chooseCorrectObjectOption(step, object)); + object.click(chooseCorrectObjectOption(step, object)); else { Rs2Inventory.use(itemId); - Rs2GameObject.interact(object); + object.click(""); } sleepUntil(() -> Rs2Player.isMoving() || Rs2Player.isAnimating()); sleep(100); sleepUntil(() -> !Rs2Player.isMoving() && !Rs2Player.isAnimating()); - objectsHandeled.add(object); + objectsHandeled.add(object.getHash()); } return true; } private boolean applyDigStep(DigStep step) { - if (!Rs2Walker.walkTo(step.getWorldPoint())) + if (!Rs2Walker.walkTo(step.getDefinedPoint().getWorldPoint())) return false; - else if (!Rs2Player.getWorldLocation().equals(step.getWorldPoint())) - Rs2Walker.walkFastCanvas(step.getWorldPoint()); + else if (!Rs2Player.getWorldLocation().equals(step.getDefinedPoint().getWorldPoint())) + Rs2Walker.walkFastCanvas(step.getDefinedPoint().getWorldPoint()); else { Rs2Inventory.interact(ItemID.SPADE, "Dig"); return true; @@ -464,7 +589,7 @@ private boolean applyPuzzleStep(PuzzleStep step) { return false; } - private String chooseCorrectObjectOption(QuestStep step, TileObject object) { + private String chooseCorrectObjectOption(QuestStep step, Rs2TileObjectModel object) { ObjectComposition objComp = Microbot.getClientThread().runOnClientThreadOptional(() -> Microbot.getClient().getObjectDefinition(object.getId())).orElse(null); @@ -486,7 +611,7 @@ private String chooseCorrectObjectOption(QuestStep step, TileObject object) { return ""; } - private String chooseCorrectNPCOption(QuestStep step, NPC npc) { + private String chooseCorrectNPCOption(QuestStep step, Rs2NpcModel npc) { var npcComp = Microbot.getClientThread().runOnClientThreadOptional(() -> Microbot.getClient().getNpcDefinition(npc.getId())) .orElse(null); @@ -501,23 +626,47 @@ private String chooseCorrectNPCOption(QuestStep step, NPC npc) { return "Talk-to"; } - private String chooseCorrectItemOption(QuestStep step, int itemId) { - for (var action : Rs2Inventory.get(itemId).getInventoryActions()) { - if (action != null && step.getText().stream().anyMatch(x -> x.toLowerCase().contains(action.toLowerCase()))) - return action; - } + private String chooseCorrectItemOption(QuestStep step, int itemId) { + for (var action : Rs2Inventory.get(itemId).getInventoryActions()) { + if (action != null && step.getText().stream().anyMatch(x -> x.toLowerCase().contains(action.toLowerCase()))) + return action; + } - return "use"; - } + return "use"; + } + + private boolean hasLineOfSightToObject(Rs2TileObjectModel object) { + if (object == null || object.getWorldLocation() == null || Microbot.getClient().getLocalPlayer() == null) { + return false; + } + + WorldArea objectArea = object.getWorldLocation().toWorldArea(); + WorldArea playerArea = Microbot.getClient().getLocalPlayer().getWorldLocation().toWorldArea(); + + return Microbot.getClient().getTopLevelWorldView() != null + && playerArea.hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), objectArea); + } + + private boolean hasLineOfSightFrom(WorldPoint point, Rs2TileObjectModel object) { + if (point == null || object == null || object.getWorldLocation() == null) { + return false; + } + + WorldArea fromArea = point.toWorldArea(); + WorldArea targetArea = object.getWorldLocation().toWorldArea(); + + return Microbot.getClient().getTopLevelWorldView() != null + && fromArea.hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), targetArea); + } private boolean applyDetailedQuestStep(DetailedQuestStep conditionalStep) { if (conditionalStep instanceof NpcStep) return false; if (conditionalStep.getIconItemID() != -1 - && conditionalStep.getWorldPoint() != null - && !conditionalStep.getWorldPoint().toWorldArea().hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), Rs2Player.getWorldLocation())) { - if (Rs2Tile.areSurroundingTilesWalkable(conditionalStep.getWorldPoint(), 1, 1)) { - WorldPoint nearestUnreachableWalkableTile = Rs2Tile.getNearestWalkableTileWithLineOfSight(conditionalStep.getWorldPoint()); + && conditionalStep.getDefinedPoint().getWorldPoint() != null + && !conditionalStep.getDefinedPoint().getWorldPoint().toWorldArea().hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), Rs2Player.getWorldLocation())) { + if (Rs2Tile.areSurroundingTilesWalkable(conditionalStep.getDefinedPoint().getWorldPoint(), 1, 1)) { + WorldPoint nearestUnreachableWalkableTile = Rs2Tile.getNearestWalkableTileWithLineOfSight(conditionalStep.getDefinedPoint().getWorldPoint()); if (nearestUnreachableWalkableTile != null) { return Rs2Walker.walkTo(nearestUnreachableWalkableTile, 0); } @@ -529,46 +678,35 @@ private boolean applyDetailedQuestStep(DetailedQuestStep conditionalStep) { if (requirement instanceof ItemRequirement) { ItemRequirement itemRequirement = (ItemRequirement) requirement; - if (itemRequirement.shouldHighlightInInventory(Microbot.getClient()) - && Rs2Inventory.contains(itemRequirement.getAllIds().stream().mapToInt(i -> i).toArray())) { - var itemId = itemRequirement.getAllIds().stream().filter(Rs2Inventory::contains).findFirst().orElse(-1); - Rs2Inventory.interact(itemId, chooseCorrectItemOption(conditionalStep, itemId)); - sleep(100, 200); - usingItems = true; - continue; - } - - if (!Rs2Inventory.contains(itemRequirement.getAllIds().stream().mapToInt(i -> i).toArray()) && conditionalStep.getWorldPoint() != null) { - if (Rs2Walker.canReach(conditionalStep.getWorldPoint()) && - (conditionalStep.getWorldPoint().distanceTo(Rs2Player.getWorldLocation()) < 2) - || conditionalStep.getWorldPoint().toWorldArea().hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), Microbot.getClient().getLocalPlayer().getWorldLocation().toWorldArea()) - && Rs2Camera.isTileOnScreen(LocalPoint.fromWorld(Microbot.getClient().getTopLevelWorldView(), conditionalStep.getWorldPoint()))) { - Rs2GroundItem.loot(itemRequirement.getId()); - } else { - Rs2Walker.walkTo(conditionalStep.getWorldPoint(), 2); - } - return true; - } else if (!Rs2Inventory.contains(itemRequirement.getAllIds().stream().mapToInt(i -> i).toArray())) { - Rs2GroundItem.loot(itemRequirement.getId()); - return true; - } - } - } - - if (!usingItems && conditionalStep.getWorldPoint() != null && !Rs2Walker.walkTo(conditionalStep.getWorldPoint())) + if (itemRequirement.shouldHighlightInInventory(Microbot.getClient()) + && Rs2Inventory.contains(itemRequirement.getAllIds().stream().mapToInt(i -> i).toArray())) { + var itemId = itemRequirement.getAllIds().stream().filter(Rs2Inventory::contains).findFirst().orElse(-1); + Rs2Inventory.interact(itemId, chooseCorrectItemOption(conditionalStep, itemId)); + sleep(100, 200); + usingItems = true; + continue; + } + + if (!hasItemRequirementOnPlayer(itemRequirement)) { + return attemptToAcquireRequirementItem(conditionalStep, itemRequirement); + } + } + } + + if (!usingItems && conditionalStep.getDefinedPoint().getWorldPoint() != null && !Rs2Walker.walkTo(conditionalStep.getDefinedPoint().getWorldPoint())) return true; - if (conditionalStep.getIconItemID() != -1 && conditionalStep.getWorldPoint() != null - && conditionalStep.getWorldPoint().toWorldArea().hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), Rs2Player.getWorldLocation())) { - if (conditionalStep.getQuestHelper().getQuest() == QuestHelperQuest.ZOGRE_FLESH_EATERS) { - if (conditionalStep.getIconItemID() == 4836) { // strange potion - Rs2GroundItem.interact(ItemID.CUP_OF_TEA_4838, "", 20); - } - } - } - - return usingItems; - } + if (conditionalStep.getIconItemID() != -1 && conditionalStep.getDefinedPoint().getWorldPoint() != null + && conditionalStep.getDefinedPoint().getWorldPoint().toWorldArea().hasLineOfSightTo(Microbot.getClient().getTopLevelWorldView(), Rs2Player.getWorldLocation())) { + if (conditionalStep.getQuestHelper().getQuest() == QuestHelperQuest.ZOGRE_FLESH_EATERS) { + if (conditionalStep.getIconItemID() == 4836) { // strange potion + lootGroundItem(ItemID.CUP_OF_TEA_4838, 20); + } + } + } + + return usingItems; + } private boolean applyWidgetStep(WidgetStep step) { var widgetDetails = step.getWidgetDetails().get(0); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/QuestBank.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/QuestBank.java index 7ad3b65cd0f..73a29ea717a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/QuestBank.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/QuestBank.java @@ -41,6 +41,9 @@ import java.util.EnumSet; import java.util.List; +/// The QuestBank helps interface RuneLite's config system to save a player's bank. +/// +/// If you need to check the contents of a player's bank, utilize {@link net.runelite.client.plugins.microbot.questhelper.managers.QuestContainerManager} instead. @Slf4j @Singleton public class QuestBank diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/PotionStorage.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/PotionStorage.java index 8d725beaaf4..5a2367e9512 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/PotionStorage.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/PotionStorage.java @@ -188,6 +188,11 @@ public Item[] getItems() int count(int itemId) { + if (itemId == ItemID.VIAL_EMPTY) + { + return getVialsInPotionStorage(); + } + if (potions == null) { return 0; @@ -208,29 +213,44 @@ int count(int itemId) return 0; } - int find(int itemId) - { - if (potions == null) - { - return -1; - } + int getIdx(int itemId) + { + if (potions == null) + { + return -1; + } - if (itemId == ItemID.VIAL_EMPTY) - { - return VIAL_IDX; - } + if (itemId == ItemID.VIAL_EMPTY) + { + if (hasVialsInPotionStorage()) + { + return potions.length * COMPONENTS_PER_POTION + 4; + } - int potionIdx = 0; - for (Potion potion : potions) - { - ++potionIdx; - if (potion != null && potion.itemId == itemId) - { - return potionIdx - 1; - } - } - return -1; - } + return -1; + } + + int potionIdx = 0; + for (Potion potion : potions) + { + ++potionIdx; + if (potion != null && potion.itemId == itemId) + { + return (potionIdx - 1) * COMPONENTS_PER_POTION; + } + } + return -1; + } + + boolean hasVialsInPotionStorage() + { + return getVialsInPotionStorage() > 0; + } + + int getVialsInPotionStorage() + { + return client.getVarpValue(VarPlayerID.POTIONSTORE_VIALS); + } public void prepareWidgets() { @@ -247,6 +267,13 @@ public void prepareWidgets() potStoreContent.createChild(childIdx++, WidgetType.GRAPHIC); } } + + // Add widgets so that we can also take out vials + potStoreContent.createChild(childIdx++, WidgetType.GRAPHIC); + potStoreContent.createChild(childIdx++, WidgetType.RECTANGLE); + potStoreContent.createChild(childIdx++, WidgetType.TEXT); + potStoreContent.createChild(childIdx++, WidgetType.RECTANGLE); + potStoreContent.createChild(childIdx++, WidgetType.TEXT); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTab.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTab.java index 1f4070c052b..90c88c4c779 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTab.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTab.java @@ -34,10 +34,10 @@ import lombok.extern.slf4j.Slf4j; import net.runelite.api.*; import net.runelite.api.events.*; -import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.*; import net.runelite.api.gameval.InventoryID; import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.SpriteID; import net.runelite.api.widgets.ItemQuantityMode; import net.runelite.api.widgets.JavaScriptCallback; import net.runelite.api.widgets.Widget; @@ -55,15 +55,13 @@ import javax.inject.Inject; import javax.inject.Singleton; -import java.awt.Point; import java.awt.*; -import java.util.List; +import java.awt.Point; import java.util.*; +import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import static net.runelite.client.plugins.microbot.questhelper.bank.banktab.PotionStorage.COMPONENTS_PER_POTION; -import static net.runelite.client.plugins.microbot.questhelper.bank.banktab.PotionStorage.VIAL_IDX; import static net.runelite.client.plugins.banktags.BankTagsPlugin.*; @Singleton @@ -77,12 +75,12 @@ public class QuestBankTab private static final int LINE_VERTICAL_SPACING = 5; private static final int LINE_HEIGHT = 2; private static final int TEXT_HEIGHT = 15; - private static final int EMPTY_BANK_SLOT_ID = 6512; + private static final int EMPTY_BANK_SLOT_ID = ItemID.BLANKOBJECT; private static final int MAX_RESULT_COUNT = 250; - private static final int CROSS_SPRITE_ID = 1216; - private static final int TICK_SPRITE_ID = 1217; + private static final int CROSS_SPRITE_ID = SpriteID.Checkbox.CROSSED; + private static final int TICK_SPRITE_ID = SpriteID.Checkbox.CHECKED; private final ArrayList addedWidgets = new ArrayList<>(); @@ -154,7 +152,7 @@ public void refreshBankTab() @Subscribe public void onGrandExchangeSearched(GrandExchangeSearched event) { - final String input = client.getVarcStrValue(VarClientStr.INPUT_TEXT); + final String input = client.getVarcStrValue(VarClientID.MESLAYERINPUT); String QUEST_BANK_TAG = "quest-helper"; if (!input.equals(QUEST_BANK_TAG) || questHelper.getSelectedQuest() == null) @@ -162,7 +160,27 @@ public void onGrandExchangeSearched(GrandExchangeSearched event) return; } event.consume(); - updateGrandExchangeResults(); + + var itemsToTag = questHelper.getSelectedQuest().getCurrentStep().getActiveStep().getGeInterfaceIcon(); + if (geButtonWidget.notAtGE()) + { + if (itemsToTag != null) + { + updateGrandExchangeUiForSpecificItem(itemsToTag); + } + } + else + { + updateGrandExchangeResults(); + } + } + + public void updateGrandExchangeUiForSpecificItem(List itemToTag) + { + client.setGeSearchResultIndex(0); + client.setGeSearchResultCount(itemToTag.size()); + + client.setGeSearchResultIds(Shorts.toArray(itemToTag)); } public void updateGrandExchangeResults() @@ -277,18 +295,12 @@ public void onMenuOptionClicked(MenuOptionClicked event) return; } - idx = potionStorage.find(w.getItemId()); - if (idx == VIAL_IDX) - { - potionStorage.prepareWidgets(); - menu.setParam1(InterfaceID.Bankmain.POTIONSTORE_ITEMS); - menu.setParam0(VIAL_IDX); - } - else if (idx > -1) + idx = potionStorage.getIdx(w.getItemId()); + if (idx > -1) { potionStorage.prepareWidgets(); menu.setParam1(InterfaceID.Bankmain.POTIONSTORE_ITEMS); - menu.setParam0(idx * COMPONENTS_PER_POTION); + menu.setParam0(idx); } } } @@ -400,7 +412,7 @@ private void sortBankTabItems(Widget itemContainer, Widget[] containerChildren, List itemList = new ArrayList<>(); for (Widget itemWidget : containerChildren) { - if (itemWidget.getSpriteId() == SpriteID.RESIZEABLE_MODE_SIDE_PANEL_BACKGROUND + if (itemWidget.getSpriteId() == SpriteID.TRADEBACKING_DARK || itemWidget.getText().contains("Tab")) { itemWidget.setHidden(true); @@ -508,7 +520,7 @@ private void hideBankWidgets(Widget itemContainer, Widget[] containerChildren) // ~bankmain_drawitem uses 6512 for empty item slots if (!widget.isSelfHidden() && (widget.getItemId() > -1 && widget.getItemId() != ItemID.BLANKOBJECT) || - (widget.getSpriteId() == SpriteID.RESIZEABLE_MODE_SIDE_PANEL_BACKGROUND || widget.getText().contains("Tab")) + (widget.getSpriteId() == SpriteID.TRADEBACKING_DARK || widget.getText().contains("Tab")) ) { widget.setHidden(true); @@ -578,41 +590,31 @@ else if (qty == 0) break; } // ~script669 - int opIdx = 0; - c.setAction(opIdx++, "Withdraw-" + suffix); + c.setAction(0, "Withdraw-" + suffix); if (quantityType != 0) { - c.setAction(opIdx++, "Withdraw-1"); - } - if (quantityType != 1) - { - c.setAction(opIdx++, "Withdraw-5"); - } - if (quantityType != 2) - { - c.setAction(opIdx++, "Withdraw-10"); - } - if (quantityType != 3 && requestQty > 0) - { - c.setAction(opIdx++, "Withdraw-" + requestQty); + c.setAction(1, "Withdraw-1"); } - c.setAction(opIdx++, "Withdraw-X"); - if (quantityType != 4) + c.setAction(2, "Withdraw-5"); + c.setAction(3, "Withdraw-10"); + if (requestQty > 0) { - c.setAction(opIdx++, "Withdraw-All"); + c.setAction(4, "Withdraw-" + requestQty); } - c.setAction(opIdx++, "Withdraw-All-but-1"); + c.setAction(5, "Withdraw-X"); + c.setAction(6, "Withdraw-All"); + c.setAction(7, "Withdraw-All-but-1"); if (!isPotStorage && client.getVarbitValue(VarbitID.BANK_BANKOPS_TOGGLE_ON) == 1 && def.getIntValue(ParamID.BANK_AUTOCHARGE) != -1) { - c.setAction(opIdx++, "Configure-Charges"); + c.setAction(8, "Configure-Charges"); } if (!isPotStorage && client.getVarbitValue(VarbitID.BANK_LEAVEPLACEHOLDERS) == 0) { - c.setAction(opIdx++, "Placeholder"); + c.setAction(9, "Placeholder"); } if (!isPotStorage) { - c.setAction(9, "Examine"); + c.setAction(10, "Examine"); } c.setOpacity(0); } @@ -757,7 +759,7 @@ private int addSubSectionHeader(Widget itemContainer, String title, int totalSec private int addSectionHeader(Widget itemContainer, String title, int totalSectionsHeight) { - addedWidgets.add(createGraphic(itemContainer, SpriteID.RESIZEABLE_MODE_SIDE_PANEL_BACKGROUND, ITEM_ROW_START, totalSectionsHeight)); + addedWidgets.add(createGraphic(itemContainer, SpriteID.TRADEBACKING_DARK, ITEM_ROW_START, totalSectionsHeight)); addedWidgets.add(createText(itemContainer, title, new Color(228, 216, 162).getRGB(), (ITEMS_PER_ROW * ITEM_HORIZONTAL_SPACING) + ITEM_ROW_START , TEXT_HEIGHT, ITEM_ROW_START, totalSectionsHeight + LINE_VERTICAL_SPACING)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTabInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTabInterface.java index 08a3d147d3a..32e6be9e82d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTabInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestBankTabInterface.java @@ -31,6 +31,8 @@ import net.runelite.api.*; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.SpriteID; +import net.runelite.api.gameval.VarClientID; import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.JavaScriptCallback; import net.runelite.api.widgets.Widget; @@ -83,13 +85,13 @@ public void init() int QUEST_BUTTON_SIZE = 25; int QUEST_BUTTON_X = 408; int QUEST_BUTTON_Y = 5; - questBackgroundWidget = createGraphic("quest-helper", SpriteID.UNKNOWN_BUTTON_SQUARE_SMALL, QUEST_BUTTON_SIZE, + questBackgroundWidget = createGraphic("quest-helper", SpriteID.Miscgraphics3.UNKNOWN_BUTTON_SQUARE_SMALL, QUEST_BUTTON_SIZE, QUEST_BUTTON_SIZE, QUEST_BUTTON_X, QUEST_BUTTON_Y); questBackgroundWidget.setAction(1, VIEW_TAB); questBackgroundWidget.setOnOpListener((JavaScriptCallback) this::handleTagTab); - questIconWidget = createGraphic("", SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS, QUEST_BUTTON_SIZE - 6, + questIconWidget = createGraphic("", SpriteID.AchievementDiaryIcons.BLUE_QUESTS, QUEST_BUTTON_SIZE - 6, QUEST_BUTTON_SIZE - 6, QUEST_BUTTON_X + 3, QUEST_BUTTON_Y + 3); @@ -148,8 +150,8 @@ public void handleSearch() closeTab(); // This ensures that when clicking Search when tab is selected, the search input is opened rather // than client trying to close it first - client.setVarcStrValue(VarClientStr.INPUT_TEXT, ""); - client.setVarcIntValue(VarClientInt.INPUT_TYPE, 0); + client.setVarcStrValue(VarClientID.MESLAYERINPUT, ""); + client.setVarcIntValue(VarClientID.MESLAYERMODE, 0); } } @@ -186,7 +188,7 @@ public void closeTab() questTabActive = false; if (questBackgroundWidget != null) { - questBackgroundWidget.setSpriteId(SpriteID.UNKNOWN_BUTTON_SQUARE_SMALL); + questBackgroundWidget.setSpriteId(SpriteID.Miscgraphics3.UNKNOWN_BUTTON_SQUARE_SMALL); questBackgroundWidget.revalidate(); } } @@ -210,7 +212,7 @@ public void refreshTab() if (searchButtonBackground != null) { searchButtonBackground.setOnTimerListener((Object[]) null); - searchButtonBackground.setSpriteId(SpriteID.EQUIPMENT_SLOT_TILE); + searchButtonBackground.setSpriteId(SpriteID.Miscgraphics.EQUIPMENT_SLOT_TILE); } } @@ -228,7 +230,7 @@ private void activateTab(boolean wasInPotionStorage) client.menuAction(-1, InterfaceID.Bankmain.POTIONSTORE_BUTTON, MenuAction.CC_OP, 1, -1, "Potion store", ""); } - questBackgroundWidget.setSpriteId(SpriteID.UNKNOWN_BUTTON_SQUARE_SMALL_SELECTED); + questBackgroundWidget.setSpriteId(SpriteID.Miscgraphics3.UNKNOWN_BUTTON_SQUARE_SMALL_SELECTED); questBackgroundWidget.revalidate(); questTabActive = true; @@ -242,7 +244,7 @@ private void activateTab(boolean wasInPotionStorage) if (searchButtonBackground != null) { searchButtonBackground.setOnTimerListener((Object[]) null); - searchButtonBackground.setSpriteId(SpriteID.EQUIPMENT_SLOT_TILE); + searchButtonBackground.setSpriteId(SpriteID.Miscgraphics.EQUIPMENT_SLOT_TILE); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestGrandExchangeInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestGrandExchangeInterface.java index 6f2e9a7cd88..e40f86d9941 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestGrandExchangeInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bank/banktab/QuestGrandExchangeInterface.java @@ -30,9 +30,13 @@ import lombok.Getter; import lombok.Setter; import net.runelite.api.*; +import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.SpriteID; +import net.runelite.api.gameval.VarClientID; import net.runelite.api.widgets.JavaScriptCallback; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetTextAlignment; import net.runelite.api.widgets.WidgetType; import net.runelite.client.callback.ClientThread; import net.runelite.client.ui.JagexColors; @@ -80,17 +84,26 @@ public void init() parent = client.getWidget(InterfaceID.Chatbox.MES_LAYER); + if (notAtGE()) + { + if (questHelper.getConfig().solvePuzzles() && questHelper.getSelectedQuest().getCurrentStep().getActiveStep().getGeInterfaceIcon() != null) + { + onceOffActivateTab(parent); + } + return; + } + int QUEST_BUTTON_SIZE = 20; int QUEST_BUTTON_X = 480; int QUEST_BUTTON_Y = 0; - questBackgroundWidget = createGraphic("quest helper", SpriteID.UNKNOWN_BUTTON_SQUARE_SMALL, + questBackgroundWidget = createGraphic("quest helper", SpriteID.Miscgraphics3.UNKNOWN_BUTTON_SQUARE_SMALL, QUEST_BUTTON_SIZE, QUEST_BUTTON_SIZE, QUEST_BUTTON_X, QUEST_BUTTON_Y); questBackgroundWidget.setAction(1, VIEW_TAB); questBackgroundWidget.setOnOpListener((JavaScriptCallback) this::handleTagTab); - questIconWidget = createGraphic("", SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS, QUEST_BUTTON_SIZE - 6, + questIconWidget = createGraphic("", SpriteID.AchievementDiaryIcons.BLUE_QUESTS, QUEST_BUTTON_SIZE - 6, QUEST_BUTTON_SIZE - 6, QUEST_BUTTON_X + 3, QUEST_BUTTON_Y + 3); @@ -129,6 +142,13 @@ public void destroy() active = false; } + public boolean notAtGE() + { + // Only show button if we're at GE + var playerLocation = client.getLocalPlayer().getWorldLocation(); + return playerLocation.distanceTo(new WorldPoint(3164, 3489, 0)) > 20; + } + public boolean isHidden() { Widget widget = client.getWidget(InterfaceID.Chatbox.MES_LAYER); @@ -154,14 +174,14 @@ public void closeOptions() active = false; if (questBackgroundWidget != null) { - questBackgroundWidget.setSpriteId(SpriteID.UNKNOWN_BUTTON_SQUARE_SMALL); + questBackgroundWidget.setSpriteId(SpriteID.Miscgraphics3.UNKNOWN_BUTTON_SQUARE_SMALL); questBackgroundWidget.revalidate(); } grandExchangeTitle.setHidden(true); - client.setVarcStrValue(VarClientStr.INPUT_TEXT, ""); - client.setVarcIntValue(VarClientInt.INPUT_TYPE, 14); + client.setVarcStrValue(VarClientID.MESLAYERINPUT, ""); + client.setVarcIntValue(VarClientID.MESLAYERMODE, 14); clientThread.invokeLater(() -> updateSearchInterface(false)); } @@ -173,12 +193,22 @@ private void activateTab() return; } - questBackgroundWidget.setSpriteId(SpriteID.UNKNOWN_BUTTON_SQUARE_SMALL_SELECTED); + questBackgroundWidget.setSpriteId(SpriteID.Miscgraphics3.UNKNOWN_BUTTON_SQUARE_SMALL_SELECTED); questBackgroundWidget.revalidate(); grandExchangeTitle.setHidden(false); active = true; - client.setVarcStrValue(VarClientStr.INPUT_TEXT, "quest-helper"); - client.setVarcIntValue(VarClientInt.INPUT_TYPE, 14); + client.setVarcStrValue(VarClientID.MESLAYERINPUT, "quest-helper"); + client.setVarcIntValue(VarClientID.MESLAYERMODE, 14); + + clientThread.invokeLater(() -> updateSearchInterface(true)); + } + + // Used for non-ge ge interfaces + public void onceOffActivateTab(Widget parent) + { + createTitleStepNeededItem(parent); + client.setVarcStrValue(VarClientID.MESLAYERINPUT, "quest-helper"); + client.setVarcIntValue(VarClientID.MESLAYERMODE, 14); clientThread.invokeLater(() -> updateSearchInterface(true)); } @@ -238,8 +268,8 @@ private Widget createTitle(Widget container) widget.setOriginalX(0); widget.setOriginalY(0); widget.setTextShadowed(false); - widget.setXTextAlignment(1); - widget.setYTextAlignment(1); + widget.setXTextAlignment(WidgetTextAlignment.CENTER); + widget.setYTextAlignment(WidgetTextAlignment.CENTER); widget.setText("" + questHelper.getSelectedQuest().getQuest().getName() + " required items"); widget.setFontId(FontID.BOLD_12); @@ -254,4 +284,31 @@ private Widget createTitle(Widget container) return widget; } + + private Widget createTitleStepNeededItem(Widget container) + { + Widget chatbox = client.getWidget(InterfaceID.Chatbox.MES_TEXT2); + + Widget widget = container.createChild(-1, WidgetType.TEXT); + if (chatbox == null) + { + return widget; + } + + widget.setOriginalWidth(chatbox.getWidth()); + widget.setOriginalHeight(chatbox.getHeight()); + widget.setOriginalX(0); + widget.setOriginalY(0); + widget.setTextShadowed(false); + widget.setXTextAlignment(WidgetTextAlignment.CENTER); + widget.setYTextAlignment(WidgetTextAlignment.CENTER); + + widget.setText("Quest Helper Items"); + widget.setFontId(FontID.BOLD_12); + widget.setTextColor(JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND.getRGB()); + + widget.revalidate(); + + return widget; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bikeshedder/BikeShedder.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bikeshedder/BikeShedder.java new file mode 100644 index 00000000000..67222f288e5 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/bikeshedder/BikeShedder.java @@ -0,0 +1,352 @@ +/* + * Copyright (c) 2024, pajlada + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.bikeshedder; + +import com.google.common.collect.ImmutableMap; +import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; +import net.runelite.client.plugins.microbot.questhelper.collections.TeleportCollections; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SpellbookRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Spellbook; +import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetTextRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.client.plugins.microbot.questhelper.steps.widget.NormalSpells; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.ObjectID; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; + +public class BikeShedder extends BasicQuestHelper +{ + private DetailedQuestStep moveToLumbridge; + private DetailedQuestStep confuseHans; + private DetailedQuestStep equipLightbearer; + + private ItemRequirement anyLog; + private ObjectStep useLogOnBush; + + private ItemRequirement oneCoin; + private ItemRequirement manyCoins; + private ObjectStep useCoinOnBush; + private ObjectStep useManyCoinsOnBush; + + private ItemRequirement varrockTeleport; + private ItemRequirement ardougneTeleport; + private ItemRequirement faladorTeleport; + + private Zone conditionalRequirementZone; + private ZoneRequirement conditionalRequirementZoneRequirement; + private ZoneRequirement conditionalRequirementZoneSouthRequirement; + private ZoneRequirement conditionalRequirementZoneNorthRequirement; + private ItemRequirement conditionalRequirementCoins; + private DetailedQuestStep conditionalRequirementLookAtCoins; + private ItemRequirement conditionalRequirementGoldBar; + private WidgetTextRequirement lookAtCooksAssistantRequirement; + private DetailedQuestStep lookAtCooksAssistant; + private WidgetTextRequirement lookAtCooksAssistantTextRequirement; + private ZoneRequirement byStaircaseInSunrisePalace; + private ObjectStep goDownstairsInSunrisePalace; + private DetailedQuestStep haveRunes; + private ItemRequirement lightbearer; + private ItemRequirement elemental30Unique; + private ItemRequirement elemental30; + private ItemRequirement anyCoins; + private ItemStep getCoins; + + // Sailing + private NpcStep talkToNpcOnBoat; + private NpcStep talkToKlarenceFromShip; + private ObjectStep useSalvagingHook; + private ObjectStep useObjectOffBoat; + private ZoneRequirement onBoat1; + private ZoneRequirement onBoat2; + private ZoneRequirement onBoat3; + private ZoneRequirement onBoat4; + + @Override + public Map loadSteps() + { + var lumbridge = new Zone(new WorldPoint(3217, 3210, 0), new WorldPoint(3226, 3228, 0)); + var outsideLumbridge = new ZoneRequirement(false, lumbridge); + moveToLumbridge.setHighlightZone(lumbridge); + var steps = new ConditionalStep(this, confuseHans); + + // aldarin bank + var plankNoBank = new ItemRequirement("Plank (no bank)", ItemID.WOODPLANK); + { + // Do not check bank for plank + var plankStep = new DetailedQuestStep(this, "Plank requirement will not check bank", plankNoBank); + var plankStepPassed = new DetailedQuestStep(this, "Plank requirement will not check bank (Requirement used as conditional step passed)", plankNoBank); + var cPlankStep = new ConditionalStep(this, plankStep); + cPlankStep.addStep(plankNoBank, plankStepPassed); + steps.addStep(new ZoneRequirement(new WorldPoint(1399, 2926, 0)), cPlankStep); + } + + { + // Check bank for plank using alsoCheckBank + var plank = plankNoBank.alsoCheckBank(); + plank.setName("Plank (check bank 1)"); + var plankStep = new DetailedQuestStep(this, "Plank requirement will check bank 1", plank); + var plankStepPassed = new DetailedQuestStep(this, "Plank requirement will check bank 1 (Requirement used as conditional step passed)", plank); + var cPlankStep = new ConditionalStep(this, plankStep); + cPlankStep.addStep(plank, plankStepPassed); + steps.addStep(new ZoneRequirement(new WorldPoint(1399, 2925, 0)), cPlankStep); + } + + { + // Check bank for plank using setShouldCheckBank + var plank = new ItemRequirement("Plank (no bank)", ItemID.WOODPLANK); + plank.setShouldCheckBank(true); + plank.setName("Plank (check bank 2)"); + var plankStep = new DetailedQuestStep(this, "Plank requirement will check bank 2", plank); + var plankStepPassed = new DetailedQuestStep(this, "Plank requirement will check bank 2 (Requirement used as conditional step passed)", plank); + var cPlankStep = new ConditionalStep(this, plankStep); + cPlankStep.addStep(plank, plankStepPassed); + steps.addStep(new ZoneRequirement(new WorldPoint(1399, 2924, 0)), cPlankStep); + } + + // mistrock bank + { + // does not need to be equipped + var blueWizardHat = new ItemRequirement("Blue wizard hat", ItemID.BLUEWIZHAT); + var step = new DetailedQuestStep(this, "Blue wizard hat, does not have to be equipped", blueWizardHat); + var stepPassed = new DetailedQuestStep(this, "Blue wizard hat, does not have to be equipped (Requirement used as conditional step passed)", blueWizardHat); + var cStep = new ConditionalStep(this, step); + cStep.addStep(blueWizardHat, stepPassed); + steps.addStep(new ZoneRequirement(new WorldPoint(1383, 2866, 0)), cStep); + } + + { + // must be equipped + var blueWizardHat = new ItemRequirement("Blue wizard hat", ItemID.BLUEWIZHAT); + blueWizardHat.setMustBeEquipped(true); + var step = new DetailedQuestStep(this, "Blue wizard hat, must be equipped", blueWizardHat); + var stepPassed = new DetailedQuestStep(this, "Blue wizard hat, must be equipped (Requirement used as conditional step passed)", blueWizardHat); + var cStep = new ConditionalStep(this, step); + cStep.addStep(blueWizardHat, stepPassed); + steps.addStep(new ZoneRequirement(new WorldPoint(1382, 2866, 0)), cStep); + } + + // Boat + steps.addStep(onBoat1, talkToNpcOnBoat); + steps.addStep(onBoat2, talkToKlarenceFromShip); + steps.addStep(onBoat3, useSalvagingHook); + steps.addStep(onBoat4, useObjectOffBoat); + + steps.addStep(byStaircaseInSunrisePalace, goDownstairsInSunrisePalace); + steps.addStep(outsideLumbridge, moveToLumbridge); + steps.addStep(new ZoneRequirement(new WorldPoint(3224, 3218, 0)), haveRunes); + steps.addStep(new ZoneRequirement(new WorldPoint(3222, 3218, 0)), equipLightbearer); + steps.addStep(new ZoneRequirement(new WorldPoint(3223, 3218, 0)), useLogOnBush); + steps.addStep(new ZoneRequirement(new WorldPoint(3222, 3217, 0)), useCoinOnBush); + steps.addStep(new ZoneRequirement(new WorldPoint(3223, 3216, 0)), useManyCoinsOnBush); + steps.addStep(new ZoneRequirement(new WorldPoint(3224, 3216, 0)), getCoins); + steps.addStep(conditionalRequirementZoneRequirement, conditionalRequirementLookAtCoins); + steps.addStep(new ZoneRequirement(new WorldPoint(3224, 3221, 0)), lookAtCooksAssistant); + + return new ImmutableMap.Builder() + .put(-1, steps) + .build(); + } + + @Override + protected void setupRequirements() + { + moveToLumbridge = new DetailedQuestStep(this, new WorldPoint(3221, 3218, 0), "Move to outside Lumbridge Castle"); + + var normalSpellbook = new SpellbookRequirement(Spellbook.NORMAL); + + confuseHans = new NpcStep(this, NpcID.HANS, new WorldPoint(3221, 3218, 0), "Cast Confuse on Hans", normalSpellbook); + confuseHans.addSpellHighlight(NormalSpells.CONFUSE); + + lightbearer = new ItemRequirement("Lightbearer", ItemID.LIGHTBEARER).highlighted(); + equipLightbearer = new DetailedQuestStep(this, "Equip a Lightbearer", lightbearer.equipped()); + + anyLog = new ItemRequirement("Any log", ItemCollections.LOGS_FOR_FIRE).highlighted(); + + useLogOnBush = new ObjectStep(this, ObjectID.PVPW_ARMOURSTAND_BUSH, new WorldPoint(3223, 3217, 0), "Use log on bush", anyLog); + useLogOnBush.addIcon(ItemID.LOGS); + + varrockTeleport = TeleportCollections.VARROCK_TELEPORT.getItemRequirement(); + ardougneTeleport = TeleportCollections.ARDOUGNE_TELEPORT.getItemRequirement(); + faladorTeleport = TeleportCollections.FALADOR_TELEPORT.getItemRequirement(); + + oneCoin = new ItemRequirement("Coins", ItemCollections.COINS, 1); + oneCoin.setHighlightInInventory(true); + useCoinOnBush = new ObjectStep(this, ObjectID.PVPW_ARMOURSTAND_BUSH, new WorldPoint(3223, 3217, 0), "Use coins on the bush.", oneCoin); + useCoinOnBush.addIcon(ItemID.COINS); + + manyCoins = new ItemRequirement("Coins", ItemCollections.COINS, 100); + manyCoins.setHighlightInInventory(true); + useManyCoinsOnBush = new ObjectStep(this, ObjectID.PVPW_ARMOURSTAND_BUSH, new WorldPoint(3223, 3217, 0), "Use many coins on the bush.", manyCoins); + useManyCoinsOnBush.addIcon(ItemID.COINS); + + conditionalRequirementZone = new Zone(new WorldPoint(3223, 3221, 0), new WorldPoint(3223, 3223, 0)); + conditionalRequirementZoneRequirement = new ZoneRequirement(conditionalRequirementZone); + conditionalRequirementZoneSouthRequirement = new ZoneRequirement(new WorldPoint(3223, 3221, 0)); + conditionalRequirementZoneNorthRequirement = new ZoneRequirement(new WorldPoint(3223, 3223, 0)); + + conditionalRequirementCoins = new ItemRequirement("Coins", ItemCollections.COINS, 50); + conditionalRequirementCoins.setTooltip("Obtained by robbing a bank"); + conditionalRequirementCoins.setHighlightInInventory(true); + conditionalRequirementCoins.setConditionToHide(conditionalRequirementZoneSouthRequirement); + + conditionalRequirementGoldBar = new ItemRequirement("Gold Bar", ItemID.GOLD_BAR, 1); + conditionalRequirementGoldBar.setTooltip("Obtained by robbing a bank"); + conditionalRequirementGoldBar.setHighlightInInventory(true); + conditionalRequirementGoldBar.setConditionToHide(or(conditionalRequirementZoneNorthRequirement, conditionalRequirementZoneSouthRequirement)); + + conditionalRequirementLookAtCoins = new DetailedQuestStep(this, "Admire the coins in your inventory.", conditionalRequirementCoins); + + lookAtCooksAssistantRequirement = new WidgetTextRequirement(InterfaceID.Questjournal.TITLE, "Cook's Assistant"); + lookAtCooksAssistantRequirement.setDisplayText("Cook's Assistant quest journal open"); + lookAtCooksAssistantTextRequirement = new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "he now lets me use his high quality range"); + lookAtCooksAssistantTextRequirement.setDisplayText("Cook's Assistant quest journal open & received reward (checking text)"); + lookAtCooksAssistant = new DetailedQuestStep(this, "Open the Cook's Assistant quest journal. You must have started the quest for this test to work.", lookAtCooksAssistantRequirement, lookAtCooksAssistantTextRequirement); + + var upstairsInSunrisePalace = new Zone(new WorldPoint(1684, 3162, 1), new WorldPoint(1691, 3168, 1)); + byStaircaseInSunrisePalace = new ZoneRequirement(upstairsInSunrisePalace); + goDownstairsInSunrisePalace = new ObjectStep(getQuest().getQuestHelper(), ObjectID.CIVITAS_PALACE_STAIRS_DOWN, new WorldPoint(1690, 3164, 1), "Climb downstairs, ensure stairs are well highlighted!"); + + + var fire30 = new ItemRequirement("Fire runes", ItemID.FIRERUNE, 30) + .showConditioned(new SkillRequirement(Skill.MAGIC, 63)); + var air30 = new ItemRequirement("Air runes", ItemID.AIRRUNE, 30) + .showConditioned(new SkillRequirement(Skill.MAGIC, 66)); + var water30 = new ItemRequirement("Water runes", ItemID.WATERRUNE, 30) + .showConditioned(new SkillRequirement(Skill.MAGIC, 56)); + var earth30 = new ItemRequirement("Earth runes", ItemID.EARTHRUNE, 30) + .showConditioned(new SkillRequirement(Skill.MAGIC, 60)); + elemental30Unique = new ItemRequirements(LogicType.OR, "Elemental runes as ItemRequirements OR", air30, water30, earth30, fire30); + elemental30Unique.addAlternates(ItemID.FIRERUNE, ItemID.EARTHRUNE, ItemID.AIRRUNE); + elemental30 = new ItemRequirement("Elemental rune as ItemRequirement", List.of(ItemID.AIRRUNE, ItemID.EARTHRUNE, ItemID.WATERRUNE, + ItemID.FIRERUNE), 30); + elemental30.setTooltip("You have potato"); + haveRunes = new DetailedQuestStep(this, "Compare rune checks for ItemRequirement and ItemRequirements with OR.", elemental30, elemental30Unique); + + anyCoins = new ItemRequirement("Coins", ItemCollections.COINS); + getCoins = new ItemStep(this, new WorldPoint(3224, 3215, 0), "Get coins", anyCoins); + + // Sailing + + var zones1 = new Zone[] { + new Zone(new WorldPoint(3843, 6402, 1), new WorldPoint(3844, 6402, 1)), // Tutorial + new Zone(new WorldPoint(3842, 6389, 1), new WorldPoint(3876, 6389, 1)), + new Zone(new WorldPoint(3842, 6365, 1), new WorldPoint(3860, 6365, 1)), + new Zone(new WorldPoint(3843, 6354, 1), new WorldPoint(3884, 6354, 1)) + }; + onBoat1 = new ZoneRequirement(zones1); + + var zones2 = new Zone[] { + new Zone(new WorldPoint(3843, 6403, 1), new WorldPoint(3844, 6403, 1)), // Tutorial + new Zone(new WorldPoint(3842, 6390, 1), new WorldPoint(3876, 6390, 1)), + new Zone(new WorldPoint(3842, 6366, 1), new WorldPoint(3860, 6366, 1)), + new Zone(new WorldPoint(3843, 6355, 1), new WorldPoint(3884, 6355, 1)) + }; + onBoat2 = new ZoneRequirement(zones2); + + var zones3 = new Zone[] { + new Zone(new WorldPoint(3843, 6404, 1), new WorldPoint(3844, 6404, 1)), // Tutorial + new Zone(new WorldPoint(3842, 6391, 1), new WorldPoint(3876, 6391, 1)), + new Zone(new WorldPoint(3842, 6367, 1), new WorldPoint(3860, 6367, 1)), + new Zone(new WorldPoint(3843, 6356, 1), new WorldPoint(3884, 6356, 1)) + }; + onBoat3 = new ZoneRequirement(zones3); + + var zones4 = new Zone[] { + new Zone(new WorldPoint(3843, 6405, 1), new WorldPoint(3844, 6405, 1)), // Tutorial + new Zone(new WorldPoint(3842, 6312, 1), new WorldPoint(3876, 6392, 1)), + new Zone(new WorldPoint(3842, 6368, 1), new WorldPoint(3860, 6368, 1)), + new Zone(new WorldPoint(3843, 6357, 1), new WorldPoint(3884, 6357, 1)) + }; + onBoat4 = new ZoneRequirement(zones4); + + talkToNpcOnBoat = new NpcStep(this, NpcID.SAILING_INTRO_ANNE_BOAT, "Talk to a ship NPC."); + List shipNpcs = new ArrayList<>(); + for (int i = NpcID.SAILING_CREW_GENERIC_1_WORLD; i <= NpcID.SAILING_CREW_GHOST_JENKINS_CARGO_3; i++) + { + shipNpcs.add(i); + } + talkToNpcOnBoat.addHighlightZones(zones1); + talkToNpcOnBoat.addAlternateNpcs(shipNpcs.toArray(new Integer[0])); + + talkToKlarenceFromShip = new NpcStep(this, NpcID.KLARENSE, new WorldPoint(3046, 3205, 0), "Klarence off the ship."); + talkToKlarenceFromShip.setHighlightZone(new Zone(new WorldPoint(3044, 3202, 0), new WorldPoint(3050, 3205, 0))); + talkToKlarenceFromShip.addHighlightZones(zones2); + List salvagingHookIds = new ArrayList<>(); + for (int i = ObjectID.SAILING_INTRO_SALVAGING_HOOK; i <= ObjectID.SALVAGING_HOOK_LARGE_DRAGON_B; i++) + { + salvagingHookIds.add(i); + } + + useSalvagingHook = new ObjectStep(this, ObjectID.SAILING_INTRO_SALVAGING_HOOK, "Use the salvaging hook."); + useSalvagingHook.addAlternateObjects(salvagingHookIds.toArray(new Integer[0])); + useSalvagingHook.addHighlightZones(zones3); + + useObjectOffBoat = new ObjectStep(this, ObjectID.DRAGONSHIPGANGPLANK_ON, new WorldPoint(3047, 3205, 0), "Click Klarense's gangplank."); + useObjectOffBoat.setHighlightZone(new Zone(new WorldPoint(3044, 3202, 0), new WorldPoint(3050, 3205, 0))); + useObjectOffBoat.addHighlightZones(zones4); + } + + @Override + public List getItemRecommended() { + return Arrays.asList(varrockTeleport, ardougneTeleport, faladorTeleport, elemental30, elemental30Unique); + } + + @Override + public List getPanels() + { + var panels = new ArrayList(); + + panels.add(new PanelDetails("Move to Lumbridge", List.of(moveToLumbridge))); + panels.add(new PanelDetails("Normal Spellbook", List.of(confuseHans))); + panels.add(new PanelDetails("Equip Lightbearer", List.of(equipLightbearer), List.of(lightbearer))); + panels.add(new PanelDetails("Use log on mysterious bush", List.of(useLogOnBush), List.of(anyLog))); + panels.add(new PanelDetails("Use coins on mysterious bush", List.of(useCoinOnBush, useManyCoinsOnBush), List.of(oneCoin, manyCoins))); + panels.add(new PanelDetails("Conditional requirement", List.of(conditionalRequirementLookAtCoins), List.of(conditionalRequirementCoins, conditionalRequirementGoldBar))); + panels.add(new PanelDetails("Item step", List.of(getCoins), List.of(anyCoins))); + panels.add(new PanelDetails("Quest state", List.of(lookAtCooksAssistant), List.of(lookAtCooksAssistantRequirement, lookAtCooksAssistantTextRequirement))); + panels.add(new PanelDetails("Ensure staircase upstairs in Sunrise Palace is highlighted", List.of(goDownstairsInSunrisePalace), List.of())); + panels.add(new PanelDetails("Sailing", List.of(talkToNpcOnBoat, talkToKlarenceFromShip, useSalvagingHook, useObjectOffBoat), List.of())); + + return panels; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/collections/ItemCollections.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/collections/ItemCollections.java index 07007445b54..37a15faf427 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/collections/ItemCollections.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/collections/ItemCollections.java @@ -1417,7 +1417,7 @@ public enum ItemCollections ItemID.TIARA_ELEMENTAL ).build()), FIRE_ALTAR(new ImmutableList.Builder() - .addAll(AIR_ALTAR_WEARABLE.getItems()).add( + .addAll(FIRE_ALTAR_WEARABLE.getItems()).add( ItemID.ELEMENTAL_TALISMAN, ItemID.FIRE_TALISMAN ).build()), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneEasy.java index cb616282067..c7fab86e217 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneEasy.java @@ -33,6 +33,8 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; @@ -48,154 +50,202 @@ import net.runelite.api.gameval.VarPlayerID; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; public class ArdougneEasy extends ComplexStateQuestHelper { - // Items required - ItemRequirement rustySword, silk, coins; + // Required items + ItemRequirement rustySword; + ItemRequirement silk; + ItemRequirement coins; - // Quests required - Requirement runeMysteries, biohazard; + // Required quests + QuestRequirement runeMysteries; + QuestRequirement biohazard; - Requirement notEssMine, notStealCake, notSellSilk, notEastArdyAltar, notFishingTrawler, notEnterCombatCamp, - notIdentifySword, notWildyLever, notAlecksEmporium, notProbitaPet; + // Required skills + SkillRequirement thieving; - QuestStep claimReward, essMine, stealCake, sellSilk, eastArdyAltar, fishingTrawler, enterCombatCamp, - identifySword, wildyLever, alecksEmporium, probitaPet; + // Tasks + VarplayerRequirement notAlecksEmporium; + NpcStep alecksEmporium; + ConditionalStep alecksEmporiumTask; - ConditionalStep essMineTask, stealCakeTask, sellSilkTask, eastArdyAltarTask, fishingTrawlerTask, enterCombatCampTask, - identifySwordTask, wildyLeverTask, alecksEmporiumTask, probitaPetTask; + VarplayerRequirement notIdentifySword; + NpcStep identifySword; + ConditionalStep identifySwordTask; - @Override - public QuestStep loadStep() - { - initializeRequirements(); - setupSteps(); + VarplayerRequirement notFishingTrawler; + QuestStep fishingTrawler; + ConditionalStep fishingTrawlerTask; - ConditionalStep doEasy = new ConditionalStep(this, claimReward); + VarplayerRequirement notProbitaPet; + NpcStep probitaPet; + ConditionalStep probitaPetTask; - alecksEmporiumTask = new ConditionalStep(this, alecksEmporium); - doEasy.addStep(notAlecksEmporium, alecksEmporiumTask); + VarplayerRequirement notEastArdyAltar; + ObjectStep eastArdyAltar; + ConditionalStep eastArdyAltarTask; - fishingTrawlerTask = new ConditionalStep(this, fishingTrawler); - doEasy.addStep(notFishingTrawler, fishingTrawlerTask); + VarplayerRequirement notSellSilk; + NpcStep sellSilk; + ConditionalStep sellSilkTask; - identifySwordTask = new ConditionalStep(this, identifySword); - doEasy.addStep(notIdentifySword, identifySwordTask); + VarplayerRequirement notStealCake; + ObjectStep stealCake; + ConditionalStep stealCakeTask; - essMineTask = new ConditionalStep(this, essMine); - doEasy.addStep(notEssMine, essMineTask); + VarplayerRequirement notEssMine; + NpcStep essMine; + ConditionalStep essMineTask; - stealCakeTask = new ConditionalStep(this, stealCake); - doEasy.addStep(notStealCake, stealCakeTask); + VarplayerRequirement notWildyLever; + ObjectStep wildyLever; + ConditionalStep wildyLeverTask; - sellSilkTask = new ConditionalStep(this, sellSilk); - doEasy.addStep(notSellSilk, sellSilkTask); + ZoneRequirement nearWildyLever; + ObjectStep useWildyLever; + VarplayerRequirement notEnterCombatCamp; + ObjectStep enterCombatCamp; + ConditionalStep enterCombatCampTask; - probitaPetTask = new ConditionalStep(this, probitaPet); - doEasy.addStep(notProbitaPet, probitaPetTask); + NpcStep claimReward; - eastArdyAltarTask = new ConditionalStep(this, eastArdyAltar); - doEasy.addStep(notEastArdyAltar, eastArdyAltarTask); + @Override + protected void setupRequirements() + { + notAlecksEmporium = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 11); - wildyLeverTask = new ConditionalStep(this, wildyLever); - doEasy.addStep(notWildyLever, wildyLeverTask); + notIdentifySword = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 7); - enterCombatCampTask = new ConditionalStep(this, enterCombatCamp); - doEasy.addStep(notEnterCombatCamp, enterCombatCampTask); + notFishingTrawler = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 5); - return doEasy; - } + notProbitaPet = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 12); - @Override - protected void setupRequirements() - { - notEssMine = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 0); - notStealCake = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 1); - notSellSilk = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 2); notEastArdyAltar = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 4); - notFishingTrawler = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 5); + + notSellSilk = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 2); + + notStealCake = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 1); + + notEssMine = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 0); + + nearWildyLever = new ZoneRequirement(new Zone(12605)); notEnterCombatCamp = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 6); - notIdentifySword = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 7); + notWildyLever = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 9); - notAlecksEmporium = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 11); - notProbitaPet = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 12); - silk = new ItemRequirement("Silk", ItemID.SILK).showConditioned(notSellSilk); rustySword = new ItemRequirement("Rusty sword", ItemID.DIGSITESWORD).showConditioned(notIdentifySword); - coins = new ItemRequirement("Coins", ItemCollections.COINS).showConditioned(notIdentifySword); + silk = new ItemRequirement("Silk", ItemID.SILK).showConditioned(notSellSilk); + coins = new ItemRequirement("Coins", ItemCollections.COINS, 100).showConditioned(notIdentifySword); runeMysteries = new QuestRequirement(QuestHelperQuest.RUNE_MYSTERIES, QuestState.FINISHED); biohazard = new QuestRequirement(QuestHelperQuest.BIOHAZARD, QuestState.FINISHED); + thieving = new SkillRequirement(Skill.THIEVING, 5, true); } public void setupSteps() { - essMine = new NpcStep(this, NpcID.CROMPERTY_PRE_DIARY, new WorldPoint(2683, 3326, 0), - "Have Wizard Cromperty teleport you to the Rune essence mine."); - essMine.addDialogStep("Can you teleport me to the Rune Essence?"); + alecksEmporium = new NpcStep(this, NpcID.HUNTING_SHOP_OWNER_YANILLE, new WorldPoint(2566, 3083, 0), "View Aleck's Hunter Emporium in Yanille."); + alecksEmporium.addDialogStep("Ok, let's see what you've got!"); + alecksEmporiumTask = new ConditionalStep(this, alecksEmporium); + + identifySword = new NpcStep(this, NpcID.TINDEL_MARCHANT, new WorldPoint(2676, 3152, 0), "Have Tindel Marchant identify a rusty sword for you. Note: there is about a 1% chance this fails and you'll need another sword and more coins.", rustySword, coins); + identifySword.addDialogStep("Ok, I'll give it a go!"); + identifySwordTask = new ConditionalStep(this, identifySword); - stealCake = new ObjectStep(this, ObjectID.CAKETHIEFSTALL, new WorldPoint(2668, 3311, 0), - "Steal a cake from the East Ardougne market stalls."); + fishingTrawler = new ObjectStep(this, ObjectID.TRAWLER_GANGPLANK, new WorldPoint(2675, 3170, 0), "Go out fishing on the Fishing Trawler."); + fishingTrawlerTask = new ConditionalStep(this, fishingTrawler); - sellSilk = new NpcStep(this, NpcID.SILK_MERCHANT_ARDOUGNE, new WorldPoint(2655, 3300, 0), - "Sell silk to the Silk trader in East Ardougne for 60 coins each.");// finish dialog - sellSilk.addDialogSteps("120 coins.", "I'll give it do you for 60."); + probitaPet = new NpcStep(this, NpcID.PET_INSURANCE_BROKER, new WorldPoint(2621, 3294, 0), "Check what pets you have insured with Probita in East Ardougne (right-click her to Check)."); + probitaPet.addDialogStep("What pets have I insured?"); + probitaPet.addDialogStepWithExclusion("More options...", "What pets have I insured?"); + probitaPetTask = new ConditionalStep(this, probitaPet); - eastArdyAltar = new ObjectStep(this, ObjectID.ALTAR, new WorldPoint(2618, 3309, 0), - "Use the altar in East Ardougne's church (requires less than full Prayer points)."); + eastArdyAltar = new ObjectStep(this, ObjectID.ALTAR, new WorldPoint(2618, 3309, 0), "Use the altar in East Ardougne's church (requires less than full Prayer points)."); + eastArdyAltarTask = new ConditionalStep(this, eastArdyAltar); - probitaPet = new NpcStep(this, NpcID.PET_INSURANCE_BROKER, new WorldPoint(2621, 3294, 0), - "Check what pets you have insured with Probita in East Ardougne (right-click her to Check)."); + sellSilk = new NpcStep(this, NpcID.SILK_MERCHANT_ARDOUGNE, new WorldPoint(2655, 3300, 0), "Sell silk to the Silk trader in East Ardougne for 60 coins each."); + sellSilk.addDialogSteps("120 coins.", "I'll give it to you for 60."); + sellSilkTask = new ConditionalStep(this, sellSilk); - wildyLever = new ObjectStep(this, ObjectID.WILDINLEVER, new WorldPoint(2561, 3311, 0), - "Use the Ardougne lever to teleport to the Wilderness (you may pull the lever there to return). This will take you to DEEP Wilderness, bank anything you aren't willing to lose."); + stealCake = new ObjectStep(this, ObjectID.CAKETHIEFSTALL, new WorldPoint(2668, 3311, 0), "Steal a cake from the East Ardougne market stalls."); + stealCakeTask = new ConditionalStep(this, stealCake); - enterCombatCamp = new ObjectStep(this, ObjectID.LATHASTRAINING_GATER, new WorldPoint(2518, 3356, 0), - "Enter the Combat Training Camp north of West Ardougne."); + essMine = new NpcStep(this, NpcID.CROMPERTY_PRE_DIARY, new WorldPoint(2683, 3326, 0), "Have Wizard Cromperty teleport you to the Rune essence mine."); + essMine.addDialogStep("Can you teleport me to the Rune Essence Mine?"); + essMineTask = new ConditionalStep(this, essMine); - fishingTrawler = new ObjectStep(this, ObjectID.TRAWLER_GANGPLANK, new WorldPoint(2675, 3170, 0), - "Go out fishing on the Fishing Trawler."); + wildyLever = new ObjectStep(this, ObjectID.WILDINLEVER, new WorldPoint(2561, 3311, 0), "Use the Ardougne lever to teleport to the Wilderness (you may pull the lever there to return). This will take you to DEEP Wilderness, bank anything you aren't willing to lose."); + // We don't add a dialog highlight on purpose here to make sure people don't mindlessly click blue and lose items + wildyLeverTask = new ConditionalStep(this, wildyLever); - identifySword = new NpcStep(this, NpcID.TINDEL_MARCHANT, new WorldPoint(2676, 3152, 0), - "Have Tindel Marchant identify a rusty sword for you. Note: there is about a 1% chance this fails and " + - "you'll need another sword and more coins.", rustySword, coins.quantity(100)); - identifySword.addDialogStep("Ok, I'll give it a go!"); + useWildyLever = new ObjectStep(this, ObjectID.WILDOUTLEVER, new WorldPoint(3153, 3923, 0), "Click the lever to return to Ardougne."); + enterCombatCamp = new ObjectStep(this, ObjectID.LATHASTRAINING_GATER, new WorldPoint(2518, 3356, 0), "Enter the Combat Training Camp north of West Ardougne."); + enterCombatCampTask = new ConditionalStep(this, enterCombatCamp); + enterCombatCampTask.addStep(nearWildyLever, useWildyLever); - alecksEmporium = new NpcStep(this, NpcID.HUNTING_SHOP_OWNER_YANILLE, new WorldPoint(2566, 3083, 0), - "View Aleck's Hunter Emporium in Yanille."); - alecksEmporium.addDialogStep("Ok, let's see what you've got!"); + enterCombatCamp.addSubSteps(useWildyLever); - claimReward = new NpcStep(this, NpcID.ARDY_TWOPINTS_DIARY, new WorldPoint(2574, 3323, 0), - "Talk to Two-pints in the Flying Horse Inn at East Ardougne to claim your reward!"); + claimReward = new NpcStep(this, NpcID.ARDY_TWOPINTS_DIARY, new WorldPoint(2574, 3323, 0), "Talk to Two-pints in the Flying Horse Inn at East Ardougne to claim your reward!"); claimReward.addDialogStep("I have a question about my Achievement Diary."); } + @Override + public QuestStep loadStep() + { + initializeRequirements(); + setupSteps(); + + var diary = new ConditionalStep(this, claimReward); + + diary.addStep(notAlecksEmporium, alecksEmporiumTask); + + diary.addStep(notIdentifySword, identifySwordTask); + + diary.addStep(notFishingTrawler, fishingTrawlerTask); + + diary.addStep(notProbitaPet, probitaPetTask); + + diary.addStep(notEastArdyAltar, eastArdyAltarTask); + + diary.addStep(notSellSilk, sellSilkTask); + + diary.addStep(notStealCake, stealCakeTask); + + diary.addStep(notEssMine, essMineTask); + + diary.addStep(notWildyLever, wildyLeverTask); + + diary.addStep(notEnterCombatCamp, enterCombatCampTask); + + return diary; + } + @Override public List getItemRequirements() { - return Arrays.asList(rustySword, silk, coins.quantity(100)); + return List.of( + rustySword, + silk, + coins + ); } @Override public List getGeneralRequirements() { - List reqs = new ArrayList<>(); - reqs.add(new SkillRequirement(Skill.THIEVING, 5, true)); - - reqs.add(runeMysteries); - reqs.add(biohazard); - - return reqs; + return List.of( + thieving, + runeMysteries, + biohazard + ); } @Override public List getItemRewards() { - return Arrays.asList( + return List.of( new ItemReward("Ardougne Cloak 1", ItemID.ARDY_CAPE_EASY), new ItemReward("2,500 Exp. Lamp (Any skill over 30)", ItemID.THOSF_REWARD_LAMP) ); @@ -204,7 +254,7 @@ public List getItemRewards() @Override public List getUnlockRewards() { - return Arrays.asList( + return List.of( new UnlockReward("Unlimited teleports to the Ardougne Monastery with the Ardougne cloak 1"), new UnlockReward("Double death runes (200) when trading in cats to civilians"), new UnlockReward("10% increased chance to successfully steal from stalls in Ardougne"), @@ -215,64 +265,107 @@ public List getUnlockRewards() @Override public List getPanels() { - List allSteps = new ArrayList<>(); - - PanelDetails aleckSteps = new PanelDetails("Aleck's Hunter Emporium", - Collections.singletonList(alecksEmporium)); - aleckSteps.setDisplayCondition(notAlecksEmporium); - aleckSteps.setLockingStep(alecksEmporiumTask); - allSteps.add(aleckSteps); - - PanelDetails trawlerSteps = new PanelDetails("Fishing Trawler", Collections.singletonList(fishingTrawler)); - trawlerSteps.setDisplayCondition(notFishingTrawler); - trawlerSteps.setLockingStep(fishingTrawlerTask); - allSteps.add(trawlerSteps); - - PanelDetails swordSteps = new PanelDetails("Identify Sword", Collections.singletonList(identifySword), - rustySword, coins.quantity(100)); - swordSteps.setDisplayCondition(notIdentifySword); - swordSteps.setLockingStep(identifySwordTask); - allSteps.add(swordSteps); - - PanelDetails essSteps = new PanelDetails("Essence Mine", Collections.singletonList(essMine), runeMysteries); - essSteps.setDisplayCondition(notEssMine); - essSteps.setLockingStep(essMineTask); - allSteps.add(essSteps); - - PanelDetails cakeSteps = new PanelDetails("Steal Cake", Collections.singletonList(stealCake), - new SkillRequirement(Skill.THIEVING, 5, true)); - cakeSteps.setDisplayCondition(notStealCake); - cakeSteps.setLockingStep(stealCakeTask); - allSteps.add(cakeSteps); - - PanelDetails silkSteps = new PanelDetails("Sell Silk", Collections.singletonList(sellSilk), silk); - silkSteps.setDisplayCondition(notSellSilk); - silkSteps.setLockingStep(sellSilkTask); - allSteps.add(silkSteps); - - PanelDetails petSteps = new PanelDetails("Pet Insurance", Collections.singletonList(probitaPet)); - petSteps.setDisplayCondition(notProbitaPet); - petSteps.setLockingStep(probitaPetTask); - allSteps.add(petSteps); - - PanelDetails altarSteps = new PanelDetails("Restore Prayer", Collections.singletonList(eastArdyAltar)); - altarSteps.setDisplayCondition(notEastArdyAltar); - altarSteps.setLockingStep(eastArdyAltarTask); - allSteps.add(altarSteps); - - PanelDetails leverSteps = new PanelDetails("Wilderness Lever", Collections.singletonList(wildyLever)); - leverSteps.setDisplayCondition(notWildyLever); - leverSteps.setLockingStep(wildyLeverTask); - allSteps.add(leverSteps); - - PanelDetails campSteps = new PanelDetails("Combat Camp", Collections.singletonList(enterCombatCamp), - biohazard); - campSteps.setDisplayCondition(notEnterCombatCamp); - campSteps.setLockingStep(enterCombatCampTask); - allSteps.add(campSteps); - - allSteps.add(new PanelDetails("Finishing off", Collections.singletonList(claimReward))); - - return allSteps; + var sections = new ArrayList(); + + sections.add(PanelDetails.lockedPanel( + "Aleck's Hunter Emporium", + notAlecksEmporium, + alecksEmporiumTask, + List.of( + alecksEmporium + ) + )); + + sections.add(PanelDetails.lockedPanel( + "Identify Sword", + notIdentifySword, + identifySword, + List.of( + identifySword + ), + rustySword, + coins + )); + + sections.add(PanelDetails.lockedPanel( + "Fishing Trawler", + notFishingTrawler, + fishingTrawlerTask, + List.of( + fishingTrawler + ) + )); + + sections.add(PanelDetails.lockedPanel( + "Pet Insurance", + notProbitaPet, + probitaPetTask, + List.of( + probitaPet + ) + )); + + sections.add(PanelDetails.lockedPanel( + "Restore Prayer", + notEastArdyAltar, + eastArdyAltarTask, + List.of( + eastArdyAltar + ) + )); + + sections.add(PanelDetails.lockedPanel( + "Sell Silk", + notSellSilk, + sellSilkTask, + List.of( + sellSilk + ), + silk + )); + + sections.add(PanelDetails.lockedPanel( + "Steal Cake", + notStealCake, + stealCakeTask, + List.of( + stealCake + ), + thieving + )); + + sections.add(PanelDetails.lockedPanel( + "Essence Mine", + notEssMine, + essMineTask, + List.of( + essMine + ), + runeMysteries + )); + + sections.add(PanelDetails.lockedPanel( + "Wilderness Lever", + notWildyLever, + wildyLeverTask, + List.of( + wildyLever + ) + )); + + sections.add(PanelDetails.lockedPanel( + "Combat Camp", + notEnterCombatCamp, + enterCombatCampTask, + List.of( + enterCombatCamp + ) + )); + + sections.add(new PanelDetails("Finishing off", List.of( + claimReward + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneElite.java index 95792035cb2..09d5b1c2468 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneElite.java @@ -106,7 +106,7 @@ public QuestStep loadStep() imbueSalveTask = new ConditionalStep(this, farmMorePoints); imbueSalveTask.addStep(enoughNMZPoints, imbueSalve); - imbueSalveTask.addStep(imbuedSalve.alsoCheckBank(questBank), equipSalve); + imbueSalveTask.addStep(imbuedSalve.alsoCheckBank(), equipSalve); doElite.addStep(notImbueSalve, imbueSalveTask); trawlerRayTask = new ConditionalStep(this, trawlerRay); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneHard.java index 1c2cc093fd6..d08ea96525e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneHard.java @@ -129,13 +129,13 @@ public QuestStep loadStep() doHard.addStep(notDragSquare, dragSquareTask); deathRuneTask = new ConditionalStep(this, enterMournerHQ); - deathRuneTask.addStep(inMournerHQ, enterMournerBasement); + deathRuneTask.addStep(new Conditions(redAtAltar, inDeath02), deathAltar); + deathRuneTask.addStep(new Conditions(redAtDoor, inDeath02), turnKeyMirror); + deathRuneTask.addStep(new Conditions(inDeath), deathRune); deathRuneTask.addStep(inDeath0, deathMoveUp1); + deathRuneTask.addStep(inDeath12, deathMoveDown0); deathRuneTask.addStep(inDeath1, deathMoveUp2); deathRuneTask.addStep(inDeath2, deathMoveDown1); - deathRuneTask.addStep(inDeath12, deathMoveDown0); - deathRuneTask.addStep(new Conditions(redAtDoor, inDeath02), turnKeyMirror); - deathRuneTask.addStep(new Conditions(redAtAltar, inDeath02), deathRune); doHard.addStep(notDeathRune, deathRuneTask); return doHard; @@ -158,9 +158,9 @@ protected void setupRequirements() notDeathRune = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY2, false, 5); notYanHouse = new VarbitRequirement(VarbitID.POH_HOUSE_LOCATION, 6, Operation.NOT_EQUAL); - notYanHouse2 = new VarbitRequirement(2187, 6); - redAtDoor = new VarbitRequirement(1249, 1); - redAtAltar = new VarbitRequirement(1250, 1); + notYanHouse2 = new VarbitRequirement(VarbitID.POH_HOUSE_LOCATION, 6); + redAtDoor = new VarbitRequirement(VarbitID.MOURNING_LIGHT_TEMPLE_1_B_EAST, 1); + redAtAltar = new VarbitRequirement(VarbitID.MOURNING_LIGHT_TEMPLE_1_B_WEST, 1); earthRune = new ItemRequirement("Earth rune", ItemID.EARTHRUNE).showConditioned(notTPWatchtower); lawRune = new ItemRequirement("Law runes", ItemID.LAWRUNE).showConditioned(notTPWatchtower); @@ -248,7 +248,7 @@ public void setupSteps() moveHouse = new NpcStep(this, NpcID.POH_ESTATE_AGENT, new WorldPoint(2638, 3293, 0), "Talk to an Estate agent and relocate your house to Yanille.", coins.quantity(25000)); moveHouse.addDialogStep("Can you move my house please?"); - yanPOH = new ObjectStep(this, 15482, new WorldPoint(2544, 3098, 0), + yanPOH = new ObjectStep(this, ObjectID.POH_YANILLE_PORTAL, new WorldPoint(2544, 3098, 0), "Enter your house from the portal in Yanille."); magicGuild = new ObjectStep(this, ObjectID.MAGICGUILD_DOOR_L, new WorldPoint(2584, 3088, 0), @@ -261,7 +261,7 @@ public void setupSteps() redSally = new ObjectStep(this, ObjectID.HUNTING_SAPLING_UP_RED, new WorldPoint(2474, 3239, 0), "Catch a Red Salamander.", true, rope, smallFishingNet); - recharge = new ObjectStep(this, 2638, new WorldPoint(2729, 3378, 0), + recharge = new ObjectStep(this, ObjectID.LG_TOTEM_POLE_LEGENDS, new WorldPoint(2729, 3378, 0), "Recharge some jewellery at the Totem pole in the Legends' Guild.", rechargableJewelry); monkeyCage = new NpcStep(this, NpcID.MM_MONKEY_MINDER, new WorldPoint(2607, 3277, 0), @@ -291,19 +291,19 @@ public void setupSteps() "Go down to the ground floor.", deathAccess, highEss, crystalTrink); turnKeyMirror = new ObjectStep(this, ObjectID.MOURNING_TEMPLE_PILLAR_1_B, new WorldPoint(1881, 4639, 0), "Enter the central area, and turn the pillar's mirror west."); - deathAltar = new ObjectStep(this, 34823, new WorldPoint(1860, 4639, 0), - "Enter the Death altar.", deathAccess, highEss, crystalTrink); + deathAltar = new ObjectStep(this, ObjectID.DEATHTEMPLE_RUINED, new WorldPoint(1860, 4639, 0), + "Enter the Death altar.", deathAccess.highlighted(), highEss, crystalTrink); deathAltar.addIcon(ItemID.DEATH_TALISMAN); deathRune = new ObjectStep(this, ObjectID.DEATH_ALTAR, new WorldPoint(2205, 4836, 0), "Craft some death runes from essence." + "TURN THE MIDDLE PILLAR TO POINT BACK EAST OR YOU'LL HAVE TO RETURN VIA THE UNDERGROUND PASS.", highEss); - poisonIvy = new ObjectStep(this, 7580, new WorldPoint(2618, 3226, 0), + poisonIvy = new ObjectStep(this, ObjectID.FARMING_BUSH_PATCH_4, new WorldPoint(2618, 3226, 0), "Plant and harvest poison ivy in the Ardougne Monastery bush patch. " + "If you're waiting for it to grow and want to complete further tasks, use the tick box on panel.", rake, seedDib, poisonIvySeed); - palmTree = new ObjectStep(this, 7963, new WorldPoint(2490, 3180, 0), + palmTree = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_2, new WorldPoint(2490, 3180, 0), "Check the health of a palm tree near Tree Gnome Village. " + "If you're waiting for it to grow and want to complete further tasks, use the tick box on panel.", spade, rake, palmSap); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneMedium.java index 3cf16b27895..78ae2a463cc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/ardougne/ArdougneMedium.java @@ -52,10 +52,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import net.runelite.client.game.FishingSpot; import java.util.ArrayList; @@ -135,7 +132,7 @@ public QuestStep loadStep() doMedium.addStep(notPickMasterFarmer, pickMasterFarmerTask); ibanUpgradeTask = new ConditionalStep(this, ibanUpgrade); - ibanUpgradeTask.addStep(ibanStaffU.alsoCheckBank(questBank), equipIban); + ibanUpgradeTask.addStep(ibanStaffU.alsoCheckBank(), equipIban); doMedium.addStep(notIbanUpgrade, ibanUpgradeTask); uniPenTask = new ConditionalStep(this, uniPen); @@ -163,8 +160,8 @@ protected void setupRequirements() notIbanUpgrade = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 24); notNecroTower = new VarplayerRequirement(VarPlayerID.ARDOUNGE_ACHIEVEMENT_DIARY, false, 25); - notCWBallon = new VarbitRequirement(2869, 1); - notCWBallon2 = new VarbitRequirement(2869, 0); + notCWBallon = new VarbitRequirement(VarbitID.ZEP_MULTI_CAST, 1); + notCWBallon2 = new VarbitRequirement(VarbitID.ZEP_MULTI_CAST, 0); normalBook = new SpellbookRequirement(Spellbook.NORMAL); combatGear = new ItemRequirement("Combat gear", -1, -1).isNotConsumed(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertEasy.java index 8d3ffe7d127..cf00c7c3de8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertEasy.java @@ -39,8 +39,8 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; -import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; @@ -217,24 +217,24 @@ public void setupSteps() "Kill a vulture.", true); killVulture.addAlternateNpcs(NpcID.RAG_VULTURE_FLYING); - moveToPyramidPlunder = new ObjectStep(this, 26622, new WorldPoint(3289, 2800, 0), + moveToPyramidPlunder = new ObjectStep(this, ObjectID.NTK_PYRAMID_DOOR_NORTH_MULTI, new WorldPoint(3289, 2800, 0), "Enter the Pyramid plunder minigame. If you don't see a Guardian mummy exit and try a different entrance."); startPyramidPlunder = new NpcStep(this, NpcID.NTK_MUMMY_GUARDIAN, new WorldPoint(1934, 4427, 3), "Talk to the guardian mummy to start the minigame. If you don't see a Guardian mummy exit and try a different entrance."); startPyramidPlunder.addDialogStep("I know what I'm doing - let's get on with it."); - openSarc = new ObjectStep(this, 26626, new WorldPoint(1928, 4465, 0), + openSarc = new ObjectStep(this, ObjectID.NTK_SARCOPHAGUS_MULTI, new WorldPoint(1928, 4465, 0), "Open the sarcophagus in the first room."); sellArtefact = new NpcStep(this, NpcID.AGILITY_PYRAMID_SIMON, new WorldPoint(3346, 2827, 0), "Talk to Simon Templeton and sell your artefact.", pyramidPlunderArtefact); sellArtefact.addDialogStep("Yes, show me the money."); - enterKalph = new ObjectStep(this, 3827, new WorldPoint(3228, 3109, 0), + enterKalph = new ObjectStep(this, ObjectID.KALPHITE_BURROW_ENTRANCE, new WorldPoint(3228, 3109, 0), "Use the rope on the entrance and enter the Kalphite Hive.", rope.highlighted()); enterKalph.addAlternateObjects(ObjectID.KALPHITE_BURROW_ENTRANCE_WITHROPE); enterKalph.addIcon(ItemID.ROPE); - enterKalphForCacti = new ObjectStep(this, 3827, new WorldPoint(3228, 3109, 0), + enterKalphForCacti = new ObjectStep(this, ObjectID.KALPHITE_BURROW_ENTRANCE, new WorldPoint(3228, 3109, 0), "Use the rope on the entrance and enter the Kalphite Hive.", rope.highlighted()); enterKalphForCacti.addAlternateObjects(ObjectID.KALPHITE_BURROW_ENTRANCE_WITHROPE); enterKalphForCacti.addIcon(ItemID.ROPE); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertElite.java index ed674161ff4..ae515eed2ab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertElite.java @@ -133,7 +133,7 @@ protected void setupRequirements() dragonDartTip = new ItemRequirement("Dragon dart tip", ItemID.DRAGON_DART_TIP).showConditioned(notDragonDarts); feather = new ItemRequirement("Feather", ItemID.FEATHER).showConditioned(notDragonDarts); mahoganyPlank = new ItemRequirement("Mahogany plank", ItemID.PLANK_MAHOGANY).showConditioned(notTalkKQHead); - goldLeaves = new ItemRequirement("Gold leaf", ItemID.ICS_GOLDLEAF).showConditioned(notTalkKQHead); + goldLeaves = new ItemRequirement("Gold leaf", ItemID.GOLD_LEAF).showConditioned(notTalkKQHead); saw = new ItemRequirement("Saw", ItemID.POH_SAW).showConditioned(notTalkKQHead).isNotConsumed(); hammer = new ItemRequirement("Hammer", ItemID.HAMMER).showConditioned(notTalkKQHead).isNotConsumed(); kqHead = new ItemRequirement("Stuffed KQ head", ItemCollections.STUFFED_KQ_HEAD).showConditioned(notTalkKQHead); @@ -171,7 +171,7 @@ protected void setupZones() public void setupSteps() { - moveToPyramidPlunder = new ObjectStep(this, 26622, new WorldPoint(3289, 2800, 0), + moveToPyramidPlunder = new ObjectStep(this, ObjectID.NTK_PYRAMID_DOOR_NORTH_MULTI, new WorldPoint(3289, 2800, 0), "Enter the Pyramid plunder minigame. If you don't see a Guardian mummy exit and try a different " + "entrance.", true); ((ObjectStep) moveToPyramidPlunder).addAlternateObjects(ObjectID.NTK_PYRAMID_DOOR_EAST_MULTI, ObjectID.NTK_PYRAMID_DOOR_SOUTH_MULTI, @@ -180,7 +180,7 @@ public void setupSteps() "Talk to the guardian mummy to start the minigame."); startPyramidPlunder.addDialogStep("I know what I'm doing - let's get on with it."); - traversePyramid = new ObjectStep(this, 26618, new WorldPoint(1951, 4452, 0), + traversePyramid = new ObjectStep(this, ObjectID.NTK_TOMB_DOOR1, new WorldPoint(1951, 4452, 0), "Go through each of the pyramid rooms until the final room.", true); ((ObjectStep) traversePyramid).setMaxObjectDistance(40); ((ObjectStep) traversePyramid).setMaxRenderDistance(10); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertHard.java index 014c79931c9..6e9c8b9b546 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertHard.java @@ -201,11 +201,11 @@ protected void setupZones() public void setupSteps() { - moveToKalph = new ObjectStep(this, 3827, new WorldPoint(3228, 3109, 0), + moveToKalph = new ObjectStep(this, ObjectID.KALPHITE_BURROW_ENTRANCE, new WorldPoint(3228, 3109, 0), "Use the rope on the entrance and enter the Kalphite Hive.", rope.highlighted().quantity(2)); moveToKalph.addAlternateObjects(ObjectID.KALPHITE_BURROW_ENTRANCE_WITHROPE); moveToKalph.addIcon(ItemID.ROPE); - kalphQueen = new ObjectStep(this, 23609, new WorldPoint(3510, 9498, 2), + kalphQueen = new ObjectStep(this, ObjectID.KALPHITE_CHAMBER_ENTRANCE_UPDATE, new WorldPoint(3510, 9498, 2), "Climb down the tunnel entrance that leads to the Kalphite Queen and kill her.", rope); kalphQueen.addAlternateObjects(10230); kalphQueen.addIcon(ItemID.ROPE); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertMedium.java index 5a46f14e848..d2be4ac2f37 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/desert/DesertMedium.java @@ -208,7 +208,7 @@ protected void setupZones() public void setupSteps() { - moveToEagle = new ObjectStep(this, 19790, new WorldPoint(2329, 3495, 0), + moveToEagle = new ObjectStep(this, ObjectID.EAGLEPEAK_ENTRANCE_CAVE_MULTI, new WorldPoint(2329, 3495, 0), "Enter the cave at the top of Eagles' Peak. You can use a fairy ring to (AKQ), then head " + "south to get there easily."); eagleTravel = new NpcStep(this, NpcID.EAGLEPEAK_EAGLE_TODESERT, new WorldPoint(2027, 4964, 3), @@ -240,7 +240,7 @@ public void setupSteps() visitGenie = new NpcStep(this, NpcID.ELID_GENIE, new WorldPoint(3371, 9320, 0), "Visit the genie."); - moveToGenie = new ObjectStep(this, 10478, new WorldPoint(3374, 2904, 0), + moveToGenie = new ObjectStep(this, ObjectID.ELID_FALLOFF_5, new WorldPoint(3374, 2904, 0), "Climb down the crevice west of Nardah.", rope, lightSource); talkToSimon = new NpcStep(this, NpcID.AGILITY_PYRAMID_SIMON, new WorldPoint(3346, 2827, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorEasy.java index f2238586344..05cd374f162 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorEasy.java @@ -175,8 +175,8 @@ protected void setupRequirements() explorersRing = new TeleportItemRequirement("Explorers Ring (2) or above.", ItemID.LUMBRIDGE_RING_MEDIUM).isNotConsumed(); explorersRing.addAlternates(ItemID.LUMBRIDGE_RING_HARD, ItemID.LUMBRIDGE_RING_ELITE); - hasBluriteOre = bluriteOre.alsoCheckBank(questBank); - hasBluriteBar = bluriteBar.alsoCheckBank(questBank); + hasBluriteOre = bluriteOre.alsoCheckBank(); + hasBluriteBar = bluriteBar.alsoCheckBank(); inMindAltar = new ZoneRequirement(mindAltar); inBluriteDungeon = new ZoneRequirement(bluriteDungeon); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorElite.java index 8db5ed4f72d..950d2727f99 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorElite.java @@ -50,10 +50,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -149,9 +146,9 @@ protected void setupRequirements() faladorTeleport = new TeleportItemRequirement("Multiple Teleports to Falador", ItemID.POH_TABLET_FALADORTELEPORT, -1); - magicTreeNearbyNotCheckedVar = new VarbitRequirement(4471, 60); - magicTreeNearbyCheckedVar = new VarbitRequirement(4471, 61); - stumpNearbyVar = new VarbitRequirement(4471, 62); + magicTreeNearbyNotCheckedVar = new VarbitRequirement(VarbitID.WESTERN_DIARY_EASY_COMPLETE, 60); + magicTreeNearbyCheckedVar = new VarbitRequirement(VarbitID.WESTERN_DIARY_EASY_COMPLETE, 61); + stumpNearbyVar = new VarbitRequirement(VarbitID.WESTERN_DIARY_EASY_COMPLETE, 62); inAirAltar = new ZoneRequirement(airAltar); inFaladorCastle1 = new ZoneRequirement(faladorCastle1); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorHard.java index 1396d9fdfd7..e016c24a241 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/falador/FaladorHard.java @@ -135,8 +135,8 @@ public QuestStep loadStep() doHard.addStep(notCraftedMindRunes, craftedMindRunesTask); praySarimAltarProsyTask = new ConditionalStep(this, getProsySet); - praySarimAltarProsyTask.addStep(new Conditions(notPraySarimAltarProsy, prosyHelm.alsoCheckBank(questBank), - prosyLegs.alsoCheckBank(questBank), prosyChest.alsoCheckBank(questBank)), prayAtAltarSarim); + praySarimAltarProsyTask.addStep(new Conditions(notPraySarimAltarProsy, prosyHelm.alsoCheckBank(), + prosyLegs.alsoCheckBank(), prosyChest.alsoCheckBank()), prayAtAltarSarim); doHard.addStep(notPraySarimAltarProsy, praySarimAltarProsyTask); killedWyvernTask = new ConditionalStep(this, goToIceDungeon); @@ -289,7 +289,7 @@ public void setupSteps() "Equip your Proselyte armor and pray at the altar in Port Sarim.", prosyHelm, prosyChest, prosyLegs); //Warriors Guild - enterWarriorsGuild = new ObjectStep(this, ObjectID.WARGUILD_DOOR_FRONT, new WorldPoint(2896, 3510, 0), + enterWarriorsGuild = new ObjectStep(this, ObjectID.WARGUILD_DOOR_FRONT, new WorldPoint(2877, 3546, 0), "Enter the Warriors Guild, in Burthorpe. You can get here faster by teleporting with a combat bracelet or a games necklace."); //Dwarven Helm diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/DagRoute.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/DagRoute.java index 64cf077e40b..4075ccb267a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/DagRoute.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/DagRoute.java @@ -38,11 +38,11 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Prayer; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.SpriteID; import java.util.List; @@ -161,21 +161,21 @@ public void setupConditions() public void setupSteps() { moveToWaterbirth = steps.get(null); - moveToDagCave = new ObjectStep(questHelper, 8929, new WorldPoint(2521, 3740, 0), + moveToDagCave = new ObjectStep(questHelper, ObjectID.DAGANNOTH_CAVEENTRANCE_ROCK, new WorldPoint(2521, 3740, 0), "Enter the cave and pray melee. Make sure you are full stamina and prayer before entering.", protectMelee, thrownaxe, petRock, food, stamPot, prayerPot); - dropPetRock = new ObjectStep(questHelper, 8965, new WorldPoint(2490, 10162, 0), + dropPetRock = new ObjectStep(questHelper, ObjectID.DAGANNOTH_PRESSURE_PAD_2, new WorldPoint(2490, 10162, 0), "Drop your pet rock on one pressure pad then stand on the other pad to open the gate.", petRock);// item on tile req? dropPetRock.addIcon(ItemID.VT_USELESS_ROCK); - dropPetRock.addTileMarker(new WorldPoint(2490, 10164, 0), SpriteID.SKILL_AGILITY); - moveToAxeSpot = new ObjectStep(questHelper, 8945, new WorldPoint(2545, 10146, 0), + dropPetRock.addTileMarker(new WorldPoint(2490, 10164, 0), SpriteID.Staticons.AGILITY); + moveToAxeSpot = new ObjectStep(questHelper, ObjectID.DAGANNOTH_DUGUPSOIL_2, new WorldPoint(2545, 10146, 0), "Continue onwards until you reach the barrier.", thrownaxe); activateSpecial = new DetailedQuestStep(questHelper, "Activate special attack with the rune thrownaxes equipped.", thrownaxe.equipped(), specialAttackEnabled); throwAxe = new NpcStep(questHelper, 2253, new WorldPoint(2543, 10143, 0), "Attack the Door-Support with a rune thrownaxe special attack. If done correctly the axe should ricochet" + " and lower all 3 barriers.", thrownaxe.equipped(), specialAttackEnabled); - moveToDagCave1 = new ObjectStep(questHelper, 10177, new WorldPoint(2546, 10143, 0), + moveToDagCave1 = new ObjectStep(questHelper, ObjectID.DAGANNOTH_LADDER_BASE_EXT2, new WorldPoint(2546, 10143, 0), "Enable magic protection then climb down the ladder.", protectMagic); moveToDagCave1.addDialogSteps("Climb Down."); moveToDagCave2 = new ObjectStep(questHelper, ObjectID.DAGEXP_LADDER1, new WorldPoint(1808, 4405, 3), @@ -200,7 +200,7 @@ public void setupSteps() "Keep current protection and continue through the cave.", protectMelee); moveToDagCave12 = new ObjectStep(questHelper, ObjectID.DAGEXP_LADDER21, new WorldPoint(1890, 4407, 1), "Keep current protection and continue through the cave.", protectMelee); - moveToDagKings = new ObjectStep(questHelper, 3831, new WorldPoint(1911, 4367, 0), + moveToDagKings = new ObjectStep(questHelper, ObjectID.DAGEXP_BOSSROOMLADDER_DOWN, new WorldPoint(1911, 4367, 0), "Enter the Kings' lair.", protectMelee); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikElite.java index 18e07a6cbac..ff4824e6a6a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikElite.java @@ -50,12 +50,8 @@ import net.runelite.api.Prayer; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -264,9 +260,9 @@ protected void setupZones() public void setupSteps() { - rellRooftop = new ObjectStep(this, 14946, new WorldPoint(2625, 3677, 0), + rellRooftop = new ObjectStep(this, ObjectID.ROOFTOPS_RELLEKKA_WALLCLIMB, new WorldPoint(2625, 3677, 0), "Complete a lap of the Rellekka Rooftop course."); - dragonAmulet = new ObjectStep(this, 21303, new WorldPoint(2344, 3811, 0), + dragonAmulet = new ObjectStep(this, ObjectID.IZNOT_CLAY_FORGE, new WorldPoint(2344, 3811, 0), "Smelt a dragonstone amulet on the clay forge."); dragonAmulet.addIcon(ItemID.UNSTRUNG_DRAGONSTONE_AMULET); moveToPirates = new NpcStep(this, NpcID.LUNAR_FREMENNIK_PIRATE_BY_PIRATESHIP, new WorldPoint(2620, 3693, 0), @@ -287,9 +283,9 @@ public void setupSteps() "Speak with Maria Gunnars to travel to Neitiznot."); - moveToGodWarsSM = new ObjectStep(this, 26419, new WorldPoint(2919, 3747, 0), + moveToGodWarsSM = new ObjectStep(this, ObjectID.GODWARS_ENTRANCE_MULTI, new WorldPoint(2919, 3747, 0), "Go down the hole. Bring a rope if this is your first time entering.", combatGear, food); - moveToGodWarsGWD = new ObjectStep(this, 26419, new WorldPoint(2919, 3747, 0), + moveToGodWarsGWD = new ObjectStep(this, ObjectID.GODWARS_ENTRANCE_MULTI, new WorldPoint(2919, 3747, 0), "Go down the hole. Bring a rope if this is your first time entering.", combatGear, food); godwarsGenerals = new NpcStep(this, NpcID.GODWARS_ARMADYL_AVATAR, new WorldPoint(2832, 5301, 2), "Get kills for a faction then kill its respective general.", true); @@ -308,17 +304,17 @@ public void setupSteps() moveToWaterbirth.addDialogStep("What Jarvald is doing."); moveToWaterbirth.addDialogStep("Can I come?"); moveToWaterbirth.addDialogStep("YES"); - moveToDagCave = new ObjectStep(this, 8929, new WorldPoint(2521, 3740, 0), + moveToDagCave = new ObjectStep(this, ObjectID.DAGANNOTH_CAVEENTRANCE_ROCK, new WorldPoint(2521, 3740, 0), "Enter cave and pray melee. Make sure you are full stam and prayer before entering.", protectMelee); - dropPetRock = new ObjectStep(this, 8965, new WorldPoint(2490, 10162, 0), + dropPetRock = new ObjectStep(this, ObjectID.DAGANNOTH_PRESSURE_PAD_2, new WorldPoint(2490, 10162, 0), "Drop your pet rock on one pressure pad then stand on the other pad to open the gate.", petRock);// item on tile req? dropPetRock.addIcon(ItemID.VT_USELESS_ROCK); - dropPetRock.addTileMarker(new WorldPoint(2490, 10164, 0), SpriteID.SKILL_AGILITY); - moveToAxeSpot = new ObjectStep(this, 8945, new WorldPoint(2545, 10146, 0), + dropPetRock.addTileMarker(new WorldPoint(2490, 10164, 0), SpriteID.Staticons.AGILITY); + moveToAxeSpot = new ObjectStep(this, ObjectID.DAGANNOTH_DUGUPSOIL_2, new WorldPoint(2545, 10146, 0), "Continue onwards until you reach the barrier."); - throwAxe = new NpcStep(this, 2253, new WorldPoint(2543, 10143, 0), + throwAxe = new NpcStep(this, NpcID.DAGANNOTH_WEAK_DOOR_WEST, new WorldPoint(2543, 10143, 0), "Attack the Door-Support with a rune thrownaxe special attack. If done correctly the axe should ricochet and lower all 3 barriers.", thrownaxe.equipped(), specialAttackEnabled); - moveToDagCave1 = new ObjectStep(this, 10177, new WorldPoint(2546, 10143, 0), + moveToDagCave1 = new ObjectStep(this, ObjectID.DAGANNOTH_LADDER_BASE_EXT2, new WorldPoint(2546, 10143, 0), "Enable magic protection then climb down the ladder.", protectMagic); moveToDagCave1.addDialogSteps("Climb Down."); moveToDagCave2 = new ObjectStep(this, ObjectID.DAGEXP_LADDER1, new WorldPoint(1808, 4405, 3), @@ -345,7 +341,7 @@ public void setupSteps() "Continue through the cave.", protectMelee); moveToDagCave13 = new ObjectStep(this, ObjectID.DAGEXP_LADDER23, new WorldPoint(1957, 4371, 0), "Continue through the cave.", protectMelee); - moveToDagKings = new ObjectStep(this, 3831, new WorldPoint(1911, 4367, 0), + moveToDagKings = new ObjectStep(this, ObjectID.DAGEXP_BOSSROOMLADDER_DOWN, new WorldPoint(1911, 4367, 0), "Enter the Kings' lair.", protectMelee); dagKings = new NpcStep(this, NpcID.DAGCAVE_MELEE_BOSS, new WorldPoint(2913, 4449, 0), "Kill each of the Dagannoth Kings.", true, combatGear); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikHard.java index 04758883fc0..844c1ba88a8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikHard.java @@ -246,14 +246,14 @@ public void setupSteps() moveToJatizso.addDialogStep("Can you ferry me to Jatizso?"); moveToMine = new ObjectStep(this, ObjectID.FRISD_IZSO_MINE_ENTRANCE, new WorldPoint(2398, 3813, 0), "Go down the staircase."); - mineAddy = new ObjectStep(this, 11374, new WorldPoint(2402, 10189, 0), + mineAddy = new ObjectStep(this, ObjectID.ADAMANTITEROCK1, new WorldPoint(2402, 10189, 0), "Mine 5 Adamantite ores.", pickaxe); mineAddy.addIcon(ItemID.RUNE_PICKAXE); moveToMisc = new NpcStep(this, NpcID.VIKING_SAILOR, new WorldPoint(2630, 3692, 0), "Speak to the sailor to go to Miscellania."); - miscSupport = new ObjectStep(this, 15084, new WorldPoint(2527, 3849, 0), + miscSupport = new ObjectStep(this, ObjectID.MISC_HERB_MULTILOC, new WorldPoint(2527, 3849, 0), "Rake the herb and flax patch until 100% support.", true, rake); - miscSupport.addAlternateObjects(15079); + miscSupport.addAlternateObjects(ObjectID.MISC_FLAX_MULTILOC); tpWaterbirth = new DetailedQuestStep(this, "Teleport to Waterbirth.", waterRune.quantity(1), astralRune.quantity(2), lawRune2.quantity(1), lunarBook); moveToBlast = new ObjectStep(this, ObjectID.DWARF_KELDAGRIM_FACTORY_STAIRS, new WorldPoint(2930, 10197, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikMedium.java index 56490701a35..3826ed23878 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/fremennik/FremennikMedium.java @@ -51,12 +51,8 @@ import net.runelite.api.Prayer; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -308,14 +304,14 @@ public void setupSteps() enterBrineCave.addIcon(ItemID.SPADE); slayBrineRat = new NpcStep(this, NpcID.OLAF2_BRINE_RATS, new WorldPoint(2706, 10133, 0), "Kill a brine rat then roll the boulder and exit the cave..", true); - travelMisc = new ObjectStep(this, 29495, new WorldPoint(2744, 3719, 0), + travelMisc = new ObjectStep(this, ObjectID.FAIRYRING_MINORHUB, new WorldPoint(2744, 3719, 0), "Use a fairy ring and travel to (CIP).", fairyTaleII); - enterEaglesPeak = new ObjectStep(this, 19790, new WorldPoint(2329, 3495, 0), + enterEaglesPeak = new ObjectStep(this, ObjectID.EAGLEPEAK_ENTRANCE_CAVE_MULTI, new WorldPoint(2329, 3495, 0), "Enter the cave at the top of Eagles' Peak. Use fairy ring and travel to (AKQ), then head south.", rope); snowyHunter = new NpcStep(this, NpcID.EAGLEPEAK_EAGLE_TOPOLAR, new WorldPoint(2027, 4964, 3), "Use rope on the Polar Eagle to travel to the Snowy Hunter area.", rope.highlighted()); snowyHunter.addIcon(ItemID.ROPE); - exitIceCave = new ObjectStep(this, 19764, new WorldPoint(2706, 10205, 0), "Exit the cave."); + exitIceCave = new ObjectStep(this, ObjectID.EAGLEPEAK_ICE_CAVE_ENTRANCE, new WorldPoint(2706, 10205, 0), "Exit the cave."); snowyKnight0 = new NpcStep(this, NpcID.BUTTERFLY_SNOWY, new WorldPoint(2725, 3770, 0), "Catch a Snowy Knight at the Fremennik Hunter Area.", butterFlyNet.equipped()); snowyKnight1 = new NpcStep(this, NpcID.BUTTERFLY_SNOWY, new WorldPoint(2712, 3822, 1), @@ -341,21 +337,21 @@ public void setupSteps() moveToWaterbirth = new NpcStep(this, NpcID.VIKING_DAGGANOTH_CAVE_FERRYMAN_ISLAND, new WorldPoint(2620, 3686, 0), "Speak with Jarvald to travel to Waterbirth Island.", petRock, thrownaxe); moveToWaterbirth.addDialogSteps("What Jarvald is doing.", "Can I come?", "YES"); - moveToDagCave = new ObjectStep(this, 8929, new WorldPoint(2521, 3740, 0), + moveToDagCave = new ObjectStep(this, ObjectID.DAGANNOTH_CAVEENTRANCE_ROCK, new WorldPoint(2521, 3740, 0), "Enter the cave and pray melee. Make sure you are full stamina and prayer before entering.", protectMelee, thrownaxe, petRock, food, stamPot, prayerPot); - dropPetRock = new ObjectStep(this, 8965, new WorldPoint(2490, 10162, 0), + dropPetRock = new ObjectStep(this, ObjectID.DAGANNOTH_PRESSURE_PAD_2, new WorldPoint(2490, 10162, 0), "Drop your pet rock on one pressure pad then stand on the other pad to open the gate.", petRock);// item on tile req? dropPetRock.addIcon(ItemID.VT_USELESS_ROCK); - dropPetRock.addTileMarker(new WorldPoint(2490, 10164, 0), SpriteID.SKILL_AGILITY); - moveToAxeSpot = new ObjectStep(this, 8945, new WorldPoint(2545, 10146, 0), + dropPetRock.addTileMarker(new WorldPoint(2490, 10164, 0), SpriteID.Staticons.AGILITY); + moveToAxeSpot = new ObjectStep(this, ObjectID.DAGANNOTH_DUGUPSOIL_2, new WorldPoint(2545, 10146, 0), "Continue onwards until you reach the barrier.", thrownaxe); activateSpecial = new DetailedQuestStep(this, "Activate special attack with the rune thrownaxes equipped.", thrownaxe.equipped(), specialAttackEnabled); - throwAxe = new NpcStep(this, 2253, new WorldPoint(2543, 10143, 0), + throwAxe = new NpcStep(this, NpcID.DAGANNOTH_WEAK_DOOR_WEST, new WorldPoint(2543, 10143, 0), "Attack the Door-Support with a rune thrownaxe special attack. If done correctly the axe should ricochet" + " and lower all 3 barriers.", thrownaxe.equipped(), specialAttackEnabled); - moveToDagCave1 = new ObjectStep(this, 10177, new WorldPoint(2546, 10143, 0), + moveToDagCave1 = new ObjectStep(this, ObjectID.DAGANNOTH_LADDER_BASE_EXT2, new WorldPoint(2546, 10143, 0), "Enable magic protection then climb down the ladder.", protectMagic); moveToDagCave1.addDialogSteps("Climb Down."); moveToDagCave2 = new ObjectStep(this, ObjectID.DAGEXP_LADDER1, new WorldPoint(1808, 4405, 3), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kandarin/KandarinHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kandarin/KandarinHard.java index 60e6d1dfd0b..f7df8c3107c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kandarin/KandarinHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kandarin/KandarinHard.java @@ -163,6 +163,7 @@ protected void setupRequirements() piety = new PrayerRequirement("Piety", Prayer.PIETY); barbRod = new ItemRequirement("Barbarian fishing rod", ItemID.BRUT_FISHING_ROD).showConditioned(notCatchSturgeon).isNotConsumed(); + barbRod.addAlternates(ItemID.FISHINGROD_PEARL_BRUT); feather = new ItemRequirement("Feathers", ItemID.FEATHER).showConditioned(notCatchSturgeon); axe = new ItemRequirement("Any axe", ItemCollections.AXES).showConditioned(notYewLong).isNotConsumed(); bowString = new ItemRequirement("Bow string", ItemID.BOW_STRING).showConditioned(notYewLong); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaEasy.java index 507f4ba2b90..1f950a9da85 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaEasy.java @@ -125,15 +125,15 @@ protected void setupRequirements() seaweed = new ItemRequirement("Seaweed", ItemID.SEAWEED); notPickedBananas = new VarbitRequirement(VarbitID.ATJUN_EASY_BANANA, 4, Operation.LESS_EQUAL); - notSwungOnRope = new VarbitRequirement(3567, 0); - notMinedGold = new VarbitRequirement(3568, 0); - notGoneToSarim = new VarbitRequirement(3569, 0); - notGoneToArdougne = new VarbitRequirement(3570, 0); - notGoneToCairn = new VarbitRequirement(3571, 0); - notFished = new VarbitRequirement(3572, 0); + notSwungOnRope = new VarbitRequirement(VarbitID.ATJUN_EASY_SWING, 0); + notMinedGold = new VarbitRequirement(VarbitID.ATJUN_EASY_GOLD, 0); + notGoneToSarim = new VarbitRequirement(VarbitID.ATJUN_EASY_BOAT_SARIM, 0); + notGoneToArdougne = new VarbitRequirement(VarbitID.ATJUN_EASY_BOAT_ARDY, 0); + notGoneToCairn = new VarbitRequirement(VarbitID.ATJUN_EASY_CAIRN, 0); + notFished = new VarbitRequirement(VarbitID.ATJUN_EASY_FISHING, 0); notPickedUpSeaweed = new VarbitRequirement(VarbitID.ATJUN_EASY_SEAWEED, 4, Operation.LESS_EQUAL); - notEnteredFightCave = new VarbitRequirement(3574, 0); - notKilledJogre = new VarbitRequirement(3575, 0); + notEnteredFightCave = new VarbitRequirement(VarbitID.ATJUN_EASY_TZHAAR, 0); + notKilledJogre = new VarbitRequirement(VarbitID.ATJUN_EASY_JOGRE, 0); pickaxe = new ItemRequirement("Any pickaxe", ItemCollections.PICKAXES).showConditioned(notMinedGold).isNotConsumed(); coins = new ItemRequirement("Coins", ItemCollections.COINS).showConditioned(new Conditions(LogicType.OR, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaHard.java index 52ac01e77a9..0769ccd2a3d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaHard.java @@ -149,16 +149,16 @@ public QuestStep loadStep() @Override protected void setupRequirements() { - notBecomeChampion = new VarbitRequirement(3600, 0); - notKilledZek = new VarbitRequirement(3601, 0); - notEatenWrap = new VarbitRequirement(3602, 0); - notCraftedNature = new VarbitRequirement(3603, 0); - notCookedKarambwan = new VarbitRequirement(3604, 0); - notKilledDeathwing = new VarbitRequirement(3605, 0); - notUsedShortcut = new VarbitRequirement(3606, 0); + notBecomeChampion = new VarbitRequirement(VarbitID.ATJUN_HARD_FIGHTPITS, 0); + notKilledZek = new VarbitRequirement(VarbitID.ATJUN_HARD_FIGHTCAVE, 0); + notEatenWrap = new VarbitRequirement(VarbitID.ATJUN_HARD_OOMLIE, 0); + notCraftedNature = new VarbitRequirement(VarbitID.ATJUN_HARD_NATURE, 0); + notCookedKarambwan = new VarbitRequirement(VarbitID.ATJUN_HARD_KARAMBWAN, 0); + notKilledDeathwing = new VarbitRequirement(VarbitID.ATJUN_HARD_DEATHWING, 0); + notUsedShortcut = new VarbitRequirement(VarbitID.ATJUN_HARD_XBOW, 0); notCollectedLeaves = new VarbitRequirement(VarbitID.ATJUN_HARD_PALM, 4, Operation.LESS_EQUAL); - notAssignedTask = new VarbitRequirement(3608, 0); - notKilledDragon = new VarbitRequirement(3609, 0); + notAssignedTask = new VarbitRequirement(VarbitID.ATJUN_HARD_DURADEL, 0); + notKilledDragon = new VarbitRequirement(VarbitID.ATJUN_HARD_DRAGON, 0); pickaxe = new ItemRequirement("Any pickaxe", ItemCollections.PICKAXES).showConditioned(notKilledDeathwing).isNotConsumed(); coins = new ItemRequirement("Coins", ItemCollections.COINS).showConditioned(notKilledDragon); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaMedium.java index 2ba9f9c7ed4..5326e82b359 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/karamja/KaramjaMedium.java @@ -46,6 +46,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -123,7 +124,7 @@ public Map loadSteps() doMedium.addStep(notUsedGlider, usedGliderTask); caughtKarambwanTask = new ConditionalStep(this, catchKarambwanji); - caughtKarambwanTask.addStep(rawKarambwanji.alsoCheckBank(questBank), catchKarambwan); + caughtKarambwanTask.addStep(rawKarambwanji.alsoCheckBank(), catchKarambwan); doMedium.addStep(notCaughtKarambwan, caughtKarambwanTask); charteredFromShipyardTask = new ConditionalStep(this, charterFromShipyard); @@ -168,25 +169,25 @@ public Map loadSteps() @Override protected void setupRequirements() { - notClaimedTicket = new VarbitRequirement(3579, 0); - notEnteredWall = new VarbitRequirement(3580, 0); - notEnteredCrandor = new VarbitRequirement(3581, 0); - notUsedCart = new VarbitRequirement(3582, 0); - notEarned100 = new VarbitRequirement(3583, 0); - notCookedSpider = new VarbitRequirement(3584, 0); - notMinedRedRopaz = new VarbitRequirement(3585, 0); - notCutTeak = new VarbitRequirement(3586, 0); - notCutMahog = new VarbitRequirement(3587, 0); - notCaughtKarambwan = new VarbitRequirement(3588, 0); - notExchangedGems = new VarbitRequirement(3589, 0); - notUsedGlider = new VarbitRequirement(3590, 0); - notGrownFruitTree = new VarbitRequirement(3591, 0); - notTrappedGraahk = new VarbitRequirement(3592, 0); - notCutVine = new VarbitRequirement(3593, 0); - notCrossedLava = new VarbitRequirement(3594, 0); - notClimbedStairs = new VarbitRequirement(3595, 0); - notTraveledToKhazard = new VarbitRequirement(3596, 0); - notCharteredFromShipyard = new VarbitRequirement(3597, 0); + notClaimedTicket = new VarbitRequirement(VarbitID.ATJUN_MED_AGILITY, 0); + notEnteredWall = new VarbitRequirement(VarbitID.ATJUN_MED_VOLCANO, 0); + notEnteredCrandor = new VarbitRequirement(VarbitID.ATJUN_MED_CRANDOR, 0); + notUsedCart = new VarbitRequirement(VarbitID.ATJUN_MED_CART, 0); + notEarned100 = new VarbitRequirement(VarbitID.ATJUN_MED_CLEANUP, 0); + notCookedSpider = new VarbitRequirement(VarbitID.ATJUN_MED_SPIDER, 0); + notMinedRedRopaz = new VarbitRequirement(VarbitID.ATJUN_MED_TOPAZ, 0); + notCutTeak = new VarbitRequirement(VarbitID.ATJUN_MED_TEAK, 0); + notCutMahog = new VarbitRequirement(VarbitID.ATJUN_MED_MAHOGANY, 0); + notCaughtKarambwan = new VarbitRequirement(VarbitID.ATJUN_MED_KARAMBWAN, 0); + notExchangedGems = new VarbitRequirement(VarbitID.ATJUN_MED_MACHETTE, 0); + notUsedGlider = new VarbitRequirement(VarbitID.ATJUN_MED_GLIDER, 0); + notGrownFruitTree = new VarbitRequirement(VarbitID.ATJUN_MED_FARMING, 0); + notTrappedGraahk = new VarbitRequirement(VarbitID.ATJUN_MED_GRAAHK, 0); + notCutVine = new VarbitRequirement(VarbitID.ATJUN_MED_SHILO_VINES, 0); + notCrossedLava = new VarbitRequirement(VarbitID.ATJUN_MED_SHILO_LAVA, 0); + notClimbedStairs = new VarbitRequirement(VarbitID.ATJUN_MED_SHILO_STAIRS, 0); + notTraveledToKhazard = new VarbitRequirement(VarbitID.ATJUN_MED_KHAZARD, 0); + notCharteredFromShipyard = new VarbitRequirement(VarbitID.ATJUN_MED_CHARTER, 0); pickaxe = new ItemRequirement("Any pickaxe", ItemCollections.PICKAXES) .showConditioned(new Conditions(LogicType.OR, notMinedRedRopaz, notEarned100)).isNotConsumed(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendEasy.java index e1b5dedcfa0..53fed369b33 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendEasy.java @@ -43,10 +43,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -182,7 +179,7 @@ protected void setupRequirements() inCastleF1 = new ZoneRequirement(castleF1); inCastleF2 = new ZoneRequirement(castleF2); - houseInKourend = new VarbitRequirement(2187, 8); + houseInKourend = new VarbitRequirement(VarbitID.POH_HOUSE_LOCATION, 8); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendElite.java index 654d7e86b5f..1687199bb53 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendElite.java @@ -128,8 +128,8 @@ public QuestStep loadStep() doElite.addStep(notCompleteRaid, completeRaidTask); defeatSkotizoTask = new ConditionalStep(this, combineDarkTotem); - defeatSkotizoTask.addStep(darkTotem.alsoCheckBank(questBank), enterCatacombs); - defeatSkotizoTask.addStep(new Conditions(darkTotem.alsoCheckBank(questBank), inCatacombs), enterSkotizoLair); + defeatSkotizoTask.addStep(darkTotem.alsoCheckBank(), enterCatacombs); + defeatSkotizoTask.addStep(new Conditions(darkTotem.alsoCheckBank(), inCatacombs), enterSkotizoLair); defeatSkotizoTask.addStep(inSkotizoLair, defeatSkotizo); doElite.addStep(notDefeatSkotizo, defeatSkotizoTask); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendHard.java index 2bbbda764ab..f5532f0fdac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendHard.java @@ -233,7 +233,7 @@ public void setupSteps() // Smelt an adamantite bar enterForsakenTower = new DetailedQuestStep(this, new WorldPoint(1382, 3818, 0), "Enter the Forsaken Tower.", adamantiteOre, coal.quantity(6)); - smeltAddyBar = new ObjectStep(this, 34591, "Smelt an adamantite bar.", adamantiteOre, + smeltAddyBar = new ObjectStep(this, ObjectID.LOVAQUEST_TOWER_FURNACE, "Smelt an adamantite bar.", adamantiteOre, coal.quantity(6)); smeltAddyBar.addSubSteps(enterForsakenTower); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendMedium.java index fb8015b9596..e5f86fefeab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/kourend/KourendMedium.java @@ -135,7 +135,7 @@ public QuestStep loadStep() doMedium.addStep(notSubdueWintertodt, subdueWintertodtTask); deliverIntelligenceTask = new ConditionalStep(this, killGangBoss); - deliverIntelligenceTask.addStep(intelligence.alsoCheckBank(questBank), deliverIntelligence); + deliverIntelligenceTask.addStep(intelligence.alsoCheckBank(), deliverIntelligence); doMedium.addStep(notDeliverIntelligence, deliverIntelligenceTask); travelWithMemoirsTask = new ConditionalStep(this, travelWithMemoirs); @@ -213,7 +213,7 @@ protected void setupRequirements() // Zone requirements inMolchIsland = new ZoneRequirement(molchIsland); - hasBird = new VarbitRequirement(5983, 1); + hasBird = new VarbitRequirement(VarbitID.SETTINGS_BARBARIAN_POTION_MAKEX, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeEasy.java index f7adbd004e5..5b15a57d47e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeEasy.java @@ -46,10 +46,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -156,7 +153,7 @@ protected void setupRequirements() notIron = new VarplayerRequirement(VarPlayerID.LUMB_DRAY_ACHIEVEMENT_DIARY, false, 11); notEnterHAM = new VarplayerRequirement(VarPlayerID.LUMB_DRAY_ACHIEVEMENT_DIARY, false, 12); - addedRopeToHole = new VarbitRequirement(279, 1); + addedRopeToHole = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); lightSource = new ItemRequirement("Light source", ItemCollections.LIGHT_SOURCES).showConditioned(notKillCaveBug).isNotConsumed(); rope = new ItemRequirement("Rope", ItemID.ROPE).showConditioned(notKillCaveBug); @@ -210,7 +207,7 @@ protected void setupZones() public void setupSteps() { - drayAgi = new ObjectStep(this, 11404, new WorldPoint(3103, 3279, 0), + drayAgi = new ObjectStep(this, ObjectID.ROOFTOPS_DRAYNOR_WALLCLIMB, new WorldPoint(3103, 3279, 0), "Complete a lap of the Draynor Rooftop Course."); moveToDraySewer = new ObjectStep(this, ObjectID.VAMPIRE_TRAP2, new WorldPoint(3118, 3244, 0), @@ -242,7 +239,7 @@ public void setupSteps() killCaveBug = new NpcStep(this, NpcID.SWAMP_CAVE_BUG, new WorldPoint(3151, 9574, 0), "Kill a Cave Bug.", true, combatGear, lightSource); - moveToWaterAltar = new ObjectStep(this, 34815, new WorldPoint(3185, 3165, 0), + moveToWaterAltar = new ObjectStep(this, ObjectID.WATERTEMPLE_RUINED, new WorldPoint(3185, 3165, 0), "Enter the water altar in Lumbridge Swamp.", waterAccessOrAbyss.highlighted(), runeEss); moveToWaterAltar.addIcon(ItemID.WATER_TALISMAN); waterRune = new ObjectStep(this, ObjectID.WATER_ALTAR, new WorldPoint(2716, 4836, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeElite.java index d18f7a27427..20ddcfdeafa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeElite.java @@ -48,12 +48,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.emote.QuestEmote; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.VarPlayer; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -132,7 +128,7 @@ protected void setupRequirements() notWaterRunes = new VarplayerRequirement(VarPlayerID.LUMB_DRAY_ACHIEVEMENT_DIARY2, false, 8); notQCEmote = new VarplayerRequirement(VarPlayerID.LUMB_DRAY_ACHIEVEMENT_DIARY2, false, 9); - allQuests = new VarComparisonRequirement(VarType.VARP, VarPlayer.QUEST_POINTS, VarType.VARBIT, 1782, Operation.EQUAL, "All quests completed"); + allQuests = new VarComparisonRequirement(VarType.VARP, VarPlayerID.QP, VarType.VARBIT, VarbitID.QP_MAX, Operation.EQUAL, "All quests completed"); lockpick = new ItemRequirement("Lockpick", ItemID.LOCKPICK).showConditioned(notRichChest).isNotConsumed(); crossbow = new ItemRequirement("Crossbow", ItemCollections.CROSSBOWS).showConditioned(notMovario).isNotConsumed(); @@ -187,7 +183,7 @@ public void setupSteps() qcEmote = new EmoteStep(this, QuestEmote.SKILL_CAPE, new WorldPoint(3088, 3253, 0), "Perform the skill cape emote with the quest cape equipped.", qcCape.equipped()); - moveToWater = new ObjectStep(this, 34815, new WorldPoint(3185, 3165, 0), + moveToWater = new ObjectStep(this, ObjectID.WATERTEMPLE_RUINED, new WorldPoint(3185, 3165, 0), "Enter the water altar.", waterAccessOrAbyss.highlighted(), essence.quantity(28)); waterRunes = new ObjectStep(this, ObjectID.WATER_ALTAR, new WorldPoint(2716, 4836, 0), "Craft water runes.", essence.quantity(28)); @@ -246,10 +242,10 @@ public List getGeneralRequirements() reqs.add(new ComplexRequirement(LogicType.OR, "76 Runecraft or 57 with Raiments of the Eye set", new SkillRequirement(Skill.RUNECRAFT, 76, true, "76 Runecraft"), new ItemRequirements("57 with Raiments of the Eye set", - new ItemRequirement("Hat", ItemCollections.EYE_HAT).alsoCheckBank(questBank), - new ItemRequirement("Top", ItemCollections.EYE_TOP).alsoCheckBank(questBank), - new ItemRequirement("Bottom", ItemCollections.EYE_BOTTOM).alsoCheckBank(questBank), - new ItemRequirement("Boot", ItemID.BOOTS_OF_THE_EYE)).alsoCheckBank(questBank) + new ItemRequirement("Hat", ItemCollections.EYE_HAT).alsoCheckBank(), + new ItemRequirement("Top", ItemCollections.EYE_TOP).alsoCheckBank(), + new ItemRequirement("Bottom", ItemCollections.EYE_BOTTOM).alsoCheckBank(), + new ItemRequirement("Boot", ItemID.BOOTS_OF_THE_EYE)).alsoCheckBank() )); reqs.add(new SkillRequirement(Skill.SMITHING, 88, true)); reqs.add(new SkillRequirement(Skill.STRENGTH, 70, true)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeHard.java index 82b06a2a4f5..971e486b484 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeHard.java @@ -256,7 +256,7 @@ public void setupSteps() waterRune, natureRune); unlockBonesToPeaches = new DetailedQuestStep(this, "Unlock bones to peaches from the Mage Training Arena."); - wakaToEdge = new ObjectStep(this, 12163, new WorldPoint(3242, 3237, 0), + wakaToEdge = new ObjectStep(this, ObjectID.CANOEING_CANOESTATION_LUMBRIDGE, new WorldPoint(3242, 3237, 0), "Use the canoe station in lumbridge to make a Waka and travel to Edgeville.", axe); smeltAmmy = new ObjectStep(this, ObjectID.FAI_FALADOR_FURNACE, new WorldPoint(3227, 3257, 0), @@ -274,7 +274,7 @@ public void setupSteps() moveToBasementForGloves = new ObjectStep(this, ObjectID.QIP_COOK_TRAPDOOR_OPEN, new WorldPoint(3209, 3216, 0), "Climb down the trapdoor in the Lumbridge Castle.", coins); - barrowsGloves = new ObjectStep(this, 12308, new WorldPoint(3219, 9623, 0), + barrowsGloves = new ObjectStep(this, ObjectID.HUNDRED_GOODCHEST, new WorldPoint(3219, 9623, 0), "Purchase the barrows gloves from the bank chest. Right click and select 'Buy-items'.", coins); // 12308 is mine and I only have FULL access, and the ELITE version wouldn't make sense here @@ -310,7 +310,7 @@ public void setupSteps() moveToCosmic.addIcon(ItemID.COSMIC_TALISMAN); cosmics = new ObjectStep(this, ObjectID.COSMIC_ALTAR, new WorldPoint(2142, 4833, 0), "Craft 56 cosmic runes.", essence); - belladonna = new ObjectStep(this, 7572, new WorldPoint(3087, 3355, 0), + belladonna = new ObjectStep(this, ObjectID.FARMING_BELLADONNA_PATCH, new WorldPoint(3087, 3355, 0), "Grow and pick some belladonna from the Draynor Manor farming patch. " + "If you're waiting for it to grow and want to complete further tasks, use the tick box on panel.", bellaSeed, rake, spade, gloves, seedDib); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeMedium.java index c9416a076a2..8d8fa99fb92 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/lumbridgeanddraynor/LumbridgeMedium.java @@ -211,7 +211,7 @@ public void setupSteps() grappleLum = new ObjectStep(this, ObjectID.XBOWS_RAFT_BR, new WorldPoint(3252, 3179, 0), "Grapple across the River Lum.", mithGrap.equipped(), crossbow.equipped()); - moveToLavaAltar = new ObjectStep(this, 34817, new WorldPoint(3313, 3255, 0), + moveToLavaAltar = new ObjectStep(this, ObjectID.FIRETEMPLE_RUINED, new WorldPoint(3313, 3255, 0), "Enter the fire altar north of Al Kharid.", fireAccess); craftLava = new ObjectStep(this, ObjectID.FIRE_ALTAR, new WorldPoint(2585, 4838, 0), "Use an earth talisman on the fire altar.", earthTali.highlighted(), essence, earthRune); @@ -252,7 +252,7 @@ public void setupSteps() "Catch an essence or eclectic impling in Puro-Puro.", true, butterflyNet, implingJar); puroImp.addAlternateNpcs(NpcID.II_IMPLING_TYPE_5_MAZE, NpcID.II_IMPLING_TYPE_6, NpcID.II_IMPLING_TYPE_6_MAZE); - wizardFairy = new ObjectStep(this, 29560, new WorldPoint(2412, 4434, 0), + wizardFairy = new ObjectStep(this, ObjectID.FAIRYRING_HOMEHUB, new WorldPoint(2412, 4434, 0), "Take the nearest fairy ring and travel to the Wizards' Tower (DIS).", fairyAccess.equipped()); claimReward = new NpcStep(this, NpcID.HATIUS_LUMBRIDGE_DIARY, new WorldPoint(3235, 3213, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaEasy.java index 95e201568c1..8936535a4cb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaEasy.java @@ -240,7 +240,7 @@ public void setupSteps() "Use the Hay sack on the Bronze Spear.", haySack.highlighted(), bronzeSpear.highlighted()); useWatermelonOnSack = new DetailedQuestStep(this, "Use the watermelon on the Hay Sack to make the Scarecrow.", scarecrowStep2.highlighted(), watermelon.highlighted()); - placeScarecrow = new ObjectStep(this, 7850, new WorldPoint(3602, 3526, 0), + placeScarecrow = new ObjectStep(this, ObjectID.FARMING_FLOWER_PATCH_4, new WorldPoint(3602, 3526, 0), "Place a scarecrow at the Morytania flower patch, West of Port Phasmatys.", scarecrow.highlighted()); placeScarecrow.addIcon(ItemID.SCARECROW_COMPLETE); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaElite.java index 503a5077021..0645bf64be9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaElite.java @@ -47,12 +47,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -63,7 +59,7 @@ public class MorytaniaElite extends ComplexStateQuestHelper { // Items required ItemRequirement combatGear, magicRedwoodPyreLogs, shadeRemains, tinderbox, earthRune, astralRune, natureRune, - blackLeather, needle, thread, barrowsSet, ahrimSet, karilSet, guthanSet, veracSet, dharokSet, toragSet; + blackLeather, needle, thread, needleThread, costumeNeedle, needleThreadOrCostumeNeedle, barrowsSet, ahrimSet, karilSet, guthanSet, veracSet, dharokSet, toragSet; // Items recommended ItemRequirement food, barrowsTab, slayerRing, ectophial, mortTP, spade; @@ -140,7 +136,10 @@ protected void setupRequirements() blackLeather = new ItemRequirement("Black dragon leather", ItemID.DRAGON_LEATHER_BLACK).showConditioned(notCraftBlackDhideBody); needle = new ItemRequirement("Needle", ItemID.NEEDLE).showConditioned(notCraftBlackDhideBody); thread = new ItemRequirement("Thread", ItemID.THREAD).showConditioned(notCraftBlackDhideBody); - + needleThread = new ItemRequirements(needle, thread); + costumeNeedle = new ItemRequirement("Costume needle", ItemID.COSTUMENEEDLE); + needleThreadOrCostumeNeedle = new ItemRequirements(LogicType.OR, "Needle/Thread or Costume needle", needleThread, costumeNeedle); + needleThreadOrCostumeNeedle.setDisplayMatchedItemName(true); ahrimSet = new ItemRequirements("Ahrim Set", new ItemRequirement("Hood", ItemCollections.AHRIM_HOOD), new ItemRequirement("Staff", ItemCollections.AHRIM_STAFF), new ItemRequirement("Top", @@ -208,7 +207,7 @@ public void setupSteps() "Dig at the top of the mounds and search the Sarcophagi until you find the hidden tunnel. A spade can " + "be found in a shed at the entrance.", spade, barrowsSet, food); // equipped doesn't work, it's highlighted as long as it's in inventory. - barrowsChest = new ObjectStep(this, 20973, new WorldPoint(3552, 9696, 0), + barrowsChest = new ObjectStep(this, ObjectID.BARROWS_STONE_CHEST, new WorldPoint(3552, 9696, 0), "Loot the chest wearing a complete set of barrows gear.", barrowsSet.equipped()); cremateShade = new ObjectStep(this, ObjectID.TEMPLE_PYRE, new WorldPoint(3500, 3266, 0), @@ -219,7 +218,7 @@ public void setupSteps() bareHandShark = new NpcStep(this, NpcID._0_54_49_MEMBERFISH, new WorldPoint(3479, 3189, 0), "Bare hand fish a shark in Burgh de Rott."); - moveToSlayer2 = new ObjectStep(this, 2114, new WorldPoint(3436, 3538, 0), + moveToSlayer2 = new ObjectStep(this, ObjectID.SLAYER_STAIRS_LV1, new WorldPoint(3436, 3538, 0), "Climb the stairs or the Spikey chains in the Slayer tower to ascend to the higher level.", combatGear, food); moveToSlayer3 = new ObjectStep(this, ObjectID.SLAYER_STAIRS_LV2, new WorldPoint(3415, 3541, 1), @@ -231,12 +230,12 @@ public void setupSteps() moveToCanifisBank = new DetailedQuestStep(this, new WorldPoint(3511, 3480, 0), "Move to the bank in Canifis.", blackLeather.quantity(3).highlighted(), needle.highlighted(), thread); craftBlackDhideBody = new DetailedQuestStep(this, "Craft a black dragon hide body.", - blackLeather.quantity(3).highlighted(), needle.highlighted(), thread); + blackLeather.quantity(3).highlighted(), needle.highlighted(), needleThreadOrCostumeNeedle); - fertilizeHerb = new ObjectStep(this, 8153, new WorldPoint(3606, 3530, 0), + fertilizeHerb = new ObjectStep(this, ObjectID.FARMING_HERB_PATCH_4, new WorldPoint(3606, 3530, 0), "Cast Fertile Soil on the herb patch in Morytania.", lunarBook, earthRune.quantity(15), astralRune.quantity(3), natureRune.quantity(2)); - fertilizeHerb.addIcon(SpriteID.SPELL_FERTILE_SOIL); + fertilizeHerb.addIcon(SpriteID.LunarMagicOn.FERTILE_SOIL); claimReward = new NpcStep(this, NpcID.LESABRE_MORT_DIARY, new WorldPoint(3464, 3480, 0), "Talk to Le-Sabre near Canifis to claim your reward!"); @@ -248,7 +247,7 @@ public List getItemRequirements() { return Arrays.asList(combatGear, magicRedwoodPyreLogs, shadeRemains, tinderbox, barrowsSet, blackLeather.quantity(3), - needle, thread, earthRune.quantity(15), astralRune.quantity(3), natureRune.quantity(2)); + needleThreadOrCostumeNeedle.quantity(1), earthRune.quantity(15), astralRune.quantity(3), natureRune.quantity(2)); } @Override @@ -342,7 +341,7 @@ public List getPanels() PanelDetails craftSteps = new PanelDetails("Craft Black D'hide Body", Arrays.asList(moveToCanifisBank, craftBlackDhideBody), new SkillRequirement(Skill.CRAFTING, 84, true), - blackLeather.quantity(3), needle, thread); + blackLeather.quantity(3), needleThreadOrCostumeNeedle.quantity(1)); craftSteps.setDisplayCondition(notCraftBlackDhideBody); craftSteps.setLockingStep(craftBlackDhideBodyTask); allSteps.add(craftSteps); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaHard.java index 00dc4d6c06b..69f5acf42b3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaHard.java @@ -267,7 +267,7 @@ public void setupSteps() moveToUpstairs = new ObjectStep(this, ObjectID.SLAYERTOWER_SC_CHAINBOTTOM, new WorldPoint(3422, 3550, 0), "Climb up the chain to get to the second floor of the slayer tower."); - advancedSpikes = new ObjectStep(this, 16537, new WorldPoint(3447, 3576, 1), + advancedSpikes = new ObjectStep(this, ObjectID.SLAYERTOWER_SC_CHAINBOTTOM, new WorldPoint(3447, 3576, 1), "Climb the advanced spike chain. Go down and back up if you rip your hands as you climb."); moveToCaptHorror = new ObjectStep(this, ObjectID.FEVER_GANGPLANK, new WorldPoint(3710, 3496, 0), @@ -289,7 +289,7 @@ public void setupSteps() moveToIsland = new ObjectStep(this, ObjectID.HARMLESS_BLACK_SPIRAL_STAIRS, new WorldPoint(3830, 9463, 0), "Climb the staircase in the north east of the Cave Horror dungeon."); burnMaho = new ItemStep(this, "Burn mahogany logs on the island.", tinderbox.highlighted(), mahoLogs.highlighted()); - chopMaho = new ObjectStep(this, 9034, new WorldPoint(3826, 3056, 0), + chopMaho = new ObjectStep(this, ObjectID.MAHOGANYTREE, new WorldPoint(3826, 3056, 0), "Chop mahogany logs on the island.", axe, tinderbox); moveToCaptMelon = new ObjectStep(this, ObjectID.FEVER_GANGPLANK, new WorldPoint(3710, 3496, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaMedium.java index b5503d92518..7e2fdc8a675 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/morytania/MorytaniaMedium.java @@ -171,6 +171,7 @@ protected void setupRequirements() .showConditioned(notDragontoothIsland).isNotConsumed(); steelBar = new ItemRequirement("Steel bar", ItemID.STEEL_BAR).showConditioned(notCannonBall); ammoMould = new ItemRequirement("Ammo mould", ItemID.AMMO_MOULD).showConditioned(notCannonBall).isNotConsumed(); + ammoMould.addAlternates(ItemID.DOUBLE_AMMO_MOULD); slayerGloves = new ItemRequirement("Slayer gloves", ItemID.SLAYERGUIDE_SLAYER_GLOVES).showConditioned(notFeverSpider).isNotConsumed(); ectophial = new ItemRequirement("Ectophial", ItemID.ECTOPHIAL).showConditioned(notEctophialTP).isNotConsumed(); restorePot = new ItemRequirement("Restore potion (4)", ItemID._4DOSESTATRESTORE).showConditioned(notGuthBalance); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockEasy.java index d7278e52d88..d05692f96ab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockEasy.java @@ -236,10 +236,10 @@ public void setupSteps() "Get more kudos from either quests, miniquests, or turning in fossils."); kudos = new NpcStep(this, NpcID.CURATOR, new WorldPoint(3258, 3449, 0), "Speak to Curator Haig Halen.", notMoreKudos); - moveToEarthRune = new ObjectStep(this, 34816, new WorldPoint(3306, 3474, 0), + moveToEarthRune = new ObjectStep(this, ObjectID.EARTHTEMPLE_RUINED, new WorldPoint(3306, 3474, 0), "Travel to the earth altar or go through the abyss.", earthTali.highlighted(), essence); moveToEarthRune.addIcon(ItemID.EARTH_TALISMAN); - earthRune = new ObjectStep(this, 34763, new WorldPoint(2658, 4841, 0), + earthRune = new ObjectStep(this, ObjectID.EARTH_ALTAR, new WorldPoint(2658, 4841, 0), "Craft an earth rune.", essence); trout = new NpcStep(this, NpcID._0_48_53_FRESHFISH, new WorldPoint(3106, 3428, 0), "Fish a trout in the River Lum at Barbarian Village.", flyRod, feathers); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockElite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockElite.java index 89dcf2f8272..d1bb7789463 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockElite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockElite.java @@ -180,7 +180,7 @@ public void setupSteps() "Move to the west Varrock bank."); superCombat = new ItemStep(this, "Create a super combat potion.", sAtk4.highlighted(), sStr4.highlighted(), sDef4.highlighted(), torstol.highlighted()); - moveToLumb = new ObjectStep(this, 2618, new WorldPoint(3308, 3492, 0), + moveToLumb = new ObjectStep(this, ObjectID.GERTRUDEFENCE, new WorldPoint(3308, 3492, 0), "Climb the fence to enter the lumber yard.", natureRune.quantity(20), astralRune.quantity(40), earthRune.quantity(300), coins.quantity(21000), mahoganyLog.quantity(20)); plankMake = new DetailedQuestStep(this, "Cast plank make until you've made 20 mahogany planks.", @@ -189,9 +189,9 @@ public void setupSteps() "Enter the cooking guild.", cookingGuild.equipped()); summerPie = new ObjectStep(this, ObjectID.FAI_VARROCK_RANGE, new WorldPoint(3146, 3453, 0), "Cook the summer pie.", rawPie); - moveToEarthRune = new ObjectStep(this, 34816, new WorldPoint(3306, 3474, 0), + moveToEarthRune = new ObjectStep(this, ObjectID.EARTHTEMPLE_RUINED, new WorldPoint(3306, 3474, 0), "Travel to the earth altar or go through the abyss.", earthTali, essence.quantity(25)); - earthRune100 = new ObjectStep(this, 34763, new WorldPoint(2658, 4841, 0), + earthRune100 = new ObjectStep(this, ObjectID.EARTH_ALTAR, new WorldPoint(2658, 4841, 0), "Craft the earth runes.", essence.quantity(25)); moveToAnvil = new DetailedQuestStep(this, new WorldPoint(3188, 3426, 0), "Go to the anvil beside the west Varrock bank.", runeBar, feather, hammer); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockHard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockHard.java index 9996fe6bf68..12cdeab5899 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockHard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockHard.java @@ -143,38 +143,38 @@ public QuestStep loadStep() skullSceptreTask = new ConditionalStep(this, moveToStronghold); // Kill minotaurs - skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold1, new Conditions(LogicType.NOR, rightSkull.alsoCheckBank(questBank), strangeSkull.alsoCheckBank(questBank))), killMino); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold1, new Conditions(LogicType.NOR, rightSkull.alsoCheckBank(), strangeSkull.alsoCheckBank())), killMino); // Go to the 2nd floor - skullSceptreTask.addStep(new Conditions(new Conditions(LogicType.OR, rightSkull.alsoCheckBank(questBank), strangeSkull.alsoCheckBank(questBank)), + skullSceptreTask.addStep(new Conditions(new Conditions(LogicType.OR, rightSkull.alsoCheckBank(), strangeSkull.alsoCheckBank()), notSkullSceptre, inStronghold1), moveToStronghold2); // Kill Flesh crawlers - skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold2, new Conditions(LogicType.NOR, botSceptre.alsoCheckBank(questBank), runedSceptre.alsoCheckBank(questBank))), killFlesh); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold2, new Conditions(LogicType.NOR, botSceptre.alsoCheckBank(), runedSceptre.alsoCheckBank())), killFlesh); // Go to the 3rd floor - skullSceptreTask.addStep(new Conditions(new Conditions(LogicType.OR, botSceptre.alsoCheckBank(questBank), runedSceptre.alsoCheckBank(questBank)), + skullSceptreTask.addStep(new Conditions(new Conditions(LogicType.OR, botSceptre.alsoCheckBank(), runedSceptre.alsoCheckBank()), notSkullSceptre, inStronghold2), moveToStronghold3); // Kill Catablepons - skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold3, new Conditions(LogicType.NOR, topSceptre.alsoCheckBank(questBank), runedSceptre.alsoCheckBank(questBank))), killCatablepon); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold3, new Conditions(LogicType.NOR, topSceptre.alsoCheckBank(), runedSceptre.alsoCheckBank())), killCatablepon); // Go to the 4th floor - skullSceptreTask.addStep(new Conditions(new Conditions(LogicType.OR, topSceptre.alsoCheckBank(questBank), runedSceptre.alsoCheckBank(questBank)), + skullSceptreTask.addStep(new Conditions(new Conditions(LogicType.OR, topSceptre.alsoCheckBank(), runedSceptre.alsoCheckBank()), notSkullSceptre, inStronghold3), moveToStronghold4); // Kill Ankou - skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold4, new Conditions(LogicType.NOR, leftSkull.alsoCheckBank(questBank), strangeSkull.alsoCheckBank(questBank), combinedSkullSceptre.alsoCheckBank(questBank))), killAnkou); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, inStronghold4, new Conditions(LogicType.NOR, leftSkull.alsoCheckBank(), strangeSkull.alsoCheckBank(), combinedSkullSceptre.alsoCheckBank())), killAnkou); // Make strange skull - skullSceptreTask.addStep(new Conditions(notSkullSceptre, leftSkull.alsoCheckBank(questBank), rightSkull.alsoCheckBank(questBank)), makeSkull); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, leftSkull.alsoCheckBank(), rightSkull.alsoCheckBank()), makeSkull); // Make runed sceptre - skullSceptreTask.addStep(new Conditions(notSkullSceptre, botSceptre.alsoCheckBank(questBank), topSceptre.alsoCheckBank(questBank)), makeSceptre); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, botSceptre.alsoCheckBank(), topSceptre.alsoCheckBank()), makeSceptre); // Make skull sceptre - skullSceptreTask.addStep(new Conditions(notSkullSceptre, runedSceptre.alsoCheckBank(questBank), strangeSkull.alsoCheckBank(questBank)), makeSkullSceptre); - skullSceptreTask.addStep(new Conditions(notSkullSceptre, combinedSkullSceptre.alsoCheckBank(questBank)), skullSceptre); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, runedSceptre.alsoCheckBank(), strangeSkull.alsoCheckBank()), makeSkullSceptre); + skullSceptreTask.addStep(new Conditions(notSkullSceptre, combinedSkullSceptre.alsoCheckBank()), skullSceptre); doHard.addStep(notSkullSceptre, skullSceptreTask); return doHard; @@ -200,9 +200,9 @@ protected void setupRequirements() ancientBook = new SpellbookRequirement(Spellbook.ANCIENT); - yewNotChecked = new VarbitRequirement(4771, 45); - yewChecked = new VarbitRequirement(4771, 46); - yewStump = new VarbitRequirement(4771, 47); + yewNotChecked = new VarbitRequirement(VarbitID.FARMING_TRANSMIT_A, 45); + yewChecked = new VarbitRequirement(VarbitID.FARMING_TRANSMIT_A, 46); + yewStump = new VarbitRequirement(VarbitID.FARMING_TRANSMIT_A, 47); botSceptre = new ItemRequirement("Bottom of sceptre", ItemID.SOS_HALF_SCEPTRE2).showConditioned(notSkullSceptre); topSceptre = new ItemRequirement("Top of sceptre", ItemID.SOS_HALF_SCEPTRE1).showConditioned(notSkullSceptre); @@ -331,10 +331,10 @@ public void setupSteps() "Speak with Orlando."); getKudos = new DetailedQuestStep(this, "Complete more quests and tasks for kudos. " + "Check out the kudos wiki page for more details."); - wakkaEdge = new ObjectStep(this, 12166, new WorldPoint(3131, 3510, 0), + wakkaEdge = new ObjectStep(this, ObjectID.CANOEING_CANOESTATION_EDGEVILLE, new WorldPoint(3131, 3510, 0), "Make a Waka at the canoe station in Edgeville.", axe); paddewwaTP = new DetailedQuestStep(this, "Cast teleport to Paddewwa.", ancientBook, lawRune.quantity(2), airRune.quantity(1), fireRune.quantity(1)); - cutYew = new ObjectStep(this, 10823, new WorldPoint(3249, 3473, 0), + cutYew = new ObjectStep(this, ObjectID.DEADMAN_YEWTREE, new WorldPoint(3249, 3473, 0), "Cut a yew tree until you get a log.", axe); goUp1 = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRS_TALLER, new WorldPoint(3259, 3488, 0), "Climb to the top of the Varrock Church.", yewLog, tinderBox); @@ -351,15 +351,15 @@ public void setupSteps() fancyStone = new NpcStep(this, NpcID.POH_ESTATE_AGENT, new WorldPoint(3240, 3475, 0), "Talk to the estate agent to redecorate your house to fancy stone.", coins.quantity(25000)); fancyStone.addDialogStep("Can you redecorate my house please?"); - growYew = new ObjectStep(this, 8513, new WorldPoint(3229, 3459, 0), + growYew = new ObjectStep(this, ObjectID.YEW_TREE_FULLYGROWN_2, new WorldPoint(3229, 3459, 0), "Grow and check the health of a yew tree in front of Varrock palace. " + "Afterwards, dig up the stump to get the yew roots. " + "If you're waiting for it to grow and want to complete further tasks, use the tick box on panel.", yewSap, rake, spade); - chopYew = new ObjectStep(this, 8513, new WorldPoint(3229, 3459, 0), + chopYew = new ObjectStep(this, ObjectID.YEW_TREE_FULLYGROWN_2, new WorldPoint(3229, 3459, 0), "Chop the yew tree that you grew in front of Varrock palace. Afterwards, dig up the stump to get the Yew " + "roots.", axe, spade); - digUpYewRoots = new ObjectStep(this, 8514, new WorldPoint(3229, 3459, 0), + digUpYewRoots = new ObjectStep(this, ObjectID.YEW_TREE_STUMP, new WorldPoint(3229, 3459, 0), "Dig up the stump to get the Yew roots.", spade); moveToUpstairs = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRS, new WorldPoint(3219, 3497, 0), "Climb the stairs in the back of the Varrock palace."); @@ -367,7 +367,7 @@ public void setupSteps() "Pray at altar with Smite active.", smiteActive); moveToEdge = new ObjectStep(this, ObjectID.TRAPDOOR_OPEN, new WorldPoint(3097, 3468, 0), "Enter the Edgeville dungeon."); - obsPipe = new ObjectStep(this, 16511, new WorldPoint(3150, 9906, 0), + obsPipe = new ObjectStep(this, ObjectID.VARROCK_DUNGEON_PIPE_SC, new WorldPoint(3150, 9906, 0), "Climb through the pipe shortcut near Vannaka."); claimReward = new NpcStep(this, NpcID.TOBY_VARROCK_DIARY, new WorldPoint(3225, 3415, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockMedium.java index 7544c7c92fa..c7926e29559 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/varrock/VarrockMedium.java @@ -48,10 +48,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -167,15 +164,15 @@ protected void setupRequirements() notBalloon = new VarplayerRequirement(VarPlayerID.VARROCK_ACHIEVEMENT_DIARY, false, 27); notVarrAgi = new VarplayerRequirement(VarPlayerID.VARROCK_ACHIEVEMENT_DIARY, false, 28); - notFlap = new VarbitRequirement(2309, 1); - notSlap = new VarbitRequirement(2310, 1); - notIdea = new VarbitRequirement(2311, 1); - notStamp = new VarbitRequirement(2312, 1); + notFlap = new VarbitRequirement(VarbitID.SOS_EMOTE_FLAP, 1); + notSlap = new VarbitRequirement(VarbitID.SOS_EMOTE_DOH, 1); + notIdea = new VarbitRequirement(VarbitID.SOS_EMOTE_IDEA, 1); + notStamp = new VarbitRequirement(VarbitID.SOS_EMOTE_STAMP, 1); normalBook = new SpellbookRequirement(Spellbook.NORMAL); - notVarrBalloon = new VarbitRequirement(2872, 0); - notVarrBalloon2 = new VarbitRequirement(2872, 1); + notVarrBalloon = new VarbitRequirement(VarbitID.ZEP_MULTI_VARR, 0); + notVarrBalloon2 = new VarbitRequirement(VarbitID.ZEP_MULTI_VARR, 1); coins = new ItemRequirement("Coins", ItemCollections.COINS).showConditioned(new Conditions(LogicType.OR, notApothStr, notCatColour, notMaho20)); limpRoot = new ItemRequirement("Limpwurt root", ItemID.LIMPWURT_ROOT).showConditioned(notApothStr); @@ -233,7 +230,7 @@ public void setupSteps() "Check your bank if you own a cat/kitten and either store them in the POH Menagerie or shoo them. Then speak with Gertrude for a new kitten.", coins.quantity(100), ringOfCharos.equipped()); colourCat.addDialogSteps("Do you have any more kittens?", "[Charm] I'm quite fussy over cats - can I pick my own?"); - geSpirit = new ObjectStep(this, 1295, new WorldPoint(3185, 3510, 0), + geSpirit = new ObjectStep(this, ObjectID.SPIRITTREE_SMALL, new WorldPoint(3185, 3510, 0), "Use the spirit tree in the Grand Exchange."); moveToStronghold = new ObjectStep(this, ObjectID.SOS_DUNG_ENT_OPEN, new WorldPoint(3081, 3420, 0), @@ -259,7 +256,7 @@ public void setupSteps() //TODO find a better way to check for slayer task vannaka = new NpcStep(this, NpcID.SLAYER_MASTER_3, new WorldPoint(3146, 9913, 0), "Get a task from Vannaka."); - tolna = new ObjectStep(this, 13968, new WorldPoint(3310, 3452, 0), + tolna = new ObjectStep(this, ObjectID.SOULBANE_FALLOFF2_ROPE_MULTI, new WorldPoint(3310, 3452, 0), "Enter the Tolna dungeon."); tpDigsite = new DetailedQuestStep(this, "Rub the digsite pendant and select the 'Digsite' teleport.", @@ -268,7 +265,7 @@ public void setupSteps() maho20 = new NpcStep(this, NpcID.POH_SAWMILL_OPP, new WorldPoint(3302, 3492, 0), "Make 20 mahogany planks at the sawmill in ONE run.", mahoLog.quantity(20), coins.quantity(30000)); - balloon = new ObjectStep(this, 19143, new WorldPoint(3297, 3482, 0), + balloon = new ObjectStep(this, ObjectID.ZEP_MULTI_BASKET_VARR, new WorldPoint(3297, 3482, 0), "Use the basket east of Varrock to fly to any available destination.", willowLog1); moveToEntrana = new NpcStep(this, NpcID.SHIPMONK1_C, new WorldPoint(3048, 3236, 0), "Speak with a monk to travel to Entrana.", true, willowLog11); @@ -276,7 +273,7 @@ public void setupSteps() talkToAug = new NpcStep(this, NpcID.ZEP_PICCARD, new WorldPoint(2810, 3356, 0), "Speak with Augustine and travel to Varrock.", willowLog11); - whiteFruit = new ObjectStep(this, 9209, new WorldPoint(3230, 3475, 0), + whiteFruit = new ObjectStep(this, ObjectID.GARDEN_WHITE_TREE_PATCH, new WorldPoint(3230, 3475, 0), "Pick a white tree fruit at Varrock Castle."); varrAgi = new ObjectStep(this, ObjectID.ROOFTOPS_VARROCK_WALLCLIMB, new WorldPoint(3221, 3414, 0), "Complete a lap of the Varrock rooftop course."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/westernprovinces/WesternMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/westernprovinces/WesternMedium.java index 754ce2a4e80..b87bae14cd1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/westernprovinces/WesternMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/westernprovinces/WesternMedium.java @@ -279,7 +279,7 @@ public void setupSteps() agiShortcut = new ObjectStep(this, ObjectID.GNOME_STRONGHOLD_SC_ROCK_TOP, new WorldPoint(2487, 3515, 0), "Take the agility shortcut from the Grand Tree to Otto's Grotto."); - moveToEagle = new ObjectStep(this, 19790, new WorldPoint(2329, 3495, 0), + moveToEagle = new ObjectStep(this, ObjectID.EAGLEPEAK_ENTRANCE_CAVE_MULTI, new WorldPoint(2329, 3495, 0), "Enter the cave at the top of Eagles' Peak. " + "You can use a fairy ring to (AKQ), then head south to get there easily.", rope); eagleFeldip = new NpcStep(this, NpcID.EAGLEPEAK_EAGLE_TOJUNGLE, new WorldPoint(2027, 4964, 3), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessEasy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessEasy.java index 53846a4d43f..13b83d76d8e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessEasy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessEasy.java @@ -47,10 +47,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -151,7 +148,7 @@ protected void setupRequirements() notEnterAbyss = new VarplayerRequirement(VarPlayerID.WILDERNESS_ACHIEVEMENT_DIARY, false, 11); notEquipTeamCape = new VarplayerRequirement(VarPlayerID.WILDERNESS_ACHIEVEMENT_DIARY, false, 12); - firstTimeAbyss = new VarbitRequirement(626, 1); + firstTimeAbyss = new VarbitRequirement(VarbitID.RCU_ABYSSAL_WARNING, 1); normalBook = new SpellbookRequirement(Spellbook.NORMAL); chaosAccess = new ItemRequirement("Access to the Chaos altar", @@ -204,7 +201,7 @@ public void setupSteps() equipTeamCape = new DetailedQuestStep(this, "Equip a team cape. If you already have one on, re-equip it.", teamCape.equipped()); - chaosTemple = new ObjectStep(this, 34822, new WorldPoint(3060, 3591, 0), + chaosTemple = new ObjectStep(this, ObjectID.CHAOSTEMPLE_RUINED, new WorldPoint(3060, 3591, 0), "Enter the chaos altar north of Edgeville with a chaos talisman/tiara, or enter it through the Abyss."); chaosTemple.addIcon(ItemID.CHAOS_TALISMAN); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessMedium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessMedium.java index 79843ae9e32..5d373151ce8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessMedium.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/achievementdiaries/wilderness/WildernessMedium.java @@ -35,8 +35,10 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SpellbookRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Spellbook; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -74,7 +76,7 @@ public class WildernessMedium extends ComplexStateQuestHelper Requirement betweenARock; Requirement notMineMith, notEntYew, notWildyGodWars, notWildyAgi, notKillGreenDrag, notKillAnkou, - notWildyGWBloodveld, notEmblemTrader, notGoldHelm, notMuddyChest, notEarthOrb; + notWildyGWBloodveld, notEmblemTrader, notGoldHelm, notMuddyChest, standardSpellbook, notEarthOrb; QuestStep claimReward, mineMith, wildyAgi, killAnkou, wildyGWBloodveld, emblemTrader, goldHelm, muddyChest, earthOrb, moveToResource, moveToGodWars1, moveToGodWars2, mineGoldOre, smeltGoldOre, moveToEdge, moveToSlayer1, @@ -132,7 +134,7 @@ public QuestStep loadStep() // TODO: IF in bank, step to drop goldHelmTask = new ConditionalStep(this, moveToResource); - goldHelmTask.addStep(new Conditions(inResource, goldBar.quantity(3).alsoCheckBank(questBank)), goldHelm); + goldHelmTask.addStep(new Conditions(inResource, goldBar.quantity(3).alsoCheckBank()), goldHelm); goldHelmTask.addStep(new Conditions(inResource, goldOre.quantity(3)), smeltGoldOre); goldHelmTask.addStep(inResource, mineGoldOre); doMedium.addStep(notGoldHelm, goldHelmTask); @@ -158,6 +160,8 @@ protected void setupRequirements() notGoldHelm = new VarplayerRequirement(VarPlayerID.WILDERNESS_ACHIEVEMENT_DIARY, false, 23); notMuddyChest = new VarplayerRequirement(VarPlayerID.WILDERNESS_ACHIEVEMENT_DIARY, false, 24); + standardSpellbook = new SpellbookRequirement(Spellbook.NORMAL); + combatGear = new ItemRequirement("Combat gear", -1, -1); combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); @@ -293,7 +297,7 @@ public List getGeneralRequirements() reqs.add(new SkillRequirement(Skill.MINING, 55, true)); reqs.add(new SkillRequirement(Skill.SLAYER, 50, true)); reqs.add(new SkillRequirement(Skill.SMITHING, 50, true)); - reqs.add(new SkillRequirement(Skill.WOODCUTTING, 61, true)); + reqs.add(new SkillRequirement(Skill.WOODCUTTING, 61, false)); reqs.add(betweenARock); @@ -337,7 +341,7 @@ public List getPanels() List allSteps = new ArrayList<>(); PanelDetails entSteps = new PanelDetails("Ent Yew", Collections.singletonList(entYew), - new SkillRequirement(Skill.WOODCUTTING, 61, true), combatGear, food, runeAxe); + new SkillRequirement(Skill.WOODCUTTING, 61, false), combatGear, food, runeAxe); entSteps.setDisplayCondition(notEntYew); entSteps.setLockingStep(entYewTask); allSteps.add(entSteps); @@ -373,7 +377,7 @@ public List getPanels() allSteps.add(emblemSteps); PanelDetails earthOrbSteps = new PanelDetails("Earth Orb", Arrays.asList(moveToEdge, earthOrb), - new SkillRequirement(Skill.MAGIC, 60, true), unpoweredOrb, earthRune.quantity(30), cosmicRune.quantity(3)); + new SkillRequirement(Skill.MAGIC, 60, true), unpoweredOrb, standardSpellbook, earthRune.quantity(30), cosmicRune.quantity(3)); earthOrbSteps.setDisplayCondition(notEarthOrb); earthOrbSteps.setLockingStep(earthOrbTask); allSteps.add(earthOrbSteps); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingConditionalStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingConditionalStep.java new file mode 100644 index 00000000000..acdae9c6d68 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingConditionalStep.java @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import com.google.inject.Inject; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps.ChartingWeatherStep; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.runelite.RuneliteRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.PuzzleWrapperStep; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.ReorderableConditionalStep; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; +import net.runelite.api.Client; +import net.runelite.api.coords.WorldPoint; + +import java.util.Map; + +public class ChartingConditionalStep extends ReorderableConditionalStep +{ + @Inject + protected Client client; + + private final RuneliteRequirement proximityModeRequirement; + + public ChartingConditionalStep(QuestHelper questHelper, QuestStep step, String selectionMethodConfigKey, Requirement... requirements) + { + super(questHelper, step, requirements); + this.proximityModeRequirement = new RuneliteRequirement(questHelper.getConfigManager(), selectionMethodConfigKey, "PROXIMITY"); + } + + @Override + protected void updateSteps() + { + if (proximityModeRequirement.check(client)) + { + updateStepsProximity(); + } + else + { + super.updateSteps(); + } + } + + private void updateStepsProximity() + { + WorldPoint playerLocation = getPlayerLocation(); + if (playerLocation == null) + { + super.updateSteps(); + return; + } + + QuestStep closestStep = null; + int closestDistance = Integer.MAX_VALUE; + + for (Map.Entry entry : steps.entrySet()) + { + var condition = entry.getKey(); + var step = entry.getValue(); + DetailedQuestStep detailedStep; + if (!(step instanceof DetailedQuestStep)) + { + if (step instanceof PuzzleWrapperStep && ((PuzzleWrapperStep) step).getSolvingStep() instanceof DetailedQuestStep) + { + detailedStep = (DetailedQuestStep) ((PuzzleWrapperStep) step).getSolvingStep(); + } + else if (step instanceof ChartingWeatherStep) + { + detailedStep = ((ChartingWeatherStep) step).getStepToUse(); + } + else + { + continue; + } + } + else + { + detailedStep = (DetailedQuestStep) step; + } + + if (condition != null && !condition.check(client)) + { + continue; + } + + if (detailedStep.isLocked()) + { + continue; + } + + if (detailedStep instanceof ChartingTaskInterface) + { + ChartingTaskInterface chartingStep = (ChartingTaskInterface) step; + if (!chartingStep.getCanDoRequirement().check(client)) + { + continue; + } + } + + var stepLocation = detailedStep.getDefinedPoint(); + if (stepLocation == null) continue; + int distance = stepLocation.distanceTo(playerLocation); + if (distance < closestDistance) + { + closestDistance = distance; + closestStep = step; + } + } + + if (closestStep != null) + { + startUpStep(closestStep); + } + else + { + if (steps.get(null) != null && !steps.get(null).isLocked()) + { + startUpStep(steps.get(null)); + } + } + } + + private WorldPoint getPlayerLocation() + { + if (client.getLocalPlayer() == null) + { + return null; + } + + return QuestPerspective.getWorldPointConsideringWorldView( + client, + client.getLocalPlayer().getWorldView(), + client.getLocalPlayer().getWorldLocation() + ); + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingHelper.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingHelper.java new file mode 100644 index 00000000000..4677c3d31cb --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingHelper.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps.*; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.panel.TopLevelPanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.ComplexStateQuestHelper; +import net.runelite.client.plugins.microbot.questhelper.questinfo.HelperConfig; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.StepIsActiveRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.api.gameval.VarbitID; + +import java.util.*; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; + +public class ChartingHelper extends ComplexStateQuestHelper +{ + private enum SelectionMethod + { + SORTED_ORDER, + PROXIMITY + } + + private final String SELECTION_METHOD = "chartingSelectionMethod"; + + private final DetailedQuestStep overviewStep = new DetailedQuestStep(this, "You have no more things you can chart at your current level."); + private final List chartingSteps = new ArrayList<>(); + private List panelDetails = new ArrayList<>(); + + @Override + protected void setupRequirements() + { + // Book of the dead / tele to pisc for changing location? + } + + @Override + public List getPanels() + { + return panelDetails; + } + + private void buildSteps() + { + chartingSteps.clear(); + Map> stepsBySea = new LinkedHashMap<>(); + + for (ChartingSeaSection section : ChartingTasksData.getSections()) + { + List steps = new ArrayList<>(); + for (ChartingTaskDefinition definition : section.getTasks()) + { + ChartingTaskInterface step = createStep(definition); + QuestStep questStep = (QuestStep) step; + + chartingSteps.add(questStep); + steps.add(step); + } + if (!steps.isEmpty()) + { + stepsBySea.put(section.getSea(), steps); + } + } + + buildSidePanel(stepsBySea); + } + + private void buildSidePanel(Map> stepsBySea) + { + var topLevelPanel = new TopLevelPanelDetails("Sea charting"); + + // Map sea names to their sections to get IDs + Map seaNameToSection = new LinkedHashMap<>(); + for (ChartingSeaSection section : ChartingTasksData.getSections()) + { + seaNameToSection.put(section.getSea(), section); + } + + for (Map.Entry> entry : stepsBySea.entrySet()) + { + List steps = new ArrayList<>(); + for (ChartingTaskInterface chartingStep : entry.getValue()) + { + steps.add((QuestStep) chartingStep); + } + ChartingSeaSection section = seaNameToSection.get(entry.getKey()); + int panelId = section != null ? section.getId() : -1; + var panel = new PanelDetails(entry.getKey(), steps).withId(panelId); + var displayCondition = createDisplayCondition(entry.getValue()); + if (displayCondition != null) + { + panel.setDisplayCondition(displayCondition); + } + topLevelPanel.addPanelDetails(panel); + } + var allDonePanel = new PanelDetails("Done for now", overviewStep).withHideCondition(not(new StepIsActiveRequirement(overviewStep))); + panelDetails = new ArrayList<>(List.of(allDonePanel, topLevelPanel)); + } + + private ChartingTaskInterface createStep(ChartingTaskDefinition definition) + { + switch (definition.getType()) + { + case GENERIC: + return new ChartingGenericObjectStep(this, definition); + case CRATE: + return new ChartingCrateStep(this, definition); + case SPYGLASS: + if (definition.getVarbitId() == VarbitID.SAILING_CHARTING_SPYGLASS_CHARTING_TUTOR_COMPLETE) + { + return new ChartingCaveTelescopeStep(this, definition); + } + return new ChartingTelescopeStep(this, definition); + case CURRENT: + return new ChartingCurrentStep(this, definition); + case DIVING: + return new ChartingPuzzleWrapStep(this, + new ChartingDivingStep(this, definition, true), + new ChartingDivingStep(this, definition, false), + definition); + case WEATHER: + return new ChartingWeatherStep(this, definition); + default: + return new ChartingTaskStep(this, definition); + } + } + + @Override + public QuestStep loadStep() + { + buildSteps(); + + // Initialize default config value if not set + String selectionMethodName = configManager.getRSProfileConfiguration(QuestHelperConfig.QUEST_BACKGROUND_GROUP, SELECTION_METHOD); + if (selectionMethodName == null) + { + configManager.setRSProfileConfiguration(QuestHelperConfig.QUEST_BACKGROUND_GROUP, SELECTION_METHOD, SelectionMethod.PROXIMITY.name()); + } + + var chartingConditionalStep = new ChartingConditionalStep(this, overviewStep, SELECTION_METHOD); + for (QuestStep step : chartingSteps) + { + if (step instanceof ChartingTaskInterface) + { + var chartingStep = (ChartingTaskInterface) step; + chartingConditionalStep.addStep(chartingStep.getCanDoRequirement(), step); + } + } + return chartingConditionalStep; + } + + @Override + public List getConfigs() + { + HelperConfig selectionMethodConfig = new HelperConfig("Selection Method", SELECTION_METHOD, SelectionMethod.values()); + return List.of(selectionMethodConfig); + } + + @Override + public List getNotes() + { + return Collections.singletonList("You can choose to have the steps shown in the order of the sidebar, or to show the closest step to you at any time"); + } + + private Requirement createDisplayCondition(List steps) + { + if (steps.isEmpty()) + { + return null; + } + + if (steps.size() == 1) + { + return steps.get(0).getIncompleteRequirement(); + } + + var requirements = steps.stream() + .map(ChartingTaskInterface::getIncompleteRequirement) + .toArray(Requirement[]::new); + return new Conditions(LogicType.OR, requirements); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingSeaSection.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingSeaSection.java new file mode 100644 index 00000000000..f8a3c231abf --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingSeaSection.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import lombok.Getter; + +import java.util.List; + +@Getter +public final class ChartingSeaSection +{ + private final int id; + private final String sea; + private final List tasks; + public ChartingSeaSection(int id, String sea, List tasks) + { + this.id = id; + this.sea = sea; + this.tasks = tasks; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTaskDefinition.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTaskDefinition.java new file mode 100644 index 00000000000..f9d1a59a7c7 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTaskDefinition.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import lombok.Getter; +import net.runelite.api.coords.WorldPoint; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; + +import java.util.ArrayList; +import java.util.List; + +@Getter +public final class ChartingTaskDefinition +{ + private final ChartingType type; + private final String description; + private final WorldPoint worldPoint; + private final WorldPoint secondaryWorldPoint; + private final List itemIds; + private final String ocean; + private final int level; + private final int varbitId; + private final String answerText; + private final Integer bottleItemId; + private final List additionalRequirements = new ArrayList<>(); + private final List additionalRecommended = new ArrayList<>(); + + public ChartingTaskDefinition(ChartingType type, String description, WorldPoint worldPoint, String ocean, int level, int varbitId) + { + this(type, description, worldPoint, null, ocean, level, varbitId, null); + } + + public ChartingTaskDefinition(ChartingType type, String description, WorldPoint worldPoint, WorldPoint secondaryWorldPoint, String ocean, int level, int varbitId) + { + this(type, description, worldPoint, secondaryWorldPoint, ocean, level, varbitId, null); + } + + public ChartingTaskDefinition(ChartingType type, String description, WorldPoint worldPoint, String ocean, int level, int varbitId, Integer bottleItemId) + { + this(type, description, worldPoint, null, ocean, level, varbitId, bottleItemId); + } + + public ChartingTaskDefinition(ChartingType type, String description, WorldPoint worldPoint, WorldPoint secondaryWorldPoint, String ocean, int level, int varbitId, Integer bottleItemId) + { + this.type = type; + this.description = description; + this.worldPoint = worldPoint; + this.secondaryWorldPoint = secondaryWorldPoint; + this.ocean = ocean; + this.level = level; + this.varbitId = varbitId; + this.itemIds = null; + this.answerText = ""; + this.bottleItemId = bottleItemId; + } + + public ChartingTaskDefinition(ChartingType type, String description, WorldPoint worldPoint, String ocean, int level, int varbitId, String answerText, List itemIds) + { + this(type, description, worldPoint, ocean, level, varbitId, answerText, itemIds, null); + } + + public ChartingTaskDefinition(ChartingType type, String description, WorldPoint worldPoint, String ocean, int level, int varbitId, String answerText, List itemIds, Integer bottleItemId) + { + this.type = type; + this.description = description; + this.worldPoint = worldPoint; + this.secondaryWorldPoint = null; + this.itemIds = itemIds; + this.ocean = ocean; + this.level = level; + this.varbitId = varbitId; + this.answerText = answerText; + this.bottleItemId = bottleItemId; + } + + public ChartingTaskDefinition withRequirements(List requirements) + { + additionalRequirements.addAll(requirements); + return this; + } + + public ChartingTaskDefinition withRecommended(List recommended) + { + additionalRecommended.addAll(recommended); + return this; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTaskInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTaskInterface.java new file mode 100644 index 00000000000..f6ecb4ccc15 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTaskInterface.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; + +public interface ChartingTaskInterface +{ + void setupRequiredAndRecommended(ChartingTaskDefinition definition); + Requirement getIncompleteRequirement(); + Requirement getCanDoRequirement(); +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTasksData.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTasksData.java new file mode 100644 index 00000000000..5d6779ea15a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingTasksData.java @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.VarbitID; +import net.runelite.client.plugins.microbot.questhelper.requirements.sailing.BoatResistanceType; +import net.runelite.client.plugins.microbot.questhelper.requirements.sailing.HasBoatResistanceRequirement; + +import java.util.List; + +// All data generated from the OSRS Wiki (https://oldschool.runescape.wiki/w/Sea_charting) +public final class ChartingTasksData +{ + private ChartingTasksData() + { + } + + private static final List SECTIONS = List.of( + new ChartingSeaSection(0, "Kharidian Sea", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Pandemonium from the cave entrance on the island.", new WorldPoint(3045, 2995, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_THE_PANDEMONIUM_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to admire Chartin' Charles McAtless in the cave on the Pandemonium.", new WorldPoint(3051, 9388, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_CHARTING_TUTOR_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a crashed glider south of the Karamja Shipyard.", new WorldPoint(2987, 3010, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_GLIDER_KHARIDIAN_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Pandemonium II west of the Pandemonium.", new WorldPoint(2973, 2994, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_PANDEMONIUM_2_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Pandemonium III west of the Kharidian Bandit Camp.", new WorldPoint(3143, 2979, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_PANDEMONIUM_3_COMPLETE), + + // Extra + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Kharidian Bandit Camp.", new WorldPoint(3145, 2963, 0), new WorldPoint(3049, 2962, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_KHARIDIAN_SEA_COMPLETE) + )), + new ChartingSeaSection(2, "Lumbridge Basin", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an unfortunate corpse on a small island south east of Tutorial Island.", new WorldPoint(3133, 3053, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_CORPSE_LUMBRIDGE_BASIN_COMPLETE), + // Extra + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the Lum Lagoon and sample the contents. You'll need a raft to reach it. You'll take 5 damage drinking it.", new WorldPoint(3277, 3135, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SORODAMIN_BRU_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SORODAMIN_BRU), + + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a treacherous rock formation south of Lumbridge Swamp.", new WorldPoint(3182, 3136, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROCK_LUMBRIDGE_BASIN_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the western mine in Lumbridge Swamp from the south.", new WorldPoint(3145, 3134, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_LUMBRIDGE_MINE_COMPLETE) + )), + new ChartingSeaSection(1, "Bay of Sarim", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Grandyozenaym north east of the Wizards' Tower.", new WorldPoint(3126, 3202, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROWBOAT_BAY_OF_SARIM_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Wizards' Tower from the north.", new WorldPoint(3104, 3181, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_WIZARDS_TOWER_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a treacherous rock formation near Draynor Village.", new WorldPoint(3079, 3231, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROCK_BAY_OF_SARIM_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Look at the port task board in Port Sarim.", new WorldPoint(3030, 3198, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BOARD_PORT_SARIM_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Interact with the salvaging station in Port Sarim.", new WorldPoint(3029, 3207, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SALVAGE_STATION_PORT_SARIM_COMPLETE), + + // Extra + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south of the small island in the Bay of Sarim.", new WorldPoint(3082, 3201, 0), new WorldPoint(3033, 3152, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_FAIRY_RING_COMPLETE) + )), + new ChartingSeaSection(3, "Mudskipper Sound", List.of( + // Extra + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Mudskipper Point and sample the contents.", new WorldPoint(2994, 3134, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SMUGGLED_RUM_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SMUGGLED_RUM), + + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Salty Grouper south west of Tutorial Island.", new WorldPoint(3054, 3051, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROWBOAT_MUDSKIPPER_SOUND_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Karamja Shipyard from the east.", new WorldPoint(3008, 3049, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_SHIPYARD_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a strange stone tablet south east of Musa Point.", new WorldPoint(2944, 3138, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_CRUNCH_POSTER_COMPLETE), + + // Extra + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents at the mouth of the River Amja south of Musa Point.", new WorldPoint(2890, 3121, 0), new WorldPoint(2967, 3065, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_MUSA_POINT_COMPLETE) + )), + new ChartingSeaSection(4, "Rimmington Strait", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Karamja Volcano from the north.", new WorldPoint(2839, 3210, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_KARAMJA_VOLCANO_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a warning about dragons east of Crandor.", new WorldPoint(2873, 3260, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_DRAGON_STATUE_RIMMINGTON_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a treacherous rock formation west of the Crafting Guild.", new WorldPoint(2905, 3281, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROCK_RIMMINGTON_STRAIT_COMPLETE), + + // Extra + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Makeover Mage's home.", new WorldPoint(2902, 3317, 0), new WorldPoint(2872, 3273, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_RIMMINGTON_STRAIT_COMPLETE) + )), + // Got to here, level, 14 Sailing. Should be able to unlock the crates + new ChartingSeaSection(5, "Catherby Bay", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some odd aquatic plant life west of the Dark Wizards' Tower.", new WorldPoint(2897, 3335, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_THORNS_CATHERBY_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Entrana and sample the contents.", new WorldPoint(2869, 3378, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_MARROW_WINE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_MARROW_WINE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Keep le Faye from the east.", new WorldPoint(2784, 3401, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_KEEP_LE_FAYE_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find evidence of megashrimp activity east of the Legends' Guild.", new WorldPoint(2760, 3364, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_MEGASHRIMP_CATHERBY_BAY_COMPLETE) + )), + // Level 19 Sailing here with just quests + charting + // Recommend tele to pisc, and recover boat? + // Could be good to have this as a step + new ChartingSeaSection(46, "Hosidian Sea", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some discarded farming equipment east of Hosidius.", new WorldPoint(1855, 3586, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_DISCARDED_PLOUGH_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the eastern coast of Hosidius and sample the contents. WARNNG: You will have all the items on you banked when you drink it!", new WorldPoint(1887, 3556, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_BANKERS_DRAUGHT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_BANKERS_DRAUGHT), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Tithe Farm from the north east.", new WorldPoint(1861, 3528, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_TITHE_FARM_COMPLETE) + )), + new ChartingSeaSection(44, "Crabclaw Bay", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a sabotaged mooring point on Crabclaw Island.", new WorldPoint(1789, 3401, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SABOTAGED_MOORING_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Crabclaw Island from the south west.", new WorldPoint(1744, 3405, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_CRABCLAW_BAY_2_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Salvager Overlook from the west.", new WorldPoint(1600, 3310, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_CRABCLAW_BAY_1_COMPLETE) + + )), + new ChartingSeaSection(43, "Great Sound", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an advert on a small island north east of Salvager Overlook.", new WorldPoint(1656, 3304, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BARRACUDA_ADVERT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an interesting sign south east of Land's End.", new WorldPoint(1529, 3405, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BEGINNING_SIGN_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Auburnvale from the north.", new WorldPoint(1413, 3394, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_GREAT_SOUND_COMPLETE), + + // Extra + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate west of Land's End and sample the contents.", new WorldPoint(1437, 3430, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_WILD_WHISKY_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_WILD_WHISKY), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south of Lacerta Falls.", new WorldPoint(1384, 3465, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_GREAT_SOUND_COMPLETE) + )), + // TODO: Remove entire section and integrate into other sections? Keep as both so player can prioritise finishing section and also do passively?? + new ChartingSeaSection(70, "Bonus Drinks", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the Lum Lagoon and sample the contents. You'll need a raft to reach it.", new WorldPoint(3277, 3135, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SORODAMIN_BRU_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SORODAMIN_BRU), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Mudskipper Point and sample the contents.", new WorldPoint(2994, 3134, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SMUGGLED_RUM_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SMUGGLED_RUM), + // TODO: Remove as part of quest? + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Pandemonium and sample the contents.", new WorldPoint(3013, 2998, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate west of Land's End and sample the contents.", new WorldPoint(1437, 3430, 0), "", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_WILD_WHISKY_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_WILD_WHISKY) + )), + new ChartingSeaSection(6, "Brimhaven Passage", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a set of someone else's charts south of the Fishing Platform and copy them.", new WorldPoint(2769, 3267, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BOTTLE_BRIMHAVEN_PASSAGE_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Fishing Platform from the south.", new WorldPoint(2779, 3265, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_FISHING_PLATFORM_COMPLETE), + // Managed to reach 22 Sailing at this stage with above spyglass + the Bonus Drinks + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Shelled Snail east of Witchaven.", new WorldPoint(2741, 3270, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_WRECK_BRIMHAVEN_PASSAGE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south east of Ardougne Zoo.", new WorldPoint(2648, 3244, 0), new WorldPoint(2743, 3215, 0), "Ardent Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_BRIMHAVEN_PASSAGE_COMPLETE) + )), + new ChartingSeaSection(7, "Strait of Khazard", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Tower of Life from the east.", new WorldPoint(2664, 3219, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_TWO_TOWERS_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of the trawler in Port Khazard. You can spot the next two chartable locations whilst following it.", new WorldPoint(2664, 3172, 0), new WorldPoint(2640, 3095, 0), "Ardent Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_STRAIT_OF_KHAZARD_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a rowboat off the west coast of Karamja near Port Khazard.", new WorldPoint(2702, 3151, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROWBOAT_PORT_KHAZARD_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a notice from General Khazard south east of Port Khazard.", new WorldPoint(2681, 3134, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SIGN_STRAIT_OF_KHAZARD_COMPLETE), new ChartingTaskDefinition(ChartingType.GENERIC, "Find what remains of Colbansea Island in the middle of the Strait of Khazard.", new WorldPoint(2720, 3103, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ROCK_STRAIT_OF_KHAZARD_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Yanille Chain and sample the contents. This will teleport you to Witchaven, so you may wish to skip drinking this until you want to return to land.", new WorldPoint(2674, 3103, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SLUG_BALM_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SLUG_BALM) + )), + // Move later as of diving or fine here? + new ChartingSeaSection(8, "Gu'tanoth Bay", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of an ogre ship in Gu'tanoth Bay.", new WorldPoint(2633, 3039, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_OGRE_BOAT_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Yanille and sample the contents. You will take half your max hp as damage.", new WorldPoint(2624, 3069, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_OGRE_PRAYER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_OGRE_PRAYER), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the island in Gu'tanoth Bay from the east.", new WorldPoint(2597, 3027, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_OGRE_ISLAND_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of the Yanille Chain.", new WorldPoint(2676, 3035, 0), "Ardent Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_GUTANOTH_BAY_COMPLETE, "The answer is 'Earth Impling'.", List.of(ItemID.II_CAPTURED_IMPLING_4)) + )), + new ChartingSeaSection(9, "Feldip Gulf", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an odd geological phenomenon in the middle of the Feldip Gulf.", new WorldPoint(2695, 2981, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_FELDIP_RIDGE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south east of Rantz's cave.", new WorldPoint(2645, 2974, 0), new WorldPoint(2749, 2971, 0), "Ardent Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_FELDIP_GULF_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of the Feldip Gulf and sample the contents. You'll take 5 damage over 5 damage ticks.", new WorldPoint(2691, 2940, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_POINT_PUNCH_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_POINT_PUNCH) + )), + new ChartingSeaSection(10, "Kharazi Strait", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents off the south western coast of the Kharazi Jungle.", new WorldPoint(2767, 2895, 0), new WorldPoint(2764, 2994, 0), "Ardent Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_KHARAZI_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a map south west of the Kharazi Jungle and copy it.", new WorldPoint(2798, 2891, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_MAP_BOTTLE_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a crashed glider north of Ape Atoll.", new WorldPoint(2781, 2815, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_GLIDER_KHARAZI_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some curious rapids west of Rock Island Prison.", new WorldPoint(2843, 2837, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_RAPIDLESS_RAPID_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Rock Island Prison and sample the contents.", new WorldPoint(2888, 2857, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_KHARAZI_COOLER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_KHARAZI_COOLER), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of a cave in the Kharazi Jungle from the south. Watch out for Stormy seas!", new WorldPoint(2945, 2878, 0), "Ardent Ocean", 24, VarbitID.SAILING_CHARTING_SPYGLASS_KHARAZI_CAVE_COMPLETE) + )), + // Oak master desired? Should have in reqs + new ChartingSeaSection(15, "The Storm Tempor", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of Tempoross Cove. Watch out for Stormy seas!", new WorldPoint(3001, 2847, 0), new WorldPoint(3058, 2833, 0), "Ardent Ocean", 24, VarbitID.SAILING_CHARTING_CURRENT_DUCK_STORM_TEMPOR_COMPLETE) + .withRecommended(List.of(new HasBoatResistanceRequirement(BoatResistanceType.STORM, true, 1))), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Desert Trout south of Tempoross Cove. Watch out for Stormy seas!", new WorldPoint(3033, 2796, 0), "Ardent Ocean", 24, VarbitID.SAILING_CHARTING_GENERIC_DESERT_TROUT_COMPLETE) + .withRecommended(List.of(new HasBoatResistanceRequirement(BoatResistanceType.STORM, true, 1))), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find something trying to leech power from the Storm Tempor. Watch out for Stormy seas!", new WorldPoint(3065, 2885, 0), "Ardent Ocean", 24, VarbitID.SAILING_CHARTING_GENERIC_LIGHTNING_ROD_COMPLETE) + .withRecommended(List.of(new HasBoatResistanceRequirement(BoatResistanceType.STORM, true, 1))), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Ruins of Unkah from north of the docks. Watch out for Stormy seas!", new WorldPoint(3144, 2854, 0), "Ardent Ocean", 24, VarbitID.SAILING_CHARTING_SPYGLASS_UNKAH_SHIP_COMPLETE) + .withRecommended(List.of(new HasBoatResistanceRequirement(BoatResistanceType.STORM, true, 1))) + )), + new ChartingSeaSection(12, "Arrow Passage", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of Crash Island.", new WorldPoint(2917, 2765, 0), "Ardent Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_ARROW_PASSAGE_COMPLETE, "The answer is 'Harralander potion (unf)'.", List.of(ItemID.HARRALANDERVIAL)), + + // Extra + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south of Crash Island.", new WorldPoint(2903, 2698, 0), new WorldPoint(2869, 2805, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_ARROW_PASSAGE_COMPLETE), + + + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some interesting aquatic life north west of Crash Island.", new WorldPoint(2881, 2750, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SEA_MONKEYS_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the temple on Ape Atoll from the east.", new WorldPoint(2828, 2785, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_MONKEY_TEMPLE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the eastern coast of Ape Atoll and sample the contents.", new WorldPoint(2816, 2733, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_BANANA_DAIQUIRI_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_BANANA_DAIQUIRI) + )), + new ChartingSeaSection(14, "The Simian Sea", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a makeshift flag near Cape Atoll.", new WorldPoint(2681, 2714, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ATOLL_CAPE_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Void Knights' Outpost from the north.", new WorldPoint(2654, 2682, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_VOID_KNIGHTS_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Void Knights' Outpost and sample the contents. You'll get poisoned for 4 damage.", new WorldPoint(2677, 2654, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SPINNERS_GASP_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SPINNERS_GASP), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of Cape Atoll.", new WorldPoint(2691, 2703, 0), new WorldPoint(2807, 2700, 0), "Ardent Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_THE_SIMIAN_SEA_COMPLETE) + )), + // Tele over here? + new ChartingSeaSection(45, "Gulf of Kourend", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north west of the Dibber.", new WorldPoint(1813, 3664, 0), new WorldPoint(1831, 3697, 0), "Western Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_GULF_OF_KOUREND_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of the Gulf of Kourend and sample the contents. Your inventory will be filled with ensouled heads.", new WorldPoint(1934, 3742, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_HEADLESS_UNICORNMAN_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_HEADLESS_UNICORNMAN), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Port Piscarilius from north of the Foodhall.", new WorldPoint(1846, 3769, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_PORT_PISCARILIUS_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find something in desperate need of repair north east of Port Piscarilius.", new WorldPoint(1847, 3796, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BROKEN_CRANE_COMPLETE) + )), + new ChartingSeaSection(47, "Pilgrims' Passage", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find evidence of an experiment on Chinchompa Island.", new WorldPoint(1887, 3424, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_CHINCHOMPA_TABLE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of Pilgrims' Passage and sample the contents.", new WorldPoint(1926, 3394, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_ROBERTS_PORT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ROBERTS_PORT), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of Chinchompa Island.", new WorldPoint(1871, 3430, 0), new WorldPoint(1791, 3414, 0), "Western Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_PILGRIMS_PASSAGE_COMPLETE) + )), + // 2k off of 36 after doing Tempor Tantrum + new ChartingSeaSection(71, "Bonus Currents", List.of( + // TODO: Integrate into other sections? + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of the Lum Lagoon.", new WorldPoint(3209, 3134, 0), new WorldPoint(3158, 3020, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_LUMBRIDGE_BASIN_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Kharidian Bandit Camp.", new WorldPoint(3145, 2963, 0), new WorldPoint(3049, 2962, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_KHARIDIAN_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south of the small island in the Bay of Sarim.", new WorldPoint(3082, 3201, 0), new WorldPoint(3033, 3152, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_FAIRY_RING_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents at the mouth of the River Amja south of Musa Point.", new WorldPoint(2890, 3121, 0), new WorldPoint(2967, 3065, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_MUSA_POINT_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Makeover Mage's home.", new WorldPoint(2902, 3317, 0), new WorldPoint(2872, 3273, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_RIMMINGTON_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south of Lacerta Falls.", new WorldPoint(1384, 3465, 0), new WorldPoint(1492, 3448, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_GREAT_SOUND_COMPLETE), new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Kharidian Bandit Camp.", new WorldPoint(3145, 2963, 0), new WorldPoint(3049, 2962, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_KHARIDIAN_SEA_COMPLETE), + + // TODO: Remove as part of quest? + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Obelisk of Water.", new WorldPoint(2835, 3417, 0), new WorldPoint(2802, 3322, 0), "", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_CATHERBY_BAY_COMPLETE) + )), + + // North sea segment + // Teleport to Port Pisc + new ChartingSeaSection(54, "Vagabonds Rest", List.of( + // Extra + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the Dibber.", new WorldPoint(1851, 3668, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_GULF_OF_KOUREND_COMPLETE, "The answer is 2 'Malicious ash'.", List.of(ItemID.MALICIOUS_ASHES)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the east of the Hosidian Sea.", new WorldPoint(1969, 3597, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_HOSIDIAN_SEA_COMPLETE, "The answer is 'Potato', 'Potato cactus'.", List.of(ItemID.POTATO, ItemID.CACTUS_POTATO)), + + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a crate of discarded goods north of Drumstick Isle. Be careful to spot it just outside the crystal water if you don't have an adamant keel.", new WorldPoint(2133, 3589, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_HUNTER_OUTFITS_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Buccaneers' Haven and sample the contents.", new WorldPoint(2079, 3655, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SEA_SPRAY_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SEA_SPRAY), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a half-built ship west of Buccaneers' Haven. It is surrounded by krakens so be careful!", new WorldPoint(2026, 3669, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_HALF_BUILT_SHIP_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of Buccaneers' Haven.", new WorldPoint(2018, 3705, 0), "Western Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_VAGABONDS_REST_COMPLETE, "The answer is 'Double eye patch'.", List.of(ItemID.DOUBLE_EYE_PATCH)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Buccaneers' Haven from the north.", new WorldPoint(2101, 3702, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_VAGABONDS_REST_COMPLETE) + )), + new ChartingSeaSection(55, "Moonshadow", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south west of Lunar Isle.", new WorldPoint(2044, 3792, 0), "Western Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_MOONSHADOW_COMPLETE, "The answer is 'Bucket helm (g)'.", List.of(ItemID.BUCKET_HELM_GOLD)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate south west of Lunar Isle and sample the contents.", new WorldPoint(2030, 3829, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_LUNARSHINE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_LUNARSHINE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of Pirates' Cove.", new WorldPoint(2122, 3796, 0), new WorldPoint(2167, 3682, 0), "Western Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_MOONSHADOW_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Lunar Longship south west of Pirates' Cove.", new WorldPoint(2170, 3773, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_LUNAR_WRECK_COMPLETE) + )), + new ChartingSeaSection(61, "Lunar Bay", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north east of Pirates' Cove.", new WorldPoint(2221, 3833, 0), "Northern Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_LUNAR_BAY_COMPLETE, "The answer is 'Torstol'.", List.of(ItemID.TORSTOL)), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south of the Astral Altar on Lunar Isle.", new WorldPoint(2159, 3849, 0), new WorldPoint(2202, 3799, 0), "Northern Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_LUNAR_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find evidence of some strong magical spells east of Lunar Isle.", new WorldPoint(2225, 3892, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_MAGIC_WARDS_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the pirate galleon docked at Lunar Isle from the east.", new WorldPoint(2160, 3901, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_LUNAR_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Lunar Isle docks and sample the contents. Reverse into the pier to reach it. Drinking it will send you to a random lunar teleport location.", new WorldPoint(2142, 3874, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_EXILES_WELCOME_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_EXILES_WELCOME) + )), + + // Teleport to Fortis + new ChartingSeaSection(48, "Litus Lucis", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents east of the Twilight Temple.", new WorldPoint(1721, 3237, 0), new WorldPoint(1785, 3197, 0), "Western Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_LITUS_LUCIS_COMPLETE), + // Extra + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the south of Crabclaw Bay.", new WorldPoint(1681, 3380, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_CRABCLAW_BAY_COMPLETE, "The answer is 1 silver ore, 1 chisel, 1 uncut jade, 1 ring mould, 1 cosmic rune, 3 air runes.", List.of(ItemID.SILVER_ORE, ItemID.CHISEL, ItemID.UNCUT_JADE, ItemID.RING_MOULD, ItemID.COSMICRUNE, ItemID.AIRRUNE)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of Port Roberts.", new WorldPoint(1880, 3372, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_PILGRIMS_PASSAGE_COMPLETE, "The answer is 'Sandstone (2kg)', 'Sandstone (1kg)', 'Sandstone (10kg)'.", List.of(ItemID.ENAKH_SANDSTONE_SMALL, ItemID.ENAKH_SANDSTONE_TINY, ItemID.ENAKH_SANDSTONE_LARGE)), + + // TODO: Maybe have suggestion to hold on to drink for bonus drinks bit? + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of Litus Lucis and sample the contents. You will be sent to Port Sarim when you drink it.", new WorldPoint(1783, 3252, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SEA_SHANDY_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SEA_SHANDY), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the Fortis Colosseum.", new WorldPoint(1821, 3166, 0), "Western Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_LITUS_LUCIS_COMPLETE, "The answer is 'Dark bow tie'.", List.of(ItemID.TUXEDO_BOWTIE)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a strange corpse north east of Civitas illa Fortis.", new WorldPoint(1871, 3177, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_KRAKEN_SKELETON_COMPLETE) + )), + new ChartingSeaSection(51, "Crystal Sea", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Port Roberts from the south.", new WorldPoint(1886, 3266, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_CRYSTAL_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the visitors book for the Port Roberts jail.", new WorldPoint(1890, 3271, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_JAIL_BOOK_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents east of Port Roberts.", new WorldPoint(1920, 3296, 0), new WorldPoint(2059, 3299, 0), "Western Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_CRYSTAL_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of the Crystal Sea and sample the contents.", new WorldPoint(2008, 3261, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SNAKE_GRAVY_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SNAKE_GRAVY), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an elven shipwreck in the middle of the Crystal Sea.", new WorldPoint(1980, 3232, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ELVEN_SHIP_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of the Crystal Sea.", new WorldPoint(1979, 3211, 0), "Western Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_CRYSTAL_SEA_COMPLETE, "The answer is 'Butterfly jar'.", List.of(ItemID.BUTTERFLY_JAR)) + )), + new ChartingSeaSection(37, "Western Gate", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents east of Minotaurs' Rest.", new WorldPoint(1978, 3106, 0), new WorldPoint(1951, 3046, 0), "Shrouded Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_WESTERN_GATE_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of the Western Gate.", new WorldPoint(2041, 3023, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_WESTERN_GATE_COMPLETE, "The answer is 'Black flowers'.", List.of(ItemID.FLOWERS_WATERFALL_QUEST_BLACK)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of the Western Gate and sample the contents.", new WorldPoint(1993, 2972, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_MANGO_GIN_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_MANGO_GIN), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some interesting sea life in the middle of the Western Gate.", new WorldPoint(1996, 2947, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SNAKE_EGGS_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find evidence of the Sharhai east of Vatrachos Island.", new WorldPoint(1947, 2985, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SHARHAIS_PURSE_COMPLETE) + )), + new ChartingSeaSection(24, "Fortis Bay", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a nest on Vatrachos Island.", new WorldPoint(1896, 2994, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SEAGULL_NEST_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of Vatrachos Island.", new WorldPoint(1898, 3048, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_FORTIS_BAY_COMPLETE, "The answer is 'Stripy feather'.", List.of(ItemID.HUNTING_STRIPY_BIRD_FEATHER)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Fortis Colosseum from the south.", new WorldPoint(1823, 3046, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_FORTIS_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north east of Stonecutter Outpost.", new WorldPoint(1779, 2988, 0), new WorldPoint(1900, 2984, 0), "Shrouded Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_FORTIS_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate east of Stonecutter Outpost and sample the contents.", new WorldPoint(1826, 2957, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_ALCO_SOL_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ALCO_SOL) + )), + new ChartingSeaSection(25, "Aureum Coast", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of Vatrachos Island.", new WorldPoint(1889, 2882, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_AUREUM_COAST_COMPLETE, "The answer is 1 Equa leaves, 1 Batta tin, 2 Tomato, 1 Cheese, 1 Dwellberries, 1 Onion, 1 Cabbage, 1 Gianne dough.", List.of(ItemID.EQUA_LEAVES, ItemID.BATTA_TIN, ItemID.TOMATO, ItemID.CHEESE, ItemID.DWELLBERRIES, ItemID.ONION, ItemID.CABBAGE, ItemID.GIANNE_DOUGH)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Counterweight north west of Deepfin Point.", new WorldPoint(1845, 2824, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_WRECK_WEIGHT_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of the Aureum Coast and sample the contents. This will teleport you to the middle of the Abyss when drunk! Hold off drinking it until you're ready to leave.", new WorldPoint(1762, 2854, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_PORTAL_PERRY_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_PORTAL_PERRY), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the south eastern temple in the Avium Savannah from the south.", new WorldPoint(1737, 2907, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_AUREUM_COAST_COMPLETE) + )), + new ChartingSeaSection(26, "Wyrm's Waters", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth east of the Shimmering Atoll.", new WorldPoint(1711, 2818, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_WYRMS_WATERS_COMPLETE, "The answer is 'Lime'.", List.of(ItemID.LIME)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Colossal Wyrm Remains from the south.", new WorldPoint(1634, 2883, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_WYRMS_WATERS_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Shimmering Atoll and sample the contents.", new WorldPoint(1570, 2808, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_CONGRATULATION_WINE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_CONGRATULATION_WINE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents within the Shimmering Atoll.", new WorldPoint(1543, 2785, 0), new WorldPoint(1583, 2773, 0), "Shrouded Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_WYRMS_WATERS_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an interesting book on the Shimmering Atoll.", new WorldPoint(1593, 2755, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ATOLL_DICTIONARY_COMPLETE) + )), + new ChartingSeaSection(36, "Sapphire Sea", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Crown Jewel from the east.", new WorldPoint(1796, 2664, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_SAPPHIRE_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of the Crown Jewel.", new WorldPoint(1745, 2662, 0), new WorldPoint(1695, 2662, 0), "Shrouded Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_SAPPHIRE_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of the Crown Jewel.", new WorldPoint(1762, 2611, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SAPPHIRE_SEA_COMPLETE, "The answer is 'Vial', 'Coconut milk', 'Toadflax', Yew roots'.", List.of(ItemID.VIAL_EMPTY, ItemID.VIAL_COCONUT_MILK, ItemID.TOADFLAX, ItemID.YEW_ROOTS)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some odd sea life in the middle of the Sapphire Sea.", new WorldPoint(1762, 2580, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SEA_SAPPHIRES_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate where three waters meet in the Sapphire Sea and sample the contents.", new WorldPoint(1675, 2478, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_COMP_KVASS_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_COMP_KVASS) + )), + new ChartingSeaSection(41, "Misty Sea", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near some shipwrecks in the Misty Sea and sample the contents.", new WorldPoint(1561, 2655, 0), "Sunset Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_MYSTERY_CIDER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_MYSTERY_CIDER), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some discarded fishing equipment in the middle of the Misty Sea.", new WorldPoint(1439, 2716, 0), "Sunset Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_FISHING_NETS_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the south west of the Misty Sea.", new WorldPoint(1322, 2628, 0), "Sunset Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_MISTY_SEA_COMPLETE, "The answer is `Bob's blue shirt`, `Bob's purple shirt`.", List.of(ItemID.TRAIL_BOB_SHIRT_BLUE, ItemID.TRAIL_BOB_SHIRT_PURPLE)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Mistrock from the south.", new WorldPoint(1387, 2840, 0), "Sunset Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_MISTY_SEA_COMPLETE) + )), + new ChartingSeaSection(40, "Sunset Bay", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Mistrock and sample the contents.", new WorldPoint(1426, 2865, 0), "Sunset Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_DRUNK_IMPLING_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_DRUNK_IMPLING), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a wrecked shiplike thing south of Villa Lucens.", new WorldPoint(1448, 2896, 0), "Sunset Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_PROP_WRECK_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of the Colossal Wyrm Remains.", new WorldPoint(1575, 2942, 0), "Sunset Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SUNSET_BAY_COMPLETE, "The answer is 'Ring mould'.", List.of(ItemID.RING_MOULD)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Sunset Coast from the west.", new WorldPoint(1470, 2980, 0), "Sunset Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_SUNSET_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents at the mouth of the River Varla. You should use a a raft to get in, or reverse in with a skiff.", new WorldPoint(1422, 3046, 0), new WorldPoint(1387, 3148, 0), "Sunset Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_SUNSET_BAY_COMPLETE) + )), + new ChartingSeaSection(42, "Dusk's Maw", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the Darkmoon Ravine.", new WorldPoint(1314, 2931, 0), "Sunset Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_DUSKS_MAW_COMPLETE, "The answer is 'Tarromin'.", List.of(ItemID.TARROMIN)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a collapsed cave on a small island south west of the Tlati Rainforest.", new WorldPoint(1232, 3005, 0), "Sunset Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_CRAB_HOLE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the Darkmoon Ravine.", new WorldPoint(1259, 2876, 0), new WorldPoint(1104, 2900, 0), "Sunset Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_DUSKS_MAW_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the far west of Dusk's Maw and sample the contents.", new WorldPoint(1050, 2886, 0), "Sunset Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SAILING_CAT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SAILING_CAT) + )), + // Sunset Ocean fully charted with Dusk's Maw! + + // Pandemonium return? + new ChartingSeaSection(13, "Menaphite Sea", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some collected sand on an island west of Menaphos.", new WorldPoint(3143, 2770, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SAND_PIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the pyramid in Menaphos from the west.", new WorldPoint(3145, 2734, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_MENAPHOS_PYRAMID_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of the Menaphite Sea.", new WorldPoint(3044, 2722, 0), "Ardent Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_MENAPHITE_SEA_COMPLETE, "The answer is 'Sandwich lady bottom'.", List.of(ItemID.SANDWICH_LADY_BOTTOM)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Menaphos and sample the contents.", new WorldPoint(3190, 2706, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_CROCODILE_TEARS_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_CROCODILE_TEARS), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north of the island south of Menaphos.", new WorldPoint(3185, 2654, 0), new WorldPoint(3146, 2599, 0), "Ardent Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_MENAPHITE_SEA_COMPLETE) + )), + new ChartingSeaSection(20, "Bay of Elidinis", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a damaged golem east of Menaphos.", new WorldPoint(3243, 2702, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_GOLEM_CORPSE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents to the south west of the Elid Delta.", new WorldPoint(3248, 2703, 0), new WorldPoint(3275, 2748, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_BAY_OF_ELIDINIS_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the south east of the Bay of Elidinis.", new WorldPoint(3338, 2622, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_BAY_OF_ELIDINIS_COMPLETE, "The answer is 'Charcoal'.", List.of(ItemID.CHARCOAL)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate south of Menaphos and sample the contents.", new WorldPoint(3239, 2598, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_LIFE_WATER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_LIFE_WATER), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Abalone Cliffs from the north east.", new WorldPoint(3154, 2548, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_CONCH_MOUNTAIN_COMPLETE) + )), + new ChartingSeaSection(16, "Turtle Belt", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a treasure chest south east of Dognose Island.", new WorldPoint(3075, 2601, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_TREASURE_CHEST_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the surrounding sea from Dognose Island.", new WorldPoint(3050, 2656, 0), "Unquiet Ocean", 40, VarbitID.SAILING_CHARTING_SPYGLASS_DOGNOSE_ISLAND_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Dognose Island and sample the contents.", new WorldPoint(3046, 2665, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_DOGNOSE_DRAUGHT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_DOGNOSE_DRAUGHT), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south west of the remote island in the Turtle Belt.", new WorldPoint(2947, 2584, 0), new WorldPoint(2969, 2610, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_TURTLE_BELT_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of the Turtle Belt.", new WorldPoint(3014, 2556, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_TURTLE_BELT_COMPLETE, "The answer is 'Papaya fruit'.", List.of(ItemID.PAPAYA)) + )), + new ChartingSeaSection(18, "Red Reef", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north east of Red Rock.", new WorldPoint(2902, 2548, 0), new WorldPoint(2906, 2494, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_RED_REEF_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the corpse of a wayward shifter on a small island south of Red Rock.", new WorldPoint(2804, 2460, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_DEAD_SHIFTER_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of Red Rock.", new WorldPoint(2788, 2548, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_RED_REEF_COMPLETE, "The answer is 10 watermelons.", List.of(ItemID.WATERMELON)) + , new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Red Rock and sample the contents.", new WorldPoint(2778, 2523, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_REDDEST_RUM_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_REDDEST_RUM), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents south of the pest-filled island near the Void Knights' Outpost.", new WorldPoint(2665, 2560, 0), new WorldPoint(2654, 2610, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_PEST_ISLAND_COMPLETE) + )), + new ChartingSeaSection(19, "Anglerfish's Light", List.of( + // Extra + new ChartingTaskDefinition(ChartingType.WEATHER, "[Bonus] Help the meteorologist document the local weather on a small island south of Last Light.", new WorldPoint(2864, 2311, 0), new WorldPoint(2789, 2193, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_ANGLERFISHS_LIGHT_COMPLETE), + + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Last Light from the east.", new WorldPoint(2895, 2326, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_ANGLERFISHS_LIGHTHOUSE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Last Light and sample the contents.", new WorldPoint(2840, 2280, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_LIGHT_DARK_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_LIGHT_DARK), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of Anglerfish's Light.", new WorldPoint(2766, 2382, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_ANGLERFISHS_LIGHT_COMPLETE, "The answer is 'Barley'.", List.of(ItemID.BARLEY)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an odd light south west of Last Light.", new WorldPoint(2719, 2296, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_LARGE_LIGHT_COMPLETE) + )), + new ChartingSeaSection(23, "The Lonely Sea", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the far south of the Lonely Sea.", new WorldPoint(2528, 2149, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_THE_LONELY_SEA_COMPLETE, "The answer is 'Swamp weed'.", List.of(ItemID.DORGESH_SWAMP_WEED)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near some shipwrecks in the Lonely Sea and sample the contents.", new WorldPoint(2522, 2248, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_ALONE_AT_SEA_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ALONE_AT_SEA), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some dragon scales on Charred Island.", new WorldPoint(2634, 2392, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_DRAGON_SCALES_COMPLETE), + // Goes to Isle of Bones. + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of Charred Island.", new WorldPoint(2624, 2415, 0), new WorldPoint(2534, 2515, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_THE_LONELY_SEA_COMPLETE) + )), + new ChartingSeaSection(31, "The Skullhorde", List.of( + // Takes you towards the crate so is first + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Balanced Ballast south west of the Void Knights' Outpost.", new WorldPoint(2587, 2593, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_PEST_SHIPWRECK_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south west of the Isle of Bones.", new WorldPoint(2460, 2449, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_THE_SKULLHORDE_COMPLETE, "The answer is 'Fedora'.", List.of(ItemID.FEDORA)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of the Skullhorde and sample the contents. A very hard-hitting troll will spawn, so protect from melee is recommended!", new WorldPoint(2387, 2477, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_FISH_STOUTIER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_FISH_STOUTIER), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of the Isle of Bones.", new WorldPoint(2488, 2530, 0), new WorldPoint(2367, 2521, 0), "Shrouded Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_THE_SKULLHORDE_COMPLETE) + )), + new ChartingSeaSection(27, "Mythic Sea", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate west of the Void Knights' Outpost and sample the contents.", new WorldPoint(2556, 2664, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_MYTHS_MIXER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_MYTHS_MIXER), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an abandoned camp on Anglers' Retreat. Watch out for Fetid waters!", new WorldPoint(2476, 2707, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_ABANDONED_CAMP_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents east of Anglers' Retreat. Watch out for Fetid waters!", new WorldPoint(2495, 2708, 0), new WorldPoint(2533, 2736, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_CURRENT_DUCK_MYTHIC_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of the Myths' Guild. Watch out for Fetid waters!", new WorldPoint(2446, 2784, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_MYTHIC_SEA_COMPLETE, "The answer is 'Cabbage', 'Onion', 'Tomato'.", List.of(ItemID.CABBAGE, ItemID.ONION, ItemID.TOMATO)) + )), + // Should be 41 by here + // Corsair Cove level 40 start? Also get innoculation to start? + new ChartingSeaSection(11, "Oo'glog Channel", List.of( + // TODO: Allow section reqs to be added. Innoculation is one + // TODO: Add innoculation requirement + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south west of Corsair Cove.", new WorldPoint(2529, 2829, 0), "Ardent Ocean", 40, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_OOGLOG_CHANNEL_COMPLETE, "The answer is 'coal'.", List.of(ItemID.COAL)), + + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate south of Corsair Cove and sample the contents.", new WorldPoint(2595, 2787, 0), "Ardent Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_OOGLUG_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_OOGLUG), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the bananaless boat west of Ape Atoll.", new WorldPoint(2693, 2793, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BANANA_BOAT_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the throne in Corsair Cove from the east.", new WorldPoint(2605, 2867, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_COVE_THRONE_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the corpse of a sea monster north east of Corsair Cove.", new WorldPoint(2634, 2882, 0), "Ardent Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_DEAD_MONSTER_COMPLETE) + )), + // Ardent ocean charted with Oo'glog channel! Should indicate to go cash in for exp + new ChartingSeaSection(28, "Breakbone Strait", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Tear of the Soul and sample the contents. Watch out for Fetid waters!", new WorldPoint(2334, 2781, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_DRINK_CRATE_GOLDLESS_ALE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_GOLDLESS_ALE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Myths' Guild from the west. Watch out for Fetid waters!", new WorldPoint(2429, 2852, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_SPYGLASS_MYTHS_GUILD_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a chest of equipment north of the Myths' Guild. Watch out for Fetid waters!", new WorldPoint(2460, 2881, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_GENERIC_ARMY_ATTIRE_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents off the eastern coast of the Isle of Souls. Watch out for Fetid waters!", new WorldPoint(2340, 2896, 0), new WorldPoint(2456, 2895, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_CURRENT_DUCK_BREAKBONE_STRAIT_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))) + )), + new ChartingSeaSection(29, "Backwater", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the north eastern coast of the Isle of Souls and sample the contents. Watch out for Fetid waters!", new WorldPoint(2318, 2966, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_DRINK_CRATE_DESTRUCTORS_COCKTAIL_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_DESTRUCTORS_COCKTAIL) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the western coast of the Feldip Hills and sample the contents. It will poison and disease you.", new WorldPoint(2476, 2969, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_DRINK_CRATE_ZOGRES_KISS_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ZOGRES_KISS) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of Jiggig. Watch out for Fetid waters!", new WorldPoint(2469, 3006, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_BACKWATER_COMPLETE, "The answer is 'Grimy kwuarm'.", List.of(ItemID.UNIDENTIFIED_KWUARM)) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Chompy Marsh from the south. Watch out for Fetid waters!", new WorldPoint(2399, 3027, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_SPYGLASS_TOAD_PONDS_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents at the mouth of the River Dougne west of Chompy Marsh. Watch out for Fetid waters!", new WorldPoint(2318, 3057, 0), new WorldPoint(2233, 3028, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_CURRENT_DUCK_BACKWATER_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some interesting coral south east of the Poison Waste. Watch out for Fetid waters!", new WorldPoint(2300, 3043, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_GENERIC_DISEASED_CORAL_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))) + )), + new ChartingSeaSection(30, "Zul-Egil", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate south of the poison waste and sample the contents. It will give you venom.", new WorldPoint(2279, 3036, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_DRINK_CRATE_ZUL_RYE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ZUL_RYE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Zul-Andra from the south. Watch out for Fetid waters!", new WorldPoint(2199, 3036, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_SPYGLASS_ZUL_ANDRA_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a toxic hazard in the middle of Zul-Egil. Watch out for Fetid waters!", new WorldPoint(2165, 3030, 0), "Shrouded Ocean", 40, VarbitID.SAILING_CHARTING_GENERIC_POISON_SPILL_COMPLETE) + .withRequirements(List.of(new HasBoatResistanceRequirement(BoatResistanceType.FETID_WATER, true, 1))), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the ruined tower on the Isle of Souls from the south.", new WorldPoint(2128, 2983, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_RUINED_TOWER_COMPLETE) + )), + + new ChartingSeaSection(72, "Bonus Dives", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the east of the Hosidian Sea.", new WorldPoint(1969, 3597, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_HOSIDIAN_SEA_COMPLETE, "The answer is 'Potato', 'Potato cactus'.", List.of(ItemID.POTATO, ItemID.CACTUS_POTATO)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the south of Crabclaw Bay.", new WorldPoint(1681, 3380, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_CRABCLAW_BAY_COMPLETE, "The answer is 1 silver ore, 1 chisel, 1 uncut jade, 1 ring mould, 1 cosmic rune, 3 air runes.", List.of(ItemID.SILVER_ORE, ItemID.CHISEL, ItemID.UNCUT_JADE, ItemID.RING_MOULD, ItemID.COSMICRUNE, ItemID.AIRRUNE)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of Port Roberts.", new WorldPoint(1880, 3372, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_PILGRIMS_PASSAGE_COMPLETE, "The answer is 'Sandstone (2kg)', 'Sandstone (1kg)', 'Sandstone (10kg)'.", List.of(ItemID.ENAKH_SANDSTONE_SMALL, ItemID.ENAKH_SANDSTONE_TINY, ItemID.ENAKH_SANDSTONE_LARGE)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the Dibber.", new WorldPoint(1851, 3668, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_GULF_OF_KOUREND_COMPLETE, "The answer is 2 'Malicious ash'.", List.of(ItemID.MALICIOUS_ASHES)), + + // TODO: Decide how to add these to other earlier parts of helper, or assume this can be its own route at end? + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south west of the Pandemonium.", new WorldPoint(2988, 2949, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_KHARIDIAN_SEA_COMPLETE, "The answer is 'Willow stock'.", List.of(ItemID.XBOWS_CROSSBOW_STOCK_WILLOW)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of Mudskipper Point.", new WorldPoint(2979, 3085, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_MUDSKIPPER_SOUND_COMPLETE, "The answer is 'Pie dish', 'Pot of flour', 'Cooking apple'.", List.of(ItemID.PIEDISH, ItemID.POT_FLOUR, ItemID.COOKING_APPLE)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of the entrance to Taverley Dungeon.", new WorldPoint(2873, 3397, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_CATHERBY_BAY_COMPLETE, "The answer is 'Iron med helm', 'Bronze chainbody'.", List.of(ItemID.IRON_MED_HELM, ItemID.BRONZE_CHAINBODY)), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south west of Brimhaven.", new WorldPoint(2757, 3138, 0), "", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_STRAIT_OF_KHAZARD_COMPLETE, "The answer is 5 'Cabbage seeds'.", List.of(ItemID.CABBAGE_SEED)) + )), + new ChartingSeaSection(21, "Tortugan Sea", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a notable small shell north east of the Great Conch.", new WorldPoint(3284, 2514, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_MINOR_CONCH_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the coast of the Great Conch from the north east.", new WorldPoint(3261, 2506, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_TORTUGAN_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents to the east of the eastern pier on the Great Conch.", new WorldPoint(3279, 2463, 0), new WorldPoint(3403, 2509, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_TORTUGAN_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth east of the Great Conch.", new WorldPoint(3282, 2445, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_GREAT_CONCH_COMPLETE, "The answer is 'Ashes'.", List.of(ItemID.ASHES)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a strange apple tree somewhere on the Great Conch.", new WorldPoint(3216, 2466, 0), "Unquiet Ocean", 45, VarbitID.SAILING_CHARTING_GENERIC_CRAB_APPLE_COMPLETE), + + // Extra + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather at the south east tip of Cape Conch.", new WorldPoint(3321, 2327, 0), new WorldPoint(3177, 2456, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_GREAT_CONCH_COMPLETE) + + )), + new ChartingSeaSection(22, "Pearl Bank", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents to the south west of the Little Pearl.", new WorldPoint(3337, 2179, 0), new WorldPoint(3414, 2134, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_PEARL_BANK_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a ship in a bottle south of the Little Pearl.", new WorldPoint(3375, 2135, 0), "Unquiet Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SHIP_BOTTLE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate south west of the Little Pearl and sample the contents. This will spawn an Angry Tortugan (level 81).", new WorldPoint(3301, 2146, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_POSSIBLE_ALBUMEN_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_POSSIBLE_ALBUMEN), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the south of the Pearl Bank.", new WorldPoint(3276, 2130, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_PEARL_BANK_COMPLETE, "The answer is 2 woad leaf, 2 onion.", List.of(ItemID.WOADLEAF, ItemID.ONION)) + )), + new ChartingSeaSection(17, "Sea of Shells", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents near the Summer Shore docks on the Great Conch.", new WorldPoint(3204, 2367, 0), new WorldPoint(3279, 2398, 0), "Unquiet Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_GREAT_CONCH_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Summer Shore from the cliffs above it on the Great Conch.", new WorldPoint(3187, 2430, 0), "Unquiet Ocean", 45, VarbitID.SAILING_CHARTING_SPYGLASS_TORTUGAN_VILLAGE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the western coast of the Great Conch and sample the contents. This will teleport you to your POH portal when drank, so hold off drinking until you're ready!", new WorldPoint(3098, 2458, 0), "Unquiet Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_WAY_HOME_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_WAY_HOME), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the nest of a fearless bird on the Onyx Crest.", new WorldPoint(2963, 2264, 0), "Unquiet Ocean", 47, VarbitID.SAILING_CHARTING_GENERIC_BIRD_NEST_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of the Onyx Crest.", new WorldPoint(2963, 2203, 0), "Unquiet Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SEA_OF_SHELLS_COMPLETE, "The answer is 'Nose peg'.", List.of(ItemID.SLAYER_NOSEPEG)) + )), + // Up to here, level 52 (5k to 53). Claimed seas from Chartin' Charles. Done all quests. easy, medium, and 3x hard storm barracuda + new ChartingSeaSection(34, "Barracuda Belt", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of a Barracuda ship north east of Sunbleak Island.", new WorldPoint(2281, 2447, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BARRACUDA_PORTION_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the bank boat in the Barracuda Belt and sample the contents.", new WorldPoint(2282, 2506, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_BARRACUDA_BREW_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_BARRACUDA_BREW), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the bank boat in the Barracuda Belt.", new WorldPoint(2276, 2598, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_BARRACUDA_HQ_COMPLETE, "The answer is 'Vial', 'Avantoe', 'Snape grass', 'Caviar'.", List.of(ItemID.VIAL_EMPTY, ItemID.AVANTOE, ItemID.SNAPE_GRASS, ItemID.BRUT_CAVIAR)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a spool of Barracuda grade rope east of Wintumber Island.", new WorldPoint(2149, 2615, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_BARRACUDA_ROPE_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south east of Wintumber Island.", new WorldPoint(2082, 2590, 0), new WorldPoint(2154, 2440, 0), "Shrouded Ocean", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_BARRACUDA_BELT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an odd statue on Wintumber Island.", new WorldPoint(2066, 2608, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_CRAB_STATUE_COMPLETE) + )), + new ChartingSeaSection(35, "The Everdeep", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an odd shadow south of Deepfin Point.", new WorldPoint(1976, 2680, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SCARY_SHADOW_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the far south east of the Everdeep.", new WorldPoint(1942, 2650, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_THE_EVERDEEP_COMPLETE, "The answer is 'Plank'.", List.of(ItemID.WOODPLANK)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Deepfin Point from the south.", new WorldPoint(1943, 2737, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_THE_EVERDEEP_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate west of Deepfin Point and sample the contents.", new WorldPoint(1854, 2771, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_CRYSTAL_VODKA_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_CRYSTAL_VODKA), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on the western coast of Deepfin Point.", new WorldPoint(1928, 2791, 0), new WorldPoint(1895, 2665, 0), "Shrouded Ocean", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_THE_EVERDEEP_COMPLETE) + )), + new ChartingSeaSection(33, "Soul Bay", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of the Isle of Souls.", new WorldPoint(2012, 2874, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SOUL_BAY_COMPLETE, "The answer is 'Dwellberries'.", List.of(ItemID.DWELLBERRIES)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the western coast of the Isle of Souls and sample the contents.", new WorldPoint(2086, 2882, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_CREATORS_COCKTAIL_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_CREATORS_COCKTAIL), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents off the western coast of the Isle of Souls.", new WorldPoint(2080, 2859, 0), new WorldPoint(2102, 2816, 0), "Shrouded Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_SOUL_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some interesting sea life in the middle of Soul Bay.", new WorldPoint(2089, 2797, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_LARGE_JELLYFISH_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on the south western coast of the Isle of Souls.", new WorldPoint(2140, 2806, 0), new WorldPoint(2021, 2681, 0), "Shrouded Ocean", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_SOUL_BAY_COMPLETE) + )), + new ChartingSeaSection(59, "Fremennik Strait", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate north west of the Piscatoris Fishing Colony and sample the contents.", new WorldPoint(2273, 3745, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_FISHTONGUE_TONIC_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_FISHTONGUE_TONIC), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of Neitiznot.", new WorldPoint(2305, 3795, 0), new WorldPoint(2340, 3875, 0), "Northern Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_FREMENNIK_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on the southern coast of Neitiznot.", new WorldPoint(2341, 3790, 0), new WorldPoint(2426, 3841, 0), "Northern Ocean", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_FREMENNIK_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the towers on the Fremennik Isles from the south.", new WorldPoint(2366, 3777, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_FREMENNIK_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a discarded book south of Jatizso.", new WorldPoint(2383, 3769, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_NEDS_BOOK_COMPLETE) + )), + new ChartingSeaSection(57, "Grandroot Bay", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents in the River Crannmor.", new WorldPoint(2369, 3507, 0), new WorldPoint(2404, 3591, 0), "Northern Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_GRANDROOT_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of Grandroot Bay and sample the contents.", new WorldPoint(2453, 3597, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_TOAD_CIDER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_TOAD_CIDER), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the roots of the Grand Tree in Grandroot Bay.", new WorldPoint(2479, 3546, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_TREE_ROOTS_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather west of the Barbarian Outpost.", new WorldPoint(2498, 3546, 0), new WorldPoint(2439, 3625, 0), "Northern Ocean", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_GRANDROOT_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of the Barbarian Outpost.", new WorldPoint(2513, 3571, 0), "Northern Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_GRANDROOT_BAY_COMPLETE, "The answer is 'Raw cod'.", List.of(ItemID.RAW_COD)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the lighthouse on Rower's Arm from the south.", new WorldPoint(2504, 3612, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_GRANDROOT_BAY_COMPLETE) + )), + new ChartingSeaSection(56, "Fremensund", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north of Rower's Arm.", new WorldPoint(2561, 3626, 0), new WorldPoint(2484, 3628, 0), "Northern Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_FREMENSUND_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of Waterbirth Island.", new WorldPoint(2518, 3690, 0), "Northern Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_FREMENSUND_COMPLETE, "The answer is 'Kharyll teleport'.", List.of(ItemID.TABLET_KHARYLL)), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south west of Rellekka.", new WorldPoint(2594, 3644, 0), new WorldPoint(2513, 3738, 0), "Northern Ocean", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_FREMENSUND_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some suspicious eyes west of Rellekka.", new WorldPoint(2587, 3657, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_CRAB_EYES_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the market in Rellekka from the north.", new WorldPoint(2636, 3707, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_FREMENSUND_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate north of Rellekka and sample the contents.", new WorldPoint(2689, 3732, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_FISHIER_STOUT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_FISHIER_STOUT) + )), + new ChartingSeaSection(73, "Bonus Weather", List.of( + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather at the south east tip of Cape Conch.", new WorldPoint(3321, 2327, 0), new WorldPoint(3177, 2456, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_GREAT_CONCH_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south of Last Light.", new WorldPoint(2864, 2311, 0), new WorldPoint(2789, 2193, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_ANGLERFISHS_LIGHT_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south of Crash Island.", new WorldPoint(2903, 2698, 0), new WorldPoint(2869, 2805, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_ARROW_PASSAGE_COMPLETE), + + // Added up to this point to other sections + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island east of the Kharazi Jungle. Watch out for Stormy seas!", new WorldPoint(2979, 2905, 0), new WorldPoint(3062, 2862, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_STORM_TEMPOR_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island west of Rimmington.", new WorldPoint(2912, 3213, 0), new WorldPoint(2840, 3315, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_RIMMINGTON_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north of Port Khazard.", new WorldPoint(2656, 3195, 0), new WorldPoint(2742, 3100, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_STRAIT_OF_KHAZARD_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather north east of Rantz's cave.", new WorldPoint(2638, 3009, 0), new WorldPoint(2618, 2879, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_GUTANOTH_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on the Isle of Bones.", new WorldPoint(2542, 2541, 0), new WorldPoint(2732, 2641, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_THE_SKULLHORDE_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on the eastern coast of the Isle of Souls. Watch out for Fetid waters!", new WorldPoint(2335, 2921, 0), new WorldPoint(2473, 2725, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_BREAKBONE_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather south east of Stonecutter Outpost.", new WorldPoint(1779, 2940, 0), new WorldPoint(1802, 2808, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_AUREUM_COAST_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north of Laguna Aurorae.", new WorldPoint(1188, 2822, 0), new WorldPoint(1184, 3000, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_DUSKS_MAW_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north of Civitas illa Fortis.", new WorldPoint(1714, 3193, 0), new WorldPoint(1895, 3178, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_LITUS_LUCIS_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south of the Woodcutting Guild.", new WorldPoint(1651, 3461, 0), new WorldPoint(1579, 3365, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_CRABCLAW_BAY_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south east of the Tithe Farm.", new WorldPoint(1867, 3458, 0), new WorldPoint(1852, 3532, 0), "", 57, VarbitID.SAILING_CHARTING_WEATHER_TROLL_PILGRIMS_PASSAGE_COMPLETE) + )), + new ChartingSeaSection(32, "Sea of Souls", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the surrounding sea from the Tear of the Soul. Watch out for Fetid waters!", new WorldPoint(2342, 2768, 0), "Shrouded Ocean", 61, VarbitID.SAILING_CHARTING_SPYGLASS_CAPE_SOUL_ISLAND_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Soul Searcher south west of the Tear of the Soul.", new WorldPoint(2289, 2712, 0), "Shrouded Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_SOUL_SHIPWRECK_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the southern coast of the Isle of Souls and sample the contents.", new WorldPoint(2221, 2765, 0), "Shrouded Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_SOUL_BOTTLE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SOUL_BOTTLE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth east of the shipyard in the Sea of Souls.", new WorldPoint(2118, 2716, 0), "Shrouded Ocean", 38, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SEA_OF_SOULS_COMPLETE, "The answer is 'Common tench'.", List.of(ItemID.AERIAL_FISHING_COMMON_TENCH)) + )), + new ChartingSeaSection(49, "Porth Neigwl", List.of( + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island west of Zul-Andra. Watch out for Crystal-flecked waters!", new WorldPoint(2149, 3068, 0), new WorldPoint(2242, 2986, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_WEATHER_TROLL_ZUL_EGIL_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of Port Tyras. Watch out for Crystal-flecked waters!", new WorldPoint(2113, 3123, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_PORTH_NEIGWL_COMPLETE, "The answer is 2 Calquat keg, 1 Ale yeast, 1 Oak roots, 2 barley malt.", List.of(ItemID.CALQUAT_FRUIT_KEG_EMPTY, ItemID.ALE_YEAST, ItemID.OAK_ROOTS, ItemID.BARLEY_MALT)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some lost cargo south east of Lledrith Island. Watch out for Crystal-flecked waters!", new WorldPoint(2118, 3158, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_GENERIC_HALBERD_POLES_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island west of the Tyras Camp. Watch out for Crystal-flecked waters!", new WorldPoint(2118, 3159, 0), new WorldPoint(2028, 3220, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_WEATHER_TROLL_PORTH_NEIGWL_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of Lledrith Island. Watch out for Crystal-flecked waters!", new WorldPoint(2071, 3186, 0), new WorldPoint(2161, 3150, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_CURRENT_DUCK_PORTH_NEIGWL_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Tyras Camp from the west. Watch out for Crystal-flecked waters!", new WorldPoint(2160, 3155, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_SPYGLASS_TYRAS_CAMP_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate off the western coast of Isafdar and sample the contents. Watch out for Crystal-flecked waters!", new WorldPoint(2161, 3203, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_DRINK_CRATE_CRYSTAL_WATER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_CRYSTAL_WATER) + )), + new ChartingSeaSection(50, "Tirannwn Bight", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a deadly trap west of the Iorwerth Camp. Watch out for Crystal-flecked waters!", new WorldPoint(2157, 3274, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_GENERIC_RIVER_MINE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents at the mouth of the Afon Ganol west of the Iorwerth Camp. Watch out for Crystal-flecked waters!", new WorldPoint(2165, 3260, 0), new WorldPoint(2163, 3367, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_CURRENT_DUCK_TIRANNWN_BIGHT_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Prifddinas' western gates from the south west. Watch out for Crystal-flecked waters!", new WorldPoint(2163, 3318, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_SPYGLASS_PRIFDDINAS_GATE_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of the Tirannwn Bight. Watch out for Crystal-flecked waters!", new WorldPoint(2120, 3345, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_TIRANNWN_BIGHT_COMPLETE, "The answer is 'Soiled page'.", List.of(ItemID.SOILED_PAGE)), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather south west of Mynydd. Watch out for Crystal-flecked waters!", new WorldPoint(2130, 3395, 0), new WorldPoint(2041, 3328, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_WEATHER_TROLL_TIRANNWN_BIGHT_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Mynydd and sample the contents. Watch out for Crystal-flecked waters!", new WorldPoint(2120, 3418, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_DRINK_CRATE_ELVEN_WINE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ELVEN_WINE) + )), + new ChartingSeaSection(52, "Porth Gwenith", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Ynysdail and sample the contents. Watch out for Crystal-flecked waters!", new WorldPoint(2206, 3484, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_DRINK_CRATE_UNDERGROUND_MILK_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_UNDERGROUND_MILK), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an unusual boat north of Gwenith. Watch out for Crystal-flecked waters!", new WorldPoint(2210, 3445, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_GENERIC_CRYSTAL_DINGHY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north of Gwenith. Watch out for Crystal-flecked waters!", new WorldPoint(2220, 3429, 0), new WorldPoint(2205, 3462, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_CURRENT_DUCK_PORTH_GWENITH_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of Gorlah. Watch out for Crystal-flecked waters!", new WorldPoint(2283, 3459, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_PORTH_GWENITH_COMPLETE, "The answer is 'Thatch spar dense'.", List.of(ItemID.THATCHING_SPAR_DENSE)), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north west of Eagles' Peak. Watch out for Crystal-flecked waters!", new WorldPoint(2280, 3518, 0), new WorldPoint(2118, 3587, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_WEATHER_TROLL_VAGABONDS_REST_COMPLETE) + )), + new ChartingSeaSection(53, "Piscatoris Sea", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south west of Kraken Cove. Watch out for Crystal-flecked waters!", new WorldPoint(2260, 3589, 0), "Western Ocean", 66, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_PISCATORIS_SEA_COMPLETE, "The answer is 'Gold ore'.", List.of(ItemID.GOLD_ORE)), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find evidence of kraken activity south west of the Piscatoris Fishing Colony.", new WorldPoint(2300, 3662, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_KRAKEN_SLIME_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the Piscatoris Fishing Colony from the north west.", new WorldPoint(2303, 3700, 0), "Western Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_FISHING_COLONY_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate north west of the Piscatoris Fishing Colony and sample the contents.", new WorldPoint(2248, 3744, 0), "Western Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_MONKFISH_STOUT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_MONKFISH_STOUT) + )), + new ChartingSeaSection(38, "Rainbow Reef", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Sunbleak Island and sample the contents. Watch out for Tangled kelp!", new WorldPoint(2205, 2303, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_DRINK_CRATE_PLATINUM_RUM_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_PLATINUM_RUM), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of Rainbow Reef. Watch out for Tangled kelp!", new WorldPoint(2250, 2315, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_RAINBOW_REEF_COMPLETE, "The answer is 'Bucket of sap', 'Raw slimy eel'.", List.of(ItemID.ICS_LITTLE_SAP_BUCKET, ItemID.MORT_SLIMEY_EEL)), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north of Rainbow's End. Watch out for Tangled kelp!", new WorldPoint(2335, 2286, 0), new WorldPoint(2330, 2285, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_CURRENT_DUCK_RAINBOW_REEF_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a lost friend on Rainbow's End. Watch out for Tangled kelp!", new WorldPoint(2336, 2267, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_GENERIC_GNOME_BALL_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a rowboat to the far south of Rainbow's End. Watch out for Tangled kelp!", new WorldPoint(2334, 2118, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_GENERIC_EDGE_BOAT_COMPLETE) + )), + // Reached here + new ChartingSeaSection(39, "Southern Expanse", List.of( + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth west of Sunbleak Island. Watch out for Tangled kelp!", new WorldPoint(2053, 2315, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SOUTHERN_EXPANSE_COMPLETE, "The answer is 'Ghrazi rapier'.", List.of(ItemID.GHRAZI_RAPIER)), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small islands [ sic ] east of the Isle of Serpents. Watch out for Tangled kelp!", new WorldPoint(1881, 2445, 0), new WorldPoint(1813, 2191, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_WEATHER_TROLL_SOUTHERN_EXPANSE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the Isle of Serpents and sample the contents. Watch out for Tangled kelp!", new WorldPoint(1822, 2439, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_DRINK_CRATE_PUZZLERS_POTEEN_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_PUZZLERS_POTEEN), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a useful sign to the far south of the Isle of Serpents. Watch out for Tangled kelp!", new WorldPoint(1829, 2139, 0), "Shrouded Ocean", 72, VarbitID.SAILING_CHARTING_GENERIC_NOTHING_SIGN_COMPLETE) + )), + new ChartingSeaSection(58, "V's Belt", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of V's Belt and sample the contents.", new WorldPoint(2474, 3798, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_BLUE_LAGOON_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_BLUE_LAGOON), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north east of Jatizso.", new WorldPoint(2428, 3831, 0), new WorldPoint(2520, 3771, 0), "Northern Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_VS_BELT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an informative sign on a small island south of Miscellania.", new WorldPoint(2528, 3818, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_GENERIC_GHRIM_SIGN_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the castle on Miscellania from the west.", new WorldPoint(2477, 3862, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_VS_BELT_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north west of Miscellania. Watch out for Icy seas!", new WorldPoint(2505, 3892, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_VS_BELT_COMPLETE, "The answer is 'Bronze limbs'.", List.of(ItemID.XBOWS_CROSSBOW_LIMBS_BRONZE)) + )), + new ChartingSeaSection(60, "Idestia Strait", List.of( + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north of Etceteria. Watch out for Icy seas!", new WorldPoint(2600, 3908, 0), new WorldPoint(2625, 3795, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_WEATHER_TROLL_IDESTIA_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the castle on Etceteria from the east.", new WorldPoint(2636, 3874, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_IDESTIA_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate south east of Etceteria and sample the contents.", new WorldPoint(2651, 3811, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_ENDLESS_NIGHT_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_ENDLESS_NIGHT), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of the hunter area near Trollweiss Mountain.", new WorldPoint(2695, 3828, 0), new WorldPoint(2716, 3757, 0), "Northern Ocean", 22, VarbitID.SAILING_CHARTING_CURRENT_DUCK_IDESTIA_STRAIT_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a hunter free haven on a small island west of Trollweiss Mountain. Watch out for Icy seas!", new WorldPoint(2726, 3855, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_KEBBIT_BURROW_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth south of the Iceberg. Watch out for Icy seas!", new WorldPoint(2664, 3954, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_IDESTIA_STRAIT_COMPLETE, "The answer is 'Onion'.", List.of(ItemID.ONION)) // TODO + )), + new ChartingSeaSection(66, "Weissmere", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the middle of Weissmere and sample the contents. Watch out for Icy seas!", new WorldPoint(2775, 3935, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_DWARVERN_WIZARD_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_DWARVERN_WIZARD), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the large rock formations in Weissmere from their centre. Watch out for Icy seas!", new WorldPoint(2781, 3987, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_WEISSMERE_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north west of Weiss. Watch out for Icy seas!", new WorldPoint(2816, 3975, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_WEISSMERE_COMPLETE, "The answer is 'Dragon bitter'.", List.of(ItemID.DRAGON_BITTER)), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north west of Weiss. Watch out for Icy seas!", new WorldPoint(2833, 3960, 0), new WorldPoint(2801, 3887, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_CURRENT_DUCK_WEISSMERE_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some missing mountaineering equipment north of Trollweiss Mountain. Watch out for Icy seas!", new WorldPoint(2783, 3882, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_DISCARDED_SLED_COMPLETE) + )), + new ChartingSeaSection(69, "Weiss Melt", List.of( + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north of Weiss. Watch out for Icy seas!", new WorldPoint(2880, 3985, 0), new WorldPoint(2919, 4058, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_CURRENT_DUCK_WEISS_MELT_COMPLETE), // end: 2919, 4058, 0 + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a failing boat north east of Weiss. Watch out for Icy seas!", new WorldPoint(2902, 3965, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_ICE_SHIP_COMPLETE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north of the Frozen Waste Plateau. Watch out for Icy seas!", new WorldPoint(2951, 3962, 0), new WorldPoint(2861, 4021, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_WEATHER_TROLL_WEISS_MELT_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the agility course in the Wilderness from the north. Watch out for Icy seas!", new WorldPoint(2990, 3971, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_WEISS_MELT_COMPLETE, "The answer is ''.", List.of()), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate north of Grimstone and sample the contents. Watch out for Icy seas!", new WorldPoint(2912, 4154, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_WEISS_MELTWATER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_WEISS_MELTWATER) + )), + new ChartingSeaSection(68, "Shiverwake Expanse", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Grimstone from the west. Watch out for Icy seas!", new WorldPoint(2879, 4078, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_SHIVERWAKE_EXPANSE_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the east of the Shiverwake Expanse. Watch out for Icy seas!", new WorldPoint(2824, 4092, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_SHIVERWAKE_EXPANSE_COMPLETE, "The answer is 'Royal crown'.", List.of(ItemID.ROYAL_CROWN)), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on the large rock formations in Weissmere. Watch out for Icy seas!", new WorldPoint(2793, 4020, 0), new WorldPoint(2784, 4108, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_WEATHER_TROLL_SHIVERWAKE_EXPANSE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near the large rock formations in Weissmere and sample the contents. Watch out for Icy seas! You will have your attack, strength, and defence drained and be attacked by 'A corpse (level-103)'.", new WorldPoint(2785, 4046, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_CORPSE_REVIVER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_CORPSE_REVIVER), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find evidence of spying north east of the Iceberg. Watch out for Icy seas!", new WorldPoint(2709, 4124, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_KGP_PERISCOPE_COMPLETE) + )), + new ChartingSeaSection(67, "Stoneheart Sea", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the far north of the Stoneheart Sea and sample the contents. Watch out for Icy seas! Drinking it will send you to the icy hunter area.", new WorldPoint(2612, 4146, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_KGP_MARTINI_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_KGP_MARTINI), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the KGP training area from the west. Watch out for Icy seas!", new WorldPoint(2620, 4059, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_STONEHEART_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the Island of Stone. Watch out for Icy seas!", new WorldPoint(2475, 4133, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_STONEHEART_SEA_COMPLETE, "The answer is 'Rain bow'.", List.of(ItemID.RAIN_BOW)), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island south west of the Island of Stone. Watch out for Icy seas!", new WorldPoint(2447, 3995, 0), new WorldPoint(2371, 4058, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_WEATHER_TROLL_STONEHEART_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents west of the Island of Stone. Watch out for Icy seas!", new WorldPoint(2433, 4006, 0), new WorldPoint(2459, 3996, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_CURRENT_DUCK_STONEHEART_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find a shark corpse on a small island north west of Etceteria. Watch out for Icy seas!", new WorldPoint(2587, 3919, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_SHARK_CORPSE_COMPLETE) + )), + new ChartingSeaSection(65, "Kannski Tides", List.of( + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the waters of the Fremennik Isles and sample the contents.", new WorldPoint(2359, 3878, 0), "Northern Ocean", 12, VarbitID.SAILING_CHARTING_DRINK_CRATE_BLACK_LOBSTER_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_BLACK_LOBSTER), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find the wreck of the Fearless Fremennik south west of the Island of Stone. Watch out for Icy seas!", new WorldPoint(2426, 3961, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_FEARLESS_FREMENNIK_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the ice trolls of the Fremennik Isles from the north. Watch out for Icy seas!", new WorldPoint(2351, 3904, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_KANNSKI_TIDES_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the Fremennik Isles. Watch out for Icy seas!", new WorldPoint(2357, 3977, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_KANNSKI_TIDES_COMPLETE, "The answer is 1 'Vial of blood', 1 'Cadantine', 1 'Wine of zamorak'.", List.of(ItemID.VIAL_BLOOD, ItemID.CADANTINE, ItemID.WINE_OF_ZAMORAK)), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north of the western cave on the Fremennik Isles. Watch out for Icy seas!", new WorldPoint(2316, 3903, 0), new WorldPoint(2277, 4028, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_CURRENT_DUCK_KANNSKI_TIDES_COMPLETE) + )), + new ChartingSeaSection(63, "Lunar Sea", List.of( + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of Ungael from the west. Watch out for Icy seas!", new WorldPoint(2237, 4064, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_LUNAR_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some cleaning supplies north of Lunar Isle. Watch out for Icy seas!", new WorldPoint(2144, 4067, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_LUNAR_BROOMS_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the far north of the Lunar Sea and sample the contents. Watch out for Icy seas!", new WorldPoint(2113, 4142, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_SUQAH_COLA_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SUQAH_COLA), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the north west of the Lunar Sea. Watch out for Icy seas!", new WorldPoint(2061, 4118, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_LUNAR_SEA_COMPLETE, "The answer is 'Clockwork'.", List.of(ItemID.POH_CLOCKWORK_MECHANISM)) + )), + new ChartingSeaSection(62, "Winter's Edge", List.of( + new ChartingTaskDefinition(ChartingType.GENERIC, "Find an odd dead plant on a small island north west of Lunar Isle. Watch out for Icy seas!", new WorldPoint(2083, 3953, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_DEAD_LIVID_COMPLETE), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the town on Lunar Isle from the west.", new WorldPoint(2051, 3913, 0), "Northern Ocean", 1, VarbitID.SAILING_CHARTING_SPYGLASS_WINTERS_EDGE_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth in the middle of Winter's Edge. Watch out for Icy seas!", new WorldPoint(1970, 3966, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_WINTERS_EDGE_COMPLETE, "The answer is 'needle'.", List.of(ItemID.NEEDLE)), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate near Brittle Isle and sample the contents. Watch out for Icy seas! You will take major damage.", new WorldPoint(1898, 4069, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_SOUL_JUICE_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_SOUL_JUICE), + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on a small island north of the River of Souls. Watch out for Icy seas!", new WorldPoint(1817, 3965, 0), new WorldPoint(1869, 3829, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_WEATHER_TROLL_WINTERS_EDGE_COMPLETE), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents north east of the River of Souls. Watch out for Icy seas!", new WorldPoint(1866, 3911, 0), new WorldPoint(2054, 3889, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_CURRENT_DUCK_WINTERS_EDGE_COMPLETE) + )), + + new ChartingSeaSection(64, "Everwinter Sea", List.of( + new ChartingTaskDefinition(ChartingType.WEATHER, "Help the meteorologist document the local weather on Brittle Isle. Watch out for Icy seas!", new WorldPoint(1959, 4065, 0), new WorldPoint(2041, 4124, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_WEATHER_TROLL_EVERWINTER_SEA_COMPLETE), + new ChartingTaskDefinition(ChartingType.DIVING, "With help from a mermaid guide, document the water depth north of the River of Souls. Watch out for Icy seas!", new WorldPoint(1823, 4018, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_MERMAID_GUIDE_EVERWINTER_SEA_COMPLETE, "The answer is 'Shield left half'.", List.of(ItemID.DRAGONSHIELD_A)), + new ChartingTaskDefinition(ChartingType.SPYGLASS, "Use your spyglass to get a good view of the area north of the River of Souls from the east. Watch out for Icy seas!", new WorldPoint(1793, 3978, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_SPYGLASS_RIVER_OF_SOULS_COMPLETE), + new ChartingTaskDefinition(ChartingType.GENERIC, "Find some odd eggs north east of the Fishing Hamlet. Watch out for Icy seas! You will be sent to the desert when you drink it.", new WorldPoint(1762, 4005, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_GENERIC_TOAD_SPAWN_COMPLETE), + new ChartingTaskDefinition(ChartingType.CRATE, "Find a Sealed crate in the far north of the Everwinter Sea and sample the contents. Watch out for Icy seas!", new WorldPoint(1757, 4150, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_DRINK_CRATE_WINTER_SUN_COMPLETE, ItemID.SAILING_CHARTING_DRINK_CRATE_WINTER_SUN), + new ChartingTaskDefinition(ChartingType.CURRENT, "Test the currents near the shipwrecks in the Everwinter Sea. Watch out for Icy seas!", new WorldPoint(1792, 4137, 0), new WorldPoint(1783, 4086, 0), "Northern Ocean", 78, VarbitID.SAILING_CHARTING_CURRENT_DUCK_EVERWINTER_SEA_COMPLETE) + )) + ); + + public static List getSections() + { + return SECTIONS; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingType.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingType.java new file mode 100644 index 00000000000..a4848a7b266 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/ChartingType.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting; + +import lombok.Getter; + +@Getter +public enum ChartingType +{ + GENERIC("Generic"), + SPYGLASS("Spyglass"), + CRATE("Crate"), + CURRENT("Current"), + DIVING("Diving"), + WEATHER("Weather"); + + private final String displayName; + + ChartingType(String displayName) + { + this.displayName = displayName; + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCaveTelescopeStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCaveTelescopeStep.java new file mode 100644 index 00000000000..2f66459c73c --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCaveTelescopeStep.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskInterface; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; +import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; +import lombok.Getter; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ObjectID; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + +@Getter +public class ChartingCaveTelescopeStep extends ConditionalStep implements ChartingTaskInterface +{ + private Requirement incompleteRequirement; + private Requirement canDoRequirement; + + public ChartingCaveTelescopeStep(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, + new ObjectStep(questHelper, ObjectID.PANDEMONIUM_CAVE_ENTRANCE, new WorldPoint(3045, 2997, 0), + "Enter the cave on the Pandemonium island."), + "[" + definition.getType().getDisplayName() + "] " + definition.getDescription() + ); + + ZoneRequirement inCaveZone = new ZoneRequirement(new Zone(12178)); + var useTelescopeStep = new ChartingTelescopeStep(questHelper, definition, requirements); + useTelescopeStep.setText(""); + addStep(inCaveZone, useTelescopeStep); + + setupSidebarRequirements(definition); + } + + private void setupSidebarRequirements(ChartingTaskDefinition definition) + { + var sailingRequirement = new SkillRequirement(Skill.SAILING, Math.max(1, definition.getLevel())); + var completedRequirement = new VarbitRequirement(definition.getVarbitId(), 1); + var levelNotMet = nor(sailingRequirement); + levelNotMet.setText("You need to meet level " + sailingRequirement.getRequiredLevel() + " Sailing."); + + conditionToHideInSidebar(completedRequirement); + conditionToFadeInSidebar(levelNotMet); + + canDoRequirement = and(new VarbitRequirement(definition.getVarbitId(), 0), sailingRequirement); + incompleteRequirement = new VarbitRequirement(definition.getVarbitId(), 0); + } + + @Override + public void setupRequiredAndRecommended(ChartingTaskDefinition definition) + { + // Not implemented in ConditionalStep. Not needed for this so won't bother + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCrateStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCrateStep.java new file mode 100644 index 00000000000..2acbeaf1410 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCrateStep.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + +public class ChartingCrateStep extends ChartingTaskObjectStep +{ + public ChartingCrateStep(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, ObjectID.SAILING_CHARTING_DRINK_CRATE, definition, requirements); + var crowbar = new ItemRequirement("Crowbar", ItemID.SAILING_CHARTING_CROWBAR); + addRequirement(crowbar); + var reqWithQuest = or(getFadeCondition(), new VarbitRequirement(VarbitID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES_COMPLETE, 0)); + reqWithQuest.setText(getFadeCondition().getDisplayText() + " You also require completion of the quest 'Prying Times'."); + conditionToFadeInSidebar(reqWithQuest); + + // Task is complete if varbit is 1 (already drank) OR player has the bottle item + var completedVarbit = new VarbitRequirement(definition.getVarbitId(), 1); + Requirement completionRequirement = completedVarbit; + + if (definition.getBottleItemId() != null) + { + var bottleItem = new ItemRequirement("Bottle", definition.getBottleItemId()); + bottleItem.alsoCheckBank(); + completionRequirement = or(completedVarbit, bottleItem); + } + + // Task can be done if: varbit is 0 (not completed via varbit) AND quest requirement met AND task not complete (via bottle) + var varbitNotComplete = new VarbitRequirement(definition.getVarbitId(), 0); + var taskNotComplete = not(completionRequirement); + canDoRequirement = and(varbitNotComplete, not(reqWithQuest), taskNotComplete); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCurrentStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCurrentStep.java new file mode 100644 index 00000000000..d5d56dda2b5 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingCurrentStep.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + +public class ChartingCurrentStep extends ChartingTaskObjectStep +{ + + public ChartingCurrentStep(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, ObjectID.SAILING_CHARTING_HINT_MARKER_DUCK, definition, requirements); + var duck = new ItemRequirement("Current duck", ItemID.SAILING_CHARTING_CURRENT_DUCK); + addRequirement(duck); + + var reqWithQuest = or(getFadeCondition(), new VarbitRequirement(VarbitID.CURRENT_AFFAIRS, 45, Operation.LESS)); + reqWithQuest.setText(getFadeCondition().getDisplayText() + " You also require completion of the quest 'Current Affairs'."); + conditionToFadeInSidebar(reqWithQuest); + canDoRequirement = and(new VarbitRequirement(definition.getVarbitId(), 0), not(reqWithQuest)); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingDivingStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingDivingStep.java new file mode 100644 index 00000000000..8b8c4112c56 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingDivingStep.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; + +public class ChartingDivingStep extends ChartingTaskNpcStep +{ + public ChartingDivingStep(QuestHelper questHelper, ChartingTaskDefinition definition, boolean showAnswer, Requirement... requirements) + { + super(questHelper, NpcID.SAILING_CHARTING_MERMAID_GUIDE_1, definition, showAnswer, requirements); + addAlternateNpcs(NpcID.SAILING_CHARTING_MERMAID_GUIDE_2, NpcID.SAILING_CHARTING_MERMAID_GUIDE_3, + NpcID.SAILING_CHARTING_MERMAID_GUIDE_4, NpcID.SAILING_CHARTING_MERMAID_GUIDE_5); + + addDialogStep("Can I dive to the sea floor with you?"); + + var medallionOfTheDeep = new ItemRequirement("Medallion of the deep", ItemID.MEDALLION_OF_THE_DEEP).equipped(); + var divingHelmet = new ItemRequirement("Fishbowl helmet", ItemID.HUNDRED_PIRATE_DIVING_HELMET).equipped(); + var divingApparatus = new ItemRequirement("Diving apparatus", ItemID.HUNDRED_PIRATE_DIVING_BACKPACK).equipped(); + var divingGear = new ItemRequirements(LogicType.AND, divingHelmet, divingApparatus); + var canBreathUnderwater = new ItemRequirements(LogicType.OR, "Diving helmet + apparatus OR medallion of the deep", medallionOfTheDeep, divingGear).equipped(); + addRequirement(canBreathUnderwater); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingGenericObjectStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingGenericObjectStep.java new file mode 100644 index 00000000000..1ba16f7b9ff --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingGenericObjectStep.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.api.GameObject; +import net.runelite.api.TileObject; + +// This is a lazy implementation where we fully trust the location of the object to only have one thing to work +public class ChartingGenericObjectStep extends ChartingTaskObjectStep +{ + public ChartingGenericObjectStep(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, -1, definition, requirements); + } + + @Override + protected void handleObjects(TileObject object) + { + if (!(object instanceof GameObject)) + { + return; + } + + setObjects(object); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingPuzzleWrapStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingPuzzleWrapStep.java new file mode 100644 index 00000000000..98acdc3aa09 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingPuzzleWrapStep.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskInterface; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.PuzzleWrapperStep; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.api.Skill; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + +public class ChartingPuzzleWrapStep extends PuzzleWrapperStep implements ChartingTaskInterface +{ + private final ChartingTaskInterface questStep; + + public ChartingPuzzleWrapStep(QuestHelper questHelper, QuestStep questStep, QuestStep noAnswerStep, ChartingTaskDefinition definition) + { + super(questHelper, questStep, noAnswerStep); + this.questStep = (ChartingTaskInterface) questStep; + + var sailingRequirement = new SkillRequirement(Skill.SAILING, Math.max(1, definition.getLevel())); + var levelNotMet = nor(sailingRequirement); + levelNotMet.setText("You need to meet level " + sailingRequirement.getRequiredLevel() + " Sailing."); + var completedRequirement = new VarbitRequirement(definition.getVarbitId(), 1); + + conditionToHideInSidebar(completedRequirement); + conditionToFadeInSidebar(levelNotMet); + } + + @Override + public Requirement getIncompleteRequirement() + { + return questStep.getIncompleteRequirement(); + } + + @Override + public Requirement getCanDoRequirement() + { + return questStep.getCanDoRequirement(); + } + + @Override + public void setupRequiredAndRecommended(ChartingTaskDefinition definition) + { + // Hopefully implemented in the wrapped step? + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskNpcStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskNpcStep.java new file mode 100644 index 00000000000..0bf8cd55f71 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskNpcStep.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskInterface; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; +import lombok.Getter; +import net.runelite.api.Skill; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + +@Getter +public class ChartingTaskNpcStep extends NpcStep implements ChartingTaskInterface +{ + private Requirement incompleteRequirement; + private Requirement canDoRequirement; + + ChartingTaskNpcStep(QuestHelper questHelper, int npcID, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, npcID, "[" + definition.getType().getDisplayName() + "] " + definition.getDescription() + " " + definition.getAnswerText(), requirements); + setupChartingDetails(definition); + } + + ChartingTaskNpcStep(QuestHelper questHelper, int npcID, ChartingTaskDefinition definition, boolean showAnswer, Requirement... requirements) + { + super(questHelper, npcID, "[" + definition.getType().getDisplayName() + "] " + definition.getDescription() + ((showAnswer) ? " " + definition.getAnswerText() : "") , requirements); + setupChartingDetails(definition); + } + + public void setupChartingDetails(ChartingTaskDefinition definition) + { + var point = definition.getWorldPoint(); + if (point != null) + { + setWorldPoint(point); + } + else + { + setHideWorldArrow(true); + setHideMinimapLines(true); + } + + var sailingRequirement = new SkillRequirement(Skill.SAILING, Math.max(1, definition.getLevel())); + addRequirement(sailingRequirement); + + // Additional reqs and recc + setupRequiredAndRecommended(definition); + + var completedRequirement = new VarbitRequirement(definition.getVarbitId(), 1); + var levelNotMet = nor(sailingRequirement); + levelNotMet.setText("You need to meet level " + sailingRequirement.getRequiredLevel() + " Sailing."); + conditionToHideInSidebar(completedRequirement); + conditionToFadeInSidebar(levelNotMet); + + canDoRequirement = and(new VarbitRequirement(definition.getVarbitId(), 0), sailingRequirement); + incompleteRequirement = new VarbitRequirement(definition.getVarbitId(), 0); + } + + @Override + public void setupRequiredAndRecommended(ChartingTaskDefinition definition) + { + // Additional reqs and recc + if (!definition.getAdditionalRequirements().isEmpty()) + { + addRequirement(definition.getAdditionalRequirements().toArray(new Requirement[0])); + } + if (!definition.getAdditionalRecommended().isEmpty()) + { + addRecommended(definition.getAdditionalRequirements()); + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskObjectStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskObjectStep.java new file mode 100644 index 00000000000..8af4bd4a3ac --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskObjectStep.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskInterface; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; +import lombok.Getter; +import net.runelite.api.Skill; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + +@Getter +public class ChartingTaskObjectStep extends ObjectStep implements ChartingTaskInterface +{ + private Requirement incompleteRequirement; + protected Requirement canDoRequirement; + + ChartingTaskObjectStep(QuestHelper questHelper, int objectID, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, objectID, "[" + definition.getType().getDisplayName() + "] " + definition.getDescription(), requirements); + setupChartingDetails(definition); + } + + public void setupChartingDetails(ChartingTaskDefinition definition) + { + var point = definition.getWorldPoint(); + if (point != null) + { + setWorldPoint(point); + } + else + { + setHideWorldArrow(true); + setHideMinimapLines(true); + } + + var sailingRequirement = new SkillRequirement(Skill.SAILING, Math.max(1, definition.getLevel())); + addRequirement(sailingRequirement); + + // Additional reqs and recc + setupRequiredAndRecommended(definition); + + var completedRequirement = new VarbitRequirement(definition.getVarbitId(), 1); + var levelNotMet = nor(sailingRequirement); + levelNotMet.setText("You need to meet level " + sailingRequirement.getRequiredLevel() + " Sailing."); + conditionToHideInSidebar(completedRequirement); + conditionToFadeInSidebar(levelNotMet); + + canDoRequirement = and(new VarbitRequirement(definition.getVarbitId(), 0), sailingRequirement); + incompleteRequirement = new VarbitRequirement(definition.getVarbitId(), 0); + } + + @Override + public void setupRequiredAndRecommended(ChartingTaskDefinition definition) + { + // Additional reqs and recc + if (!definition.getAdditionalRequirements().isEmpty()) + { + addRequirement(definition.getAdditionalRequirements().toArray(new Requirement[0])); + } + if (!definition.getAdditionalRecommended().isEmpty()) + { + addRecommended(definition.getAdditionalRecommended()); + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskStep.java new file mode 100644 index 00000000000..03e2b5bf212 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTaskStep.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingHelper; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskInterface; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import lombok.Getter; +import net.runelite.api.Skill; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + +@Getter +public final class ChartingTaskStep extends DetailedQuestStep implements ChartingTaskInterface +{ + private Requirement incompleteRequirement; + private Requirement canDoRequirement; + + public ChartingTaskStep(ChartingHelper helper, ChartingTaskDefinition definition) + { + super(helper, "[" + definition.getType().getDisplayName() + "] " + definition.getDescription()); + setupChartingDetails(definition); + } + + public void setupChartingDetails(ChartingTaskDefinition definition) + { + var point = definition.getWorldPoint(); + if (point != null) + { + setWorldPoint(point); + } + else + { + setHideWorldArrow(true); + setHideMinimapLines(true); + } + + var sailingRequirement = new SkillRequirement(Skill.SAILING, Math.max(1, definition.getLevel())); + addRequirement(sailingRequirement); + + var completedRequirement = new VarbitRequirement(definition.getVarbitId(), 1); + var levelNotMet = nor(sailingRequirement); + levelNotMet.setText("You need to meet level " + sailingRequirement.getRequiredLevel() + " Sailing."); + conditionToHideInSidebar(completedRequirement); + conditionToFadeInSidebar(levelNotMet); + + canDoRequirement = and(new VarbitRequirement(definition.getVarbitId(), 0), sailingRequirement); + incompleteRequirement = new VarbitRequirement(definition.getVarbitId(), 0); + } + + @Override + public void setupRequiredAndRecommended(ChartingTaskDefinition definition) + { + // Additional reqs and recc + if (!definition.getAdditionalRequirements().isEmpty()) + { + addRequirement(definition.getAdditionalRequirements().toArray(new Requirement[0])); + } + if (!definition.getAdditionalRecommended().isEmpty()) + { + addRecommended(definition.getAdditionalRequirements()); + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTelescopeStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTelescopeStep.java new file mode 100644 index 00000000000..bf2a9f56513 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingTelescopeStep.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.ObjectID; + +public class ChartingTelescopeStep extends ChartingTaskObjectStep +{ + public ChartingTelescopeStep(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, ObjectID.SAILING_CHARTING_HINT_MARKER_SPYGLASS, definition, requirements); + var spyglass = new ItemRequirement("Spyglass", ItemID.SAILING_CHARTING_SPYGLASS); + addRequirement(spyglass); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingWeatherStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingWeatherStep.java new file mode 100644 index 00000000000..c8e77aa44c8 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/activities/charting/steps/ChartingWeatherStep.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.steps; + +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskDefinition; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingTaskInterface; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import lombok.Getter; +import net.runelite.api.Skill; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + +@Getter +public class ChartingWeatherStep extends ConditionalStep implements ChartingTaskInterface +{ + private Requirement incompleteRequirement; + private Requirement canDoRequirement; + + // Steps + private ChartingTaskNpcStep talkToNpcStep; + private DetailedQuestStep measureWeatherStep; + private ChartingTaskNpcStep returnToNpcStep; + + // Requirements + private ItemRequirement weatherStationEmpty; + private ItemRequirement weatherStationFull; + + public ChartingWeatherStep(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + super(questHelper, new DetailedQuestStep(questHelper, "Loading weather charting task...")); + + setupRequirements(); + setupSteps(questHelper, definition, requirements); + addConditionalSteps(); + setupSidebarRequirements(definition); + addDialogStep("Can I help you with collecting weather data?"); + + setText("[" + definition.getType().getDisplayName() + "] " + definition.getDescription()); + } + + private void setupRequirements() + { + weatherStationEmpty = new ItemRequirement("Portable weather station", ItemID.SAILING_CHARTING_WEATHER_STATION_EMPTY); + weatherStationFull = new ItemRequirement("Data filled portable weather station", ItemID.SAILING_CHARTING_WEATHER_STATION_FULL); + } + + private void setupSteps(QuestHelper questHelper, ChartingTaskDefinition definition, Requirement... requirements) + { + talkToNpcStep = new ChartingTaskNpcStep(questHelper, NpcID.SAILING_CHARTING_WEATHER_TROLL, definition, requirements); + talkToNpcStep.setText("Talk to the Meaty Aura Logist to get a weather station."); + + measureWeatherStep = new DetailedQuestStep(questHelper, "Sail to the weather location and measure the winds.", weatherStationEmpty); + measureWeatherStep.setWorldPoint(definition.getSecondaryWorldPoint()); + + returnToNpcStep = new ChartingTaskNpcStep(questHelper, NpcID.SAILING_CHARTING_WEATHER_TROLL, definition, requirements); + returnToNpcStep.setText("Return to the Meaty Aura Logist with the full weather station."); + returnToNpcStep.addRequirement(weatherStationFull); + } + + public DetailedQuestStep getStepToUse() + { + if (getWeatherStationEmpty().check(client)) + { + return getMeasureWeatherStep(); + } + else if (getWeatherStationFull().check(client)) + { + return getReturnToNpcStep(); + } + else + { + return getTalkToNpcStep(); + } + } + + private void addConditionalSteps() + { + addStep(weatherStationFull, returnToNpcStep); + addStep(weatherStationEmpty, measureWeatherStep); + addStep(null, talkToNpcStep); + } + + private void setupSidebarRequirements(ChartingTaskDefinition definition) + { + var sailingRequirement = new SkillRequirement(Skill.SAILING, Math.max(1, definition.getLevel())); + var completedRequirement = new VarbitRequirement(definition.getVarbitId(), 1); + var levelNotMet = nor(sailingRequirement); + levelNotMet.setText("You need to meet level " + sailingRequirement.getRequiredLevel() + " Sailing."); + + conditionToHideInSidebar(completedRequirement); + conditionToFadeInSidebar(levelNotMet); + + canDoRequirement = and(new VarbitRequirement(definition.getVarbitId(), 0), sailingRequirement); + incompleteRequirement = new VarbitRequirement(definition.getVarbitId(), 0); + } + + @Override + public void setupRequiredAndRecommended(ChartingTaskDefinition definition) + { + // Should've been implemented in substeps. Needed if we used any reqs for blocking + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/barbariantraining/BarbarianTraining.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/barbariantraining/BarbarianTraining.java index 7041dcc9171..0179424eb5e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/barbariantraining/BarbarianTraining.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/barbariantraining/BarbarianTraining.java @@ -41,7 +41,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.runelite.RuneliteRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetTextRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -118,7 +117,7 @@ public Map loadSteps() // Fishing fishingSteps = new ConditionalStep(this, talkToOttoAboutFishing); fishingSteps.addStep(caughtBarbarianFish, talkToOttoAfterFish); - fishingSteps.addStep(and(taskedWithFishing, barbFishingRod.alsoCheckBank(questBank)), catchFish); + fishingSteps.addStep(and(taskedWithFishing, barbFishingRod.alsoCheckBank()), catchFish); fishingSteps.addStep(taskedWithFishing, searchBed); fishingSteps.setLockingCondition(finishedFishing); @@ -127,7 +126,7 @@ public Map loadSteps() herbloreSteps.addStep(madePotion, talkToOttoAfterPotion); herbloreSteps.addStep(and(taskedWithHerblore, roe), useRoeOnAttackPotion); herbloreSteps.addStep(and(taskedWithHerblore, fish), dissectFish); - herbloreSteps.addStep(and(taskedWithHerblore, barbFishingRod.alsoCheckBank(questBank)), fishForHerblore); + herbloreSteps.addStep(and(taskedWithHerblore, barbFishingRod.alsoCheckBank()), fishForHerblore); herbloreSteps.addStep(taskedWithHerblore, getBarbRodForHerblore); herbloreSteps.setLockingCondition(finishedHerblore); @@ -157,8 +156,8 @@ public Map loadSteps() firemakingSteps.setLockingCondition(finishedFiremaking); pyreSteps = new ConditionalStep(this, talkToOttoAboutPyre); - pyreSteps.addStep(LogicHelper.and(sacrificedRemains), talkToOttoAfterPyre); - pyreSteps.addStep(and(taskedWithPyre, chewedBones.alsoCheckBank(questBank)), useLogOnPyre); + pyreSteps.addStep(and(sacrificedRemains), talkToOttoAfterPyre); + pyreSteps.addStep(and(taskedWithPyre, chewedBones.alsoCheckBank()), useLogOnPyre); pyreSteps.addStep(and(taskedWithPyre, chewedBonesNearby), pickupChewedBones); pyreSteps.addStep(and(taskedWithPyre, inAncientCavernArrivalRoom), enterWhirlpool); pyreSteps.addStep(and(taskedWithPyre, inAncientCavernF0), goUpToMithrilDragons); @@ -179,14 +178,14 @@ public Map loadSteps() spearAndHastaeSteps.setLockingCondition(finishedHasta); ConditionalStep allSteps = new ConditionalStep(this, fishingSteps); - allSteps.addStep(LogicHelper.nor(finishedFishing), fishingSteps); - allSteps.addStep(LogicHelper.nor(finishedHerblore), herbloreSteps); - allSteps.addStep(LogicHelper.nor(finishedHarpoon), harpoonSteps); - allSteps.addStep(LogicHelper.nor(finishedSeedPlanting), seedSteps); - allSteps.addStep(LogicHelper.nor(finishedPotSmashing), potSmashingSteps); - allSteps.addStep(LogicHelper.nor(finishedFiremaking), firemakingSteps); + allSteps.addStep(nor(finishedFishing), fishingSteps); + allSteps.addStep(nor(finishedHerblore), herbloreSteps); + allSteps.addStep(nor(finishedHarpoon), harpoonSteps); + allSteps.addStep(nor(finishedSeedPlanting), seedSteps); + allSteps.addStep(nor(finishedPotSmashing), potSmashingSteps); + allSteps.addStep(nor(finishedFiremaking), firemakingSteps); allSteps.addStep(nand(finishedSpear, finishedHasta), spearAndHastaeSteps); - allSteps.addStep(LogicHelper.nor(finishedPyre), pyreSteps); + allSteps.addStep(nor(finishedPyre), pyreSteps); allSteps.addDialogSteps("Let's talk about my training.", "I seek more knowledge."); allSteps.setCheckAllChildStepsOnListenerCall(true); @@ -632,7 +631,7 @@ public void setupSteps() talkToOttoAboutHastae.addDialogStep("Tell me more about the use of spears."); makeBronzeHasta = new ObjectStep(this, ObjectID.BRUT_ANVIL, new WorldPoint(2502, 3485, 0), "Make a bronze hasta on the anvil south of Otto.", bronzeBar, logs, hammer); - makeBronzeHasta.addWidgetHighlightWithItemIdRequirement(270, 15, 11421, true); + makeBronzeHasta.addWidgetHighlightWithItemIdRequirement(270, 15, ItemID.BRUT_BRONZE_SPEAR_DUMMY, true); talkToOttoAfterMakingHasta = new NpcStep(this, NpcID.BRUT_OTTO, new WorldPoint(2500, 3488, 0), "Talk to Otto in his hut north-west of Baxtorian Falls."); talkToOttoAfterMakingHasta.addDialogStep("I've created a hasta!"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/curseoftheemptylord/CurseOfTheEmptyLord.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/curseoftheemptylord/CurseOfTheEmptyLord.java index fa4876ad22f..8880cc50aae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/curseoftheemptylord/CurseOfTheEmptyLord.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/curseoftheemptylord/CurseOfTheEmptyLord.java @@ -43,13 +43,13 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.*; public class CurseOfTheEmptyLord extends BasicQuestHelper { - private final int PATH_VARBIT = 815; private int currentPath = 0; //Items Required @@ -105,7 +105,7 @@ public void onVarbitChanged(VarbitChanged varbitChanged) { if (currentPath == 0) { - int newPath = client.getVarbitValue(PATH_VARBIT); + int newPath = client.getVarbitValue(VarbitID.SECRET_GHOST_RANDOMISER); if (newPath != 0) { currentPath = newPath; @@ -122,26 +122,26 @@ protected void setupRequirements() ghostspeakItems = new ItemRequirement("Ghostspeak amulet or Morytania legs 2 or better", ItemID.AMULET_OF_GHOSTSPEAK, 1, true).isNotConsumed(); ghostspeakItems.addAlternates(ItemID.MORYTANIA_LEGS_MEDIUM, ItemID.MORYTANIA_LEGS_HARD, ItemID.MORYTANIA_LEGS_ELITE); - knife = new ItemRequirement("Knife", ItemID.KNIFE).showConditioned(new VarbitRequirement(PATH_VARBIT, 3)).isNotConsumed(); + knife = new ItemRequirement("Knife", ItemID.KNIFE).showConditioned(new VarbitRequirement(VarbitID.SECRET_GHOST_RANDOMISER, 3)).isNotConsumed(); } public void setupConditions() { - talkedToValdez = new VarbitRequirement(816, 1); - talkedToRennard = new VarbitRequirement(817, 1); - talkedToKharrim = new VarbitRequirement(818, 1); - talkedToLennissa = new VarbitRequirement(819, 1); - talkedToDhalak = new VarbitRequirement(820, 1); - talkedToViggora = new VarbitRequirement(821, 1); + talkedToValdez = new VarbitRequirement(VarbitID.SECRET_GHOST1_BACKSTORY, 1); + talkedToRennard = new VarbitRequirement(VarbitID.SECRET_GHOST2_BACKSTORY, 1); + talkedToKharrim = new VarbitRequirement(VarbitID.SECRET_GHOST3_BACKSTORY, 1); + talkedToLennissa = new VarbitRequirement(VarbitID.SECRET_GHOST4_BACKSTORY, 1); + talkedToDhalak = new VarbitRequirement(VarbitID.SECRET_GHOST5_BACKSTORY, 1); + talkedToViggora = new VarbitRequirement(VarbitID.SECRET_GHOST6_BACKSTORY, 1); inEdgevilleDungeon = new ZoneRequirement(edgevilleDungeon); inRoguesCastle = new ZoneRequirement(roguesCastleFirstFloor); inSlayerTower = new ZoneRequirement(slayerTowerFirstFloor); inEdgevilleMonastery = new ZoneRequirement(edgevilleMonastery); inPartyRoom = new ZoneRequirement(partyRoom); - onPath1 = new VarbitRequirement(PATH_VARBIT, 1); - onPath2 = new VarbitRequirement(PATH_VARBIT, 2); - onPath3 = new VarbitRequirement(PATH_VARBIT, 3); + onPath1 = new VarbitRequirement(VarbitID.SECRET_GHOST_RANDOMISER, 1); + onPath2 = new VarbitRequirement(VarbitID.SECRET_GHOST_RANDOMISER, 2); + onPath3 = new VarbitRequirement(VarbitID.SECRET_GHOST_RANDOMISER, 3); } @Override @@ -156,7 +156,7 @@ protected void setupZones() public void setupSteps() { - int pathID = client.getVarbitValue(PATH_VARBIT); + int pathID = client.getVarbitValue(VarbitID.SECRET_GHOST_RANDOMISER); talkToValdez = new NpcStep(this, NpcID.SECRET_GHOST_EXPLORER, new WorldPoint(2556, 3445, 0), "Talk to the Mysterious Ghost outside Glarial's Tomb.", ghostspeakItems, ringOfVis); talkToValdez.addDialogStep("Tell me your story"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/daddyshome/DaddysHome.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/daddyshome/DaddysHome.java index 736bba75696..8214a77b8af 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/daddyshome/DaddysHome.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/daddyshome/DaddysHome.java @@ -27,93 +27,125 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; -import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; +import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; +import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class DaddysHome extends BasicQuestHelper { - //Items Required - ItemRequirement plank10, nails20, bolt5, hammer, saw, waxwoodLog3, waxwoodPlank3, bolt2, - bolt3, nails2, nails4, plank, plank3, plank2; - - //Items Recommended - ItemRequirement lumberyardTeleport, varrockTeleport3; - - Requirement removedChair, removedTable, removedTable2, removedStool, removedStool2, removedCampbed, - removedCarpet, repairedCampbed, repairedCarpet, repairedStool, repairedTable, repairedChair, - repairedStool2, repairedTable2; - - //NPC Steps - DetailedQuestStep talkToMarlo, talkToYarlo, talkToYarloAgain, talkToOperator, talkToYarloOnceMore, talkToMarloToFinish; - - //Object/items Steps - DetailedQuestStep removeChair, removeCarpet, removeStool, removeStool2, removeTable, - removeTable2, removeCampbed, searchCrate, buildChair, buildCarpet, buildStool, - buildStool2, buildTable, buildTable2, buildCampbed; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToMarlo); - steps.put(1, talkToYarlo); - - ConditionalStep removeItems = new ConditionalStep(this, removeCampbed); - removeItems.addStep(new Conditions(removedCampbed, removedCarpet, removedStool, removedTable, removedChair, removedStool2, removedTable2), talkToYarloAgain); - removeItems.addStep(new Conditions(removedCampbed, removedCarpet, removedStool, removedTable, removedChair, removedStool2), removeTable2); - removeItems.addStep(new Conditions(removedCampbed, removedCarpet, removedStool, removedTable, removedChair), removeStool2); - removeItems.addStep(new Conditions(removedCampbed, removedCarpet, removedStool, removedTable), removeChair); - removeItems.addStep(new Conditions(removedCampbed, removedCarpet, removedStool), removeTable); - removeItems.addStep(new Conditions(removedCampbed, removedCarpet), removeStool); - removeItems.addStep(removedCampbed, removeCarpet); - - steps.put(2, removeItems); - steps.put(3, talkToYarloAgain); - steps.put(4, talkToYarloAgain); - - ConditionalStep repairFurniture = new ConditionalStep(this, buildCarpet); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable, repairedChair, repairedStool2, repairedTable2, repairedCampbed), talkToYarloOnceMore); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable, repairedChair, repairedStool2, repairedTable2, waxwoodPlank3), buildCampbed); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable, repairedChair, repairedStool2, repairedTable2, waxwoodLog3), talkToOperator); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable, repairedChair, repairedStool2, repairedTable2), searchCrate); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable, repairedChair, repairedStool2), buildTable2); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable, repairedChair), buildStool2); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool, repairedTable), buildChair); - repairFurniture.addStep(new Conditions(repairedCarpet, repairedStool), buildTable); - repairFurniture.addStep(new Conditions(repairedCarpet), buildStool); - - steps.put(5, repairFurniture); - steps.put(6, repairFurniture); - steps.put(7, repairFurniture); - steps.put(8, repairFurniture); - steps.put(9, repairFurniture); - - steps.put(10, talkToMarloToFinish); - steps.put(11, talkToMarloToFinish); - steps.put(12, talkToMarloToFinish); - - return steps; - } + // Required items + ItemRequirement plank10; + ItemRequirement nails20; + ItemRequirement bolt5; + ItemRequirement saw; + ItemRequirement hammer; + + // Recommended items + ItemRequirement lumberyardTeleport; + ItemRequirement varrockTeleport3; + + // Miscellaneous requirements + ItemRequirement waxwoodLog3; + ItemRequirement waxwoodPlank3; + ItemRequirement bolt2; + ItemRequirement bolt3; + ItemRequirement nails2; + ItemRequirement nails4; + ItemRequirement plank; + ItemRequirement plank3; + ItemRequirement plank2; + + VarbitRequirement needToRemoveCampbed; + VarbitRequirement needToRemoveCarpet; + VarbitRequirement needToRemoveStool; + VarbitRequirement needToRemoveTable; + VarbitRequirement needToRemoveChair; + VarbitRequirement needToRemoveStool2; + VarbitRequirement needToRemoveTable2; + Conditions needToRemoveAnyFurniture; + + VarbitRequirement needToBuildCarpet; + VarbitRequirement needToBuildStool; + VarbitRequirement needToBuildTable; + VarbitRequirement needToBuildChair; + VarbitRequirement needToBuildStool2; + VarbitRequirement needToBuildTable2; + Conditions needToBuildSimpleFurniture; + + VarbitRequirement needToBuildCampbed; + + // Steps + NpcStep talkToMarlo; + + NpcStep talkToYarlo; + + ObjectStep removeCampbed; + ObjectStep removeCarpet; + ObjectStep removeStool; + ObjectStep removeTable; + ObjectStep removeChair; + ObjectStep removeStool2; + ObjectStep removeTable2; + NpcStep talkToYarloAfterRemovingFurniture; + ConditionalStep removeFurniture; + + ObjectStep buildCarpet; + ObjectStep buildStool; + ObjectStep buildTable; + ObjectStep buildChair; + ObjectStep buildStool2; + ObjectStep buildTable2; + ConditionalStep buildSimpleFurniture; + + ObjectStep searchCrate; + NpcStep talkToOperator; + ObjectStep buildCampbed; + + NpcStep talkToYarloAfterBuildingFurniture; + + NpcStep talkToMarloToFinish; @Override protected void setupRequirements() { + needToRemoveCampbed = new VarbitRequirement(VarbitID.DADDYSHOME_BED, 2, Operation.LESS); + needToRemoveCarpet = new VarbitRequirement(VarbitID.DADDYSHOME_CARPET, 2, Operation.LESS); + needToRemoveStool = new VarbitRequirement(VarbitID.DADDYSHOME_STOOL_2, 2, Operation.LESS); + needToRemoveTable = new VarbitRequirement(VarbitID.DADDYSHOME_TABLE_2, 2, Operation.LESS); + needToRemoveChair = new VarbitRequirement(VarbitID.DADDYSHOME_CHAIR, 2, Operation.LESS); + needToRemoveStool2 = new VarbitRequirement(VarbitID.DADDYSHOME_STOOL_1, 2, Operation.LESS); + needToRemoveTable2 = new VarbitRequirement(VarbitID.DADDYSHOME_TABLE_1, 2, Operation.LESS); + needToRemoveAnyFurniture = or(needToRemoveCampbed, needToRemoveCarpet, needToRemoveStool, needToRemoveTable, needToRemoveChair, needToRemoveStool2, needToRemoveTable2); + + needToBuildCarpet = new VarbitRequirement(VarbitID.DADDYSHOME_CARPET, 3, Operation.LESS); + needToBuildStool = new VarbitRequirement(VarbitID.DADDYSHOME_STOOL_2, 3, Operation.LESS); + needToBuildTable = new VarbitRequirement(VarbitID.DADDYSHOME_TABLE_2, 3, Operation.LESS); + needToBuildChair = new VarbitRequirement(VarbitID.DADDYSHOME_CHAIR, 3, Operation.LESS); + needToBuildStool2 = new VarbitRequirement(VarbitID.DADDYSHOME_STOOL_1, 3, Operation.LESS); + needToBuildTable2 = new VarbitRequirement(VarbitID.DADDYSHOME_TABLE_1, 3, Operation.LESS); + needToBuildSimpleFurniture = or(needToBuildCarpet, needToBuildStool, needToBuildTable, needToBuildChair, needToBuildStool2, needToBuildTable2); + + needToBuildCampbed = new VarbitRequirement(VarbitID.DADDYSHOME_BED, 3, Operation.LESS); + plank10 = new ItemRequirement("Plank", ItemID.WOODPLANK, 10); bolt5 = new ItemRequirement("Bolt of cloth", ItemID.CLOTH, 5); nails20 = new ItemRequirement("Nails (bring more in case you fail with some)", ItemCollections.NAILS, 14); @@ -133,89 +165,140 @@ protected void setupRequirements() varrockTeleport3 = new ItemRequirement("Varrock Teleports", ItemID.POH_TABLET_VARROCKTELEPORT, 3); } - public void setupConditions() + public void setupSteps() { + talkToMarlo = new NpcStep(this, NpcID.CON_CONTRACTOR_VARROCK_1OP, new WorldPoint(3241, 3471, 0), "Talk to Marlo in north-east Varrock."); + talkToMarlo.addAlternateNpcs(NpcID.CON_CONTRACTOR_VARROCK_2OP); + talkToMarlo.addDialogSteps("What kind of favour do you want me to do?", "Tell me more about the job.", "Tell me where he lives, and I'll do the job."); - removedCampbed = new VarbitRequirement(10568, 2); - removedCarpet = new VarbitRequirement(10569, 2); - removedStool = new VarbitRequirement(10564, 2); - - removedTable = new VarbitRequirement(10567, 2); - removedChair = new VarbitRequirement(10565, 2); - removedStool2 = new VarbitRequirement(10563, 2); - removedTable2 = new VarbitRequirement(10566, 2); + talkToYarlo = new NpcStep(this, NpcID.DADDYSHOME_DADDY, new WorldPoint(3240, 3395, 0), "Talk to Old Man Yarlo in south-east Varrock, west of Aubury's Rune Shop."); + + removeCampbed = new ObjectStep(this, ObjectID.DADDYSHOME_BED, new WorldPoint(3242, 3398, 0), "Remove the campbed."); + removeCarpet = new ObjectStep(this, ObjectID.DADDYSHOME_CARPET_MIDDLE, new WorldPoint(3239, 3395, 0), "Right-click remove the rotten carpet."); + removeStool = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_2, new WorldPoint(3239, 3394, 0), "Demolish the broken stool."); + removeTable = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_2, new WorldPoint(3240, 3394, 0), "Demolish the broken table."); + removeChair = new ObjectStep(this, ObjectID.DADDYSHOME_CHAIR, new WorldPoint(3241, 3393, 0), "Demolish the broken chair."); + removeStool2 = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_1, new WorldPoint(3244, 3394, 0), "Demolish the other broken stool."); + removeTable2 = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_1, new WorldPoint(3245, 3394, 0), "Demolish the other broken table."); + + talkToYarloAfterRemovingFurniture = new NpcStep(this, NpcID.DADDYSHOME_DADDY, new WorldPoint(3240, 3395, 0), "Talk to Old Man Yarlo again after removing all the broken furniture."); + talkToYarloAfterRemovingFurniture.addDialogStep("Skip Yarlo's lecture. He'll offer it later if you like."); + + removeFurniture = new ConditionalStep(this, removeTable2, "Remove the broken furniture in Old Man Yarlo's house."); + removeFurniture.addStep(needToRemoveCampbed, removeCampbed); + removeFurniture.addStep(needToRemoveCarpet, removeCarpet); + removeFurniture.addStep(needToRemoveStool, removeStool); + removeFurniture.addStep(needToRemoveTable, removeTable); + removeFurniture.addStep(needToRemoveChair, removeChair); + removeFurniture.addStep(needToRemoveStool2, removeStool2); + + var highlightFirstOption = new WidgetHighlight(InterfaceID.PohFurnitureCreation._01); + buildCarpet = new ObjectStep(this, ObjectID.DADDYSHOME_CARPET_MIDDLE, new WorldPoint(3239, 3395, 0), "Right-click build the carpet.", bolt3, saw, hammer); + buildCarpet.addWidgetHighlight(highlightFirstOption); + buildStool = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_2, new WorldPoint(3239, 3394, 0), "Build the stool.", plank, nails2, saw, hammer); + buildStool.addWidgetHighlight(highlightFirstOption); + buildTable = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_2, new WorldPoint(3240, 3394, 0), "Build the table.", plank3, nails4, saw, hammer); + buildTable.addWidgetHighlight(highlightFirstOption); + buildChair = new ObjectStep(this, ObjectID.DADDYSHOME_CHAIR, new WorldPoint(3241, 3393, 0), "Build the chair.", plank2, nails2, saw, hammer); + buildChair.addWidgetHighlight(highlightFirstOption); + buildStool2 = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_1, new WorldPoint(3244, 3394, 0), "Build the other stool.", plank, nails2, saw, hammer); + buildStool2.addWidgetHighlight(highlightFirstOption); + buildTable2 = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_1, new WorldPoint(3245, 3394, 0), "Build the other table.", plank3, nails4, saw, hammer); + buildTable2.addWidgetHighlight(highlightFirstOption); + + buildSimpleFurniture = new ConditionalStep(this, buildTable2, "Rebuild the furniture in Old Man Yarlo's house."); + buildSimpleFurniture.addStep(needToBuildCarpet, buildCarpet); + buildSimpleFurniture.addStep(needToBuildStool, buildStool); + buildSimpleFurniture.addStep(needToBuildTable, buildTable); + buildSimpleFurniture.addStep(needToBuildChair, buildChair); + buildSimpleFurniture.addStep(needToBuildStool2, buildStool2); + + searchCrate = new ObjectStep(this, ObjectID.DADDYSHOME_CRATES, new WorldPoint(3243, 3398, 0), "Search the crates in Old Man Yarlo's house for waxwood logs."); + + talkToOperator = new NpcStep(this, NpcID.POH_SAWMILL_OPP, new WorldPoint(3302, 3492, 0), "Talk to the Sawmill operator north-east of Varrock to make waxwood planks.", waxwoodLog3); + talkToOperator.addDialogStep("I need some waxwood planks for Old Man Yarlo."); + talkToOperator.addTeleport(lumberyardTeleport); + buildCampbed = new ObjectStep(this, ObjectID.DADDYSHOME_BED, new WorldPoint(3242, 3398, 0), "Build the waxwood bed in Old Man Yarlo's house.", waxwoodPlank3, bolt2, hammer, saw); + buildCampbed.addWidgetHighlight(highlightFirstOption); + buildCampbed.addTeleport(varrockTeleport3.quantity(1)); - repairedCampbed = new VarbitRequirement(10568, 3); - repairedCarpet = new VarbitRequirement(10569, 3); - repairedStool = new VarbitRequirement(10564, 3); + talkToYarloAfterBuildingFurniture = new NpcStep(this, NpcID.DADDYSHOME_DADDY, new WorldPoint(3240, 3395, 0), "Talk to Old Man Yarlo again after rebuilding the furniture."); - repairedTable = new VarbitRequirement(10567, 3); - repairedChair = new VarbitRequirement(10565, 3); - repairedStool2 = new VarbitRequirement(10563, 3); - repairedTable2 = new VarbitRequirement(10566, 3); + talkToMarloToFinish = new NpcStep(this, NpcID.CON_CONTRACTOR_VARROCK_1OP, new WorldPoint(3241, 3471, 0), "Talk to Marlo in north-east Varrock to complete the quest."); + talkToMarloToFinish.addAlternateNpcs(NpcID.CON_CONTRACTOR_VARROCK_2OP); + talkToMarloToFinish.addDialogStep("Yeah, what have you got for me?"); } - public void setupSteps() + @Override + public Map loadSteps() { - talkToMarlo = new NpcStep(this, NpcID.CON_CONTRACTOR_VARROCK_1OP, new WorldPoint(3241, 3471, 0), "Talk to Marlo in north east Varrock."); - ((NpcStep) talkToMarlo).addAlternateNpcs(NpcID.CON_CONTRACTOR_VARROCK_2OP); - talkToMarlo.addDialogSteps("What kind of favour do you want me to do?", "Tell me more about the job.", "Tell me where he lives, and I'll do the job."); - talkToYarlo = new NpcStep(this, NpcID.DADDYSHOME_DADDY, new WorldPoint(3240, 3395, 0), "Talk to Old Man Yarlo in south Varrock."); - talkToYarloAgain = new NpcStep(this, NpcID.DADDYSHOME_DADDY, new WorldPoint(3240, 3395, 0), "Talk to Old Man Yarlo in south Varrock again."); - talkToYarloAgain.addDialogStep("Skip Yarlo's lecture. He'll offer it later if you like."); - talkToYarloOnceMore = new NpcStep(this, NpcID.DADDYSHOME_DADDY, new WorldPoint(3240, 3395, 0), "Talk to Old Man Yarlo in south Varrock."); + initializeRequirements(); + setupSteps(); - talkToMarloToFinish = new NpcStep(this, NpcID.CON_CONTRACTOR_VARROCK_1OP, new WorldPoint(3241, 3471, 0), "Talk to Marlo in north east Varrock to complete the quest."); - ((NpcStep) talkToMarloToFinish).addAlternateNpcs(NpcID.CON_CONTRACTOR_VARROCK_2OP); - talkToMarloToFinish.addDialogStep("Yeah, what have you got for me?"); + var steps = new HashMap(); - removeCampbed = new ObjectStep(this, ObjectID.DADDYSHOME_BED, new WorldPoint(3242, 3398, 0), "Remove the broken items in the house."); - removeCarpet = new ObjectStep(this, ObjectID.DADDYSHOME_CARPET_MIDDLE, new WorldPoint(3239, 3395, 0), "Remove the broken items in the house."); - removeStool = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_2, new WorldPoint(3239, 3394, 0), "Remove the broken items in the house."); - removeTable = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_2, new WorldPoint(3240, 3394, 0), "Remove the broken items in the house."); - removeChair = new ObjectStep(this, ObjectID.DADDYSHOME_CHAIR, new WorldPoint(3241, 3393, 0), "Remove the broken items in the house."); - removeTable2 = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_1, new WorldPoint(3245, 3394, 0), "Remove the broken items in the house."); - removeStool2 = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_1, new WorldPoint(3244, 3394, 0), "Remove the broken items in the house."); + steps.put(0, talkToMarlo); + steps.put(1, talkToYarlo); - removeCampbed.addSubSteps(removeCarpet, removeStool, removeTable, removeChair, removeTable2, removeStool2); + var cRemoveFurniture = new ConditionalStep(this, talkToYarloAfterRemovingFurniture); + cRemoveFurniture.addStep(needToRemoveAnyFurniture, removeFurniture); + steps.put(2, cRemoveFurniture); - searchCrate = new ObjectStep(this, ObjectID.DADDYSHOME_CRATES, new WorldPoint(3243, 3398, 0), "Search the crates in Yarlo's house for waxwood logs."); + steps.put(3, talkToYarloAfterRemovingFurniture); + steps.put(4, talkToYarloAfterRemovingFurniture); - talkToOperator = new NpcStep(this, NpcID.POH_SAWMILL_OPP, new WorldPoint(3302, 3492, 0), "Talk to the Sawmill Operator north east of Varrock to make waxwood planks.", waxwoodLog3); - talkToOperator.addDialogStep("I need some waxwood planks for Old Man Yarlo."); - buildCampbed = new ObjectStep(this, ObjectID.DADDYSHOME_BED, new WorldPoint(3242, 3398, 0), "Build the waxwood bed in the house.", waxwoodPlank3, bolt2, hammer, saw); - - buildCarpet = new ObjectStep(this, ObjectID.DADDYSHOME_CARPET_MIDDLE, new WorldPoint(3239, 3395, 0), "Build the items in the house.", bolt3, saw, hammer); - buildStool = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_2, new WorldPoint(3239, 3394, 0), "Build the items in the house.", plank, nails2, saw, hammer); - buildTable = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_2, new WorldPoint(3240, 3394, 0), "Build the items in the house.", plank3, nails4, saw, hammer); - buildChair = new ObjectStep(this, ObjectID.DADDYSHOME_CHAIR, new WorldPoint(3241, 3393, 0), "Build the items in the house.", plank2, nails2, saw, hammer); - buildTable2 = new ObjectStep(this, ObjectID.DADDYSHOME_TABLE_1, new WorldPoint(3245, 3394, 0), "Build the items in the house.", plank3, nails4, saw, hammer); - buildStool2 = new ObjectStep(this, ObjectID.DADDYSHOME_STOOL_1, new WorldPoint(3244, 3394, 0), "Build the items in the house.", plank, nails2, saw, hammer); - buildCarpet.addSubSteps(buildStool, buildTable, buildChair, buildTable2, buildStool2); + var cRepairFurniture = new ConditionalStep(this, talkToYarloAfterBuildingFurniture); + cRepairFurniture.addStep(needToBuildSimpleFurniture, buildSimpleFurniture); + cRepairFurniture.addStep(and(needToBuildCampbed, waxwoodPlank3.alsoCheckBank()), buildCampbed); + cRepairFurniture.addStep(and(needToBuildCampbed, waxwoodLog3.alsoCheckBank()), talkToOperator); + cRepairFurniture.addStep(needToBuildCampbed, searchCrate); + + steps.put(5, cRepairFurniture); + steps.put(6, cRepairFurniture); + steps.put(7, cRepairFurniture); // unreachable? + steps.put(8, cRepairFurniture); // unreachable? + steps.put(9, cRepairFurniture); // unreachable? + + steps.put(10, talkToMarloToFinish); + steps.put(11, talkToMarloToFinish); // unreachable? + steps.put(12, talkToMarloToFinish); + + return steps; } @Override public List getItemRequirements() { - return Arrays.asList(plank10, nails20, bolt5, saw, hammer); + return List.of( + plank10, + nails20, + bolt5, + saw, + hammer + ); } @Override public List getItemRecommended() { - return Arrays.asList(lumberyardTeleport, varrockTeleport3); + return List.of( + lumberyardTeleport, + varrockTeleport3 + ); } @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.CONSTRUCTION, 400)); + return List.of( + new ExperienceReward(Skill.CONSTRUCTION, 400) + ); } @Override public List getItemRewards() { - return Arrays.asList( + return List.of( new ItemReward("Planks", ItemID.WOODPLANK, 25), new ItemReward("Oak Planks", ItemID.PLANK_OAK, 10), new ItemReward("Mithril Nails", ItemID.NAILS_MITHRIL, 50), @@ -223,14 +306,34 @@ public List getItemRewards() new ItemReward("Bolt of Cloth", ItemID.CLOTH, 8), new ItemReward("House Teleport Tablets", ItemID.POH_TABLET_TELEPORTTOHOUSE, 5), new ItemReward("Falador Teleport Tablet", ItemID.POH_TABLET_FALADORTELEPORT, 1), - new ItemReward("POH in Rimmington or 1,000 Coins", ItemID.COINS, 1)); + new ItemReward("POH in Rimmington or 1,000 Coins", ItemID.COINS, 1) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Helping Yarlo & Marlo", Arrays.asList(talkToMarlo, talkToYarlo, removeCampbed, talkToYarloAgain, buildCarpet, searchCrate, talkToOperator, buildCampbed, talkToYarloOnceMore, talkToMarloToFinish), plank10, nails20, bolt5, hammer, saw)); - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Helping Yarlo & Marlo", List.of( + talkToMarlo, + talkToYarlo, + removeFurniture, + talkToYarloAfterRemovingFurniture, + buildSimpleFurniture, + searchCrate, + talkToOperator, + buildCampbed, + talkToYarloAfterBuildingFurniture, + talkToMarloToFinish + ), List.of( + plank10, + nails20, + bolt5, + hammer, + saw + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/enchantedkey/EnchantedKeyDigStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/enchantedkey/EnchantedKeyDigStep.java index 39db869d834..72b02d328f7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/enchantedkey/EnchantedKeyDigStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/enchantedkey/EnchantedKeyDigStep.java @@ -30,6 +30,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import lombok.NonNull; import net.runelite.api.ChatMessageType; import net.runelite.api.Player; @@ -38,6 +39,7 @@ import net.runelite.api.events.ChatMessage; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.game.ItemManager; import net.runelite.client.ui.overlay.OverlayUtil; @@ -85,7 +87,7 @@ public void makeOverlayHint(PanelComponent panelComponent, QuestHelperPlugin plu .left("Possible locations:") .build()); } - else if (digLocations.size() < 1) + else if (digLocations.isEmpty()) { panelComponent.getChildren().add(LineComponent.builder() .left("Unable to establish dig location") @@ -119,8 +121,8 @@ public void onVarbitChanged(VarbitChanged varbitChanged) public void resetState() { - setWorldPoint(null); - int locationStates = client.getVarbitValue(1391); + setWorldPoint(DefinedPoint.of(null)); + int locationStates = client.getVarbitValue(VarbitID.MAKINGHISTORY_LOCSTATUS); Set locations = Arrays.stream(EnchantedKeyDigLocation.values()).filter(p -> ((locationStates >> p.getBit()) & 1) == 0) .collect(Collectors.toSet()); if (enchantedKeySolver != null) @@ -138,12 +140,12 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) { super.makeWorldOverlayHint(graphics, plugin); - if (worldPoint == null) + if (definedPoint == null) { return; } - LocalPoint localLocation = LocalPoint.fromWorld(client, worldPoint); + LocalPoint localLocation = LocalPoint.fromWorld(client, definedPoint.getWorldPoint()); if (localLocation == null) { @@ -199,7 +201,7 @@ public boolean update(final String message) } else { - this.setWorldPoint(null); + this.setWorldPoint(DefinedPoint.of(null)); } return true; @@ -223,7 +225,7 @@ public void startUp() public void shutDown() { super.shutDown(); - this.setWorldPoint(null); + this.setWorldPoint(DefinedPoint.of(null)); } private BufferedImage getSpadeImage() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/familypest/FamilyPest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/familypest/FamilyPest.java index 885c5bfc1b7..82db2ecd9ca 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/familypest/FamilyPest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/familypest/FamilyPest.java @@ -45,6 +45,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -123,9 +124,9 @@ public void setupConditions() { upJollyBoar = new ZoneRequirement(upstairsJollyBoar); - talkedToCaleb = new VarbitRequirement(5348, 1); - talkedToAvan = new VarbitRequirement(5349, 1); - talkedToJohnathon = new VarbitRequirement(5350, 1); + talkedToCaleb = new VarbitRequirement(VarbitID.FAMILY_QUEST_CALEB, 1); + talkedToAvan = new VarbitRequirement(VarbitID.FAMILY_QUEST_AVAN, 1); + talkedToJohnathon = new VarbitRequirement(VarbitID.FAMILY_QUEST_JOHNATHON, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hisfaithfulservants/HisFaithfulServants.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hisfaithfulservants/HisFaithfulServants.java index 106ed4cea69..cc0fc6db782 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hisfaithfulservants/HisFaithfulServants.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hisfaithfulservants/HisFaithfulServants.java @@ -147,7 +147,7 @@ public Map loadSteps() finishingTheRun.addStep(new Conditions(isDharokTunnel, inDharok), enterDharokSarc); ConditionalStep doingBarrows = new ConditionalStep(this, enterVerac); - doingBarrows.addStep(strangeIcon.alsoCheckBank(questBank), finishQuest); + doingBarrows.addStep(strangeIcon.alsoCheckBank(), finishQuest); doingBarrows.addStep(doneWithAll, finishingTheRun); // Top condition is for catching 1 remains to point to tomb to raid doingBarrows.addStep(new Conditions(doneWithDharok, inDharok), leaveDharok); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hopespearswill/HopespearsWill.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hopespearswill/HopespearsWill.java index 3219882398d..80a00fb9cb3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hopespearswill/HopespearsWill.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/hopespearswill/HopespearsWill.java @@ -38,7 +38,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.util.ItemSlots; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetTextRequirement; @@ -52,6 +51,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -113,11 +113,11 @@ public Map loadSteps() defeatGoblins.addStep(nor(hasStrongbonesBones), sayNameStrongbones); ConditionalStep buryBones = new ConditionalStep(this, goToYubiusk); - buryBones.addStep(LogicHelper.nor(snotheadBuried), burySnothead); - buryBones.addStep(LogicHelper.nor(snailfeetBuried), burySnailfeet); - buryBones.addStep(LogicHelper.nor(mosschinBuried), buryMosschin); - buryBones.addStep(LogicHelper.nor(redeyesBuried), buryRedeyes); - buryBones.addStep(LogicHelper.nor(strongbonesBuried), buryStrongbones); + buryBones.addStep(nor(snotheadBuried), burySnothead); + buryBones.addStep(nor(snailfeetBuried), burySnailfeet); + buryBones.addStep(nor(mosschinBuried), buryMosschin); + buryBones.addStep(nor(redeyesBuried), buryRedeyes); + buryBones.addStep(nor(strongbonesBuried), buryStrongbones); ConditionalStep finishQuest = new ConditionalStep(this, goToGoblinCaveAfterStart); finishQuest.addStep(new Conditions(inYubiusk, hasAllBones), buryBones); @@ -159,16 +159,16 @@ protected void setupRequirements() plainOfMudSphere.addAlternates(ItemID.LOTG_TELEPORT_ARTIFACT); combatLevel = new ItemRequirement("90+ combat", -1, -1); - snotheadBones = new ItemRequirement("Snothead bones", ItemID.LOTG_BONE_HIGHPRIEST1).alsoCheckBank(questBank); - snailfeetBones = new ItemRequirement("Snailfeet bones", ItemID.LOTG_BONE_HIGHPRIEST2).alsoCheckBank(questBank); - mosschinBones = new ItemRequirement("Mosschin bones", ItemID.LOTG_BONE_HIGHPRIEST3).alsoCheckBank(questBank); - redeyesBones = new ItemRequirement("Redeyes bones", ItemID.LOTG_BONE_HIGHPRIEST4).alsoCheckBank(questBank); - strongbonesBones = new ItemRequirement("Strongbones bones", ItemID.LOTG_BONE_HIGHPRIEST5).alsoCheckBank(questBank); + snotheadBones = new ItemRequirement("Snothead bones", ItemID.LOTG_BONE_HIGHPRIEST1).alsoCheckBank(); + snailfeetBones = new ItemRequirement("Snailfeet bones", ItemID.LOTG_BONE_HIGHPRIEST2).alsoCheckBank(); + mosschinBones = new ItemRequirement("Mosschin bones", ItemID.LOTG_BONE_HIGHPRIEST3).alsoCheckBank(); + redeyesBones = new ItemRequirement("Redeyes bones", ItemID.LOTG_BONE_HIGHPRIEST4).alsoCheckBank(); + strongbonesBones = new ItemRequirement("Strongbones bones", ItemID.LOTG_BONE_HIGHPRIEST5).alsoCheckBank(); inGoblinCave = new ZoneRequirement(goblinCave); nothingEquipped = new NoItemRequirement("No items equipped", ItemSlots.ANY_EQUIPPED); goblinWidgetActive = new WidgetTextRequirement(739, 2, 1, "Select Your Goblin"); - isAGoblin = new VarbitRequirement(13612, 1); + isAGoblin = new VarbitRequirement(VarbitID.LOTG_PLAYER_IS_A_GOBLIN, 1); inGoblinTemple = new ZoneRequirement(goblinTemple); isInCrypt = new ZoneRequirement(crypt); inYubiusk = new ZoneRequirement(yubiusk); @@ -179,11 +179,11 @@ protected void setupRequirements() redeyesAlive = new NpcRequirement("Redeyes", NpcID.LOTG_GOBLIN_SKELETON_HIGH_PRIEST4); strongbonesAlive = new NpcRequirement("Strongbones", NpcID.LOTG_GOBLIN_SKELETON_HIGH_PRIEST5); - snotheadBuried = new VarbitRequirement(13620, 1); - snailfeetBuried = new VarbitRequirement(13621, 1); - mosschinBuried = new VarbitRequirement(13622, 1); - redeyesBuried = new VarbitRequirement(13623, 1); - strongbonesBuried = new VarbitRequirement(13624, 1); + snotheadBuried = new VarbitRequirement(VarbitID.HOPESPEAR_PRIEST_1, 1); + snailfeetBuried = new VarbitRequirement(VarbitID.HOPESPEAR_PRIEST_2, 1); + mosschinBuried = new VarbitRequirement(VarbitID.HOPESPEAR_PRIEST_3, 1); + redeyesBuried = new VarbitRequirement(VarbitID.HOPESPEAR_PRIEST_4, 1); + strongbonesBuried = new VarbitRequirement(VarbitID.HOPESPEAR_PRIEST_5, 1); hasSnotheadBones = new Conditions(LogicType.OR, snotheadBones, snotheadBuried); hasSnailfeetBones = new Conditions(LogicType.OR, snailfeetBones, snailfeetBuried); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/lairoftarnrazorlor/TarnRoute.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/lairoftarnrazorlor/TarnRoute.java index db538577b9d..d145cc52d61 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/lairoftarnrazorlor/TarnRoute.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/lairoftarnrazorlor/TarnRoute.java @@ -42,12 +42,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.Prayer; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.*; import java.util.Arrays; import java.util.List; @@ -267,10 +263,10 @@ public void setupSteps() searchWall2Room6 = new ObjectStep(questHelper, ObjectID.LOTR_TRAP_SPEAR_WALL_LVL1, new WorldPoint(3154, 4605, 1), "Follow the path to the east."); goThroughRoom6 = new ObjectStep(questHelper, ObjectID.LOTR_RUINS_DOOR_28A, new WorldPoint(3176, 4598, 1), "Follow the path to the east. Avoid the walls which will occasionally stick out and knock you down, marked with a skull."); - goThroughRoom6.addTileMarker(new WorldPoint(3162, 4600, 1), SpriteID.PLAYER_KILLER_SKULL); - goThroughRoom6.addTileMarker(new WorldPoint(3164, 4600, 1), SpriteID.PLAYER_KILLER_SKULL); - goThroughRoom6.addTileMarker(new WorldPoint(3171, 4600, 1), SpriteID.PLAYER_KILLER_SKULL); - goThroughRoom6.addTileMarker(new WorldPoint(3173, 4600, 1), SpriteID.PLAYER_KILLER_SKULL); + goThroughRoom6.addTileMarker(new WorldPoint(3162, 4600, 1), SpriteID.HEADICONS_PK); + goThroughRoom6.addTileMarker(new WorldPoint(3164, 4600, 1), SpriteID.HEADICONS_PK); + goThroughRoom6.addTileMarker(new WorldPoint(3171, 4600, 1), SpriteID.HEADICONS_PK); + goThroughRoom6.addTileMarker(new WorldPoint(3173, 4600, 1), SpriteID.HEADICONS_PK); goThroughRoom6.addSubSteps(searchWallRoom6, searchWall2Room6); goThroughRoom7 = new ObjectStep(questHelper, ObjectID.LOTR_RUINS_STAIRS_LVL1, new WorldPoint(3193, 4598, 1), "Activate Protect from Magic and jump across the pillars. Go down the stairs.", protectFromMagic); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/skippyandthemogres/SkippyAndTheMogres.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/skippyandthemogres/SkippyAndTheMogres.java index b6ec25093df..483b4f8f426 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/skippyandthemogres/SkippyAndTheMogres.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/skippyandthemogres/SkippyAndTheMogres.java @@ -123,7 +123,7 @@ public List getUnlockRewards() { return Arrays.asList( new UnlockReward("Ability to kill Mogres"), - new UnlockReward("Ability to recieve Mogres as a Slayer task")); + new UnlockReward("Ability to receive Mogres as a Slayer task")); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/thegeneralsshadow/TheGeneralsShadow.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/thegeneralsshadow/TheGeneralsShadow.java index 88d6b5cda7d..d5796b4ee26 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/thegeneralsshadow/TheGeneralsShadow.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/thegeneralsshadow/TheGeneralsShadow.java @@ -51,6 +51,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -164,11 +165,11 @@ public void setupConditions() inBouncerCave = new ZoneRequirement(bouncerCave); hasNote = sinSeersNote; - givenNote = new VarbitRequirement(3335, 2); - talkedToGnomeScout = new VarbitRequirement(3332, 1); - talkedToFaladorScout = new VarbitRequirement(3333, 1); - talkedToShantayScout = new VarbitRequirement(3334, 1); - talkedToKaramjaScout = new VarbitRequirement(3331, 1); + givenNote = new VarbitRequirement(VarbitID.SHADOW_MAJ_SEER, 2); + talkedToGnomeScout = new VarbitRequirement(VarbitID.SHADOW_MAJ_SCOUT2, 1); + talkedToFaladorScout = new VarbitRequirement(VarbitID.SHADOW_MAJ_SCOUT3, 1); + talkedToShantayScout = new VarbitRequirement(VarbitID.SHADOW_MAJ_SCOUT4, 1); + talkedToKaramjaScout = new VarbitRequirement(VarbitID.SHADOW_MAJ_SCOUT1, 1); // 3336 0->2 attempted to bribe Seer // 3335 0->1 given money to Seer diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/MageArenaBossStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/MageArenaBossStep.java index da59db179ab..076b82da09d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/MageArenaBossStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/MageArenaBossStep.java @@ -32,6 +32,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import lombok.NonNull; import net.runelite.api.ChatMessageType; import net.runelite.api.coords.LocalPoint; @@ -39,6 +40,7 @@ import net.runelite.api.events.ChatMessage; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.game.ItemManager; import net.runelite.client.ui.overlay.OverlayUtil; @@ -82,8 +84,6 @@ public class MageArenaBossStep extends DetailedQuestStep int currentVar = 0; - final int BOSS_MOVING_TIMER_VARBIT = 6062; - public MageArenaBossStep(QuestHelper questHelper, ItemRequirement staff, String bossName, String abilityDetail, ItemRequirement... requirements) { @@ -115,7 +115,7 @@ public void makeOverlayHint(PanelComponent panelComponent, QuestHelperPlugin plu .left("Possible locations:") .build()); } - else if (digLocations.size() < 1) + else if (digLocations.isEmpty()) { if (!foundLocation) { @@ -151,7 +151,7 @@ else if (digLocations.size() < 1) public void onVarbitChanged(VarbitChanged varbitChanged) { super.onVarbitChanged(varbitChanged); - int newState = client.getVarbitValue(BOSS_MOVING_TIMER_VARBIT); + int newState = client.getVarbitValue(VarbitID.MA2_TIMER_REMAINING); // If the position of the bosses changes, reset if (newState > currentVar) @@ -166,7 +166,7 @@ public void onVarbitChanged(VarbitChanged varbitChanged) public void resetState() { - setWorldPoint(null); + setWorldPoint(DefinedPoint.of(null)); Set locations = Arrays.stream(MageArenaSpawnLocation.values()) .collect(Collectors.toSet()); @@ -186,12 +186,12 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) { super.makeWorldOverlayHint(graphics, plugin); - if (worldPoint == null) + if (definedPoint == null) { return; } - LocalPoint localLocation = LocalPoint.fromWorld(client, worldPoint); + LocalPoint localLocation = LocalPoint.fromWorld(client, definedPoint.getWorldPoint()); if (localLocation == null) { @@ -245,7 +245,7 @@ public void update(final String message) } else { - this.setWorldPoint(null); + this.setWorldPoint(DefinedPoint.of(null)); } } @@ -254,7 +254,7 @@ public void update(final String message) public void startUp() { super.startUp(); - currentVar = client.getVarbitValue(BOSS_MOVING_TIMER_VARBIT); + currentVar = client.getVarbitValue(VarbitID.MA2_TIMER_REMAINING); Set locations = Arrays.stream(MageArenaSpawnLocation.values()) .collect(Collectors.toSet()); @@ -269,7 +269,7 @@ public void startUp() public void shutDown() { super.shutDown(); - this.setWorldPoint(null); + this.setWorldPoint(DefinedPoint.of(null)); } private BufferedImage getSymbolLocation() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/TheMageArenaII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/TheMageArenaII.java index 1af94ccd9af..d3cd649cc13 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/TheMageArenaII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/themagearenaii/TheMageArenaII.java @@ -46,6 +46,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -84,12 +85,12 @@ public Map loadSteps() goKillMinions.addStep(demonsHeart, enterCavernWithHeart); goKillMinions.addStep(new Conditions(givenHand, givenRoots), locateFollowerZammy); - goKillMinions.addStep(new Conditions(inCavern, entRoots.alsoCheckBank(questBank)), giveKolodionRoots); - goKillMinions.addStep(entRoots.alsoCheckBank(questBank), enterCavernWithRoots); + goKillMinions.addStep(new Conditions(inCavern, entRoots.alsoCheckBank()), giveKolodionRoots); + goKillMinions.addStep(entRoots.alsoCheckBank(), enterCavernWithRoots); goKillMinions.addStep(givenHand, locateFollowerGuthix); - goKillMinions.addStep(new Conditions(inCavern, justicarsHand.alsoCheckBank(questBank)), giveKolodionHand); - goKillMinions.addStep(justicarsHand.alsoCheckBank(questBank), enterCavernWithHand); + goKillMinions.addStep(new Conditions(inCavern, justicarsHand.alsoCheckBank()), giveKolodionHand); + goKillMinions.addStep(justicarsHand.alsoCheckBank(), enterCavernWithHand); steps.put(2, goKillMinions); ConditionalStep goImbueCape = new ConditionalStep(this, enterCavernAfterMinions); @@ -141,9 +142,9 @@ public void setupConditions() { inCavern = new ZoneRequirement(cavern); - givenHand = new VarbitRequirement(6063, 1); - givenRoots = new VarbitRequirement(6064, 1); - givenHeart = new VarbitRequirement(6065, 1); + givenHand = new VarbitRequirement(VarbitID.MA2_SARADOMIN_COMPONENT, 1); + givenRoots = new VarbitRequirement(VarbitID.MA2_GUTHIX_COMPONENT, 1); + givenHeart = new VarbitRequirement(VarbitID.MA2_ZAMORAK_COMPONENT, 1); // Handed in hand: // 6066, 6063 0->1 // 6066 varies 0->7 (3 bits) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/valetotems/ValeTotems.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/valetotems/ValeTotems.java index 411e998c0b1..c716a0340ae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/valetotems/ValeTotems.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/miniquests/valetotems/ValeTotems.java @@ -32,21 +32,14 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; @@ -55,6 +48,14 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; + /** * The quest guide for the "Vale Totems" OSRS quest */ diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/allneededitems/AllNeededItems.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/allneededitems/AllNeededItems.java index f6786e5f4f3..568f13f0e1b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/allneededitems/AllNeededItems.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/allneededitems/AllNeededItems.java @@ -30,7 +30,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import net.runelite.api.SpriteID; +import net.runelite.api.gameval.SpriteID; import java.util.*; @@ -49,7 +49,7 @@ public QuestStep loadStep() " need without running this helper if you activate it in the Quest Helper settings.", new ArrayList<>(reqs.values())); step1.hideRequirements = true; step1.considerBankForItemHighlight = true; - step1.iconToUseForNeededItems = SpriteID.TAB_QUESTS; + step1.iconToUseForNeededItems = SpriteID.SideiconsInterface.QUESTS; step1.setBackgroundWorldTooltipText("Highlighted due to the config setting 'Highlight missing items' in Quest Helper."); return step1; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingConfigChangeHandler.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingConfigChangeHandler.java index e580be9e8be..09ddde6c431 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingConfigChangeHandler.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingConfigChangeHandler.java @@ -28,6 +28,7 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; import net.runelite.client.config.ConfigManager; import net.runelite.client.events.ConfigChanged; + import java.util.function.Consumer; public class FarmingConfigChangeHandler diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingHandler.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingHandler.java index ec9f23dad18..ca5117cb143 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingHandler.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingHandler.java @@ -25,7 +25,7 @@ package net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns; import net.runelite.api.Client; -import net.runelite.api.Varbits; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.config.ConfigManager; import net.runelite.client.plugins.timetracking.TimeTrackingConfig; import net.runelite.client.plugins.timetracking.farming.Produce; @@ -99,7 +99,7 @@ public CropState predictPatch(FarmingPatch patch, String profile) int stages = state.getStages(); int tickrate = state.getTickRate(); - boolean botanist = client.getVarbitValue(Varbits.LEAGUE_RELIC_5) == 1; + boolean botanist = client.getVarbitValue(VarbitID.LEAGUE_RELIC_SELECTION_4) == 1; if (botanist) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingRegion.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingRegion.java index 76bd405804b..288f603babe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingRegion.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingRegion.java @@ -87,10 +87,10 @@ public boolean isInBounds(WorldPoint loc) public String toString() { String sb = "FarmingRegion{name='" + name + '\'' + - ", regionID=" + regionID + - ", definite=" + definite + - ", patches=" + patches.length + - '}'; + ", regionID=" + regionID + + ", definite=" + definite + + ", patches=" + patches.length + + '}'; return sb; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingUtils.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingUtils.java index 53ce93e3ff6..8280a86e6c6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingUtils.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingUtils.java @@ -27,10 +27,8 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import java.util.ArrayList; -import java.util.List; import net.runelite.api.Client; -import net.runelite.api.ItemID; +import net.runelite.api.gameval.ItemID; import net.runelite.client.config.ConfigManager; import net.runelite.client.game.ItemManager; import net.runelite.client.util.Text; @@ -170,9 +168,11 @@ default ItemRequirement getProtectionItemRequirement(ItemManager itemManager) public enum TreeSapling implements PlantableItem { - OAK(ItemID.OAK_SAPLING, ItemID.TOMATOES5, 1), WILLOW(ItemID.WILLOW_SAPLING, ItemID.APPLES5, 1), - MAPLE(ItemID.MAPLE_SAPLING, ItemID.ORANGES5, 1), YEW(ItemID.YEW_SAPLING, ItemID.CACTUS_SPINE, 10), - MAGIC(ItemID.MAGIC_SAPLING, ItemID.COCONUT, 25); + OAK(ItemID.PLANTPOT_OAK_SAPLING, ItemID.BASKET_TOMATO_5, 1), + WILLOW(ItemID.PLANTPOT_WILLOW_SAPLING, ItemID.BASKET_APPLE_5, 1), + MAPLE(ItemID.PLANTPOT_MAPLE_SAPLING, ItemID.BASKET_ORANGE_5, 1), + YEW(ItemID.PLANTPOT_YEW_SAPLING, ItemID.CACTUS_SPINE, 10), + MAGIC(ItemID.PLANTPOT_MAGIC_TREE_SAPLING, ItemID.COCONUT, 25); final int treeSaplingID; final int protectionItemId; @@ -218,10 +218,14 @@ public ConfigEnum getDefault() public enum FruitTreeSapling implements PlantableItem { - APPLE(ItemID.APPLE_SAPLING, ItemID.SWEETCORN, 9), BANANA(ItemID.BANANA_SAPLING, ItemID.APPLES5, 4), - ORANGE(ItemID.ORANGE_SAPLING, ItemID.STRAWBERRIES5, 3), CURRY(ItemID.CURRY_SAPLING, ItemID.BANANAS5, 5), - PINEAPPLE(ItemID.PINEAPPLE_SAPLING, ItemID.WATERMELON, 10), PAPAYA(ItemID.PAPAYA_SAPLING, ItemID.PINEAPPLE, 10), - PALM(ItemID.PALM_SAPLING, ItemID.PAPAYA_FRUIT, 15), DRAGONFRUIT(ItemID.DRAGONFRUIT_SAPLING, ItemID.COCONUT, 15); + APPLE(ItemID.PLANTPOT_APPLE_SAPLING, ItemID.SWEETCORN, 9), + BANANA(ItemID.PLANTPOT_BANANA_SAPLING, ItemID.BASKET_APPLE_5, 4), + ORANGE(ItemID.PLANTPOT_ORANGE_SAPLING, ItemID.BASKET_STRAWBERRY_5, 3), + CURRY(ItemID.PLANTPOT_CURRY_SAPLING, ItemID.BASKET_BANANA_5, 5), + PINEAPPLE(ItemID.PLANTPOT_PINEAPPLE_SAPLING, ItemID.WATERMELON, 10), + PAPAYA(ItemID.PLANTPOT_PAPAYA_SAPLING, ItemID.PINEAPPLE, 10), + PALM(ItemID.PLANTPOT_PALM_SAPLING, ItemID.PAPAYA, 15), + DRAGONFRUIT(ItemID.PLANTPOT_DRAGONFRUIT_SAPLING, ItemID.COCONUT, 15); final int fruitTreeSaplingId; final int protectionItemId; @@ -267,8 +271,11 @@ public ConfigEnum getDefault() public enum HardwoodTreeSapling implements PlantableItem { - TEAK(ItemID.TEAK_SAPLING, ItemID.LIMPWURT_ROOT, 15), - MAHOGANY(ItemID.MAHOGANY_SAPLING, ItemID.YANILLIAN_HOPS, 25); + TEAK(ItemID.PLANTPOT_TEAK_SAPLING, ItemID.LIMPWURT_ROOT, 15), + MAHOGANY(ItemID.PLANTPOT_MAHOGANY_SAPLING, ItemID.YANILLIAN_HOPS, 25), + CAMPHOR(ItemID.PLANTPOT_CAMPHOR_SAPLING, ItemID.WHITE_BERRIES, 10), + IRONWOOD(ItemID.PLANTPOT_IRONWOOD_SAPLING, ItemID.CURRY, 10), + ROSEWOOD(ItemID.PLANTPOT_ROSEWOOD_SAPLING, ItemID.DRAGONFRUIT, 8); final int hardwoodTreeSaplingId; final int protectionItemId; @@ -312,6 +319,52 @@ public ConfigEnum getDefault() } } + public enum CalquatTreeSapling implements PlantableItem + { + CALQUAT(ItemID.PLANTPOT_CALQUAT_SAPLING, ItemID.POISONIVY_BERRIES, 8); + + final int calquatTreeSaplingId; + final int protectionItemId; + final int protectionItemQuantity; + + CalquatTreeSapling(int calquatTreeSaplingId, int protectionItemId, int protectionItemQuantity) + { + this.calquatTreeSaplingId = calquatTreeSaplingId; + this.protectionItemId = protectionItemId; + this.protectionItemQuantity = protectionItemQuantity; + } + + @Override + public String getConfigKey() + { + return "calquatTreeSaplings"; + } + + @Override + public int getPlantableItemId() + { + return calquatTreeSaplingId; + } + + @Override + public int getProtectionItemId() + { + return protectionItemId; + } + + @Override + public int getProtectionItemQuantity() + { + return protectionItemQuantity; + } + + @Override + public ConfigEnum getDefault() + { + return CalquatTreeSapling.CALQUAT; + } + } + public enum GracefulOrFarming { NONE(), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingWorld.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingWorld.java index 16b508decbf..6f2416d2011 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingWorld.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/FarmingWorld.java @@ -49,9 +49,9 @@ public class FarmingWorld private Map> tabs = new HashMap<>(); private final Comparator tabSorter = Comparator - .comparing(FarmingPatch::getImplementation) - .thenComparing((FarmingPatch p) -> p.getRegion().getName()) - .thenComparing(FarmingPatch::getName); + .comparing(FarmingPatch::getImplementation) + .thenComparing((FarmingPatch p) -> p.getRegion().getName()) + .thenComparing(FarmingPatch::getName); @Getter private final FarmingRegion farmingGuildRegion; @@ -61,119 +61,119 @@ public class FarmingWorld // Some of these patches get updated in multiple regions. // It may be worth it to add a specialization for these patches add(new FarmingRegion("Al Kharid", 13106, false, Set.of(13105, 13362), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.CACTUS, new WorldPoint(3317, 3203, 0), - new Polygon( - new int[]{3315, 3315, 3316, 3316}, - new int[]{3202, 3203, 3203, 3202}, - 4 - ), - NpcID.FARMING_GARDENER_CACTUS) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.CACTUS, new WorldPoint(3317, 3203, 0), + new Polygon( + new int[]{3315, 3315, 3316, 3316}, + new int[]{3202, 3203, 3203, 3202}, + 4 + ), + NpcID.FARMING_GARDENER_CACTUS) )); add(new FarmingRegion("Aldarin", 5421, false, Set.of(5165, 5166, 5422, 5677, 5678), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(1366, 2941, 0), - new Polygon( - new int[]{1363, 1363, 1366, 1366}, - new int[]{2937, 2940, 2940, 2937}, - 4 - ), - NpcID.FARMING_GARDENER_HOPS_5) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(1366, 2941, 0), + new Polygon( + new int[]{1363, 1363, 1366, 1366}, + new int[]{2937, 2940, 2940, 2937}, + 4 + ), + NpcID.FARMING_GARDENER_HOPS_5) )); add(new FarmingRegion("Ardougne", 10290, false, Set.of(10546), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(2616, 3226, 0), - new Polygon( - new int[]{2617, 2617, 2618, 2618}, - new int[]{3225, 3226, 3226, 3225}, - 4 - ), - NpcID.FARMING_GARDENER_BUSH_4) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(2616, 3226, 0), + new Polygon( + new int[]{2617, 2617, 2618, 2618}, + new int[]{3225, 3226, 3226, 3225}, + 4 + ), + NpcID.FARMING_GARDENER_BUSH_4) )); add(new FarmingRegion("Ardougne", 10548, false, - new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(2672, 3379, 0), - new Polygon( - new int[]{2662, 2662, 2671, 2671, 2663, 2663}, - new int[]{3377, 3379, 3379, 3378, 3378, 3377}, - 6 - ), - NpcID.KRAGEN, 0), - new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(2672, 3371, 0), - new Polygon( - new int[]{2662, 2662, 2663, 2663, 2671, 2671}, - new int[]{3370, 3372, 3372, 3371, 3371, 3370}, - 6 - ), - NpcID.KRAGEN, 1), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(2668, 3375, 0), - new Polygon( - new int[]{2666, 2666, 2667, 2667}, - new int[]{3374, 3375, 3375, 3374}, - 4) - ), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(2672, 3375, 0), - new Polygon( - new int[]{2670, 2670, 2671, 2671}, - new int[]{3374, 3375, 3375, 3374}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(2662, 3375, 0)) + new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(2672, 3379, 0), + new Polygon( + new int[]{2662, 2662, 2671, 2671, 2663, 2663}, + new int[]{3377, 3379, 3379, 3378, 3378, 3377}, + 6 + ), + NpcID.KRAGEN, 0), + new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(2672, 3371, 0), + new Polygon( + new int[]{2662, 2662, 2663, 2663, 2671, 2671}, + new int[]{3370, 3372, 3372, 3371, 3371, 3370}, + 6 + ), + NpcID.KRAGEN, 1), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(2668, 3375, 0), + new Polygon( + new int[]{2666, 2666, 2667, 2667}, + new int[]{3374, 3375, 3375, 3374}, + 4) + ), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(2672, 3375, 0), + new Polygon( + new int[]{2670, 2670, 2671, 2671}, + new int[]{3374, 3375, 3375, 3374}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(2662, 3375, 0)) )); add(new FarmingRegion("Avium Savannah", 6702, true, Set.of(6446), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HARDWOOD_TREE, new WorldPoint(1685, 2971, 0), - new Polygon( - new int[]{1686, 1686, 1688, 1688}, - new int[]{2971, 2973, 2973, 2971}, - 4 - ), - NpcID.FROG_QUEST_MARCELLUS) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HARDWOOD_TREE, new WorldPoint(1685, 2971, 0), + new Polygon( + new int[]{1686, 1686, 1688, 1688}, + new int[]{2971, 2973, 2973, 2971}, + 4 + ), + NpcID.FROG_QUEST_MARCELLUS) )); add(new FarmingRegion("Brimhaven", 11058, false, Set.of(11057), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2766, 3213, 0), - new Polygon( - new int[]{2764, 2764, 2765, 2765}, - new int[]{3212, 3213, 3213, 3212}, - 4 - ), - NpcID.GARTH), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.SPIRIT_TREE, new WorldPoint(2800, 3202, 0), - new Polygon( - new int[]{2801, 2801, 2803, 2803}, - new int[]{3202, 3204, 3204, 3202}, - 4 - ), - NpcID.FARMING_GARDENER_SPIRIT_TREE_3) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2766, 3213, 0), + new Polygon( + new int[]{2764, 2764, 2765, 2765}, + new int[]{3212, 3213, 3213, 3212}, + 4 + ), + NpcID.GARTH), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.SPIRIT_TREE, new WorldPoint(2800, 3202, 0), + new Polygon( + new int[]{2801, 2801, 2803, 2803}, + new int[]{3202, 3204, 3204, 3202}, + 4 + ), + NpcID.FARMING_GARDENER_SPIRIT_TREE_3) )); add(new FarmingRegion("Catherby", 11062, false, Set.of(11061, 11318, 11317), - new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(2814, 3466, 0), - new Polygon( - new int[]{2805, 2805, 2814, 2814, 2806, 2806}, - new int[]{3466, 3468, 3468, 3467, 3467, 3466}, - 6 - ), - NpcID.DANTAERA, 0), - new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(2815, 3460, 0), - new Polygon( - new int[]{2805, 2805, 2806, 2806, 2814, 2814}, - new int[]{3459, 3461, 3461, 3460, 3460, 3459}, - 6 - ), - NpcID.DANTAERA, 1), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(2810, 3465, 0), - new Polygon( - new int[]{2809, 2809, 2810, 2810}, - new int[]{3463, 3464, 3464, 3463}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(2815, 3464, 0), - new Polygon( - new int[]{2813, 2813, 2814, 2814}, - new int[]{3463, 3464, 3464, 3463}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(2805, 3464, 0)) + new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(2814, 3466, 0), + new Polygon( + new int[]{2805, 2805, 2814, 2814, 2806, 2806}, + new int[]{3466, 3468, 3468, 3467, 3467, 3466}, + 6 + ), + NpcID.DANTAERA, 0), + new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(2815, 3460, 0), + new Polygon( + new int[]{2805, 2805, 2806, 2806, 2814, 2814}, + new int[]{3459, 3461, 3461, 3460, 3460, 3459}, + 6 + ), + NpcID.DANTAERA, 1), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(2810, 3465, 0), + new Polygon( + new int[]{2809, 2809, 2810, 2810}, + new int[]{3463, 3464, 3464, 3463}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(2815, 3464, 0), + new Polygon( + new int[]{2813, 2813, 2814, 2814}, + new int[]{3463, 3464, 3464, 3463}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(2805, 3464, 0)) ) { @Override @@ -188,13 +188,13 @@ public boolean isInBounds(WorldPoint loc) } }); add(new FarmingRegion("Catherby", 11317, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2860, 3432, 0), - new Polygon( - new int[]{2860, 2860, 2861, 2861}, - new int[]{3433, 3434, 3434, 3433}, - 4 - ), - NpcID.FARMING_GARDENER_FRUIT_4) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2860, 3432, 0), + new Polygon( + new int[]{2860, 2860, 2861, 2861}, + new int[]{3433, 3434, 3434, 3433}, + 4 + ), + NpcID.FARMING_GARDENER_FRUIT_4) ) { //The fruit tree patch is always sent when upstairs in 11317 @@ -206,118 +206,118 @@ public boolean isInBounds(WorldPoint loc) }); add(new FarmingRegion("Civitas illa Fortis", 6192, false, Set.of(6447, 6448, 6449, 6191, 6193), - new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(1586, 3102, 0), - new Polygon( - new int[]{1581, 1581, 1585, 1585, 1582, 1582}, - new int[]{3098, 3103, 3103, 3102, 3102, 3098}, - 6 - ), - NpcID.FORTIS_GARDENER, 0), - new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(1591, 3098, 0), - new Polygon( - new int[]{1585, 1585, 1589, 1589, 1590, 1590}, - new int[]{3094, 3095, 3095, 3098, 3098, 3094}, - 6 - ), - NpcID.FORTIS_GARDENER, 1), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(1587, 3099, 0), - new Polygon( - new int[]{1585, 1585, 1586, 1586}, - new int[]{3098, 3099, 3099, 3098}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(1581, 3094, 0), - new Polygon( - new int[]{1581, 1581, 1582, 1582}, - new int[]{3094, 3095, 3095, 3094}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(1587, 3103, 0)) + new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(1586, 3102, 0), + new Polygon( + new int[]{1581, 1581, 1585, 1585, 1582, 1582}, + new int[]{3098, 3103, 3103, 3102, 3102, 3098}, + 6 + ), + NpcID.FORTIS_GARDENER, 0), + new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(1591, 3098, 0), + new Polygon( + new int[]{1585, 1585, 1589, 1589, 1590, 1590}, + new int[]{3094, 3095, 3095, 3098, 3098, 3094}, + 6 + ), + NpcID.FORTIS_GARDENER, 1), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(1587, 3099, 0), + new Polygon( + new int[]{1585, 1585, 1586, 1586}, + new int[]{3098, 3099, 3099, 3098}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(1581, 3094, 0), + new Polygon( + new int[]{1581, 1581, 1582, 1582}, + new int[]{3094, 3095, 3095, 3094}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(1587, 3103, 0)) )); add(new FarmingRegion("Champions' Guild", 12596, true, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(3181, 3356, 0), - new Polygon( - new int[]{3181, 3181, 3182, 3182}, - new int[]{3357, 3358, 3358, 3357}, - 4 - ), - NpcID.FARMING_GARDENER_BUSH_1) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(3181, 3356, 0), + new Polygon( + new int[]{3181, 3181, 3182, 3182}, + new int[]{3357, 3358, 3358, 3357}, + 4 + ), + NpcID.FARMING_GARDENER_BUSH_1) )); add(new FarmingRegion("Draynor Manor", 12340, false, - new FarmingPatch("Belladonna", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BELLADONNA, new WorldPoint(3088, 3355, 0), - new Polygon( - new int[]{3086, 3086, 3087, 3087}, - new int[]{3354, 3355, 3355, 3354}, - 4 - )) + new FarmingPatch("Belladonna", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BELLADONNA, new WorldPoint(3088, 3355, 0), + new Polygon( + new int[]{3086, 3086, 3087, 3087}, + new int[]{3354, 3355, 3355, 3354}, + 4 + )) )); add(new FarmingRegion("Entrana", 11060, false, Set.of(11316), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(2812, 3334, 0), - new Polygon( - new int[]{2809, 2809, 2812, 2812}, - new int[]{3335, 3338, 3338, 3335}, - 4 - ), - NpcID.FRANCIS) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(2812, 3334, 0), + new Polygon( + new int[]{2809, 2809, 2812, 2812}, + new int[]{3335, 3338, 3338, 3335}, + 4 + ), + NpcID.FRANCIS) )); add(new FarmingRegion("Etceteria", 10300, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(2592, 3862, 0), - new Polygon( - new int[]{2591, 2591, 2592, 2592}, - new int[]{3863, 3864, 3864, 3863}, - 4 - ), - NpcID.FARMING_GARDENER_BUSH_3), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.SPIRIT_TREE, new WorldPoint(2613, 3856, 0), - new Polygon( - new int[]{2612, 2612, 2614, 2614}, - new int[]{3857, 3859, 3859, 3857}, - 4 - ), - NpcID.FARMING_GARDENER_SPIRIT_TREE_2) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(2592, 3862, 0), + new Polygon( + new int[]{2591, 2591, 2592, 2592}, + new int[]{3863, 3864, 3864, 3863}, + 4 + ), + NpcID.FARMING_GARDENER_BUSH_3), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.SPIRIT_TREE, new WorldPoint(2613, 3856, 0), + new Polygon( + new int[]{2612, 2612, 2614, 2614}, + new int[]{3857, 3859, 3859, 3857}, + 4 + ), + NpcID.FARMING_GARDENER_SPIRIT_TREE_2) )); add(new FarmingRegion("Falador", 11828, false, Set.of(12084), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(3004, 3371, 0), - new Polygon( - new int[]{3003, 3003, 3005, 3005}, - new int[]{3372, 3374, 3374, 3372}, - 4 - ), - NpcID.FARMING_GARDENER_TREE_2) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(3004, 3371, 0), + new Polygon( + new int[]{3003, 3003, 3005, 3005}, + new int[]{3372, 3374, 3374, 3372}, + 4 + ), + NpcID.FARMING_GARDENER_TREE_2) )); add(new FarmingRegion("Falador", 12083, false, - new FarmingPatch("North West", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3052, 3307, 0), - new Polygon( - new int[]{3050, 3050, 3054, 3054, 3051, 3051}, - new int[]{3307, 3312, 3312, 3311, 3311, 3307}, - 6 - ), - NpcID.ELSTAN, 0), - new FarmingPatch("South East", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(3055, 3305, 0), - new Polygon( - new int[]{3055, 3055, 3058, 3058, 3059, 3059}, - new int[]{3303, 3304, 3304, 3308, 3308, 3303}, - 6 - ), - NpcID.ELSTAN, 1), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(3053, 3307, 0), - new Polygon( - new int[]{3054, 3054, 3055, 3055}, - new int[]{3307, 3308, 3308, 3307}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(3057, 3311, 0), - new Polygon( - new int[]{3058, 3058, 3059, 3059}, - new int[]{3311, 3312, 3312, 3311}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(3056, 3311, 0)) + new FarmingPatch("North West", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3052, 3307, 0), + new Polygon( + new int[]{3050, 3050, 3054, 3054, 3051, 3051}, + new int[]{3307, 3312, 3312, 3311, 3311, 3307}, + 6 + ), + NpcID.ELSTAN, 0), + new FarmingPatch("South East", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(3055, 3305, 0), + new Polygon( + new int[]{3055, 3055, 3058, 3058, 3059, 3059}, + new int[]{3303, 3304, 3304, 3308, 3308, 3303}, + 6 + ), + NpcID.ELSTAN, 1), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(3053, 3307, 0), + new Polygon( + new int[]{3054, 3054, 3055, 3055}, + new int[]{3307, 3308, 3308, 3307}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(3057, 3311, 0), + new Polygon( + new int[]{3058, 3058, 3059, 3059}, + new int[]{3311, 3312, 3312, 3311}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(3056, 3311, 0)) ) { @Override @@ -329,27 +329,27 @@ public boolean isInBounds(WorldPoint loc) }); add(new FarmingRegion("Fossil Island", 14651, false, Set.of(14907, 14908, 15164, 14652, 14906, 14650, 15162, 15163), - new FarmingPatch("East", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HARDWOOD_TREE, new WorldPoint(3713, 3835, 0), - new Polygon( - new int[]{3714, 3714, 3716, 3716}, - new int[]{3834, 3836, 3836, 3834}, - 4 - ), - NpcID.FOSSIL_SQUIRREL_GARDENER1), - new FarmingPatch("Middle", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.HARDWOOD_TREE, new WorldPoint(3708, 3835, 0), - new Polygon( - new int[]{3707, 3707, 3709, 3709}, - new int[]{3832, 3834, 3834, 3832}, - 4 - ), - NpcID.FOSSIL_SQUIRREL_GARDENER2), - new FarmingPatch("West", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.HARDWOOD_TREE, new WorldPoint(3701, 3836, 0), - new Polygon( - new int[]{3701, 3701, 3703, 3703}, - new int[]{3836, 3838, 3838, 3836}, - 4 - ), - NpcID.FOSSIL_SQUIRREL_GARDENER3) + new FarmingPatch("East", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HARDWOOD_TREE, new WorldPoint(3713, 3835, 0), + new Polygon( + new int[]{3714, 3714, 3716, 3716}, + new int[]{3834, 3836, 3836, 3834}, + 4 + ), + NpcID.FOSSIL_SQUIRREL_GARDENER1), + new FarmingPatch("Middle", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.HARDWOOD_TREE, new WorldPoint(3708, 3835, 0), + new Polygon( + new int[]{3707, 3707, 3709, 3709}, + new int[]{3832, 3834, 3834, 3832}, + 4 + ), + NpcID.FOSSIL_SQUIRREL_GARDENER2), + new FarmingPatch("West", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.HARDWOOD_TREE, new WorldPoint(3701, 3836, 0), + new Polygon( + new int[]{3701, 3701, 3703, 3703}, + new int[]{3836, 3838, 3838, 3836}, + 4 + ), + NpcID.FOSSIL_SQUIRREL_GARDENER3) ) { @Override @@ -366,7 +366,7 @@ public boolean isInBounds(WorldPoint loc) //East and west ladders to rope bridge if ((loc.getX() == 3729 || loc.getX() == 3728 || loc.getX() == 3747 || loc.getX() == 3746) - && loc.getY() <= 3832 && loc.getY() >= 3830) + && loc.getY() <= 3832 && loc.getY() >= 3830) { return false; } @@ -375,185 +375,185 @@ public boolean isInBounds(WorldPoint loc) } }); add(new FarmingRegion("Seaweed", 15008, false, - new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.SEAWEED, new WorldPoint(3733, 10272, 1), - new Polygon( - new int[]{3733, 3733, 3734, 3734}, - new int[]{10273, 10274, 10274, 10273}, - 4 - ), - NpcID.FOSSIL_GARDENER_UNDERWATER, 0), - new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.SEAWEED, new WorldPoint(3733, 10269, 1), - new Polygon( - new int[]{3733, 3733, 3734, 3734}, - new int[]{10267, 10268, 10268, 10267}, - 4 - ), - NpcID.FOSSIL_GARDENER_UNDERWATER, 1) + new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.SEAWEED, new WorldPoint(3733, 10272, 1), + new Polygon( + new int[]{3733, 3733, 3734, 3734}, + new int[]{10273, 10274, 10274, 10273}, + 4 + ), + NpcID.FOSSIL_GARDENER_UNDERWATER, 0), + new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.SEAWEED, new WorldPoint(3733, 10269, 1), + new Polygon( + new int[]{3733, 3733, 3734, 3734}, + new int[]{10267, 10268, 10268, 10267}, + 4 + ), + NpcID.FOSSIL_GARDENER_UNDERWATER, 1) )); add(new FarmingRegion("Gnome Stronghold", 9781, true, Set.of(9782, 9526, 9525), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(2437, 3417, 0), - new Polygon( - new int[]{2437, 2437, 2435, 2435}, - new int[]{3416, 3414, 3414, 3416}, - 4 - ), - NpcID.FARMING_GARDENER_TREE_GNOME), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.FRUIT_TREE, new WorldPoint(2475, 3447, 0), - new Polygon( - new int[]{2475, 2475, 2476, 2476}, - new int[]{3445, 3446, 3446, 3445}, - 4 - ), - NpcID.FARMING_GARDENER_FRUIT_1) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(2437, 3417, 0), + new Polygon( + new int[]{2437, 2437, 2435, 2435}, + new int[]{3416, 3414, 3414, 3416}, + 4 + ), + NpcID.FARMING_GARDENER_TREE_GNOME), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.FRUIT_TREE, new WorldPoint(2475, 3447, 0), + new Polygon( + new int[]{2475, 2475, 2476, 2476}, + new int[]{3445, 3446, 3446, 3445}, + 4 + ), + NpcID.FARMING_GARDENER_FRUIT_1) )); add(new FarmingRegion("Harmony", 15148, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3795, 2838, 0), - new Polygon( - new int[]{3794, 3794}, - new int[]{2833, 2838}, - 2 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.HERB, new WorldPoint(3790, 3839, 0), - new Polygon( - new int[]{3789, 3789, 3790, 3790}, - new int[]{2837, 2838, 2838, 2837}, - 4 - )) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3795, 2838, 0), + new Polygon( + new int[]{3794, 3794}, + new int[]{2833, 2838}, + 2 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.HERB, new WorldPoint(3790, 3839, 0), + new Polygon( + new int[]{3789, 3789, 3790, 3790}, + new int[]{2837, 2838, 2838, 2837}, + 4 + )) )); add(new FarmingRegion("Kourend", 6967, false, Set.of(6711), - new FarmingPatch("North East", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(1739, 3553, 0), - new Polygon( - new int[]{1733, 1733, 1739, 1739, 1738, 1738}, - new int[]{3558, 3559, 3559, 3554, 3554, 3558}, - 6 - ), - NpcID.HOSIDIUS_ALLOTMENT_GARDENER, 0), - new FarmingPatch("South West", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(1735, 3552, 0), - new Polygon( - new int[]{1730, 1730, 1731, 1731, 1735, 1735}, - new int[]{3550, 3555, 3555, 3551, 3551, 3550}, - 6 - ), - NpcID.HOSIDIUS_ALLOTMENT_GARDENER, 1), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(1735, 3553, 0), - new Polygon( - new int[]{1734, 1734, 1735, 1734}, - new int[]{3554, 3555, 3555, 1734}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(1739, 3552, 0), - new Polygon( - new int[]{1738, 1738, 1739, 1739}, - new int[]{3550, 3551, 3551, 3550}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(1730, 3557, 0)), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_F, PatchImplementation.SPIRIT_TREE, new WorldPoint(1695, 3543, 0), - new Polygon( - new int[]{1692, 1692, 1694, 1694}, - new int[]{3541, 3543, 3543, 3541}, - 4 - ), - NpcID.FARMING_GARDENER_SPIRIT_TREE_4) + new FarmingPatch("North East", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(1739, 3553, 0), + new Polygon( + new int[]{1733, 1733, 1739, 1739, 1738, 1738}, + new int[]{3558, 3559, 3559, 3554, 3554, 3558}, + 6 + ), + NpcID.HOSIDIUS_ALLOTMENT_GARDENER, 0), + new FarmingPatch("South West", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(1735, 3552, 0), + new Polygon( + new int[]{1730, 1730, 1731, 1731, 1735, 1735}, + new int[]{3550, 3555, 3555, 3551, 3551, 3550}, + 6 + ), + NpcID.HOSIDIUS_ALLOTMENT_GARDENER, 1), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(1735, 3553, 0), + new Polygon( + new int[]{1734, 1734, 1735, 1734}, + new int[]{3554, 3555, 3555, 1734}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(1739, 3552, 0), + new Polygon( + new int[]{1738, 1738, 1739, 1739}, + new int[]{3550, 3551, 3551, 3550}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(1730, 3557, 0)), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_F, PatchImplementation.SPIRIT_TREE, new WorldPoint(1695, 3543, 0), + new Polygon( + new int[]{1692, 1692, 1694, 1694}, + new int[]{3541, 3543, 3543, 3541}, + 4 + ), + NpcID.FARMING_GARDENER_SPIRIT_TREE_4) )); /* Not implemented */ add(new FarmingRegion("Kourend", 7223, false, - new FarmingPatch("East 1", VarbitID.FARMING_TRANSMIT_A1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("East 2", VarbitID.FARMING_TRANSMIT_A2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("East 3", VarbitID.FARMING_TRANSMIT_B1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("East 4", VarbitID.FARMING_TRANSMIT_B2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("East 5", VarbitID.FARMING_TRANSMIT_C1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("East 6", VarbitID.FARMING_TRANSMIT_C2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("West 1", VarbitID.FARMING_TRANSMIT_D1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("West 2", VarbitID.FARMING_TRANSMIT_D2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("West 3", VarbitID.FARMING_TRANSMIT_E1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("West 4", VarbitID.FARMING_TRANSMIT_E2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("West 5", VarbitID.FARMING_TRANSMIT_F1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), - new FarmingPatch("West 6", VarbitID.FARMING_TRANSMIT_F2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)) + new FarmingPatch("East 1", VarbitID.FARMING_TRANSMIT_A1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("East 2", VarbitID.FARMING_TRANSMIT_A2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("East 3", VarbitID.FARMING_TRANSMIT_B1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("East 4", VarbitID.FARMING_TRANSMIT_B2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("East 5", VarbitID.FARMING_TRANSMIT_C1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("East 6", VarbitID.FARMING_TRANSMIT_C2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("West 1", VarbitID.FARMING_TRANSMIT_D1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("West 2", VarbitID.FARMING_TRANSMIT_D2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("West 3", VarbitID.FARMING_TRANSMIT_E1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("West 4", VarbitID.FARMING_TRANSMIT_E2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("West 5", VarbitID.FARMING_TRANSMIT_F1, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)), + new FarmingPatch("West 6", VarbitID.FARMING_TRANSMIT_F2, PatchImplementation.GRAPES, new WorldPoint(-1, -1, 0)) )); add(new FarmingRegion("Lletya", 9265, false, Set.of(11103), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2345, 3162, 0), - new Polygon( - new int[]{2346, 2346, 2347, 2347}, - new int[]{3161, 3162, 3162, 3161}, - 4 - ), - NpcID.FARMING_GARDENER_FRUIT_TREE_5) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2345, 3162, 0), + new Polygon( + new int[]{2346, 2346, 2347, 2347}, + new int[]{3161, 3162, 3162, 3161}, + 4 + ), + NpcID.FARMING_GARDENER_FRUIT_TREE_5) )); add(new FarmingRegion("Lumbridge", 12851, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(3232, 3317, 0), - new Polygon( - new int[]{3227, 3227, 3231, 3231}, - new int[]{3313, 3317, 3317, 3313}, - 4 - ), - NpcID.FARMING_GARDENER_HOPS_3) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(3232, 3317, 0), + new Polygon( + new int[]{3227, 3227, 3231, 3231}, + new int[]{3313, 3317, 3317, 3313}, + 4 + ), + NpcID.FARMING_GARDENER_HOPS_3) )); add(new FarmingRegion("Lumbridge", 12594, false, Set.of(12850), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(3195, 3230, 0), - new Polygon( - new int[]{3192, 3192, 3194, 3194}, - new int[]{3230, 3232, 3232, 3230}, - 4 - ), - NpcID.FARMING_GARDENER_TREE_4) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(3195, 3230, 0), + new Polygon( + new int[]{3192, 3192, 3194, 3194}, + new int[]{3230, 3232, 3232, 3230}, + 4 + ), + NpcID.FARMING_GARDENER_TREE_4) )); add(new FarmingRegion("Morytania", 13622, false, Set.of(13878), - new FarmingPatch("Mushroom", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.MUSHROOM, new WorldPoint(3451, 3474, 0), - new Polygon( - new int[]{3451, 3451, 3452, 3452}, - new int[]{3472, 3473, 3473, 3472}, - 4 - )) + new FarmingPatch("Mushroom", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.MUSHROOM, new WorldPoint(3451, 3474, 0), + new Polygon( + new int[]{3451, 3451, 3452, 3452}, + new int[]{3472, 3473, 3473, 3472}, + 4 + )) )); add(new FarmingRegion("Morytania", 14391, false, Set.of(14390), - new FarmingPatch("North West", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3597, 3524, 0), - new Polygon( - new int[]{3597, 3597, 3601, 3601, 3598, 3598}, - new int[]{3525, 3530, 3530, 3529, 3529, 3525}, - 6 - ), - NpcID.LYRA, 0), - new FarmingPatch("South East", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(3601, 3522, 0), - new Polygon( - new int[]{3602, 3602, 3605, 3605, 3606, 3606}, - new int[]{3521, 3522, 3522, 3526, 3526, 3521}, - 6 - ), - NpcID.LYRA, 1), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(3601, 3524, 0), - new Polygon( - new int[]{3601, 3601, 3602, 3602}, - new int[]{3225, 3226, 3226, 3225}, - 4 - ) - ), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(3605, 3528, 0), - new Polygon( - new int[]{3605, 3605, 3606, 3606}, - new int[]{3529, 3530, 3530, 3529}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(3609, 3522, 0)) + new FarmingPatch("North West", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3597, 3524, 0), + new Polygon( + new int[]{3597, 3597, 3601, 3601, 3598, 3598}, + new int[]{3525, 3530, 3530, 3529, 3529, 3525}, + 6 + ), + NpcID.LYRA, 0), + new FarmingPatch("South East", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(3601, 3522, 0), + new Polygon( + new int[]{3602, 3602, 3605, 3605, 3606, 3606}, + new int[]{3521, 3522, 3522, 3526, 3526, 3521}, + 6 + ), + NpcID.LYRA, 1), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(3601, 3524, 0), + new Polygon( + new int[]{3601, 3601, 3602, 3602}, + new int[]{3225, 3226, 3226, 3225}, + 4 + ) + ), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.HERB, new WorldPoint(3605, 3528, 0), + new Polygon( + new int[]{3605, 3605, 3606, 3606}, + new int[]{3529, 3530, 3530, 3529}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.COMPOST, new WorldPoint(3609, 3522, 0)) )); add(new FarmingRegion("Port Sarim", 12082, false, Set.of(12083), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.SPIRIT_TREE, new WorldPoint(3059, 3257, 0), - new Polygon( - new int[]{3059, 3059, 3061, 3061}, - new int[]{3257, 3259, 3259, 3257}, - 4 - ), - NpcID.FARMING_GARDENER_SPIRIT_TREE_1) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.SPIRIT_TREE, new WorldPoint(3059, 3257, 0), + new Polygon( + new int[]{3059, 3059, 3061, 3061}, + new int[]{3257, 3259, 3259, 3257}, + 4 + ), + NpcID.FARMING_GARDENER_SPIRIT_TREE_1) ) { @Override @@ -564,218 +564,218 @@ public boolean isInBounds(WorldPoint loc) }); add(new FarmingRegion("Rimmington", 11570, false, Set.of(11826), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(2940, 3223, 0), - new Polygon( - new int[]{2940, 2940, 2941, 2941}, - new int[]{3221, 3222, 3222, 3221}, - 4 - ), - NpcID.FARMING_GARDENER_BUSH_2) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.BUSH, new WorldPoint(2940, 3223, 0), + new Polygon( + new int[]{2940, 2940, 2941, 2941}, + new int[]{3221, 3222, 3222, 3221}, + 4 + ), + NpcID.FARMING_GARDENER_BUSH_2) )); add(new FarmingRegion("Seers' Village", 10551, false, Set.of(10550), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(2669, 3522, 0), - new Polygon( - new int[]{2664, 2664, 2669, 2669}, - new int[]{3523, 3528, 3528, 3523}, - 4 - ), - NpcID.FARMING_GARDENER_HOPS_4) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(2669, 3522, 0), + new Polygon( + new int[]{2664, 2664, 2669, 2669}, + new int[]{3523, 3528, 3528, 3523}, + 4 + ), + NpcID.FARMING_GARDENER_HOPS_4) )); add(new FarmingRegion("Tai Bwo Wannai", 11056, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.CALQUAT, new WorldPoint(2796, 3103, 0), - new Polygon( - new int[]{2795, 2795, 2797, 2797}, - new int[]{3100, 3102, 3102, 3100}, - 4 - ), - NpcID.FARMING_GARDENER_CALQUAT) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.CALQUAT, new WorldPoint(2796, 3103, 0), + new Polygon( + new int[]{2795, 2795, 2797, 2797}, + new int[]{3100, 3102, 3102, 3100}, + 4 + ), + NpcID.FARMING_GARDENER_CALQUAT) )); add(new FarmingRegion("Taverley", 11573, false, Set.of(11829), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(2936, 3440, 0), - new Polygon( - new int[]{2935, 2935, 2937, 2937}, - new int[]{3437, 3439, 3439, 3437}, - 4 - ), - NpcID.FARMING_GARDENER_TREE_1) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(2936, 3440, 0), + new Polygon( + new int[]{2935, 2935, 2937, 2937}, + new int[]{3437, 3439, 3439, 3437}, + 4 + ), + NpcID.FARMING_GARDENER_TREE_1) )); add(new FarmingRegion("Tree Gnome Village", 9777, true, Set.of(10033), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2488, 3180, 0), - new Polygon( - new int[]{2489, 2489, 2490, 2490}, - new int[]{3179, 3180, 3180, 3179}, - 4 - ), - NpcID.FARMING_GARDENER_FRUIT_2) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.FRUIT_TREE, new WorldPoint(2488, 3180, 0), + new Polygon( + new int[]{2489, 2489, 2490, 2490}, + new int[]{3179, 3180, 3180, 3179}, + 4 + ), + NpcID.FARMING_GARDENER_FRUIT_2) )); add(new FarmingRegion("Troll Stronghold", 11321, true, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HERB, new WorldPoint(2827, 3693, 0), - new Polygon( - new int[]{2826, 2826, 2827, 2827}, - new int[]{3694, 3695, 3695, 3694}, - 4 - )) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HERB, new WorldPoint(2827, 3693, 0), + new Polygon( + new int[]{2826, 2826, 2827, 2827}, + new int[]{3694, 3695, 3695, 3694}, + 4 + )) )); add(new FarmingRegion("Varrock", 12854, false, Set.of(12853), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(3229, 3457, 0), - new Polygon( - new int[]{3228, 3228, 3230, 3230}, - new int[]{3458, 3460, 3460, 3458}, - 4 - ), - NpcID.FARMING_GARDENER_TREE_3_02) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.TREE, new WorldPoint(3229, 3457, 0), + new Polygon( + new int[]{3228, 3228, 3230, 3230}, + new int[]{3458, 3460, 3460, 3458}, + 4 + ), + NpcID.FARMING_GARDENER_TREE_3_02) )); add(new FarmingRegion("Yanille", 10288, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(2573, 3106, 0), - new Polygon( - new int[]{2574, 2574, 2577, 2577}, - new int[]{3103, 3106, 3106, 3103}, - 4 - ), - NpcID.FARMING_GARDENER_HOPS_1) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HOPS, new WorldPoint(2573, 3106, 0), + new Polygon( + new int[]{2574, 2574, 2577, 2577}, + new int[]{3103, 3106, 3106, 3103}, + 4 + ), + NpcID.FARMING_GARDENER_HOPS_1) )); add(new FarmingRegion("Weiss", 11325, false, - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HERB, new WorldPoint(2849, 3933, 0), - new Polygon( - new int[]{2848, 2848, 2849, 2849}, - new int[]{3934, 3935, 3935, 3934}, - 4 - )) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.HERB, new WorldPoint(2849, 3933, 0), + new Polygon( + new int[]{2848, 2848, 2849, 2849}, + new int[]{3934, 3935, 3935, 3934}, + 4 + )) )); add(new FarmingRegion("Farming Guild", 5021, true, - new FarmingPatch("Hespori", VarbitID.FARMING_TRANSMIT_J, PatchImplementation.HESPORI, new WorldPoint(1246, 10085, 0), - new Polygon( - new int[]{1246, 1248, 1248, 1246}, - new int[]{10086, 10088, 10088, 10086}, - 4 - )) + new FarmingPatch("Hespori", VarbitID.FARMING_TRANSMIT_J, PatchImplementation.HESPORI, new WorldPoint(1246, 10085, 0), + new Polygon( + new int[]{1246, 1248, 1248, 1246}, + new int[]{10086, 10088, 10088, 10086}, + 4 + )) )); //Full 3x3 region area centered on farming guild add(farmingGuildRegion = new FarmingRegion("Farming Guild", 4922, true, Set.of(5177, 5178, 5179, 4921, 4923, 4665, 4666, 4667), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_G, PatchImplementation.TREE, new WorldPoint(1233, 3734, 0), - new Polygon( - new int[]{1231, 1231, 1233, 1233}, - new int[]{3735, 3737, 3737, 3735}, - 4 - ), - NpcID.FARMING_GARDENER_FARMGUILD_T2), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.HERB, new WorldPoint(1238, 3728, 0), - new Polygon( - new int[]{1238, 1238, 1239, 1239}, - new int[]{3726, 3727, 3727, 3726}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.BUSH, new WorldPoint(1261, 3732, 0), - new Polygon( - new int[]{1260, 1260, 1261, 1261}, - new int[]{3733, 3734, 3734, 3733}, - 4 - ), - NpcID.FARMING_GARDENER_FARMGUILD_T1, 3), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_H, PatchImplementation.FLOWER, new WorldPoint(1261, 3727, 0), - new Polygon( - new int[]{1260, 1260, 1261, 1261}, - new int[]{3725, 3726, 3726, 3725}, - 4 - )), - new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.ALLOTMENT, new WorldPoint(1266, 3732, 0), - new Polygon( - new int[]{1267, 1267, 1268, 1268, 1272, 1272}, - new int[]{3732, 3736, 3736, 3733, 3733, 3732}, - 6 - ), - NpcID.FARMING_GARDENER_FARMGUILD_T1, 1), - new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.ALLOTMENT, new WorldPoint(1266, 3727, 0), - new Polygon( - new int[]{1267, 1267, 1272, 1272, 1268, 1268}, - new int[]{3723, 3727, 3727, 3726, 3726, 3723}, - 6 - ), - NpcID.FARMING_GARDENER_FARMGUILD_T1, 2), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_N, PatchImplementation.BIG_COMPOST, new WorldPoint(1271, 3729, 0)), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_F, PatchImplementation.CACTUS, new WorldPoint(1264, 3746, 0), - new Polygon( - new int[]{1264, 1264, 1265, 1265}, - new int[]{3747, 3748, 3748, 3747}, - 4 - ), - NpcID.FARMING_GARDENER_FARMGUILD_T1, 0), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.SPIRIT_TREE, new WorldPoint(1251, 3749, 0), - new Polygon( - new int[]{1252, 1252, 1254, 1254}, - new int[]{3749, 3751, 3751, 3749}, - 4 - ), - NpcID.FARMING_GARDENER_SPIRIT_TREE_5), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_K, PatchImplementation.FRUIT_TREE, new WorldPoint(1243, 3757, 0), - new Polygon( - new int[]{1242, 1242, 1243, 1243}, - new int[]{3758, 3759, 3758, 3758}, - 4 - ), - NpcID.FARMING_GARDENER_FARMGUILD_T3), - new FarmingPatch("Anima", VarbitID.FARMING_TRANSMIT_M, PatchImplementation.ANIMA, new WorldPoint(1233, 3725, 0), - new Polygon( - new int[]{1231, 1231, 1233, 1233}, - new int[]{3722, 3724, 3724, 3722}, - 4 - )), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_L, PatchImplementation.CELASTRUS, new WorldPoint(1245, 3752, 0), - new Polygon( - new int[]{1243, 1243, 1245, 1245}, - new int[]{3749, 3751, 3751, 3749}, - 4 - ), - NpcID.FARMING_GARDENER_FARMGUILD_CELASTRUS), - new FarmingPatch("", VarbitID.FARMING_TRANSMIT_I, PatchImplementation.REDWOOD, new WorldPoint(1233, 3752, 0), - new Polygon( - new int[]{1225, 1225, 1232, 1232}, - new int[]{3751, 3758, 3758, 3751}, - 4 - ), - NpcID.FARMING_GARDENER_FARMGUILD_REDWOOD) + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_G, PatchImplementation.TREE, new WorldPoint(1233, 3734, 0), + new Polygon( + new int[]{1231, 1231, 1233, 1233}, + new int[]{3735, 3737, 3737, 3735}, + 4 + ), + NpcID.FARMING_GARDENER_FARMGUILD_T2), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.HERB, new WorldPoint(1238, 3728, 0), + new Polygon( + new int[]{1238, 1238, 1239, 1239}, + new int[]{3726, 3727, 3727, 3726}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.BUSH, new WorldPoint(1261, 3732, 0), + new Polygon( + new int[]{1260, 1260, 1261, 1261}, + new int[]{3733, 3734, 3734, 3733}, + 4 + ), + NpcID.FARMING_GARDENER_FARMGUILD_T1, 3), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_H, PatchImplementation.FLOWER, new WorldPoint(1261, 3727, 0), + new Polygon( + new int[]{1260, 1260, 1261, 1261}, + new int[]{3725, 3726, 3726, 3725}, + 4 + )), + new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.ALLOTMENT, new WorldPoint(1266, 3732, 0), + new Polygon( + new int[]{1267, 1267, 1268, 1268, 1272, 1272}, + new int[]{3732, 3736, 3736, 3733, 3733, 3732}, + 6 + ), + NpcID.FARMING_GARDENER_FARMGUILD_T1, 1), + new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.ALLOTMENT, new WorldPoint(1266, 3727, 0), + new Polygon( + new int[]{1267, 1267, 1272, 1272, 1268, 1268}, + new int[]{3723, 3727, 3727, 3726, 3726, 3723}, + 6 + ), + NpcID.FARMING_GARDENER_FARMGUILD_T1, 2), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_N, PatchImplementation.BIG_COMPOST, new WorldPoint(1271, 3729, 0)), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_F, PatchImplementation.CACTUS, new WorldPoint(1264, 3746, 0), + new Polygon( + new int[]{1264, 1264, 1265, 1265}, + new int[]{3747, 3748, 3748, 3747}, + 4 + ), + NpcID.FARMING_GARDENER_FARMGUILD_T1, 0), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.SPIRIT_TREE, new WorldPoint(1251, 3749, 0), + new Polygon( + new int[]{1252, 1252, 1254, 1254}, + new int[]{3749, 3751, 3751, 3749}, + 4 + ), + NpcID.FARMING_GARDENER_SPIRIT_TREE_5), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_K, PatchImplementation.FRUIT_TREE, new WorldPoint(1243, 3757, 0), + new Polygon( + new int[]{1242, 1242, 1243, 1243}, + new int[]{3758, 3759, 3758, 3758}, + 4 + ), + NpcID.FARMING_GARDENER_FARMGUILD_T3), + new FarmingPatch("Anima", VarbitID.FARMING_TRANSMIT_M, PatchImplementation.ANIMA, new WorldPoint(1233, 3725, 0), + new Polygon( + new int[]{1231, 1231, 1233, 1233}, + new int[]{3722, 3724, 3724, 3722}, + 4 + )), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_L, PatchImplementation.CELASTRUS, new WorldPoint(1245, 3752, 0), + new Polygon( + new int[]{1243, 1243, 1245, 1245}, + new int[]{3749, 3751, 3751, 3749}, + 4 + ), + NpcID.FARMING_GARDENER_FARMGUILD_CELASTRUS), + new FarmingPatch("", VarbitID.FARMING_TRANSMIT_I, PatchImplementation.REDWOOD, new WorldPoint(1233, 3752, 0), + new Polygon( + new int[]{1225, 1225, 1232, 1232}, + new int[]{3751, 3758, 3758, 3751}, + 4 + ), + NpcID.FARMING_GARDENER_FARMGUILD_REDWOOD) )); //All of Prifddinas, and all of Prifddinas Underground add(new FarmingRegion("Prifddinas", 13151, false, Set.of(12895, 12894, 13150, 12994, 12993, 12737, 12738, 12126, 12127, 13250), new FarmingPatch("North", VarbitID.FARMING_TRANSMIT_A, PatchImplementation.ALLOTMENT, new WorldPoint(3293, 6105, 0), - new Polygon( - new int[]{3288, 3288, 3293, 3293, 3289, 3289}, - new int[]{6101, 6104, 6104, 6103, 6103, 6101}, - 6 - ), - NpcID.PRIF_GARDENER, 0), + new Polygon( + new int[]{3288, 3288, 3293, 3293, 3289, 3289}, + new int[]{6101, 6104, 6104, 6103, 6103, 6101}, + 6 + ), + NpcID.PRIF_GARDENER, 0), new FarmingPatch("South", VarbitID.FARMING_TRANSMIT_B, PatchImplementation.ALLOTMENT, new WorldPoint(3294, 6096, 0), - new Polygon( - new int[]{3288, 3288, 3289, 3289, 3293, 3293}, - new int[]{6095, 6098, 6098, 6096, 6096, 6095}, - 6 - ), - NpcID.PRIF_GARDENER, 1), + new Polygon( + new int[]{3288, 3288, 3289, 3289, 3293, 3293}, + new int[]{6095, 6098, 6098, 6096, 6096, 6095}, + 6 + ), + NpcID.PRIF_GARDENER, 1), new FarmingPatch("", VarbitID.FARMING_TRANSMIT_C, PatchImplementation.FLOWER, new WorldPoint(3294, 6100, 0), - new Polygon( - new int[]{3292, 3292, 3293, 3293}, - new int[]{6099, 6100, 6100, 6099}, - 4 - )), + new Polygon( + new int[]{3292, 3292, 3293, 3293}, + new int[]{6099, 6100, 6100, 6099}, + 4 + )), new FarmingPatch("", VarbitID.FARMING_TRANSMIT_E, PatchImplementation.CRYSTAL_TREE, new WorldPoint(3291, 6117, 0), - new Polygon( - new int[]{3291, 3291, 3292, 3292}, - new int[]{6118, 6119, 6119, 6118}, - 4 - )), + new Polygon( + new int[]{3291, 3291, 3292, 3292}, + new int[]{6118, 6119, 6119, 6118}, + 4 + )), new FarmingPatch("", VarbitID.FARMING_TRANSMIT_D, PatchImplementation.COMPOST, new WorldPoint(3288, 6100, 0)) - )); + )); // Finalize this.regions = Multimaps.unmodifiableMultimap(this.regions); @@ -797,15 +797,15 @@ private void add(FarmingRegion r) for (FarmingPatch p : r.getPatches()) { tabs - .computeIfAbsent(p.getImplementation().getTab(), k -> new TreeSet<>(tabSorter)) - .add(p); + .computeIfAbsent(p.getImplementation().getTab(), k -> new TreeSet<>(tabSorter)) + .add(p); } } Collection getRegionsForLocation(WorldPoint location) { return this.regions.get(location.getRegionID()).stream() - .filter(region -> region.isInBounds(location)) - .collect(Collectors.toSet()); + .filter(region -> region.isInBounds(location)) + .collect(Collectors.toSet()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/HerbRun.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/HerbRun.java index 626945c67d8..cf76611eed4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/HerbRun.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/HerbRun.java @@ -26,12 +26,13 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; +import net.runelite.client.plugins.microbot.questhelper.config.ConfigKeys; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.panel.TopLevelPanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.ComplexStateQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.HelperConfig; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.requirements.ManualRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; @@ -40,13 +41,9 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.runelite.RuneliteRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.Varbits; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; @@ -60,33 +57,114 @@ import javax.inject.Inject; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; + public class HerbRun extends ComplexStateQuestHelper { - // TODO: Updating setId and setName in ItemRequirement @Inject private FarmingWorld farmingWorld; private FarmingHandler farmingHandler; - DetailedQuestStep waitForHerbs, ardougnePatch, catherbyPatch, faladorPatch, farmingGuildPatch, harmonyPatch, morytaniaPatch, trollStrongholdPatch, weissPatch, hosidiusPatch, varlamorePatch; - - DetailedQuestStep ardougnePlant, catherbyPlant, faladorPlant, farmingGuildPlant, harmonyPlant, morytaniaPlant, trollStrongholdPlant, weissPlant, hosidiusPlant, varlamorePlant; - ItemRequirement spade, dibber, rake, seed, compost; - ItemRequirement ectophial, magicSec, explorerRing2, ardyCloak2, xericsTalisman, catherbyTeleport, trollheimTeleport, icyBasalt, stonyBasalt, farmingGuildTeleport, hosidiusHouseTeleport, hunterWhistle; - ItemRequirement gracefulHood, gracefulTop, gracefulLegs, gracefulGloves, gracefulBoots, gracefulCape, gracefulOutfit; - ItemRequirement farmingHat, farmingTop, farmingLegs, farmingBoots, farmersOutfit; - - Requirement accessToHarmony, accessToWeiss, accessToTrollStronghold, accessToFarmingGuildPatch, accessToVarlamore; - - ManualRequirement ardougneEmpty, catherbyEmpty, faladorEmpty, farmingGuildEmpty, harmonyEmpty, morytaniaEmpty, trollStrongholdEmpty, weissEmpty, hosidiusEmpty, varlamoreEmpty; - ManualRequirement ardougneReady, catherbyReady, faladorReady, farmingGuildReady, harmonyReady, morytaniaReady, trollStrongholdReady, weissReady, hosidiusReady, varlamoreReady; - - private enum Seed { + // Required items + ItemRequirement spade; + ItemRequirement dibber; + ItemRequirement rake; + ItemRequirement seed; + + // Recommended items + ItemRequirement compost; + ItemRequirement ectophial; + ItemRequirement magicSec; + ItemRequirement explorerRing2; + ItemRequirement ardyCloak2; + ItemRequirement xericsTalisman; + ItemRequirement catherbyTeleport; + ItemRequirement trollheimTeleport; + ItemRequirement icyBasalt; + ItemRequirement stonyBasalt; + ItemRequirement farmingGuildTeleport; + ItemRequirement hosidiusHouseTeleport; + ItemRequirement hunterWhistle; + ItemRequirement harmonyTeleport; + ItemRequirement gracefulHood; + ItemRequirement gracefulTop; + ItemRequirement gracefulLegs; + ItemRequirement gracefulGloves; + ItemRequirement gracefulBoots; + ItemRequirement gracefulCape; + ItemRequirement gracefulOutfit; + ItemRequirement farmingHat; + ItemRequirement farmingTop; + ItemRequirement farmingLegs; + ItemRequirement farmingBoots; + ItemRequirement farmersOutfit; + + // Miscellaneous requirements + QuestRequirement accessToHarmony; + QuestRequirement accessToWeiss; + QuestRequirement accessToTrollStronghold; + SkillRequirement accessToFarmingGuildPatch; + QuestRequirement accessToVarlamore; + RuneliteRequirement unlockedBarbarianPlanting; + + ManualRequirement ardougneEmpty; + ManualRequirement catherbyEmpty; + ManualRequirement faladorEmpty; + ManualRequirement farmingGuildEmpty; + ManualRequirement harmonyEmpty; + ManualRequirement morytaniaEmpty; + ManualRequirement trollStrongholdEmpty; + ManualRequirement weissEmpty; + ManualRequirement hosidiusEmpty; + ManualRequirement varlamoreEmpty; + ManualRequirement ardougneReady; + ManualRequirement catherbyReady; + ManualRequirement faladorReady; + ManualRequirement farmingGuildReady; + ManualRequirement harmonyReady; + ManualRequirement morytaniaReady; + ManualRequirement trollStrongholdReady; + ManualRequirement weissReady; + ManualRequirement hosidiusReady; + ManualRequirement varlamoreReady; + Conditions allGrowing; + + // Steps + ReorderableConditionalStep steps; + DetailedQuestStep waitForHerbs; + ObjectStep ardougnePatch; + ObjectStep catherbyPatch; + ObjectStep faladorPatch; + ObjectStep farmingGuildPatch; + ObjectStep harmonyPatch; + ObjectStep morytaniaPatch; + ObjectStep trollStrongholdPatch; + ObjectStep weissPatch; + ObjectStep hosidiusPatch; + ObjectStep varlamorePatch; + ObjectStep ardougnePlant; + ObjectStep catherbyPlant; + ObjectStep faladorPlant; + ObjectStep farmingGuildPlant; + ObjectStep harmonyPlant; + ObjectStep morytaniaPlant; + ObjectStep trollStrongholdPlant; + ObjectStep weissPlant; + ObjectStep hosidiusPlant; + ObjectStep varlamorePlant; + + // Sidebar panels + List allSteps; + + private enum Seed + { GUAM(ItemID.GUAM_SEED), MARRENTILL(ItemID.MARRENTILL_SEED), TARROMIN(ItemID.TARROMIN_SEED), HARRALANDER(ItemID.HARRALANDER_SEED), RANARR(ItemID.RANARR_SEED), TOADFLAX(ItemID.TOADFLAX_SEED), IRIT(ItemID.IRIT_SEED), AVANTOE(ItemID.AVANTOE_SEED), KWUARM(ItemID.KWUARM_SEED), - SNAPDRAGON(ItemID.SNAPDRAGON_SEED), HUASCA(ItemID.HUASCA_SEED), CADANTINE(ItemID.CADANTINE_SEED), LATANDYME(ItemID.LANTADYME_SEED), + SNAPDRAGON(ItemID.SNAPDRAGON_SEED), HUASCA(ItemID.HUASCA_SEED), CADANTINE(ItemID.CADANTINE_SEED), LANTADYME(ItemID.LANTADYME_SEED), DWARF_WEED(ItemID.DWARF_WEED_SEED), TORSTOL(ItemID.TORSTOL_SEED); final int seedID; @@ -97,58 +175,18 @@ private enum Seed { } } - private enum GracefulOrFarming { + private enum GracefulOrFarming + { NONE(), GRACEFUL(), - FARMING(); + FARMING() } private final String HERB_SEEDS = "herbSeeds"; private final String GRACEFUL_OR_FARMING = "gracefulOrFarming"; @Override - public QuestStep loadStep() - { - farmingHandler = new FarmingHandler(client, configManager); - initializeRequirements(); - setupConditions(); - setupSteps(); - - ConditionalStep steps = new ConditionalStep(this, waitForHerbs, spade, dibber, rake, seed, magicSec, farmersOutfit, gracefulOutfit); - steps.addStep(faladorReady, faladorPatch); - steps.addStep(faladorEmpty, faladorPlant); - - steps.addStep(ardougneReady, ardougnePatch); - steps.addStep(ardougneEmpty, ardougnePlant); - - steps.addStep(catherbyReady, catherbyPatch); - steps.addStep(catherbyEmpty, catherbyPlant); - - steps.addStep(morytaniaReady, morytaniaPatch); - steps.addStep(morytaniaEmpty, morytaniaPlant); - - steps.addStep(hosidiusReady, hosidiusPatch); - steps.addStep(hosidiusEmpty, hosidiusPlant); - - steps.addStep(new Conditions(accessToTrollStronghold, trollStrongholdReady), trollStrongholdPatch); - steps.addStep(new Conditions(accessToTrollStronghold, trollStrongholdEmpty), trollStrongholdPlant); - - steps.addStep(new Conditions(accessToWeiss, weissReady), weissPatch); - steps.addStep(new Conditions(accessToWeiss, weissEmpty), weissPlant); - - steps.addStep(new Conditions(accessToFarmingGuildPatch, farmingGuildReady), farmingGuildPatch); - steps.addStep(new Conditions(accessToFarmingGuildPatch, farmingGuildEmpty), farmingGuildPlant); - - steps.addStep(new Conditions(accessToHarmony, harmonyReady), harmonyPatch); - steps.addStep(new Conditions(accessToHarmony, harmonyEmpty), harmonyPlant); - - steps.addStep(new Conditions(accessToVarlamore, varlamoreReady), varlamorePatch); - steps.addStep(new Conditions(accessToVarlamore, varlamoreEmpty), varlamorePlant); - - return steps; - } - - public void setupConditions() + protected void setupRequirements() { ardougneReady = new ManualRequirement(); catherbyReady = new ManualRequirement(); @@ -171,11 +209,11 @@ public void setupConditions() weissEmpty = new ManualRequirement(); hosidiusEmpty = new ManualRequirement(); varlamoreEmpty = new ManualRequirement(); - } - @Override - protected void setupRequirements() - { + allGrowing = nor(ardougneReady, catherbyReady, faladorReady, farmingGuildReady, harmonyReady, morytaniaReady, trollStrongholdReady, weissReady, + hosidiusReady, varlamoreReady, ardougneEmpty, catherbyEmpty, faladorEmpty, farmingGuildEmpty, harmonyEmpty, morytaniaEmpty, + trollStrongholdEmpty, weissEmpty, hosidiusEmpty, varlamoreEmpty); + accessToFarmingGuildPatch = new SkillRequirement(Skill.FARMING, 65); accessToHarmony = new QuestRequirement(QuestHelperQuest.MORYTANIA_ELITE, QuestState.FINISHED); @@ -183,13 +221,15 @@ protected void setupRequirements() accessToTrollStronghold = new QuestRequirement(QuestHelperQuest.MY_ARMS_BIG_ADVENTURE, QuestState.FINISHED); accessToVarlamore = new QuestRequirement(QuestHelperQuest.CHILDREN_OF_THE_SUN, QuestState.FINISHED); + unlockedBarbarianPlanting = new RuneliteRequirement(configManager, ConfigKeys.BARBARIAN_TRAINING_FINISHED_SEED_PLANTING.getKey()); + spade = new ItemRequirement("Spade", ItemID.SPADE); - dibber = new ItemRequirement("Seed dibber", ItemID.DIBBER); + dibber = new ItemRequirement("Seed dibber", ItemID.DIBBER).hideConditioned(unlockedBarbarianPlanting); rake = new ItemRequirement("Rake", ItemID.RAKE).hideConditioned(new VarbitRequirement(VarbitID.FARMING_BLOCKWEEDS, 2)); seed = new ItemRequirement("Seeds of your choice", ItemID.GUAM_SEED); - String seedName = configManager.getRSProfileConfiguration(QuestHelperConfig.QUEST_BACKGROUND_GROUP, HERB_SEEDS); + var seedName = configManager.getRSProfileConfiguration(QuestHelperConfig.QUEST_BACKGROUND_GROUP, HERB_SEEDS); if (seedName != null) { @@ -219,17 +259,17 @@ protected void setupRequirements() hosidiusHouseTeleport = new ItemRequirement("Teleport to Hosidius House", ItemID.NZONE_TELETAB_KOUREND); hosidiusHouseTeleport.addAlternates(ItemID.XERIC_TALISMAN); - ItemRequirement catherbyRunes = new ItemRequirements("Catherby teleport runes", new ItemRequirement("Law rune", - ItemID.LAWRUNE), new ItemRequirement("Air rune", ItemID.AIRRUNE, 5)); - ItemRequirement catherbyTablet = new ItemRequirement("Catherby tablet", ItemID.LUNAR_TABLET_CATHERBY_TELEPORT); + var catherbyRunes = new ItemRequirements("Catherby teleport runes", new ItemRequirement("Law rune", + ItemID.LAWRUNE), new ItemRequirement("Air rune", ItemID.AIRRUNE, 5)); + var catherbyTablet = new ItemRequirement("Catherby tablet", ItemID.LUNAR_TABLET_CATHERBY_TELEPORT); catherbyTeleport = new ItemRequirements(LogicType.OR, "Catherby teleport", catherbyRunes, catherbyTablet); - ItemRequirement trollheimRunes = new ItemRequirements("Trollheim teleport runes", new ItemRequirement("Law rune", - ItemID.LAWRUNE, 2), new ItemRequirement("Fire rune", ItemID.FIRERUNE, 2)); - ItemRequirement trollheimTablet = new ItemRequirement("Trollheim tablet", ItemID.NZONE_TELETAB_TROLLHEIM); + var trollheimRunes = new ItemRequirements("Trollheim teleport runes", new ItemRequirement("Law rune", + ItemID.LAWRUNE, 2), new ItemRequirement("Fire rune", ItemID.FIRERUNE, 2)); + var trollheimTablet = new ItemRequirement("Trollheim tablet", ItemID.NZONE_TELETAB_TROLLHEIM); trollheimTeleport = new ItemRequirements(LogicType.OR, "Trollheim teleport", trollheimRunes, trollheimTablet) - .hideConditioned(new QuestRequirement(QuestHelperQuest.MAKING_FRIENDS_WITH_MY_ARM, QuestState.FINISHED)); + .hideConditioned(new QuestRequirement(QuestHelperQuest.MAKING_FRIENDS_WITH_MY_ARM, QuestState.FINISHED)); icyBasalt = new ItemRequirement("Icy basalt", ItemID.WEISS_TELEPORT_BASALT).showConditioned(new QuestRequirement(QuestHelperQuest.MAKING_FRIENDS_WITH_MY_ARM, QuestState.FINISHED)); stonyBasalt = new ItemRequirement("Stony basalt", ItemID.STRONGHOLD_TELEPORT_BASALT).showConditioned(new QuestRequirement(QuestHelperQuest.MAKING_FRIENDS_WITH_MY_ARM, QuestState.FINISHED)); @@ -239,55 +279,57 @@ protected void setupRequirements() farmingGuildTeleport.addAlternates(ItemCollections.SKILLS_NECKLACES); farmingGuildTeleport.addAlternates(ItemCollections.FAIRY_STAFF); + harmonyTeleport = new ItemRequirement("Harmony Teleport", ItemID.TELETAB_HARMONY); + hunterWhistle = new ItemRequirement("Quetzal whistle", ItemID.HG_QUETZALWHISTLE_PERFECTED).showConditioned(accessToVarlamore); hunterWhistle.addAlternates(ItemID.HG_QUETZALWHISTLE_BASIC); hunterWhistle.addAlternates(ItemID.HG_QUETZALWHISTLE_ENHANCED); gracefulHood = new ItemRequirement( - "Graceful hood", ItemCollections.GRACEFUL_HOOD, 1 ,true).isNotConsumed(); + "Graceful hood", ItemCollections.GRACEFUL_HOOD, 1, true).isNotConsumed(); gracefulTop = new ItemRequirement( - "Graceful top", ItemCollections.GRACEFUL_TOP, 1, true).isNotConsumed(); + "Graceful top", ItemCollections.GRACEFUL_TOP, 1, true).isNotConsumed(); gracefulLegs = new ItemRequirement( - "Graceful legs", ItemCollections.GRACEFUL_LEGS, 1, true).isNotConsumed(); + "Graceful legs", ItemCollections.GRACEFUL_LEGS, 1, true).isNotConsumed(); gracefulCape = new ItemRequirement( - "Graceful cape", ItemCollections.GRACEFUL_CAPE, 1, true).isNotConsumed(); + "Graceful cape", ItemCollections.GRACEFUL_CAPE, 1, true).isNotConsumed(); gracefulGloves = new ItemRequirement( - "Graceful gloves", ItemCollections.GRACEFUL_GLOVES, 1, true).isNotConsumed(); + "Graceful gloves", ItemCollections.GRACEFUL_GLOVES, 1, true).isNotConsumed(); gracefulBoots = new ItemRequirement( - "Graceful boots", ItemCollections.GRACEFUL_BOOTS, 1, true).isNotConsumed(); + "Graceful boots", ItemCollections.GRACEFUL_BOOTS, 1, true).isNotConsumed(); gracefulBoots.addAlternates(ItemID.IKOV_BOOTSOFLIGHTNESS); gracefulOutfit = new ItemRequirements( - "Graceful outfit (equipped)", - gracefulHood, gracefulTop, gracefulLegs, gracefulGloves, gracefulBoots, gracefulCape + "Graceful outfit (equipped)", + gracefulHood, gracefulTop, gracefulLegs, gracefulGloves, gracefulBoots, gracefulCape ).isNotConsumed().showConditioned(new RuneliteRequirement(configManager, GRACEFUL_OR_FARMING, GracefulOrFarming.GRACEFUL.name())); farmingHat = new ItemRequirement( - "Farmer's strawhat", ItemID.TITHE_REWARD_HAT_MALE, 1 ,true).isNotConsumed(); + "Farmer's strawhat", ItemID.TITHE_REWARD_HAT_MALE, 1, true).isNotConsumed(); farmingHat.addAlternates(ItemID.TITHE_REWARD_HAT_FEMALE, ItemID.TITHE_REWARD_HAT_MALE_DUMMY, ItemID.TITHE_REWARD_HAT_FEMALE_DUMMY); farmingTop = new ItemRequirement( - "Farmer's top", ItemID.TITHE_REWARD_TORSO_MALE, 1, true).isNotConsumed(); + "Farmer's top", ItemID.TITHE_REWARD_TORSO_MALE, 1, true).isNotConsumed(); farmingTop.addAlternates(ItemID.TITHE_REWARD_TORSO_FEMALE); farmingLegs = new ItemRequirement( - "Farmer's boro trousers", ItemID.TITHE_REWARD_LEGS_MALE, 1, true).isNotConsumed(); + "Farmer's boro trousers", ItemID.TITHE_REWARD_LEGS_MALE, 1, true).isNotConsumed(); farmingLegs.addAlternates(ItemID.TITHE_REWARD_LEGS_FEMALE); farmingBoots = new ItemRequirement( - "Graceful cape", ItemID.TITHE_REWARD_FEET_MALE, 1, true).isNotConsumed(); + "Graceful cape", ItemID.TITHE_REWARD_FEET_MALE, 1, true).isNotConsumed(); farmingBoots.addAlternates(ItemID.TITHE_REWARD_FEET_FEMALE); farmersOutfit = new ItemRequirements( - "Farmer's outfit (equipped)", - farmingHat, farmingTop, farmingLegs, farmingBoots + "Farmer's outfit (equipped)", + farmingHat, farmingTop, farmingLegs, farmingBoots ).isNotConsumed().showConditioned(new RuneliteRequirement(configManager, GRACEFUL_OR_FARMING, GracefulOrFarming.FARMING.name())); } @@ -308,7 +350,7 @@ public void setupSteps() morytaniaPatch = new ObjectStep(this, ObjectID.FARMING_HERB_PATCH_4, new WorldPoint(3605, 3529, 0), "Harvest your herbs from the Morytania patch.", ectophial); trollStrongholdPatch = new ObjectStep(this, ObjectID.MYARM_HERBPATCH, new WorldPoint(2826, 3694, 0), "Harvest your herbs from the Troll Stronghold patch.", - trollheimTeleport, stonyBasalt); + trollheimTeleport, stonyBasalt); trollStrongholdPatch.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToTrollStronghold)); weissPatch = new ObjectStep(this, ObjectID.MY2ARM_HERBPATCH, new WorldPoint(2848, 3934, 0), "Harvest your herbs from the Weiss patch.", icyBasalt); weissPatch.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToWeiss)); @@ -330,7 +372,7 @@ public void setupSteps() hosidiusPlant = new ObjectStep(this, ObjectID.FARMING_HERB_PATCH_6, new WorldPoint(1738, 3550, 0), "Plant your seeds into the Hosidius patch.", hosidiusHouseTeleport); hosidiusPlant.addIcon(ItemID.RANARR_SEED); - hosidiusPlant.addSubSteps(hosidiusPlant); + hosidiusPatch.addSubSteps(hosidiusPlant); farmingGuildPlant = new ObjectStep(this, ObjectID.FARMING_HERB_PATCH_7, new WorldPoint(1238, 3726, 0), "Plant your seeds into the Farming Guild patch.", farmingGuildTeleport); farmingGuildPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToFarmingGuildPatch)); @@ -347,7 +389,7 @@ public void setupSteps() morytaniaPatch.addSubSteps(morytaniaPlant); trollStrongholdPlant = new ObjectStep(this, ObjectID.MYARM_HERBPATCH, new WorldPoint(2826, 3694, 0), "Plant your seeds into the Troll Stronghold patch.", - trollheimTeleport, stonyBasalt); + trollheimTeleport, stonyBasalt); trollStrongholdPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToTrollStronghold)); trollStrongholdPlant.addIcon(ItemID.RANARR_SEED); trollStrongholdPatch.addSubSteps(trollStrongholdPlant); @@ -363,6 +405,48 @@ public void setupSteps() varlamorePatch.addSubSteps(varlamorePlant); } + @Override + public QuestStep loadStep() + { + farmingHandler = new FarmingHandler(client, configManager); + initializeRequirements(); + setupSteps(); + prepopulateSidebarPanels(); + + steps = new ReorderableConditionalStep(this, waitForHerbs, spade, dibber, rake, seed, magicSec, farmersOutfit, gracefulOutfit); + steps.addStep(faladorReady, faladorPatch); + steps.addStep(faladorEmpty, faladorPlant); + + steps.addStep(ardougneReady, ardougnePatch); + steps.addStep(ardougneEmpty, ardougnePlant); + + steps.addStep(catherbyReady, catherbyPatch); + steps.addStep(catherbyEmpty, catherbyPlant); + + steps.addStep(morytaniaReady, morytaniaPatch); + steps.addStep(morytaniaEmpty, morytaniaPlant); + + steps.addStep(hosidiusReady, hosidiusPatch); + steps.addStep(hosidiusEmpty, hosidiusPlant); + + steps.addStep(new Conditions(accessToTrollStronghold, trollStrongholdReady), trollStrongholdPatch); + steps.addStep(new Conditions(accessToTrollStronghold, trollStrongholdEmpty), trollStrongholdPlant); + + steps.addStep(new Conditions(accessToWeiss, weissReady), weissPatch); + steps.addStep(new Conditions(accessToWeiss, weissEmpty), weissPlant); + + steps.addStep(new Conditions(accessToFarmingGuildPatch, farmingGuildReady), farmingGuildPatch); + steps.addStep(new Conditions(accessToFarmingGuildPatch, farmingGuildEmpty), farmingGuildPlant); + + steps.addStep(new Conditions(accessToHarmony, harmonyReady), harmonyPatch); + steps.addStep(new Conditions(accessToHarmony, harmonyEmpty), harmonyPlant); + + steps.addStep(new Conditions(accessToVarlamore, varlamoreReady), varlamorePatch); + steps.addStep(new Conditions(accessToVarlamore, varlamoreEmpty), varlamorePlant); + + return steps; + } + @Subscribe public void onConfigChanged(ConfigChanged event) { @@ -379,8 +463,7 @@ public void onConfigChanged(ConfigChanged event) seed.setId(selectedSeed.seedID); seed.setName(Text.titleCase(selectedSeed) + " seed"); questHelperPlugin.refreshBank(); - } - catch (IllegalArgumentException err) + } catch (IllegalArgumentException err) { questHelperPlugin.getConfigManager().setConfiguration(QuestHelperConfig.QUEST_BACKGROUND_GROUP, HERB_SEEDS, Seed.GUAM); } @@ -423,7 +506,7 @@ public void onGameTick(GameTick event) case "Farming Guild": farmingGuildReady.setShouldPass(isHarvestable); farmingGuildEmpty.setShouldPass(isPlantable); - if(!accessToFarmingGuildPatch.check(client)) + if (!accessToFarmingGuildPatch.check(client)) { seedsNeeded--; } @@ -447,7 +530,7 @@ public void onGameTick(GameTick event) case "Troll Stronghold": trollStrongholdReady.setShouldPass(isHarvestable); trollStrongholdEmpty.setShouldPass(isPlantable); - if(!accessToTrollStronghold.check(client)) + if (!accessToTrollStronghold.check(client)) { seedsNeeded--; } @@ -455,7 +538,7 @@ public void onGameTick(GameTick event) case "Weiss": weissReady.setShouldPass(isHarvestable); weissEmpty.setShouldPass(isPlantable); - if(!accessToWeiss.check(client)) + if (!accessToWeiss.check(client)) { seedsNeeded--; } @@ -463,7 +546,7 @@ public void onGameTick(GameTick event) case "Civitas illa Fortis": varlamoreReady.setShouldPass(isHarvestable); varlamoreEmpty.setShouldPass(isPlantable); - if(!accessToVarlamore.check(client)) + if (!accessToVarlamore.check(client)) { seedsNeeded--; } @@ -483,7 +566,8 @@ public List getItemRequirements() @Override public List getItemRecommended() { - return Arrays.asList(compost, ectophial, magicSec, explorerRing2, ardyCloak2, xericsTalisman, hosidiusHouseTeleport, catherbyTeleport, trollheimTeleport, icyBasalt, stonyBasalt, farmingGuildTeleport, hunterWhistle, gracefulOutfit, farmersOutfit); + return Arrays.asList(compost, ectophial, magicSec, explorerRing2, ardyCloak2, xericsTalisman, hosidiusHouseTeleport, catherbyTeleport, + trollheimTeleport, icyBasalt, stonyBasalt, farmingGuildTeleport, hunterWhistle, harmonyTeleport, gracefulOutfit, farmersOutfit); } @Override @@ -494,14 +578,29 @@ public List getConfigs() return Arrays.asList(seedsConfig, outfitConfig); } + private void prepopulateSidebarPanels() + { + allSteps = new ArrayList<>(); + + allSteps.add(new PanelDetails("Wait for Herbs", waitForHerbs).withHideCondition(nor(allGrowing))); + TopLevelPanelDetails farmRunSidebar = new TopLevelPanelDetails("Farm Run", + new PanelDetails("Farming Guild", Collections.singletonList(farmingGuildPatch)).withId(0), + new PanelDetails("Falador", Collections.singletonList(faladorPatch)).withId(1), + new PanelDetails("Ardougne", Collections.singletonList(ardougnePatch)).withId(2), + new PanelDetails("Catherby", Collections.singletonList(catherbyPatch)).withId(3), + new PanelDetails("Morytania", Collections.singletonList(morytaniaPatch)).withId(4), + new PanelDetails("Hosidius", Collections.singletonList(hosidiusPatch)).withId(5), + new PanelDetails("Varlamore", Collections.singletonList(varlamorePatch)).withId(6), + new PanelDetails("Troll Stronghold", Collections.singletonList(trollStrongholdPatch)).withId(7), + new PanelDetails("Weiss", Collections.singletonList(weissPatch)).withId(8), + new PanelDetails("Harmony Island", Collections.singletonList(harmonyPatch)).withId(9).withHideCondition(nor(accessToHarmony)) + ); + allSteps.add(farmRunSidebar); + } + @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Farm run", Arrays.asList(faladorPatch, ardougnePatch, catherbyPatch, morytaniaPatch, hosidiusPatch, - trollStrongholdPatch, weissPatch, farmingGuildPatch, harmonyPatch, varlamorePatch), Arrays.asList(spade, dibber, rake, seed, magicSec), - Arrays.asList(compost, ectophial, explorerRing2, ardyCloak2, xericsTalisman, catherbyTeleport, trollheimTeleport, icyBasalt, stonyBasalt, farmingGuildTeleport, hunterWhistle, gracefulOutfit, farmersOutfit))); - return allSteps; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PatchImplementation.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PatchImplementation.java index 7adf89fc00b..f7a1c2e1fb8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PatchImplementation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PatchImplementation.java @@ -35,44 +35,6 @@ @Getter public enum PatchImplementation { - BELLADONNA(Tab.SPECIAL, "", false) - { - @Override - PatchState forVarbitValue(int value) - { - if (value >= 0 && value <= 3) - { - // Belladonna patch[Rake,Inspect,Guide] 7560,7559,7558,7557 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); - } - if (value >= 4 && value <= 7) - { - // Belladonna[Inspect,Guide] 7561,7562,7563,7564 - return new PatchState(Produce.BELLADONNA, CropState.GROWING, value - 4); - } - if (value == 8) - { - // Belladonna[Pick,Inspect,Guide] 7565 - return new PatchState(Produce.BELLADONNA, CropState.HARVESTABLE, 0); - } - if (value >= 9 && value <= 11) - { - // Diseased Belladonna[Cure,Inspect,Guide] 7566,7567,7568 - return new PatchState(Produce.BELLADONNA, CropState.DISEASED, value - 8); - } - if (value >= 12 && value <= 14) - { - // Dead Belladonna[Clear,Inspect,Guide] 7569,7570,7571 - return new PatchState(Produce.BELLADONNA, CropState.DEAD, value - 11); - } - if (value >= 15 && value <= 255) - { - // Belladonna patch[Rake,Inspect,Guide] 7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); - } - return null; - } - }, MUSHROOM(Tab.SPECIAL, "", false) { @Override @@ -81,7 +43,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Mushroom patch[Rake,Inspect,Guide] 8314,8313,8312,8311 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 9) { @@ -106,7 +68,7 @@ PatchState forVarbitValue(int value) if (value >= 26 && value <= 255) { // Mushroom patch[Rake,Inspect,Guide] 8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314,8314 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -119,7 +81,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Hespori patch[Rake,Inspect,Guide] 33722,33723,33724,33725 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 6) { @@ -134,7 +96,7 @@ PatchState forVarbitValue(int value) if (value == 9) { // Hespori patch[Rake,Inspect,Guide] 33722 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -147,12 +109,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Allotment[Rake,Inspect,Guide] 8576,8575,8574,8573 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 5) { // Allotment[Rake,Inspect,Guide] 8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 6 && value <= 9) { @@ -237,7 +199,7 @@ PatchState forVarbitValue(int value) if (value >= 74 && value <= 76) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 77 && value <= 80) { @@ -247,7 +209,7 @@ PatchState forVarbitValue(int value) if (value >= 81 && value <= 83) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 84 && value <= 87) { @@ -257,7 +219,7 @@ PatchState forVarbitValue(int value) if (value >= 88 && value <= 90) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 91 && value <= 94) { @@ -267,7 +229,7 @@ PatchState forVarbitValue(int value) if (value >= 95 && value <= 97) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 98 && value <= 103) { @@ -277,7 +239,7 @@ PatchState forVarbitValue(int value) if (value >= 104 && value <= 106) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 107 && value <= 112) { @@ -287,7 +249,7 @@ PatchState forVarbitValue(int value) if (value >= 113 && value <= 115) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 116 && value <= 123) { @@ -297,7 +259,7 @@ PatchState forVarbitValue(int value) if (value >= 124 && value <= 127) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 128 && value <= 134) { @@ -317,7 +279,7 @@ PatchState forVarbitValue(int value) if (value == 141) { // Allotment[Rake,Inspect,Guide] 8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 142 && value <= 144) { @@ -327,7 +289,7 @@ PatchState forVarbitValue(int value) if (value >= 145 && value <= 148) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 149 && value <= 151) { @@ -337,7 +299,7 @@ PatchState forVarbitValue(int value) if (value >= 152 && value <= 155) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 156 && value <= 158) { @@ -347,7 +309,7 @@ PatchState forVarbitValue(int value) if (value >= 159 && value <= 162) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 163 && value <= 167) { @@ -357,7 +319,7 @@ PatchState forVarbitValue(int value) if (value >= 168 && value <= 171) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 172 && value <= 176) { @@ -367,7 +329,7 @@ PatchState forVarbitValue(int value) if (value >= 177 && value <= 180) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 181 && value <= 187) { @@ -377,7 +339,7 @@ PatchState forVarbitValue(int value) if (value >= 188 && value <= 192) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 193 && value <= 195) { @@ -402,7 +364,7 @@ PatchState forVarbitValue(int value) if (value == 205) { // Allotment[Rake,Inspect,Guide] 8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 206 && value <= 208) { @@ -417,7 +379,7 @@ PatchState forVarbitValue(int value) if (value == 212) { // Allotment[Rake,Inspect,Guide] 8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 213 && value <= 215) { @@ -427,7 +389,7 @@ PatchState forVarbitValue(int value) if (value >= 216 && value <= 219) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 220 && value <= 222) { @@ -437,7 +399,7 @@ PatchState forVarbitValue(int value) if (value >= 223 && value <= 226) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 227 && value <= 231) { @@ -447,7 +409,7 @@ PatchState forVarbitValue(int value) if (value >= 232 && value <= 235) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 236 && value <= 240) { @@ -457,7 +419,7 @@ PatchState forVarbitValue(int value) if (value >= 241 && value <= 244) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 245 && value <= 251) { @@ -467,7 +429,7 @@ PatchState forVarbitValue(int value) if (value >= 252 && value <= 255) { // Allotment[Rake,Inspect,Guide] 8576,8576,8576,8576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -480,86 +442,86 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Herb patch[Rake,Inspect,Guide] 8135,8134,8133,8132 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 14209,26825,26826,26827 return new PatchState(Produce.GUAM, CropState.GROWING, value - 4); } if (value >= 8 && value <= 10) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 26828,26828,26828 return new PatchState(Produce.GUAM, CropState.HARVESTABLE, 10 - value); } if (value >= 11 && value <= 14) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 26829,39748,39749,39750 return new PatchState(Produce.MARRENTILL, CropState.GROWING, value - 11); } if (value >= 15 && value <= 17) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39751,39751,39751 return new PatchState(Produce.MARRENTILL, CropState.HARVESTABLE, 17 - value); } if (value >= 18 && value <= 21) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39752,39753,39754,39755 return new PatchState(Produce.TARROMIN, CropState.GROWING, value - 18); } if (value >= 22 && value <= 24) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39756,39756,39756 return new PatchState(Produce.TARROMIN, CropState.HARVESTABLE, 24 - value); } if (value >= 25 && value <= 28) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39757,39758,39759,39760 return new PatchState(Produce.HARRALANDER, CropState.GROWING, value - 25); } if (value >= 29 && value <= 31) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39761,39761,39761 return new PatchState(Produce.HARRALANDER, CropState.HARVESTABLE, 31 - value); } if (value >= 32 && value <= 35) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39762,39763,39764,39765 return new PatchState(Produce.RANARR, CropState.GROWING, value - 32); } if (value >= 36 && value <= 38) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39766,39766,39766 return new PatchState(Produce.RANARR, CropState.HARVESTABLE, 38 - value); } if (value >= 39 && value <= 42) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39777,39778,39779,39780 return new PatchState(Produce.TOADFLAX, CropState.GROWING, value - 39); } if (value >= 43 && value <= 45) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39781,39781,39781 return new PatchState(Produce.TOADFLAX, CropState.HARVESTABLE, 45 - value); } if (value >= 46 && value <= 49) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39767,39768,39769,39770 return new PatchState(Produce.IRIT, CropState.GROWING, value - 46); } if (value >= 50 && value <= 52) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39771,39771,39771 return new PatchState(Produce.IRIT, CropState.HARVESTABLE, 52 - value); } if (value >= 53 && value <= 56) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39772,39773,39774,39775 return new PatchState(Produce.AVANTOE, CropState.GROWING, value - 53); } if (value >= 57 && value <= 59) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39776,39776,39776 return new PatchState(Produce.AVANTOE, CropState.HARVESTABLE, 59 - value); } if (value >= 60 && value <= 63) @@ -574,66 +536,67 @@ PatchState forVarbitValue(int value) } if (value == 67) { - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Herb patch[Rake,Inspect,Guide] 8135 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 68 && value <= 71) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39782,39783,39784,39785 return new PatchState(Produce.KWUARM, CropState.GROWING, value - 68); } if (value >= 72 && value <= 74) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39786,39786,39786 return new PatchState(Produce.KWUARM, CropState.HARVESTABLE, 74 - value); } if (value >= 75 && value <= 78) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39807,39808,39809,39810 return new PatchState(Produce.SNAPDRAGON, CropState.GROWING, value - 75); } if (value >= 79 && value <= 81) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39811,39811,39811 return new PatchState(Produce.SNAPDRAGON, CropState.HARVESTABLE, 81 - value); } if (value >= 82 && value <= 85) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39787,39788,39789,39790 return new PatchState(Produce.CADANTINE, CropState.GROWING, value - 82); } if (value >= 86 && value <= 88) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39791,39791,39791 return new PatchState(Produce.CADANTINE, CropState.HARVESTABLE, 88 - value); } if (value >= 89 && value <= 92) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39792,39793,39794,39795 return new PatchState(Produce.LANTADYME, CropState.GROWING, value - 89); } if (value >= 93 && value <= 95) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39796,39796,39796 return new PatchState(Produce.LANTADYME, CropState.HARVESTABLE, 95 - value); } if (value >= 96 && value <= 99) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39797,39798,39799,39800 return new PatchState(Produce.DWARF_WEED, CropState.GROWING, value - 96); } if (value >= 100 && value <= 102) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39801,39801,39801 return new PatchState(Produce.DWARF_WEED, CropState.HARVESTABLE, 102 - value); } if (value >= 103 && value <= 106) { - // Herbs[Inspect,Guide] 8139,8140,8141,8142 + // Herbs[Inspect,Guide] 39802,39803,39804,39805 return new PatchState(Produce.TORSTOL, CropState.GROWING, value - 103); } if (value >= 107 && value <= 109) { - // Herbs[Pick,Inspect,Guide] 8143,8143,8143 + // Herbs[Pick,Inspect,Guide] 39806,39806,39806 return new PatchState(Produce.TORSTOL, CropState.HARVESTABLE, 109 - value); } if (value >= 128 && value <= 130) @@ -711,10 +674,15 @@ PatchState forVarbitValue(int value) // Dead herbs[Clear,Inspect,Guide] 8147,8148,8149 return new PatchState(Produce.ANYHERB, CropState.DEAD, value - 169); } - if (value >= 173 && value <= 191) + if (value >= 173 && value <= 175) + { + // Diseased herbs[Cure,Inspect,Guide] 8144,8145,8146 + return new PatchState(Produce.HUASCA, CropState.DISEASED, value - 172); + } + if (value >= 176 && value <= 191) { - // Herb patch[Rake,Inspect,Guide] 8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Herb patch[Rake,Inspect,Guide] 8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 192 && value <= 195) { @@ -739,12 +707,12 @@ PatchState forVarbitValue(int value) if (value >= 204 && value <= 219) { // Herb patch[Rake,Inspect,Guide] 8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 221 && value <= 255) { // Herb patch[Rake,Inspect,Guide] 8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135,8135 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -757,12 +725,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Flower Patch[Rake,Inspect,Guide] 7843,7842,7841,7840 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 11) { @@ -837,7 +805,7 @@ PatchState forVarbitValue(int value) if (value >= 42 && value <= 71) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 72 && value <= 75) { @@ -847,7 +815,7 @@ PatchState forVarbitValue(int value) if (value == 76) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 77 && value <= 80) { @@ -857,7 +825,7 @@ PatchState forVarbitValue(int value) if (value == 81) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 82 && value <= 85) { @@ -867,7 +835,7 @@ PatchState forVarbitValue(int value) if (value == 86) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 87 && value <= 90) { @@ -877,7 +845,7 @@ PatchState forVarbitValue(int value) if (value == 91) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 92 && value <= 95) { @@ -887,7 +855,7 @@ PatchState forVarbitValue(int value) if (value >= 96 && value <= 100) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 101 && value <= 104) { @@ -897,7 +865,7 @@ PatchState forVarbitValue(int value) if (value >= 105 && value <= 136) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 137 && value <= 139) { @@ -907,7 +875,7 @@ PatchState forVarbitValue(int value) if (value >= 140 && value <= 141) { // Flower Patch[Rake,Inspect,Guide] 7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 142 && value <= 144) { @@ -917,7 +885,7 @@ PatchState forVarbitValue(int value) if (value >= 145 && value <= 146) { // Flower Patch[Rake,Inspect,Guide] 7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 147 && value <= 149) { @@ -927,7 +895,7 @@ PatchState forVarbitValue(int value) if (value >= 150 && value <= 151) { // Flower Patch[Rake,Inspect,Guide] 7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 152 && value <= 154) { @@ -937,7 +905,7 @@ PatchState forVarbitValue(int value) if (value >= 155 && value <= 156) { // Flower Patch[Rake,Inspect,Guide] 7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 157 && value <= 159) { @@ -947,7 +915,7 @@ PatchState forVarbitValue(int value) if (value >= 160 && value <= 165) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 166 && value <= 168) { @@ -957,7 +925,7 @@ PatchState forVarbitValue(int value) if (value >= 169 && value <= 200) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 201 && value <= 204) { @@ -967,7 +935,7 @@ PatchState forVarbitValue(int value) if (value == 205) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 206 && value <= 209) { @@ -977,7 +945,7 @@ PatchState forVarbitValue(int value) if (value == 210) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 211 && value <= 214) { @@ -987,7 +955,7 @@ PatchState forVarbitValue(int value) if (value == 215) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 216 && value <= 219) { @@ -997,7 +965,7 @@ PatchState forVarbitValue(int value) if (value == 220) { // Flower Patch[Rake,Inspect,Guide] 7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 221 && value <= 224) { @@ -1007,7 +975,7 @@ PatchState forVarbitValue(int value) if (value >= 225 && value <= 229) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 230 && value <= 233) { @@ -1017,7 +985,7 @@ PatchState forVarbitValue(int value) if (value >= 234 && value <= 255) { // Flower Patch[Rake,Inspect,Guide] 7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843,7843 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -1030,12 +998,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Bush Patch[Rake,Inspect,Guide] 7576,7575,7574,7573 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value == 4) { // Bush Patch[Rake,Inspect,Guide] 7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 5 && value <= 9) { @@ -1090,7 +1058,7 @@ PatchState forVarbitValue(int value) if (value >= 64 && value <= 69) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 70 && value <= 74) { @@ -1100,7 +1068,7 @@ PatchState forVarbitValue(int value) if (value >= 75 && value <= 79) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 80 && value <= 85) { @@ -1110,7 +1078,7 @@ PatchState forVarbitValue(int value) if (value >= 86 && value <= 90) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 91 && value <= 97) { @@ -1120,7 +1088,7 @@ PatchState forVarbitValue(int value) if (value >= 98 && value <= 102) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 103 && value <= 110) { @@ -1130,7 +1098,7 @@ PatchState forVarbitValue(int value) if (value >= 111 && value <= 115) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 116 && value <= 123) { @@ -1140,7 +1108,7 @@ PatchState forVarbitValue(int value) if (value >= 124 && value <= 133) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576,7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 134 && value <= 138) { @@ -1150,7 +1118,7 @@ PatchState forVarbitValue(int value) if (value >= 139 && value <= 143) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 144 && value <= 149) { @@ -1160,7 +1128,7 @@ PatchState forVarbitValue(int value) if (value >= 150 && value <= 154) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 155 && value <= 161) { @@ -1170,7 +1138,7 @@ PatchState forVarbitValue(int value) if (value >= 162 && value <= 166) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 167 && value <= 174) { @@ -1180,7 +1148,7 @@ PatchState forVarbitValue(int value) if (value >= 175 && value <= 179) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 180 && value <= 187) { @@ -1190,7 +1158,7 @@ PatchState forVarbitValue(int value) if (value >= 188 && value <= 196) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 197 && value <= 204) { @@ -1220,37 +1188,37 @@ PatchState forVarbitValue(int value) if (value >= 226 && value <= 249) { // Bush Patch[Rake,Inspect,Guide] 7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576,7576 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value == 250) { // Redberry bush[Check-health,Inspect,Guide] 7702 - return new PatchState(Produce.REDBERRIES, CropState.UNCHECKED, Produce.REDBERRIES.getStages() - 1); + return new PatchState(Produce.REDBERRIES, CropState.GROWING, Produce.REDBERRIES.getStages() - 1); } if (value == 251) { // Cadavaberry bush[Check-health,Inspect,Guide] 7592 - return new PatchState(Produce.CADAVABERRIES, CropState.UNCHECKED, Produce.CADAVABERRIES.getStages() - 1); + return new PatchState(Produce.CADAVABERRIES, CropState.GROWING, Produce.CADAVABERRIES.getStages() - 1); } if (value == 252) { // Dwellberry bush[Check-health,Inspect,Guide] 7617 - return new PatchState(Produce.DWELLBERRIES, CropState.UNCHECKED, Produce.DWELLBERRIES.getStages() - 1); + return new PatchState(Produce.DWELLBERRIES, CropState.GROWING, Produce.DWELLBERRIES.getStages() - 1); } if (value == 253) { // Jangerberry bush[Check-health,Inspect,Guide] 7645 - return new PatchState(Produce.JANGERBERRIES, CropState.UNCHECKED, Produce.JANGERBERRIES.getStages() - 1); + return new PatchState(Produce.JANGERBERRIES, CropState.GROWING, Produce.JANGERBERRIES.getStages() - 1); } if (value == 254) { // Whiteberry bush[Check-health,Inspect,Guide] 7726 - return new PatchState(Produce.WHITEBERRIES, CropState.UNCHECKED, Produce.WHITEBERRIES.getStages() - 1); + return new PatchState(Produce.WHITEBERRIES, CropState.GROWING, Produce.WHITEBERRIES.getStages() - 1); } if (value == 255) { // Poison Ivy bush[Check-health,Inspect,Guide] 7675 - return new PatchState(Produce.POISON_IVY, CropState.UNCHECKED, Produce.POISON_IVY.getStages() - 1); + return new PatchState(Produce.POISON_IVY, CropState.GROWING, Produce.POISON_IVY.getStages() - 1); } return null; } @@ -1263,12 +1231,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Fruit Tree Patch[Rake,Inspect,Guide] 8050,8049,8048,8047 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Fruit Tree Patch[Rake,Inspect,Guide] 8050,8050,8050,8050 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 13) { @@ -1293,12 +1261,12 @@ PatchState forVarbitValue(int value) if (value == 33) { // Apple tree stump[Clear,Inspect,Guide] 7961 - return new PatchState(Produce.APPLE, CropState.STUMP, 0); + return new PatchState(Produce.APPLE, CropState.HARVESTABLE, 0); } if (value == 34) { // Apple tree[Check-health,Inspect,Guide] 7948 - return new PatchState(Produce.APPLE, CropState.UNCHECKED, Produce.APPLE.getStages() - 1); + return new PatchState(Produce.APPLE, CropState.GROWING, Produce.APPLE.getStages() - 1); } if (value >= 35 && value <= 40) { @@ -1323,17 +1291,17 @@ PatchState forVarbitValue(int value) if (value == 60) { // Banana tree stump[Clear,Inspect,Guide] 8019 - return new PatchState(Produce.BANANA, CropState.STUMP, 0); + return new PatchState(Produce.BANANA, CropState.HARVESTABLE, 0); } if (value == 61) { // Banana tree[Check-health,Inspect,Guide] 7999 - return new PatchState(Produce.BANANA, CropState.UNCHECKED, Produce.BANANA.getStages() - 1); + return new PatchState(Produce.BANANA, CropState.GROWING, Produce.BANANA.getStages() - 1); } if (value >= 62 && value <= 71) { // Fruit Tree Patch[Rake,Inspect,Guide] 8050,8050,8050,8050,8050,8050,8050,8050,8050,8050 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 72 && value <= 77) { @@ -1363,12 +1331,12 @@ PatchState forVarbitValue(int value) if (value == 97) { // Orange tree stump[Clear,Inspect,Guide] 8077 - return new PatchState(Produce.ORANGE, CropState.STUMP, 0); + return new PatchState(Produce.ORANGE, CropState.HARVESTABLE, 0); } if (value == 98) { // Orange tree[Check-health,Inspect,Guide] 8064 - return new PatchState(Produce.ORANGE, CropState.UNCHECKED, Produce.ORANGE.getStages() - 1); + return new PatchState(Produce.ORANGE, CropState.GROWING, Produce.ORANGE.getStages() - 1); } if (value >= 99 && value <= 104) { @@ -1393,17 +1361,17 @@ PatchState forVarbitValue(int value) if (value == 124) { // Curry tree stump[Clear,Inspect,Guide] 8046 - return new PatchState(Produce.CURRY, CropState.STUMP, 0); + return new PatchState(Produce.CURRY, CropState.HARVESTABLE, 0); } if (value == 125) { // Curry tree[Check-health,Inspect,Guide] 8033 - return new PatchState(Produce.CURRY, CropState.UNCHECKED, Produce.CURRY.getStages() - 1); + return new PatchState(Produce.CURRY, CropState.GROWING, Produce.CURRY.getStages() - 1); } if (value >= 126 && value <= 135) { // Fruit Tree Patch[Rake,Inspect,Guide] 8050,8050,8050,8050,8050,8050,8050,8050,8050,8050 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 136 && value <= 141) { @@ -1428,12 +1396,12 @@ PatchState forVarbitValue(int value) if (value == 161) { // Pineapple plant stump[Clear,Inspect,Guide] 7992 - return new PatchState(Produce.PINEAPPLE, CropState.STUMP, 0); + return new PatchState(Produce.PINEAPPLE, CropState.HARVESTABLE, 0); } if (value == 162) { // Pineapple plant[Check-health,Inspect,Guide] 7979 - return new PatchState(Produce.PINEAPPLE, CropState.UNCHECKED, Produce.PINEAPPLE.getStages() - 1); + return new PatchState(Produce.PINEAPPLE, CropState.GROWING, Produce.PINEAPPLE.getStages() - 1); } if (value >= 163 && value <= 168) { @@ -1458,17 +1426,17 @@ PatchState forVarbitValue(int value) if (value == 188) { // Papaya tree stump[Clear,Inspect,Guide] 8131 - return new PatchState(Produce.PAPAYA, CropState.STUMP, 0); + return new PatchState(Produce.PAPAYA, CropState.HARVESTABLE, 0); } if (value == 189) { // Papaya tree[Check-health,Inspect,Guide] 8118 - return new PatchState(Produce.PAPAYA, CropState.UNCHECKED, Produce.PAPAYA.getStages() - 1); + return new PatchState(Produce.PAPAYA, CropState.GROWING, Produce.PAPAYA.getStages() - 1); } if (value >= 190 && value <= 199) { // Fruit Tree Patch[Rake,Inspect,Guide] 8050,8050,8050,8050,8050,8050,8050,8050,8050,8050 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 200 && value <= 205) { @@ -1493,12 +1461,12 @@ PatchState forVarbitValue(int value) if (value == 225) { // Palm tree stump[Clear,Inspect,Guide] 8104 - return new PatchState(Produce.PALM, CropState.STUMP, 0); + return new PatchState(Produce.PALM, CropState.HARVESTABLE, 0); } if (value == 226) { // Palm tree[Check-health,Inspect,Guide] 8091 - return new PatchState(Produce.PALM, CropState.UNCHECKED, Produce.PALM.getStages() - 1); + return new PatchState(Produce.PALM, CropState.GROWING, Produce.PALM.getStages() - 1); } if (value >= 227 && value <= 232) { @@ -1523,17 +1491,17 @@ PatchState forVarbitValue(int value) if (value == 252) { // Dragonfruit tree stump[Clear,Inspect,Guide] 34034 - return new PatchState(Produce.DRAGONFRUIT, CropState.STUMP, 0); + return new PatchState(Produce.DRAGONFRUIT, CropState.HARVESTABLE, 0); } if (value == 253) { // Dragonfruit tree[Check-health,Inspect,Guide] 34021 - return new PatchState(Produce.DRAGONFRUIT, CropState.UNCHECKED, Produce.DRAGONFRUIT.getStages() - 1); + return new PatchState(Produce.DRAGONFRUIT, CropState.GROWING, Produce.DRAGONFRUIT.getStages() - 1); } if (value >= 254 && value <= 255) { // Fruit Tree Patch[Rake,Inspect,Guide] 8050,8050 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -1546,7 +1514,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Hops Patch[Rake,Inspect,Guide] 8210,8209,8208,8207 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { @@ -1556,287 +1524,312 @@ PatchState forVarbitValue(int value) if (value >= 8 && value <= 10) { // Hammerstone Hops[Harvest,Inspect,Guide] 8181,8181,8181 - return new PatchState(Produce.HAMMERSTONE, CropState.HARVESTABLE, value - 8); + return new PatchState(Produce.HAMMERSTONE, CropState.HARVESTABLE, 10 - value); } - if (value >= 11 && value <= 15) + if (value >= 11 && value <= 13) + { + // Diseased Hammerstone Hops[Cure,Inspect,Guide] 8186,8187,8188 + return new PatchState(Produce.HAMMERSTONE, CropState.DISEASED, value - 10); + } + if (value >= 14 && value <= 18) { // Asgarnian Hops[Inspect,Guide] 8154,8155,8156,8157,8158 - return new PatchState(Produce.ASGARNIAN, CropState.GROWING, value - 11); + return new PatchState(Produce.ASGARNIAN, CropState.GROWING, value - 14); } - if (value >= 16 && value <= 18) + if (value >= 19 && value <= 21) { // Asgarnian Hops[Harvest,Inspect,Guide] 8159,8159,8159 - return new PatchState(Produce.ASGARNIAN, CropState.HARVESTABLE, value - 16); + return new PatchState(Produce.ASGARNIAN, CropState.HARVESTABLE, 21 - value); } - if (value >= 19 && value <= 24) + if (value >= 22 && value <= 25) + { + // Diseased Asgarnian Hops[Cure,Inspect,Guide] 8165,8166,8167,8168 + return new PatchState(Produce.ASGARNIAN, CropState.DISEASED, value - 21); + } + if (value >= 26 && value <= 31) { // Yanillian Hops[Inspect,Guide] 8288,8289,8290,8291,8292,8293 - return new PatchState(Produce.YANILLIAN, CropState.GROWING, value - 19); + return new PatchState(Produce.YANILLIAN, CropState.GROWING, value - 26); } - if (value >= 25 && value <= 27) + if (value >= 32 && value <= 34) { // Yanillian Hops[Harvest,Inspect,Guide] 8294,8294,8294 - return new PatchState(Produce.YANILLIAN, CropState.HARVESTABLE, value - 25); + return new PatchState(Produce.YANILLIAN, CropState.HARVESTABLE, 34 - value); + } + if (value >= 35 && value <= 39) + { + // Diseased Yanillian Hops[Cure,Inspect,Guide] 8301,8302,8303,8304,8305 + return new PatchState(Produce.YANILLIAN, CropState.DISEASED, value - 34); } - if (value >= 28 && value <= 34) + if (value >= 40 && value <= 46) { // Krandorian Hops[Inspect,Guide] 8211,8212,8213,8214,8215,8216,8217 - return new PatchState(Produce.KRANDORIAN, CropState.GROWING, value - 28); + return new PatchState(Produce.KRANDORIAN, CropState.GROWING, value - 40); } - if (value >= 35 && value <= 37) + if (value >= 47 && value <= 49) { // Krandorian Hops[Harvest,Inspect,Guide] 8218,8218,8218 - return new PatchState(Produce.KRANDORIAN, CropState.HARVESTABLE, value - 35); + return new PatchState(Produce.KRANDORIAN, CropState.HARVESTABLE, 49 - value); } - if (value >= 38 && value <= 45) + if (value >= 50 && value <= 55) + { + // Diseased Krandorian Hops[Cure,Inspect,Guide] 8226,8227,8228,8229,8230,8231 + return new PatchState(Produce.KRANDORIAN, CropState.DISEASED, value - 49); + } + if (value >= 56 && value <= 63) { // Wildblood Hops[Inspect,Guide] 8257,8258,8259,8260,8261,8262,8263,8264 - return new PatchState(Produce.WILDBLOOD, CropState.GROWING, value - 38); + return new PatchState(Produce.WILDBLOOD, CropState.GROWING, value - 56); } - if (value >= 46 && value <= 48) + if (value >= 64 && value <= 66) { // Wildblood Hops[Harvest,Inspect,Guide] 8265,8265,8265 - return new PatchState(Produce.WILDBLOOD, CropState.HARVESTABLE, value - 46); + return new PatchState(Produce.WILDBLOOD, CropState.HARVESTABLE, 66 - value); + } + if (value >= 67 && value <= 73) + { + // Diseased Wildblood Hops[Cure,Inspect,Guide] 8274,8275,8276,8277,8278,8279,8280 + return new PatchState(Produce.WILDBLOOD, CropState.DISEASED, value - 66); } - if (value >= 49 && value <= 52) + if (value >= 74 && value <= 77) { // Barley[Inspect,Guide] 8192,8193,8194,8195 - return new PatchState(Produce.BARLEY, CropState.GROWING, value - 49); + return new PatchState(Produce.BARLEY, CropState.GROWING, value - 74); } - if (value >= 53 && value <= 55) + if (value >= 78 && value <= 80) { // Barley[Harvest,Inspect,Guide] 8196,8196,8196 - return new PatchState(Produce.BARLEY, CropState.HARVESTABLE, value - 53); + return new PatchState(Produce.BARLEY, CropState.HARVESTABLE, 80 - value); + } + if (value >= 81 && value <= 83) + { + // Diseased Barley[Cure,Inspect,Guide] 8201,8202,8203 + return new PatchState(Produce.BARLEY, CropState.DISEASED, value - 80); } - if (value >= 56 && value <= 60) + if (value >= 84 && value <= 88) { // Jute[Inspect,Guide] 8238,8239,8240,8241,8242 - return new PatchState(Produce.JUTE, CropState.GROWING, value - 56); + return new PatchState(Produce.JUTE, CropState.GROWING, value - 84); } - if (value >= 61 && value <= 63) + if (value >= 89 && value <= 91) { // Jute[Harvest,Inspect,Guide] 8243,8243,8243 - return new PatchState(Produce.JUTE, CropState.HARVESTABLE, value - 61); + return new PatchState(Produce.JUTE, CropState.HARVESTABLE, 91 - value); } - if (value >= 64 && value <= 67) + if (value >= 92 && value <= 95) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Diseased Jute[Cure,Inspect,Guide] 8249,8250,8251,8252 + return new PatchState(Produce.JUTE, CropState.DISEASED, value - 91); } - if (value >= 68 && value <= 71) + if (value >= 96 && value <= 98) { - // Hammerstone Hops[Inspect,Guide] 8182,8183,8184,8185 - return new PatchState(Produce.HAMMERSTONE, CropState.GROWING, value - 68); + // Flax[Inspect,Guide] 58836,58837,58838 + return new PatchState(Produce.FLAX, CropState.GROWING, value - 96); } - if (value >= 72 && value <= 74) + if (value >= 99 && value <= 101) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Flax[Harvest,Inspect,Guide] 58839,58839,58839 + return new PatchState(Produce.FLAX, CropState.HARVESTABLE, 101 - value); } - if (value >= 75 && value <= 79) + if (value >= 102 && value <= 103) { - // Asgarnian Hops[Inspect,Guide] 8160,8161,8162,8163,8164 - return new PatchState(Produce.ASGARNIAN, CropState.GROWING, value - 75); + // Diseased Flax[Cure,Inspect,Guide] 58843,58844 + return new PatchState(Produce.FLAX, CropState.DISEASED, value - 101); } - if (value >= 80 && value <= 82) + if (value >= 104 && value <= 107) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hemp[Inspect,Guide] 58847,58848,58849,58850 + return new PatchState(Produce.HEMP, CropState.GROWING, value - 104); } - if (value >= 83 && value <= 88) + if (value >= 108 && value <= 110) { - // Yanillian Hops[Inspect,Guide] 8295,8296,8297,8298,8299,8300 - return new PatchState(Produce.YANILLIAN, CropState.GROWING, value - 83); + // Hemp[Harvest,Inspect,Guide] 58851,58851,58851 + return new PatchState(Produce.HEMP, CropState.HARVESTABLE, 110 - value); } - if (value >= 89 && value <= 91) + if (value >= 111 && value <= 113) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Diseased Hemp[Cure,Inspect,Guide] 58856,58857,58858 + return new PatchState(Produce.HEMP, CropState.DISEASED, value - 110); } - if (value >= 92 && value <= 98) + if (value >= 114 && value <= 118) { - // Krandorian Hops[Inspect,Guide] 8219,8220,8221,8222,8223,8224,8225 - return new PatchState(Produce.KRANDORIAN, CropState.GROWING, value - 92); + // Cotton[Inspect,Guide] 58862,58863,58864,58865,58866 + return new PatchState(Produce.COTTON, CropState.GROWING, value - 114); } - if (value >= 99 && value <= 101) + if (value >= 119 && value <= 121) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Cotton[Harvest,Inspect,Guide] 58867,58867,58867 + return new PatchState(Produce.COTTON, CropState.HARVESTABLE, 121 - value); } - if (value >= 102 && value <= 109) + if (value >= 122 && value <= 125) { - // Wildblood Hops[Inspect,Guide] 8266,8267,8268,8269,8270,8271,8272,8273 - return new PatchState(Produce.WILDBLOOD, CropState.GROWING, value - 102); + // Diseased Cotton[Cure,Inspect,Guide] 58873,58874,58875,58876 + return new PatchState(Produce.COTTON, CropState.DISEASED, value - 121); } - if (value >= 110 && value <= 112) + if (value >= 126 && value <= 131) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 113 && value <= 116) + if (value >= 132 && value <= 135) { - // Barley[Inspect,Guide] 8197,8198,8199,8200 - return new PatchState(Produce.BARLEY, CropState.GROWING, value - 113); + // Hammerstone Hops[Inspect,Guide] 8182,8183,8184,8185 + return new PatchState(Produce.HAMMERSTONE, CropState.GROWING, value - 132); } - if (value >= 117 && value <= 119) + if (value >= 136 && value <= 138) { // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); - } - if (value >= 120 && value <= 124) - { - // Jute[Inspect,Guide] 8244,8245,8246,8247,8248 - return new PatchState(Produce.JUTE, CropState.GROWING, value - 120); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 125 && value <= 132) + if (value >= 139 && value <= 141) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210,8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Dead Hammerstone Hops[Clear,Inspect,Guide] 8189,8190,8191 + return new PatchState(Produce.HAMMERSTONE, CropState.DEAD, value - 138); } - if (value >= 133 && value <= 135) + if (value >= 142 && value <= 146) { - // Diseased Hammerstone Hops[Cure,Inspect,Guide] 8186,8187,8188 - return new PatchState(Produce.HAMMERSTONE, CropState.DISEASED, value - 132); + // Asgarnian Hops[Inspect,Guide] 8160,8161,8162,8163,8164 + return new PatchState(Produce.ASGARNIAN, CropState.GROWING, value - 142); } - if (value >= 136 && value <= 139) + if (value >= 147 && value <= 149) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 140 && value <= 143) + if (value >= 150 && value <= 153) { - // Diseased Asgarnian Hops[Cure,Inspect,Guide] 8165,8166,8167,8168 - return new PatchState(Produce.ASGARNIAN, CropState.DISEASED, value - 139); + // Dead Asgarnian Hops[Clear,Inspect,Guide] 8169,8170,8171,8172 + return new PatchState(Produce.ASGARNIAN, CropState.DEAD, value - 149); } - if (value >= 144 && value <= 147) + if (value >= 154 && value <= 159) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Yanillian Hops[Inspect,Guide] 8295,8296,8297,8298,8299,8300 + return new PatchState(Produce.YANILLIAN, CropState.GROWING, value - 154); } - if (value >= 148 && value <= 152) + if (value >= 160 && value <= 162) { - // Diseased Yanillian Hops[Cure,Inspect,Guide] 8301,8302,8303,8304,8305 - return new PatchState(Produce.YANILLIAN, CropState.DISEASED, value - 147); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 153 && value <= 156) + if (value >= 163 && value <= 167) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Dead Yanillian Hops[Clear,Inspect,Guide] 8306,8307,8308,8309,8310 + return new PatchState(Produce.YANILLIAN, CropState.DEAD, value - 162); } - if (value >= 157 && value <= 162) + if (value >= 168 && value <= 174) { - // Diseased Krandorian Hops[Cure,Inspect,Guide] 8226,8227,8228,8229,8230,8231 - return new PatchState(Produce.KRANDORIAN, CropState.DISEASED, value - 156); + // Krandorian Hops[Inspect,Guide] 8219,8220,8221,8222,8223,8224,8225 + return new PatchState(Produce.KRANDORIAN, CropState.GROWING, value - 168); } - if (value >= 163 && value <= 166) + if (value >= 175 && value <= 177) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 167 && value <= 173) + if (value >= 178 && value <= 183) { - // Diseased Wildblood Hops[Cure,Inspect,Guide] 8274,8275,8276,8277,8278,8279,8280 - return new PatchState(Produce.WILDBLOOD, CropState.DISEASED, value - 166); + // Dead Krandorian Hops[Clear,Inspect,Guide] 8232,8233,8234,8235,8236,8237 + return new PatchState(Produce.KRANDORIAN, CropState.DEAD, value - 177); } - if (value >= 174 && value <= 177) + if (value >= 184 && value <= 191) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Wildblood Hops[Inspect,Guide] 8266,8267,8268,8269,8270,8271,8272,8273 + return new PatchState(Produce.WILDBLOOD, CropState.GROWING, value - 184); } - if (value >= 178 && value <= 180) + if (value >= 192 && value <= 194) { - // Diseased Barley[Cure,Inspect,Guide] 8201,8202,8203 - return new PatchState(Produce.BARLEY, CropState.DISEASED, value - 177); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value == 181) + if (value >= 195 && value <= 201) { - // Hops Patch[Rake,Inspect,Guide] 8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Dead Wildblood Hops[Clear,Inspect,Guide] 8281,8282,8283,8284,8285,8286,8287 + return new PatchState(Produce.WILDBLOOD, CropState.DEAD, value - 194); } - if (value >= 183 && value <= 184) + if (value >= 202 && value <= 205) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Barley[Inspect,Guide] 8197,8198,8199,8200 + return new PatchState(Produce.BARLEY, CropState.GROWING, value - 202); } - if (value >= 185 && value <= 188) + if (value >= 206 && value <= 208) { - // Diseased Jute[Cure,Inspect,Guide] 8249,8250,8251,8252 - return new PatchState(Produce.JUTE, CropState.DISEASED, value - 184); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 189 && value <= 196) + if (value >= 209 && value <= 211) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210,8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Dead Barley[Clear,Inspect,Guide] 8204,8205,8206 + return new PatchState(Produce.BARLEY, CropState.DEAD, value - 208); } - if (value >= 197 && value <= 199) + if (value >= 212 && value <= 216) { - // Dead Hammerstone Hops[Clear,Inspect,Guide] 8189,8190,8191 - return new PatchState(Produce.HAMMERSTONE, CropState.DEAD, value - 196); + // Jute[Inspect,Guide] 8244,8245,8246,8247,8248 + return new PatchState(Produce.JUTE, CropState.GROWING, value - 212); } - if (value >= 200 && value <= 203) + if (value >= 217 && value <= 219) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 204 && value <= 207) + if (value >= 220 && value <= 223) { - // Dead Asgarnian Hops[Clear,Inspect,Guide] 8169,8170,8171,8172 - return new PatchState(Produce.ASGARNIAN, CropState.DEAD, value - 203); + // Dead Jute[Clear,Inspect,Guide] 8253,8254,8255,8256 + return new PatchState(Produce.JUTE, CropState.DEAD, value - 219); } - if (value >= 208 && value <= 211) + if (value >= 224 && value <= 226) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Flax[Inspect,Guide] 58840,58841,58842 + return new PatchState(Produce.FLAX, CropState.GROWING, value - 224); } - if (value >= 212 && value <= 216) + if (value >= 227 && value <= 229) { - // Dead Yanillian Hops[Clear,Inspect,Guide] 8306,8307,8308,8309,8310 - return new PatchState(Produce.YANILLIAN, CropState.DEAD, value - 211); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 217 && value <= 220) + if (value >= 230 && value <= 231) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Dead Flax[Clear,Inspect,Guide] 58845,58846 + return new PatchState(Produce.FLAX, CropState.DEAD, value - 229); } - if (value >= 221 && value <= 226) + if (value >= 232 && value <= 235) { - // Dead Krandorian Hops[Clear,Inspect,Guide] 8232,8233,8234,8235,8236,8237 - return new PatchState(Produce.KRANDORIAN, CropState.DEAD, value - 220); + // Hemp[Inspect,Guide] 58852,58853,58854,58855 + return new PatchState(Produce.HEMP, CropState.GROWING, value - 232); } - if (value >= 227 && value <= 230) + if (value >= 236 && value <= 238) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 231 && value <= 237) + if (value >= 239 && value <= 240) { - // Dead Wildblood Hops[Clear,Inspect,Guide] 8281,8282,8283,8284,8285,8286,8287 - return new PatchState(Produce.WILDBLOOD, CropState.DEAD, value - 230); + // Dead Hemp[Clear,Inspect,Guide] 58859,58860 + return new PatchState(Produce.HEMP, CropState.DEAD, value - 238); } - if (value >= 238 && value <= 241) + if (value == 241) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Dead Hemp[Inspect,Guide] 58861 + return new PatchState(Produce.HEMP, CropState.DEAD, 3); } - if (value >= 242 && value <= 244) + if (value >= 242 && value <= 246) { - // Dead Barley[Clear,Inspect,Guide] 8204,8205,8206 - return new PatchState(Produce.BARLEY, CropState.DEAD, value - 241); + // Cotton[Inspect,Guide] 58868,58869,58870,58871,58872 + return new PatchState(Produce.COTTON, CropState.GROWING, value - 242); } - if (value >= 245 && value <= 248) + if (value >= 247 && value <= 249) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } - if (value >= 249 && value <= 252) + if (value >= 250 && value <= 253) { - // Dead Jute[Clear,Inspect,Guide] 8253,8254,8255,8256 - return new PatchState(Produce.JUTE, CropState.DEAD, value - 248); + // Dead Cotton[Clear,Inspect,Guide] 58877,58878,58879,58880 + return new PatchState(Produce.COTTON, CropState.DEAD, value - 249); } - if (value >= 253 && value <= 255) + if (value >= 254 && value <= 255) { - // Hops Patch[Rake,Inspect,Guide] 8210,8210,8210 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Hops Patch[Rake,Inspect,Guide] 8210,8210 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -1849,12 +1842,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Tree patch[Rake,Inspect,Guide] 8395,8394,8393,8392 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Tree patch[Rake,Inspect,Guide] 8395,8395,8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 11) { @@ -1864,7 +1857,7 @@ PatchState forVarbitValue(int value) if (value == 12) { // Oak[Check-health,Inspect,Guide] 8466 - return new PatchState(Produce.OAK, CropState.UNCHECKED, Produce.OAK.getStages() - 1); + return new PatchState(Produce.OAK, CropState.GROWING, Produce.OAK.getStages() - 1); } if (value == 13) { @@ -1874,7 +1867,7 @@ PatchState forVarbitValue(int value) if (value == 14) { // Oak tree stump[Clear,Inspect,Guide] 8468 - return new PatchState(Produce.OAK, CropState.STUMP, 0); + return new PatchState(Produce.OAK, CropState.HARVESTABLE, 0); } if (value >= 15 && value <= 20) { @@ -1884,7 +1877,7 @@ PatchState forVarbitValue(int value) if (value == 21) { // Willow Tree[Check-health,Inspect,Guide] 8487 - return new PatchState(Produce.WILLOW, CropState.UNCHECKED, Produce.WILLOW.getStages() - 1); + return new PatchState(Produce.WILLOW, CropState.GROWING, Produce.WILLOW.getStages() - 1); } if (value == 22) { @@ -1894,7 +1887,7 @@ PatchState forVarbitValue(int value) if (value == 23) { // Willow tree stump[Clear,Inspect,Guide] 8489 - return new PatchState(Produce.WILLOW, CropState.STUMP, 0); + return new PatchState(Produce.WILLOW, CropState.HARVESTABLE, 0); } if (value >= 24 && value <= 31) { @@ -1904,7 +1897,7 @@ PatchState forVarbitValue(int value) if (value == 32) { // Maple Tree[Check-health,Inspect,Guide] 8443 - return new PatchState(Produce.MAPLE, CropState.UNCHECKED, Produce.MAPLE.getStages() - 1); + return new PatchState(Produce.MAPLE, CropState.GROWING, Produce.MAPLE.getStages() - 1); } if (value == 33) { @@ -1914,7 +1907,7 @@ PatchState forVarbitValue(int value) if (value == 34) { // Tree stump[Clear,Inspect,Guide] 8445 - return new PatchState(Produce.MAPLE, CropState.STUMP, 0); + return new PatchState(Produce.MAPLE, CropState.HARVESTABLE, 0); } if (value >= 35 && value <= 44) { @@ -1924,7 +1917,7 @@ PatchState forVarbitValue(int value) if (value == 45) { // Yew tree[Check-health,Inspect,Guide] 8512 - return new PatchState(Produce.YEW, CropState.UNCHECKED, Produce.YEW.getStages() - 1); + return new PatchState(Produce.YEW, CropState.GROWING, Produce.YEW.getStages() - 1); } if (value == 46) { @@ -1934,7 +1927,7 @@ PatchState forVarbitValue(int value) if (value == 47) { // Yew tree stump[Clear,Inspect,Guide] 8514 - return new PatchState(Produce.YEW, CropState.STUMP, 0); + return new PatchState(Produce.YEW, CropState.HARVESTABLE, 0); } if (value >= 48 && value <= 59) { @@ -1944,7 +1937,7 @@ PatchState forVarbitValue(int value) if (value == 60) { // Magic Tree[Check-health,Inspect,Guide] 8408 - return new PatchState(Produce.MAGIC, CropState.UNCHECKED, Produce.MAGIC.getStages() - 1); + return new PatchState(Produce.MAGIC, CropState.GROWING, Produce.MAGIC.getStages() - 1); } if (value == 61) { @@ -1954,12 +1947,12 @@ PatchState forVarbitValue(int value) if (value == 62) { // Magic Tree Stump[Clear,Inspect,Guide] 8410 - return new PatchState(Produce.MAGIC, CropState.STUMP, 0); + return new PatchState(Produce.MAGIC, CropState.HARVESTABLE, 0); } if (value >= 63 && value <= 72) { // Tree patch[Rake,Inspect,Guide] 8395,8395,8395,8395,8395,8395,8395,8395,8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 73 && value <= 75) { @@ -1974,7 +1967,7 @@ PatchState forVarbitValue(int value) if (value >= 78 && value <= 79) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 80 && value <= 84) { @@ -1989,7 +1982,7 @@ PatchState forVarbitValue(int value) if (value >= 87 && value <= 88) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 89 && value <= 95) { @@ -2004,7 +1997,7 @@ PatchState forVarbitValue(int value) if (value >= 98 && value <= 99) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 100 && value <= 108) { @@ -2019,7 +2012,7 @@ PatchState forVarbitValue(int value) if (value >= 111 && value <= 112) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 113 && value <= 123) { @@ -2034,7 +2027,7 @@ PatchState forVarbitValue(int value) if (value >= 126 && value <= 136) { // Tree patch[Rake,Inspect,Guide] 8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 137 && value <= 139) { @@ -2049,7 +2042,7 @@ PatchState forVarbitValue(int value) if (value >= 142 && value <= 143) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 144 && value <= 148) { @@ -2064,7 +2057,7 @@ PatchState forVarbitValue(int value) if (value >= 151 && value <= 152) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 153 && value <= 159) { @@ -2079,7 +2072,7 @@ PatchState forVarbitValue(int value) if (value >= 162 && value <= 163) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 164 && value <= 172) { @@ -2094,7 +2087,7 @@ PatchState forVarbitValue(int value) if (value >= 175 && value <= 176) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 177 && value <= 187) { @@ -2109,7 +2102,7 @@ PatchState forVarbitValue(int value) if (value >= 190 && value <= 191) { // Tree patch[Rake,Inspect,Guide] 8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 192 && value <= 197) { @@ -2119,7 +2112,7 @@ PatchState forVarbitValue(int value) if (value >= 198 && value <= 255) { // Tree patch[Rake,Inspect,Guide] 8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395,8395 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2132,12 +2125,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Tree patch[Rake,Inspect,Guide] 30479,30478,30477,30476 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Tree patch[Rake,Inspect,Guide] 30479,30479,30479,30479 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 14) { @@ -2147,7 +2140,7 @@ PatchState forVarbitValue(int value) if (value == 15) { // Teak Tree[Check-health,Inspect,Guide] 30444 - return new PatchState(Produce.TEAK, CropState.UNCHECKED, Produce.TEAK.getStages() - 1); + return new PatchState(Produce.TEAK, CropState.GROWING, Produce.TEAK.getStages() - 1); } if (value == 16) { @@ -2157,7 +2150,7 @@ PatchState forVarbitValue(int value) if (value == 17) { // Tree stump[Clear,Inspect,Guide] 30446 - return new PatchState(Produce.TEAK, CropState.STUMP, 0); + return new PatchState(Produce.TEAK, CropState.HARVESTABLE, 0); } if (value >= 18 && value <= 23) { @@ -2177,7 +2170,7 @@ PatchState forVarbitValue(int value) if (value == 38) { // Mahogany tree[Check-health,Inspect,Guide] 30416 - return new PatchState(Produce.MAHOGANY, CropState.UNCHECKED, Produce.MAHOGANY.getStages() - 1); + return new PatchState(Produce.MAHOGANY, CropState.GROWING, Produce.MAHOGANY.getStages() - 1); } if (value == 39) { @@ -2187,7 +2180,7 @@ PatchState forVarbitValue(int value) if (value == 40) { // Mahogany tree stump[Clear,Inspect,Guide] 30418 - return new PatchState(Produce.MAHOGANY, CropState.STUMP, 0); + return new PatchState(Produce.MAHOGANY, CropState.HARVESTABLE, 0); } if (value >= 41 && value <= 47) { @@ -2199,10 +2192,100 @@ PatchState forVarbitValue(int value) // Dead Mahogany[Clear,Inspect,Guide] 30428,30429,30430,30431,30432,30433,30434 return new PatchState(Produce.MAHOGANY, CropState.DEAD, value - 47); } - if (value >= 55 && value <= 255) + if (value >= 55 && value <= 62) + { + // Camphor sapling,Camphor tree[Inspect,Guide] 58712,58713,58714,58715,58716,58717,58718,58719 + return new PatchState(Produce.CAMPHOR, CropState.GROWING, value - 55); + } + if (value == 63) + { + // Camphor tree[Check-health,Inspect,Guide] 58722 + return new PatchState(Produce.CAMPHOR, CropState.GROWING, Produce.CAMPHOR.getStages() - 1); + } + if (value == 64) { - // Tree patch[Rake,Inspect,Guide] 30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + // Camphor tree[Chop down,Inspect,Guide] 58723 + return new PatchState(Produce.CAMPHOR, CropState.HARVESTABLE, 0); + } + if (value == 65) + { + // Camphor tree stump[Clear,Inspect,Guide] 58724 + return new PatchState(Produce.CAMPHOR, CropState.HARVESTABLE, 0); + } + if (value >= 66 && value <= 72) + { + // Diseased Camphor[Prune,Inspect,Guide] 58725,58726,58727,58728,58729,58730,58731 + return new PatchState(Produce.CAMPHOR, CropState.DISEASED, value - 65); + } + if (value >= 73 && value <= 79) + { + // Dead Camphor[Clear,Inspect,Guide] 58734,58735,58736,58737,58738,58739,58740 + return new PatchState(Produce.CAMPHOR, CropState.DEAD, value - 72); + } + if (value >= 80 && value <= 87) + { + // Ironwood sapling,Ironwood tree[Inspect,Guide] 58743,58744,58745,58746,58747,58748,58749,58750 + return new PatchState(Produce.IRONWOOD, CropState.GROWING, value - 80); + } + if (value == 88) + { + // Ironwood tree[Check-health,Inspect,Guide] 58753 + return new PatchState(Produce.IRONWOOD, CropState.GROWING, Produce.IRONWOOD.getStages() - 1); + } + if (value == 89) + { + // Ironwood tree[Chop down,Inspect,Guide] 58754 + return new PatchState(Produce.IRONWOOD, CropState.HARVESTABLE, 0); + } + if (value == 90) + { + // Ironwood tree stump[Clear,Inspect,Guide] 58755 + return new PatchState(Produce.IRONWOOD, CropState.HARVESTABLE, 0); + } + if (value >= 91 && value <= 97) + { + // Diseased Ironwood[Prune,Inspect,Guide] 58756,58757,58758,58759,58760,58761,58762 + return new PatchState(Produce.IRONWOOD, CropState.DISEASED, value - 90); + } + if (value >= 98 && value <= 104) + { + // Dead Ironwood[Clear,Inspect,Guide] 58765,58766,58767,58768,58769,58770,58771 + return new PatchState(Produce.IRONWOOD, CropState.DEAD, value - 97); + } + if (value >= 105 && value <= 113) + { + // Rosewood sapling,Rosewood tree[Inspect,Guide] 58774,58775,58776,58777,58778,58779,58780,58781,58782 + return new PatchState(Produce.ROSEWOOD, CropState.GROWING, value - 105); + } + if (value == 114) + { + // Rosewood tree[Check-health,Inspect,Guide] 58784 + return new PatchState(Produce.ROSEWOOD, CropState.GROWING, Produce.ROSEWOOD.getStages() - 1); + } + if (value == 115) + { + // Rosewood tree[Chop down,Inspect,Guide] 58785 + return new PatchState(Produce.ROSEWOOD, CropState.HARVESTABLE, 0); + } + if (value == 116) + { + // Rosewood tree stump[Clear,Inspect,Guide] 58786 + return new PatchState(Produce.ROSEWOOD, CropState.HARVESTABLE, 0); + } + if (value >= 117 && value <= 124) + { + // Diseased Rosewood[Prune,Inspect,Guide] 58787,58788,58789,58790,58791,58792,58793,58794 + return new PatchState(Produce.ROSEWOOD, CropState.DISEASED, value - 116); + } + if (value >= 125 && value <= 132) + { + // Dead Rosewood[Clear,Inspect,Guide] 58796,58797,58798,58799,58800,58801,58802,58803 + return new PatchState(Produce.ROSEWOOD, CropState.DEAD, value - 124); + } + if (value >= 133 && value <= 255) + { + // Tree patch[Rake,Inspect,Guide] 30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479,30479 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2215,12 +2298,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Redwood tree patch[Rake,Inspect,Guide] 34050,34049,34048,34047 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Redwood tree patch[Rake,Inspect,Guide] 34050,34050,34050,34050 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 17) { @@ -2245,7 +2328,7 @@ PatchState forVarbitValue(int value) if (value == 37) { // Redwood tree[Check-health,Inspect,Guide] 34297 - return new PatchState(Produce.REDWOOD, CropState.UNCHECKED, Produce.REDWOOD.getStages() - 1); + return new PatchState(Produce.REDWOOD, CropState.GROWING, Produce.REDWOOD.getStages() - 1); } if (value >= 41 && value <= 55) { @@ -2263,12 +2346,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Spirit Tree Patch[Rake,Inspect,Guide] 8342,8341,8340,8339 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Spirit Tree Patch[Rake,Inspect,Guide] 8342,8342,8342,8342 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 19) { @@ -2278,7 +2361,7 @@ PatchState forVarbitValue(int value) if (value == 20) { // Spirit Tree[Travel,Talk-to,Inspect,Guide,Clear] 8355 - return new PatchState(Produce.SPIRIT_TREE, CropState.HARVESTABLE, 12); + return new PatchState(Produce.SPIRIT_TREE, CropState.GROWING, 12); } if (value >= 21 && value <= 31) { @@ -2293,12 +2376,12 @@ PatchState forVarbitValue(int value) if (value == 44) { // Spirit Tree[Check-health,Inspect,Guide] 8356 - return new PatchState(Produce.SPIRIT_TREE, CropState.UNCHECKED, Produce.SPIRIT_TREE.getStages() - 1); + return new PatchState(Produce.SPIRIT_TREE, CropState.GROWING, Produce.SPIRIT_TREE.getStages() - 1); } if (value >= 45 && value <= 63) { // Spirit Tree Patch[Rake,Inspect,Guide] 8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342,8342 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2311,12 +2394,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Anima patch[Rake,Inspect,Guide] 33983,33982,33981,33980 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Anima patch[Rake,Inspect,Guide] 33983,33983,33983,33983 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 16) { @@ -2345,7 +2428,45 @@ PatchState forVarbitValue(int value) if (value >= 35 && value <= 255) { // Anima patch[Rake,Inspect,Guide] 33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983,33983 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); + } + return null; + } + }, + BELLADONNA(Tab.SPECIAL, "Belladonna", false) + { + @Override + PatchState forVarbitValue(int value) + { + if (value >= 0 && value <= 3) + { + // Belladonna patch[Rake,Inspect,Guide] 7560,7559,7558,7557 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); + } + if (value >= 4 && value <= 7) + { + // Belladonna[Inspect,Guide] 7561,7562,7563,7564 + return new PatchState(Produce.BELLADONNA, CropState.GROWING, value - 4); + } + if (value == 8) + { + // Belladonna[Pick,Inspect,Guide] 7565 + return new PatchState(Produce.BELLADONNA, CropState.HARVESTABLE, 0); + } + if (value >= 9 && value <= 11) + { + // Diseased Belladonna[Cure,Inspect,Guide] 7566,7567,7568 + return new PatchState(Produce.BELLADONNA, CropState.DISEASED, value - 8); + } + if (value >= 12 && value <= 14) + { + // Dead Belladonna[Clear,Inspect,Guide] 7569,7570,7571 + return new PatchState(Produce.BELLADONNA, CropState.DEAD, value - 11); + } + if (value >= 15 && value <= 255) + { + // Belladonna patch[Rake,Inspect,Guide] 7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560,7560 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2358,12 +2479,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Cactus patch[Rake,Inspect,Guide] 7746,7745,7744,7743 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Cactus patch[Rake,Inspect,Guide] 7746,7746,7746,7746 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 14) { @@ -2388,7 +2509,7 @@ PatchState forVarbitValue(int value) if (value == 31) { // Cactus[Check-health,Inspect,Guide] 7758 - return new PatchState(Produce.CACTUS, CropState.UNCHECKED, Produce.CACTUS.getStages() - 1); + return new PatchState(Produce.CACTUS, CropState.GROWING, Produce.CACTUS.getStages() - 1); } if (value >= 32 && value <= 38) { @@ -2413,12 +2534,90 @@ PatchState forVarbitValue(int value) if (value == 58) { // Potato cactus[Check-health,Inspect,Guide] 33748 - return new PatchState(Produce.POTATO_CACTUS, CropState.UNCHECKED, Produce.POTATO_CACTUS.getStages() - 1); + return new PatchState(Produce.POTATO_CACTUS, CropState.GROWING, Produce.POTATO_CACTUS.getStages() - 1); } if (value >= 59 && value <= 255) { // Cactus patch[Rake,Inspect,Guide] 7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746,7746 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); + } + return null; + } + }, + CORAL(Tab.SPECIAL, "Coral", false) + { + @Override + PatchState forVarbitValue(int value) + { + if (value >= 0 && value <= 3) + { + // Coral nursery[Inspect,Guide] 58676,58676,58676,58676 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); + } + if (value >= 4 && value <= 7) + { + // Elkhorn coral[Inspect,Guide] 58677,58678,58679,58680 + return new PatchState(Produce.ELKHORN_CORAL, CropState.GROWING, value - 4); + } + if (value == 8) + { + // Elkhorn coral[Collect,Inspect,Guide] 58681 + return new PatchState(Produce.ELKHORN_CORAL, CropState.GROWING, 4); + } + if (value >= 9 && value <= 11) + { + // Diseased elkhorn coral[Prune,Inspect,Guide] 58692,58693,58694 + return new PatchState(Produce.ELKHORN_CORAL, CropState.DISEASED, value - 8); + } + if (value >= 12 && value <= 14) + { + // Dead coral[Clear,Inspect,Guide] 58701,58702,58703 + return new PatchState(Produce.ELKHORN_CORAL, CropState.DEAD, value - 11); + } + if (value >= 15 && value <= 18) + { + // Pillar coral[Inspect,Guide] 58682,58683,58684,58685 + return new PatchState(Produce.PILLAR_CORAL, CropState.GROWING, value - 15); + } + if (value == 19) + { + // Pillar coral[Collect,Inspect,Guide] 58686 + return new PatchState(Produce.PILLAR_CORAL, CropState.GROWING, 4); + } + if (value >= 20 && value <= 22) + { + // Diseased pillar coral[Prune,Inspect,Guide] 58695,58696,58697 + return new PatchState(Produce.PILLAR_CORAL, CropState.DISEASED, value - 19); + } + if (value >= 23 && value <= 25) + { + // Dead coral[Clear,Inspect,Guide] 58704,58705,58706 + return new PatchState(Produce.PILLAR_CORAL, CropState.DEAD, value - 22); + } + if (value >= 26 && value <= 29) + { + // Umbral coral[Inspect,Guide] 58687,58688,58689,58690 + return new PatchState(Produce.UMBRAL_CORAL, CropState.GROWING, value - 26); + } + if (value == 30) + { + // Umbral coral[Collect,Inspect,Guide] 58691 + return new PatchState(Produce.UMBRAL_CORAL, CropState.GROWING, 4); + } + if (value >= 31 && value <= 33) + { + // Diseased umbral coral[Prune,Inspect,Guide] 58698,58699,58700 + return new PatchState(Produce.UMBRAL_CORAL, CropState.DISEASED, value - 30); + } + if (value >= 34 && value <= 36) + { + // Dead coral[Clear,Inspect,Guide] 58707,58708,58709 + return new PatchState(Produce.UMBRAL_CORAL, CropState.DEAD, value - 33); + } + if (value >= 37 && value <= 255) + { + // Coral nursery[Inspect,Guide] 58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676,58676 + return new PatchState(Produce.WEEDS, CropState.GROWING, 0); } return null; } @@ -2431,7 +2630,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Seaweed patch[Rake,Inspect,Guide] 30486,30485,30484,30483 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { @@ -2456,7 +2655,7 @@ PatchState forVarbitValue(int value) if (value >= 17 && value <= 255) { // Seaweed patch[Rake,Inspect,Guide] 30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486,30486 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2469,7 +2668,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Calquat patch[Rake,Inspect,Guide] 7775,7774,7773,7772 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 11) { @@ -2494,12 +2693,12 @@ PatchState forVarbitValue(int value) if (value == 34) { // Calquat Tree[Check-health,Inspect,Guide] 7791 - return new PatchState(Produce.CALQUAT, CropState.UNCHECKED, Produce.CALQUAT.getStages() - 1); + return new PatchState(Produce.CALQUAT, CropState.GROWING, Produce.CALQUAT.getStages() - 1); } if (value >= 35 && value <= 255) { // Calquat patch[Rake,Inspect,Guide] 7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775,7775 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2512,12 +2711,12 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Celastrus patch[Rake,Inspect,Guide] 33698,33697,33696,33695 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 4 && value <= 7) { // Celastrus patch[Rake,Inspect,Guide] 33698,33698,33698,33698 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 8 && value <= 12) { @@ -2527,7 +2726,7 @@ PatchState forVarbitValue(int value) if (value == 13) { // Celastrus tree[Check-health,Inspect,Guide] 33704 - return new PatchState(Produce.CELASTRUS, CropState.UNCHECKED, Produce.CELASTRUS.getStages() - 1); + return new PatchState(Produce.CELASTRUS, CropState.GROWING, Produce.CELASTRUS.getStages() - 1); } if (value >= 14 && value <= 16) { @@ -2552,12 +2751,12 @@ PatchState forVarbitValue(int value) if (value == 28) { // Celastrus tree stump[Clear,Inspect,Guide] 33721 - return new PatchState(Produce.CELASTRUS, CropState.STUMP, 0); + return new PatchState(Produce.CELASTRUS, CropState.HARVESTABLE, 0); } if (value >= 29 && value <= 255) { // Celastrus patch[Rake,Inspect,Guide] 33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698,33698 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } return null; } @@ -2570,7 +2769,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 1) { // Empty, empty+fertilizer - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3); } if (value >= 2 && value <= 9) { @@ -2595,7 +2794,7 @@ PatchState forVarbitValue(int value) if (value >= 0 && value <= 3) { // Crystal tree patch[Rake,Inspect,Guide] 34910,34909,34908,34907 - return new PatchState(Produce.WEEDS, CropState.EMPTY, 3 - value); + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); } if (value >= 8 && value <= 13) { @@ -2605,7 +2804,7 @@ PatchState forVarbitValue(int value) if (value == 14) { // Crystal tree[Check-health,Inspect,Guide] 34917 - return new PatchState(Produce.CRYSTAL_TREE, CropState.UNCHECKED, Produce.CRYSTAL_TREE.getStages() - 1); + return new PatchState(Produce.CRYSTAL_TREE, CropState.GROWING, Produce.CRYSTAL_TREE.getStages() - 1); } if (value == 15) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PaymentTracker.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PaymentTracker.java index f3086e05699..e60d07530c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PaymentTracker.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/PaymentTracker.java @@ -24,14 +24,15 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns; -import javax.inject.Inject; -import javax.inject.Singleton; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import net.runelite.client.config.ConfigManager; import net.runelite.client.plugins.timetracking.TimeTrackingConfig; +import javax.inject.Inject; +import javax.inject.Singleton; + @Slf4j @RequiredArgsConstructor( access = AccessLevel.PRIVATE, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/TreeRun.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/TreeRun.java index 861260c7322..be0e8318a03 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/TreeRun.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/farmruns/TreeRun.java @@ -28,13 +28,9 @@ import com.google.inject.Inject; import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.FruitTreeSapling; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.GracefulOrFarming; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.HardwoodTreeSapling; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.TreeSapling; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.PayOrCut; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.PayOrCompost; +import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.FarmingUtils.*; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.panel.TopLevelPanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.ComplexStateQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.HelperConfig; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; @@ -50,8 +46,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.client.plugins.microbot.questhelper.steps.widget.LunarSpells; import net.runelite.client.plugins.microbot.questhelper.steps.widget.NormalSpells; -import java.util.Set; - +import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; @@ -61,9 +56,11 @@ import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.timetracking.Tab; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Set; import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; @@ -88,68 +85,95 @@ public class TreeRun extends ComplexStateQuestHelper DetailedQuestStep waitForTree; // Trees - DetailedQuestStep farmingGuildTreePatchCheckHealth, lumbridgeTreePatchCheckHealth, faladorTreePatchCheckHealth, taverleyTreePatchCheckHealth, varrockTreePatchCheckHealth, - gnomeStrongholdTreePatchCheckHealth; - DetailedQuestStep farmingGuildTreePatchPlant, lumbridgeTreePatchPlant, faladorTreePatchPlant, taverleyTreePatchPlant, - varrockTreePatchPlant, gnomeStrongholdTreePatchPlant; + DetailedQuestStep farmingGuildTreePatchCheckHealth, lumbridgeTreePatchCheckHealth, faladorTreePatchCheckHealth, + taverleyTreePatchCheckHealth, varrockTreePatchCheckHealth, gnomeStrongholdTreePatchCheckHealth, + auburnvaleTreePatchCheckHealth; + DetailedQuestStep farmingGuildTreePatchPlant, lumbridgeTreePatchPlant, faladorTreePatchPlant, + taverleyTreePatchPlant, varrockTreePatchPlant, gnomeStrongholdTreePatchPlant, + auburnvaleTreePatchPlant; DetailedQuestStep lumbridgeTreePatchClear, faladorTreePatchClear, taverleyTreePatchClear, varrockTreePatchClear, - gnomeStrongholdTreePatchClear, farmingGuildTreePatchClear; + gnomeStrongholdTreePatchClear, farmingGuildTreePatchClear, auburnvaleTreePatchClear; DetailedQuestStep lumbridgeTreePatchDig, faladorTreePatchDig, taverleyTreePatchDig, varrockTreePatchDig, - gnomeStrongholdTreePatchDig, farmingGuildTreePatchDig; + gnomeStrongholdTreePatchDig, farmingGuildTreePatchDig, auburnvaleTreePatchDig; - DetailedQuestStep farmingGuildTreePayForProtection, lumbridgeTreeProtect, faladorTreeProtect, taverleyTreeProtect, varrockTreeProtect, strongholdTreeProtect; + DetailedQuestStep farmingGuildTreePayForProtection, lumbridgeTreeProtect, + faladorTreeProtect, taverleyTreeProtect, varrockTreeProtect, strongholdTreeProtect, + auburnvaleTreeProtect; // Fruit Trees - DetailedQuestStep farmingGuildFruitTreePatchCheckHealth, gnomeStrongholdFruitTreePatchCheckHealth, gnomeVillageFruitTreePatchCheckHealth, - brimhavenFruitTreePatchCheckHealth, lletyaFruitTreePatchCheckHealth, catherbyFruitTreePatchCheckHealth; - DetailedQuestStep farmingGuildFruitTreePatchPlant, gnomeStrongholdFruitTreePatchPlant, gnomeVillageFruitTreePatchPlant, - brimhavenFruitTreePatchPlant, lletyaFruitTreePatchPlant, catherbyFruitTreePatchPlant; - - DetailedQuestStep farmingGuildFruitTreePatchClear, gnomeStrongholdFruitTreePatchClear, gnomeVillageFruitTreePatchClear, - brimhavenFruitTreePatchClear, lletyaFruitTreePatchClear, catherbyFruitTreePatchClear; + DetailedQuestStep farmingGuildFruitTreePatchCheckHealth, gnomeStrongholdFruitTreePatchCheckHealth, + gnomeVillageFruitTreePatchCheckHealth, brimhavenFruitTreePatchCheckHealth, lletyaFruitTreePatchCheckHealth, + catherbyFruitTreePatchCheckHealth, taiBwoWannaiCalquatPatchCheckHealth, kastoriFruitTreePatchCheckHealth, + kastoriCalquatPatchCheckHealth, greatConchCalquatPatchCheckHealth; + DetailedQuestStep farmingGuildFruitTreePatchPlant, gnomeStrongholdFruitTreePatchPlant, + gnomeVillageFruitTreePatchPlant, brimhavenFruitTreePatchPlant, lletyaFruitTreePatchPlant, + catherbyFruitTreePatchPlant, taiBwoWannaiCalquatPatchPlant, kastoriFruitTreePatchPlant, + kastoriCalquatPatchPlant, greatConchCalquatPatchPlant; + + DetailedQuestStep farmingGuildFruitTreePatchClear, gnomeStrongholdFruitTreePatchClear, + gnomeVillageFruitTreePatchClear, brimhavenFruitTreePatchClear, lletyaFruitTreePatchClear, + catherbyFruitTreePatchClear, taiBwoWannaiCalquatPatchClear, kastoriFruitTreePatchClear, + kastoriCalquatPatchClear, greatConchCalquatPatchClear; DetailedQuestStep farmingGuildFruitTreePatchDig, gnomeStrongholdFruitTreePatchDig, gnomeVillageFruitTreePatchDig, - brimhavenFruitTreePatchDig, lletyaFruitTreePatchDig, catherbyFruitTreePatchDig; + brimhavenFruitTreePatchDig, lletyaFruitTreePatchDig, catherbyFruitTreePatchDig, + taiBwoWannaiCalquatPatchDig, kastoriFruitTreePatchDig, kastoriCalquatPatchDig, greatConchCalquatPatchDig; DetailedQuestStep guildFruitProtect, strongholdFruitProtect, villageFruitProtect, brimhavenFruitProtect, - lletyaFruitProtect, catherbyFruitProtect; + lletyaFruitProtect, catherbyFruitProtect, taiBwoWannaiCalquatProtect, kastoriFruitProtect, + kastoriCalquatProtect, greatConchCalquatProtect; // Hardwood Trees - DetailedQuestStep eastHardwoodTreePatchCheckHealth, westHardwoodTreePatchCheckHealth, middleHardwoodTreePatchCheckHealth, savannahCheckHealth; - DetailedQuestStep eastHardwoodTreePatchPlant, westHardwoodTreePatchPlant, middleHardwoodTreePatchPlant, savannahPlant; - DetailedQuestStep eastHardwoodTreePatchDig, westHardwoodTreePatchDig, middleHardwoodTreePatchDig, savannahDig; + DetailedQuestStep eastHardwoodTreePatchCheckHealth, westHardwoodTreePatchCheckHealth, + middleHardwoodTreePatchCheckHealth, savannahCheckHealth, anglersCheckHealth; + DetailedQuestStep eastHardwoodTreePatchPlant, westHardwoodTreePatchPlant, middleHardwoodTreePatchPlant, + savannahPlant, anglersPlant; + DetailedQuestStep eastHardwoodTreePatchDig, westHardwoodTreePatchDig, middleHardwoodTreePatchDig, savannahDig, + anglersDig; - DetailedQuestStep eastHardwoodTreePatchClear, westHardwoodTreePatchClear, middleHardwoodTreePatchClear, savannahClear; + DetailedQuestStep eastHardwoodTreePatchClear, westHardwoodTreePatchClear, middleHardwoodTreePatchClear, + savannahClear, anglersClear; - DetailedQuestStep eastHardwoodProtect, westHardwoodProtect, middleHardwoodProtect, savannahProtect; + DetailedQuestStep eastHardwoodProtect, westHardwoodProtect, middleHardwoodProtect, savannahProtect, + anglersProtect; // Farming Items - ItemRequirement coins, spade, rake, allTreeSaplings, treeSapling, allFruitSaplings, fruitTreeSapling, allHardwoodSaplings, hardwoodSapling, compost, axe, - protectionItemTree, allProtectionItemTree, protectionItemFruitTree, allProtectionItemFruitTree, protectionItemHardwood, allProtectionItemHardwood; + ItemRequirement coins, spade, rake, allTreeSaplings, treeSapling, allFruitSaplings, fruitTreeSapling, + allHardwoodSaplings, hardwoodSapling, calquatSapling, allCalquatSaplings, + compost, axe, protectionItemTree, allProtectionItemTree, protectionItemCalquat, allProtectionItemCalquat, + protectionItemFruitTree, allProtectionItemFruitTree, protectionItemHardwood, allProtectionItemHardwood; // Teleport Items // TODO: Add these... - ItemRequirement farmingGuildTeleport, crystalTeleport, catherbyTeleport, varrockTeleport, lumbridgeTeleport, faladorTeleport, fossilIslandTeleport; + ItemRequirement farmingGuildTeleport, crystalTeleport, catherbyTeleport, varrockTeleport, lumbridgeTeleport, + faladorTeleport, fossilIslandTeleport, auburnvaleTeleport, kastoriTeleport; // Graceful Set - ItemRequirement gracefulHood, gracefulTop, gracefulLegs, gracefulGloves, gracefulBoots, gracefulCape, gracefulOutfit; + ItemRequirement gracefulHood, gracefulTop, gracefulLegs, gracefulGloves, gracefulBoots, gracefulCape, + gracefulOutfit; // Farming Set ItemRequirement farmingHat, farmingTop, farmingLegs, farmingBoots, farmersOutfit; // Access Requirements - Requirement accessToFarmingGuildTreePatch, accessToFarmingGuildFruitTreePatch, accessToLletya, accessToFossilIsland, accessToSavannah; + Requirement accessToFarmingGuildTreePatch, accessToFarmingGuildFruitTreePatch, accessToLletya, accessToFossilIsland, + accessToSavannah, accessToVarlamore, accessToAnglersRetreat, accessToGreatConch; Requirement payingForRemoval, payingForProtection, usingCompostorNothing; - PatchStates faladorStates, lumbridgeStates, farmingGuildTreeStates, taverleyStates, varrockStates, gnomeStrongholdTreeStates; + PatchStates faladorStates, lumbridgeStates, farmingGuildTreeStates, taverleyStates, varrockStates, + gnomeStrongholdTreeStates, auburnvaleStates; + + PatchStates gnomeStrongholdFruitStates, gnomeVillageStates, brimhavenStates, catherbyStates, lletyaStates, + farmingGuildFruitStates, taiBwoWannaiStates, kastoriStates, greatConchStates; - PatchStates gnomeStrongholdFruitStates, gnomeVillageStates, brimhavenStates, catherbyStates, lletyaStates, farmingGuildFruitStates; + PatchStates eastHardwoodStates, middleHardwoodStates, westHardwoodStates, savannahStates, anglersRetreatStates; - PatchStates eastHardwoodStates, middleHardwoodStates, westHardwoodStates, savannahStates; + Requirement allGrowing; - ConditionalStep farmingGuildStep, lumbridgeStep, varrockStep, faladorStep, taverleyStep, strongholdStep, villageStep, lletyaStep, - catherbyStep, brimhavenStep, fossilIslandStep, savannahStep; + ConditionalStep farmingGuildStep, lumbridgeStep, varrockStep, faladorStep, taverleyStep, strongholdStep, + villageStep, lletyaStep, catherbyStep, brimhavenStep, fossilIslandStep, savannahStep, auburnvaleStep, + kastoriStep, anglersRetreatStep, greatConchStep; private final String PAY_OR_CUT = "payOrCutTree"; private final String PAY_OR_COMPOST = "payOrCompostTree"; @@ -162,8 +186,8 @@ public QuestStep loadStep() setupSteps(); farmingHandler = new FarmingHandler(client, configManager); - ReorderableConditionalStep steps = new ReorderableConditionalStep(this, waitForTree, spade, coins, rake, compost - , farmersOutfit, gracefulOutfit); + ReorderableConditionalStep steps = new ReorderableConditionalStep(this, waitForTree, spade, coins, + rake, compost, farmersOutfit, gracefulOutfit); // Farming Guild Tree -> Farming Guild Fruit Tree -> Lumbridge -> Falador -> Taverley // Varrock -> Gnome Stronghold Fruit -> Gnome Stronghold Tree -> Gnome Village -> catherby @@ -261,8 +285,14 @@ public QuestStep loadStep() brimhavenStep.addStep(brimhavenStates.getIsHarvestable(), brimhavenFruitTreePatchClear); brimhavenStep.addStep(brimhavenStates.getIsStump(), brimhavenFruitTreePatchDig); brimhavenStep.addStep(nor(usingCompostorNothing, brimhavenStates.getIsProtected()), brimhavenFruitProtect); + brimhavenStep.addStep(taiBwoWannaiStates.getIsUnchecked(), taiBwoWannaiCalquatPatchCheckHealth); + brimhavenStep.addStep(taiBwoWannaiStates.getIsEmpty(), taiBwoWannaiCalquatPatchPlant); + brimhavenStep.addStep(taiBwoWannaiStates.getIsHarvestable(), taiBwoWannaiCalquatPatchClear); + brimhavenStep.addStep(taiBwoWannaiStates.getIsStump(), taiBwoWannaiCalquatPatchDig); + brimhavenStep.addStep(nor(usingCompostorNothing, taiBwoWannaiStates.getIsProtected()), + taiBwoWannaiCalquatProtect); - steps.addStep(nor(brimhavenStates.getIsGrowing()), brimhavenStep.withId(8)); + steps.addStep(nand(brimhavenStates.getIsGrowing(), taiBwoWannaiStates.getIsGrowing()), brimhavenStep.withId(8)); lletyaStep = new ConditionalStep(this, lletyaFruitTreePatchCheckHealth); lletyaStep.addStep(lletyaStates.getIsUnchecked(), lletyaFruitTreePatchCheckHealth); @@ -305,6 +335,53 @@ public QuestStep loadStep() steps.addStep(and(accessToSavannah, nor(savannahStates.getIsGrowing())), savannahStep.withId(11)); + auburnvaleStep = new ConditionalStep(this, auburnvaleTreePatchCheckHealth); + auburnvaleStep.addStep(auburnvaleStates.getIsUnchecked(), auburnvaleTreePatchCheckHealth); + auburnvaleStep.addStep(auburnvaleStates.getIsEmpty(), auburnvaleTreePatchPlant); + auburnvaleStep.addStep(auburnvaleStates.getIsHarvestable(), auburnvaleTreePatchClear); + auburnvaleStep.addStep(auburnvaleStates.getIsStump(), auburnvaleTreePatchDig); + auburnvaleStep.addStep(nor(usingCompostorNothing, auburnvaleStates.getIsProtected()), auburnvaleTreeProtect); + + steps.addStep(and(accessToVarlamore, nor(auburnvaleStates.getIsGrowing())), auburnvaleStep.withId(12)); + + + //kastoriStep, anglersRetreatStep, greatConchStep; + + kastoriStep = new ConditionalStep(this, kastoriFruitTreePatchCheckHealth); + kastoriStep.addStep(kastoriStates.getIsUnchecked(), kastoriFruitTreePatchCheckHealth); + kastoriStep.addStep(kastoriStates.getIsEmpty(), kastoriFruitTreePatchPlant); + kastoriStep.addStep(kastoriStates.getIsHarvestable(), kastoriFruitTreePatchClear); + kastoriStep.addStep(kastoriStates.getIsStump(), kastoriFruitTreePatchDig); + kastoriStep.addStep(nor(usingCompostorNothing, kastoriStates.getIsProtected()), kastoriFruitProtect); + + kastoriStep.addStep(kastoriStates.getIsUnchecked(), kastoriCalquatPatchCheckHealth); + kastoriStep.addStep(kastoriStates.getIsEmpty(), kastoriCalquatPatchPlant); + kastoriStep.addStep(kastoriStates.getIsHarvestable(), kastoriCalquatPatchClear); + kastoriStep.addStep(kastoriStates.getIsStump(), kastoriCalquatPatchDig); + kastoriStep.addStep(nor(usingCompostorNothing, kastoriStates.getIsProtected()), kastoriCalquatProtect); + + steps.addStep(and(accessToVarlamore, nand(kastoriStates.getIsGrowing(), kastoriStates.getIsGrowing())), kastoriStep.withId(13)); + + anglersRetreatStep = new ConditionalStep(this, anglersCheckHealth); + anglersRetreatStep.addStep(anglersRetreatStates.getIsUnchecked(), anglersCheckHealth); + anglersRetreatStep.addStep(anglersRetreatStates.getIsEmpty(), anglersPlant); + anglersRetreatStep.addStep(anglersRetreatStates.getIsHarvestable(), anglersClear); + anglersRetreatStep.addStep(anglersRetreatStates.getIsStump(), anglersDig); + anglersRetreatStep.addStep(nor(usingCompostorNothing, anglersRetreatStates.getIsProtected()), anglersProtect); + + steps.addStep(and(accessToAnglersRetreat, nor(anglersRetreatStates.getIsGrowing())), + anglersRetreatStep.withId(14)); + + greatConchStep = new ConditionalStep(this, greatConchCalquatPatchCheckHealth); + greatConchStep.addStep(greatConchStates.getIsUnchecked(), greatConchCalquatPatchCheckHealth); + greatConchStep.addStep(greatConchStates.getIsEmpty(), greatConchCalquatPatchPlant); + greatConchStep.addStep(greatConchStates.getIsHarvestable(), greatConchCalquatPatchClear); + greatConchStep.addStep(greatConchStates.getIsStump(), greatConchCalquatPatchDig); + greatConchStep.addStep(nor(usingCompostorNothing, greatConchStates.getIsProtected()), greatConchCalquatProtect); + + steps.addStep(and(accessToGreatConch, nor(greatConchStates.getIsGrowing())), + greatConchStep.withId(15)); + return steps; } @@ -323,6 +400,13 @@ private void setupConditions() new SkillRequirement(Skill.FARMING, 85) ); accessToSavannah = new QuestRequirement(QuestHelperQuest.THE_RIBBITING_TALE_OF_A_LILY_PAD_LABOUR_DISPUTE, QuestState.FINISHED); + accessToVarlamore = new QuestRequirement(QuestHelperQuest.CHILDREN_OF_THE_SUN, QuestState.FINISHED); + + accessToAnglersRetreat = new Conditions( + new SkillRequirement(Skill.SAILING, 51) + ); + + accessToGreatConch = new QuestRequirement(QuestHelperQuest.TROUBLED_TORTUGANS, QuestState.FINISHED); // Trees lumbridgeStates = new PatchStates("Lumbridge"); @@ -331,19 +415,39 @@ private void setupConditions() varrockStates = new PatchStates("Varrock"); gnomeStrongholdTreeStates = new PatchStates("Gnome Stronghold"); farmingGuildTreeStates = new PatchStates("Farming Guild", accessToFarmingGuildTreePatch); + auburnvaleStates = new PatchStates("Auburnvale", accessToVarlamore); // Fruit trees catherbyStates = new PatchStates("Catherby"); brimhavenStates = new PatchStates("Brimhaven"); + taiBwoWannaiStates = new PatchStates("Tai Bwo Wannai"); gnomeVillageStates = new PatchStates("Tree Gnome Village"); gnomeStrongholdFruitStates = new PatchStates("Gnome Stronghold"); lletyaStates = new PatchStates("Lletya", accessToLletya); farmingGuildFruitStates = new PatchStates("Farming Guild", accessToFarmingGuildFruitTreePatch); + kastoriStates = new PatchStates("Kastori", accessToVarlamore); + greatConchStates = new PatchStates("Great Conch", accessToGreatConch); westHardwoodStates = new PatchStates("Fossil Island", "West"); middleHardwoodStates = new PatchStates("Fossil Island", "Middle"); eastHardwoodStates = new PatchStates("Fossil Island", "East"); savannahStates = new PatchStates("Avium Savannah", accessToSavannah); + anglersRetreatStates = new PatchStates("Anglers' Retreat", accessToAnglersRetreat); + + allGrowing = and(lumbridgeStates.getIsGrowing(), faladorStates.getIsGrowing(), taverleyStates.getIsGrowing(), + varrockStates.getIsGrowing(), gnomeStrongholdTreeStates.getIsGrowing(), catherbyStates.getIsGrowing(), + brimhavenStates.getIsGrowing(), taiBwoWannaiStates.getIsGrowing(), gnomeVillageStates.getIsGrowing(), + gnomeStrongholdFruitStates.getIsGrowing(), + or(not(accessToLletya), lletyaStates.getIsGrowing()), + or(not(accessToVarlamore), auburnvaleStates.getIsGrowing()), + or(not(accessToVarlamore), kastoriStates.getIsGrowing()), + or(not(accessToFarmingGuildTreePatch), farmingGuildTreeStates.getIsGrowing()), + or(not(accessToFarmingGuildFruitTreePatch), farmingGuildFruitStates.getIsGrowing()), + or(not(accessToFossilIsland), and(westHardwoodStates.getIsGrowing(), middleHardwoodStates.getIsGrowing(), eastHardwoodStates.getIsGrowing())), + or(not(accessToSavannah), savannahStates.getIsGrowing()), + or(not(accessToAnglersRetreat), anglersRetreatStates.getIsGrowing()), + or(not(accessToGreatConch), greatConchStates.getIsGrowing()) + ); payingForRemoval = new RuneliteRequirement(configManager, PAY_OR_CUT, PayOrCut.PAY.name()); payingForProtection = new RuneliteRequirement(configManager, PAY_OR_COMPOST, PayOrCompost.PAY.name()); @@ -356,8 +460,8 @@ public void setupRequirements() { setupConditions(); // Farming Item Requirements - spade = new ItemRequirement("Spade", net.runelite.api.gameval.ItemID.SPADE); - rake = new ItemRequirement("Rake", net.runelite.api.gameval.ItemID.RAKE) + spade = new ItemRequirement("Spade", ItemID.SPADE); + rake = new ItemRequirement("Rake", ItemID.RAKE) .hideConditioned(new VarbitRequirement(VarbitID.FARMING_BLOCKWEEDS, 2)); coins = new ItemRequirement("Coins to quickly remove trees.", ItemID.COINS) .showConditioned(payingForRemoval); @@ -390,6 +494,16 @@ public void setupRequirements() protectionItemHardwood.addAlternates(protectionItemHardwood.getId() + 1); allProtectionItemHardwood = protectionItemHardwood.copy(); + CalquatTreeSapling calquatTreeSaplingEnum = (CalquatTreeSapling) FarmingUtils.getEnumFromConfig(configManager, + CalquatTreeSapling.CALQUAT); + calquatSapling = calquatTreeSaplingEnum.getPlantableItemRequirement(itemManager); + calquatSapling.setHighlightInInventory(true); + allCalquatSaplings = calquatSapling.copy(); + + protectionItemCalquat = calquatTreeSaplingEnum.getProtectionItemRequirement(itemManager).showConditioned(payingForProtection); + protectionItemCalquat.addAlternates(protectionItemCalquat.getId() + 1); + allProtectionItemCalquat = protectionItemCalquat.copy(); + compost = new ItemRequirement("Compost", ItemCollections.COMPOST).showConditioned(usingCompostorNothing); compost.setDisplayMatchedItemName(true); @@ -403,7 +517,10 @@ public void setupRequirements() faladorTeleport = new ItemRequirement("Falador teleport", ItemCollections.RING_OF_WEALTHS); faladorTeleport.addAlternates(ItemID.POH_TABLET_FALADORTELEPORT); fossilIslandTeleport = new ItemRequirement("Teleport to Fossil Island", ItemCollections.DIGSITE_PENDANTS); - + auburnvaleTeleport = new ItemRequirement("Auburnvale Teleport", ItemID.PENDANT_OF_ATES); + auburnvaleTeleport.addAlternates(ItemCollections.FAIRY_STAFF); + kastoriTeleport = new ItemRequirement("Kastori Teleport", ItemID.PENDANT_OF_ATES); + kastoriTeleport.addAlternates(ItemCollections.FAIRY_STAFF); // Graceful and Farming Outfit gracefulHood = new ItemRequirement( @@ -432,7 +549,7 @@ public void setupRequirements() farmingHat = new ItemRequirement( - "Farmer's strawhat", net.runelite.api.gameval.ItemID.TITHE_REWARD_HAT_MALE, 1 ,true).isNotConsumed(); + "Farmer's strawhat", ItemID.TITHE_REWARD_HAT_MALE, 1 ,true).isNotConsumed(); farmingHat.addAlternates(ItemID.TITHE_REWARD_HAT_FEMALE); farmingTop = new ItemRequirement( @@ -441,11 +558,11 @@ public void setupRequirements() farmingLegs = new ItemRequirement( "Farmer's boro trousers", ItemID.TITHE_REWARD_LEGS_MALE, 1, true).isNotConsumed(); - farmingLegs.addAlternates(net.runelite.api.gameval.ItemID.TITHE_REWARD_LEGS_FEMALE); + farmingLegs.addAlternates(ItemID.TITHE_REWARD_LEGS_FEMALE); farmingBoots = new ItemRequirement( "Graceful cape", ItemID.TITHE_REWARD_FEET_MALE, 1, true).isNotConsumed(); - farmingBoots.addAlternates(net.runelite.api.gameval.ItemID.TITHE_REWARD_FEET_FEMALE); + farmingBoots.addAlternates(ItemID.TITHE_REWARD_FEET_FEMALE); farmersOutfit = new ItemRequirements( "Farmer's outfit (equipped)", @@ -483,6 +600,10 @@ private void setupSteps() "Speak to Rosie to clear the patch."); farmingGuildTreePatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + auburnvaleTreePatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_TREE_7, new WorldPoint(1367, 3322, 0), + "Speak to Aub to clear the patch."); + auburnvaleTreePatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + lumbridgeTreeProtect = new NpcStep(this, NpcID.FARMING_GARDENER_TREE_4, new WorldPoint(3193, 3231, 0), "Speak to Fayeth to protect the patch."); lumbridgeTreeProtect.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); @@ -507,6 +628,10 @@ private void setupSteps() "Speak to Rosie to protect the patch."); farmingGuildTreePayForProtection.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + auburnvaleTreeProtect = new NpcStep(this, NpcID.FARMING_GARDENER_TREE_7, new WorldPoint(1367, 3322, 0), + "Speak to Aub to protect the patch."); + auburnvaleTreeProtect.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + // Tree Patch Steps lumbridgeTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_4, new WorldPoint(3193, 3231, 0), "Check the health of the tree planted in Lumbridge."); @@ -530,6 +655,11 @@ private void setupSteps() farmingGuildTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToFarmingGuildTreePatch)); farmingGuildTreePatchCheckHealth.addTeleport(farmingGuildTeleport); + auburnvaleTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_7, new WorldPoint(1367, 3322, 0), + "Check the health of the tree planted at Auburnvale"); + auburnvaleTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToVarlamore)); + auburnvaleTreePatchCheckHealth.addTeleport(auburnvaleTeleport); + // Tree Plant Steps lumbridgeTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_4, new WorldPoint(3193, 3231, 0), "Plant your sapling in the Lumbridge patch.", treeSapling); @@ -562,6 +692,12 @@ private void setupSteps() farmingGuildTreePatchPlant.addIcon(treeSapling.getId()); farmingGuildTreePatchCheckHealth.addSubSteps(farmingGuildTreePatchPlant); + auburnvaleTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_7, new WorldPoint(1367, 3322, 0), + "Plant your sapling in the Auburnvale tree patch.", treeSapling); + auburnvaleTreePatchPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToVarlamore)); + auburnvaleTreePatchPlant.addIcon(treeSapling.getId()); + auburnvaleTreePatchCheckHealth.addSubSteps(auburnvaleTreePatchPlant); + // Dig lumbridgeTreePatchDig = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_4, new WorldPoint(3193, 3231, 0), "Dig up the tree stump in Lumbridge."); @@ -575,76 +711,128 @@ private void setupSteps() "Dig up the tree stump in the Tree Gnome Stronghold."); farmingGuildTreePatchDig = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_6, new WorldPoint(1232, 3736, 0), "Dig up the tree stump in the Farming Guild tree patch."); + auburnvaleTreePatchDig = new ObjectStep(this, ObjectID.FARMING_TREE_PATCH_7, new WorldPoint(1367, 3322, 0), + "Dig up the tree stump in the Auburnvale tree patch."); faladorTreePatchClear.addSubSteps(faladorTreePatchDig, faladorTreeProtect); taverleyTreePatchClear.addSubSteps(taverleyTreePatchDig, taverleyTreeProtect); varrockTreePatchClear.addSubSteps(varrockTreePatchDig, varrockTreeProtect); gnomeStrongholdTreePatchClear.addSubSteps(gnomeStrongholdTreePatchDig, strongholdTreeProtect); lumbridgeTreePatchClear.addSubSteps(lumbridgeTreePatchDig, lumbridgeTreeProtect); - farmingGuildTreePatchClear.addSubSteps(farmingGuildTreePatchDig, farmingGuildTreePatchDig); + farmingGuildTreePatchClear.addSubSteps(farmingGuildTreePatchDig, farmingGuildTreePayForProtection); + auburnvaleTreePatchClear.addSubSteps(auburnvaleTreePatchDig, auburnvaleTreeProtect); // Fruit Tree Steps - gnomeStrongholdFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_1, new WorldPoint(2476, 3446, 0), - "Check the health of the fruit tree planted in the Tree Gnome Stronghold."); - gnomeStrongholdFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Gnome Stronghold", true); - gnomeVillageFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_2, new WorldPoint(2490, 3180, 0), - "Check the health of the fruit tree planted outside the Tree Gnome Village. Follow Elkoy to get out quickly."); - gnomeVillageFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Tree Gnome Village", true); - brimhavenFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_3, new WorldPoint(2765, 3213, 0), - "Check the health of the fruit tree planted in Brimhaven."); - brimhavenFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Brimhaven", true); - brimhavenFruitTreePatchCheckHealth.addWidgetHighlight(InterfaceID.SailingMenu.CONTENT); - catherbyFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_4, new WorldPoint(2860, 3433, 0), - "Check the health of the fruit tree planted in Catherby."); - catherbyFruitTreePatchCheckHealth.addTeleport(catherbyTeleport); - catherbyFruitTreePatchCheckHealth.addSpellHighlight(NormalSpells.CAMELOT_TELEPORT); - catherbyFruitTreePatchCheckHealth.addSpellHighlight(LunarSpells.CATHERBY_TELEPORT); - - lletyaFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_5, new WorldPoint(2347, 3162, 0), - "Check the health of the fruit tree planted in Lletya."); - lletyaFruitTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToLletya)); - lletyaFruitTreePatchCheckHealth.addTeleport(crystalTeleport); - - farmingGuildFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_6, new WorldPoint(1242, 3758, 0), - "Check the health of the fruit tree planted in the Farming Guild."); - farmingGuildFruitTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToFarmingGuildFruitTreePatch)); - farmingGuildFruitTreePatchCheckHealth.addTeleport(farmingGuildTeleport); - farmingGuildFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Farming Guild", true); // Fruit Tree Plant Steps gnomeStrongholdFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_1, new WorldPoint(2476, 3446, 0), "Plant your sapling in the Tree Gnome Stronghold patch.", fruitTreeSapling); gnomeStrongholdFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); - gnomeStrongholdTreePatchCheckHealth.addSubSteps(gnomeStrongholdTreePatchPlant); gnomeVillageFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_2, new WorldPoint(2490, 3180, 0), "Plant your sapling in the Tree Gnome Village patch. Follow Elkoy to get out quickly.", fruitTreeSapling); gnomeVillageFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); - gnomeVillageFruitTreePatchCheckHealth.addSubSteps(gnomeVillageFruitTreePatchPlant); brimhavenFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_3, new WorldPoint(2765, 3213, 0), "Plant your sapling in the Brimhaven patch.", fruitTreeSapling); brimhavenFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); - brimhavenFruitTreePatchCheckHealth.addSubSteps(brimhavenFruitTreePatchPlant); - // Plant catherbyFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_4, new WorldPoint(2860, 3433, 0), "Plant your sapling in the Catherby patch.", fruitTreeSapling); catherbyFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); - catherbyFruitTreePatchCheckHealth.addSubSteps(catherbyFruitTreePatchPlant); lletyaFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_5, new WorldPoint(2347, 3162, 0), "Plant your sapling in the Lletya patch.", fruitTreeSapling); lletyaFruitTreePatchPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToLletya)); lletyaFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); - lletyaFruitTreePatchCheckHealth.addSubSteps(lletyaFruitTreePatchPlant); farmingGuildFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_6, new WorldPoint(1242, 3758, 0), "Plant your sapling in the Farming Guild patch.", fruitTreeSapling); farmingGuildFruitTreePatchPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToFarmingGuildFruitTreePatch)); farmingGuildFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); + + kastoriFruitTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_7, new WorldPoint(1350, 3057, 0), + "Plant your sapling in the Kastori patch.", fruitTreeSapling); + kastoriFruitTreePatchPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToVarlamore)); + kastoriFruitTreePatchPlant.addIcon(fruitTreeSapling.getId()); + + taiBwoWannaiCalquatPatchPlant = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH, new WorldPoint(2795, 3102, 0), + "Plant your sapling in the Tai Bwo Wannai patch.", calquatSapling); + taiBwoWannaiCalquatPatchPlant.addIcon(calquatSapling.getId()); + + kastoriCalquatPatchPlant = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH_2, new WorldPoint(1366, 3033, 0), + "Plant your sapling in the Kastori Calquat patch.", calquatSapling); + kastoriCalquatPatchPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToVarlamore)); + kastoriCalquatPatchPlant.addIcon(calquatSapling.getId()); + + greatConchCalquatPatchPlant = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH_3, new WorldPoint(3129, 2406, 0), + "Plant your sapling in the Great Conch patch.", calquatSapling); + greatConchCalquatPatchPlant.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToGreatConch)); + greatConchCalquatPatchPlant.addIcon(calquatSapling.getId()); + + // Fruit Tree Check Health Steps + gnomeStrongholdFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_1, new WorldPoint(2476, 3446, 0), + "Check the health of the fruit tree planted in the Tree Gnome Stronghold."); + gnomeStrongholdFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Gnome Stronghold", true); + gnomeStrongholdFruitTreePatchCheckHealth.addSubSteps(gnomeStrongholdFruitTreePatchPlant); + + gnomeVillageFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_2, new WorldPoint(2490, 3180, 0), + "Check the health of the fruit tree planted outside the Tree Gnome Village. Follow Elkoy to get out quickly."); + gnomeVillageFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Tree Gnome Village", true); + gnomeVillageFruitTreePatchCheckHealth.addSubSteps(gnomeVillageFruitTreePatchPlant); + + brimhavenFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_3, new WorldPoint(2765, 3213, 0), + "Check the health of the fruit tree planted in Brimhaven."); + brimhavenFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(InterfaceID.MENU, InterfaceID.Menu.LJ_LAYER1 & 0xFFFF, "Brimhaven", true); + brimhavenFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(InterfaceID.CHARTERING_MENU_SIDE, InterfaceID.CharteringMenuSide.LIST_CONTENT & 0xFFFF, "Brimhaven", true); + brimhavenFruitTreePatchCheckHealth.addWidgetHighlight(new WidgetHighlight(InterfaceID.SAILING_MENU, InterfaceID.SailingMenu.CONTENT & 0xFFFF, 2)); + brimhavenFruitTreePatchCheckHealth.addSubSteps(brimhavenFruitTreePatchPlant); + + catherbyFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_4, new WorldPoint(2860, 3433, 0), + "Check the health of the fruit tree planted in Catherby."); + catherbyFruitTreePatchCheckHealth.addTeleport(catherbyTeleport); + catherbyFruitTreePatchCheckHealth.addSpellHighlight(NormalSpells.CAMELOT_TELEPORT); + catherbyFruitTreePatchCheckHealth.addSpellHighlight(LunarSpells.CATHERBY_TELEPORT); + catherbyFruitTreePatchCheckHealth.addSubSteps(catherbyFruitTreePatchPlant); + + lletyaFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_5, new WorldPoint(2347, 3162, 0), + "Check the health of the fruit tree planted in Lletya."); + lletyaFruitTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToLletya)); + lletyaFruitTreePatchCheckHealth.addTeleport(crystalTeleport); + lletyaFruitTreePatchCheckHealth.addSubSteps(lletyaFruitTreePatchPlant); + + farmingGuildFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_6, new WorldPoint(1242, 3758, 0), + "Check the health of the fruit tree planted in the Farming Guild."); + farmingGuildFruitTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToFarmingGuildFruitTreePatch)); + farmingGuildFruitTreePatchCheckHealth.addTeleport(farmingGuildTeleport); + farmingGuildFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Farming Guild", true); farmingGuildFruitTreePatchCheckHealth.addSubSteps(farmingGuildFruitTreePatchPlant); + kastoriFruitTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_7, new WorldPoint(1350, 3057, 0), + "Check the health of the fruit tree planted in Kastori."); + kastoriFruitTreePatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToVarlamore)); + kastoriFruitTreePatchCheckHealth.addTeleport(kastoriTeleport); + kastoriFruitTreePatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Kastori", true); + kastoriFruitTreePatchCheckHealth.addSubSteps(kastoriFruitTreePatchPlant); + + taiBwoWannaiCalquatPatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH, new WorldPoint(2795, 3102, 0), + "Check the health of the calquat tree planted in Tai Bwo Wannai.", calquatSapling); + taiBwoWannaiCalquatPatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Tai Bwo Wannai", true); + taiBwoWannaiCalquatPatchCheckHealth.addSubSteps(taiBwoWannaiCalquatPatchPlant); + + kastoriCalquatPatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH_2, new WorldPoint(1366, 3033, 0), + "Check the health of the calquat tree planted in Kastori."); + kastoriCalquatPatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToVarlamore)); + kastoriCalquatPatchCheckHealth.addTeleport(kastoriTeleport); + kastoriCalquatPatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Kastori", true); + kastoriCalquatPatchCheckHealth.addSubSteps(kastoriCalquatPatchPlant); + + greatConchCalquatPatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH_3, new WorldPoint(3129, 2406, 0), + "Check the health of the calquat tree planted in Great Conch.", calquatSapling); + greatConchCalquatPatchCheckHealth.conditionToHideInSidebar(new Conditions(LogicType.NOR, accessToGreatConch)); + greatConchCalquatPatchCheckHealth.addWidgetHighlightWithTextRequirement(187, 3, "Great Conch", true); + greatConchCalquatPatchCheckHealth.addSubSteps(greatConchCalquatPatchPlant); + // Clear gnomeStrongholdFruitTreePatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_FRUIT_1, new WorldPoint(2476, 3446, 0), "Pay Bolongo 200 coins to clear the fruit tree, or pick all the fruit and cut it down."); @@ -654,6 +842,9 @@ private void setupSteps() gnomeVillageFruitTreePatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); brimhavenFruitTreePatchClear = new NpcStep(this, NpcID.GARTH, new WorldPoint(2765, 3213, 0), "Pay Garth 200 coins to clear the fruit tree, or pick all the fruit and cut it down."); + brimhavenFruitTreePatchClear.addWidgetHighlightWithTextRequirement(InterfaceID.MENU, InterfaceID.Menu.LJ_LAYER1 & 0xFFFF, "Brimhaven", true); + brimhavenFruitTreePatchClear.addWidgetHighlightWithTextRequirement(InterfaceID.CHARTERING_MENU_SIDE, InterfaceID.CharteringMenuSide.LIST_CONTENT & 0xFFFF, "Brimhaven", true); + brimhavenFruitTreePatchClear.addWidgetHighlight(new WidgetHighlight(InterfaceID.SAILING_MENU, InterfaceID.SailingMenu.CONTENT & 0xFFFF, 2)); brimhavenFruitTreePatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); catherbyFruitTreePatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_FRUIT_4, new WorldPoint(2860, 3433, 0), "Pay Ellena 200 coins to clear the fruit tree, or pick all the fruit and cut it down."); @@ -664,6 +855,18 @@ private void setupSteps() farmingGuildFruitTreePatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_FARMGUILD_T3, new WorldPoint(1243, 3760, 0), "Pay Nikkie 200 coins to clear the fruit tree, or pick all the fruit and cut it down."); farmingGuildFruitTreePatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + kastoriFruitTreePatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_FRUIT_7, new WorldPoint(1350, 3057, 0), + "Pay Ehecatl 200 coins to clear the fruit tree, or pick all the fruit and cut it down."); + kastoriFruitTreePatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + taiBwoWannaiCalquatPatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_CALQUAT, new WorldPoint(2795, 3102, 0), + "Pay Imiago 200 coins to clear the calquat tree, or pick all the fruit and cut it down."); + taiBwoWannaiCalquatPatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + kastoriCalquatPatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_CALQUAT_2, new WorldPoint(1366, 3033, 0), + "Pay Tziuhtla 200 coins to clear the calquat tree, or pick all the fruit and cut it down."); + kastoriCalquatPatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + greatConchCalquatPatchClear = new NpcStep(this, NpcID.FARMING_GARDENER_CALQUAT_3, new WorldPoint(3129, 2406, 0), + "Pay Guppa 200 coins to clear the calquat tree, or pick all the fruit and cut it down."); + greatConchCalquatPatchClear.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); strongholdFruitProtect = new NpcStep(this, NpcID.FARMING_GARDENER_FRUIT_1, new WorldPoint(2476, 3446, 0), "Pay Bolongo to protect the patch."); @@ -685,8 +888,20 @@ private void setupSteps() "Pay Nikkie to protect the patch."); guildFruitProtect.addDialogSteps("Would you chop my tree down for me?", "I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - " + "chop my tree down please.", "Yes."); - - // Dig Fruit Tree Steps + kastoriFruitProtect = new NpcStep(this, NpcID.FARMING_GARDENER_FRUIT_7, new WorldPoint(1350, 3057, 0), + "Pay Ehecatl to protect the patch."); + kastoriFruitProtect.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + taiBwoWannaiCalquatProtect = new NpcStep(this, NpcID.FARMING_GARDENER_CALQUAT, new WorldPoint(2795, 3102, 0), + "Pay Imiago to protect the patch."); + taiBwoWannaiCalquatProtect.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + kastoriCalquatProtect = new NpcStep(this, NpcID.FARMING_GARDENER_CALQUAT_2, new WorldPoint(1366, 3033, 0), + "Pay Tziuhtla to protect the patch."); + kastoriCalquatProtect.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + greatConchCalquatProtect = new NpcStep(this, NpcID.FARMING_GARDENER_CALQUAT_3, new WorldPoint(3129, 2406, 0), + "Pay Guppa to protect the patch."); + greatConchCalquatProtect.addDialogSteps("Would you chop my tree down for me?","I can't be bothered - I'd rather pay you to do it.", "Here's 200 Coins - chop my tree down please.", "Yes."); + + // Dig Fruit Tree Steps gnomeStrongholdFruitTreePatchDig = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_1, new WorldPoint(2476, 3446, 0), "Dig up the fruit tree's stump in the Tree Gnome Stronghold."); gnomeVillageFruitTreePatchDig = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_2, new WorldPoint(2490, 3180, 0), @@ -699,6 +914,14 @@ private void setupSteps() "Dig up the fruit tree's stump in Lletya."); farmingGuildFruitTreePatchDig = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_6, new WorldPoint(1242, 3758, 0), "Dig up the fruit tree's stump in the Farming Guild."); + kastoriFruitTreePatchDig = new ObjectStep(this, ObjectID.FARMING_FRUIT_TREE_PATCH_7, new WorldPoint(1350, 3057, 0), + "Dig up the fruit tree's stump in Kastori."); + taiBwoWannaiCalquatPatchDig = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH, new WorldPoint(2795, 3102, 0), + "Dig up the calquat tree's stump in Tai Bwo Wannai."); + kastoriCalquatPatchDig = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH_2, new WorldPoint(1366, 3033, 0), + "Dig up the calquat tree's stump in Kastori."); + greatConchCalquatPatchDig = new ObjectStep(this, ObjectID.FARMING_CALQUAT_TREE_PATCH_3, new WorldPoint(3129, 2406, 0), + "Dig up the calquat tree's stump in Great Conch."); gnomeStrongholdFruitTreePatchClear.addSubSteps(gnomeStrongholdFruitTreePatchDig, strongholdFruitProtect); gnomeVillageFruitTreePatchClear.addSubSteps(gnomeVillageFruitTreePatchDig, villageFruitProtect); @@ -706,6 +929,10 @@ private void setupSteps() catherbyFruitTreePatchClear.addSubSteps(catherbyFruitTreePatchDig, catherbyFruitProtect); lletyaFruitTreePatchClear.addSubSteps(lletyaFruitTreePatchDig, lletyaFruitProtect); farmingGuildFruitTreePatchClear.addSubSteps(farmingGuildFruitTreePatchDig, guildFruitProtect); + kastoriFruitTreePatchClear.addSubSteps(kastoriFruitTreePatchDig, kastoriFruitProtect); + taiBwoWannaiCalquatPatchClear.addSubSteps(taiBwoWannaiCalquatPatchDig, taiBwoWannaiCalquatProtect); + kastoriCalquatPatchClear.addSubSteps(kastoriCalquatPatchDig, kastoriCalquatProtect); + greatConchCalquatPatchClear.addSubSteps(greatConchCalquatPatchDig, greatConchCalquatProtect); // Hardwood Tree Steps westHardwoodTreePatchCheckHealth = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_3, new WorldPoint(3702, 3837, 0), @@ -716,6 +943,8 @@ private void setupSteps() "Check the health of the eastern hardwood tree on Fossil Island."); savannahCheckHealth = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_4, new WorldPoint(1687, 2972, 0), "Check the health of the hardwood tree in the Avium Savannah."); + anglersCheckHealth = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_5, new WorldPoint(2470, 2704, 0), + "Check the health of the hardwood tree in the Anglers' Retreat."); // Hardwood Tree Plant Steps westHardwoodTreePatchPlant = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_3, new WorldPoint(3702, 3837, 0), @@ -734,7 +963,10 @@ private void setupSteps() eastHardwoodTreePatchCheckHealth.addSubSteps(eastHardwoodTreePatchPlant); savannahPlant = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_4, new WorldPoint(1687, 2972, 0), - "Plant your sapling into the hardwood tree in the hardwood tree patch in the Avium Savannah.", hardwoodSapling); + "Plant your sapling on the hardwood tree patch in the Avium Savannah.", hardwoodSapling); + + anglersPlant = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_5, new WorldPoint(2470, 2704, 0), + "Plant your sapling on the hardwood tree patch on Anglers' Retreat.", hardwoodSapling); westHardwoodTreePatchClear = new NpcStep(this, NpcID.FOSSIL_SQUIRREL_GARDENER3, new WorldPoint(3702, 3837, 0), "Pay the brown squirrel to remove the west tree."); @@ -754,6 +986,11 @@ private void setupSteps() savannahClear.addDialogSteps("Would you chop my tree down for me?", "I can't be bothered - I'd rather pay you to do it.", "Here's 200 " + "Coins - chop my tree down please.", "Yes."); + anglersClear = new NpcStep(this, NpcID.FARMING_GARDENER_HARDWOOD_TREE_5, new WorldPoint(2470, 2704, 0), + "Pay Argo to clear the tree."); + anglersClear.addDialogSteps("Would you chop my tree down for me?", "I can't be bothered - I'd rather pay you to do it.", "Here's 200 " + + "Coins - chop my tree down please.", "Yes."); + westHardwoodTreePatchDig = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_3, new WorldPoint(3702, 3837, 0), "Dig up the western hardwood tree's stump on Fossil Island."); middleHardwoodTreePatchDig = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_2, new WorldPoint(3708, 3833, 0), @@ -762,6 +999,8 @@ private void setupSteps() "Dig up the eastern hardwood tree's stump on Fossil Island."); savannahDig = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_4, new WorldPoint(1687, 2972, 0), "Dig up the Savannah hardwood tree's stump."); + anglersDig = new ObjectStep(this, ObjectID.FARMING_HARDWOOD_TREE_PATCH_5, new WorldPoint(2470,2704, 0), + "Dig up the Anglers' Retreat hardwood tree's stump."); westHardwoodProtect = new NpcStep(this, NpcID.FOSSIL_SQUIRREL_GARDENER3, new WorldPoint(3702, 3837, 0), "Pay the brown squirrel to protect the west tree."); @@ -771,11 +1010,14 @@ private void setupSteps() "Pay the grey squirrel to protect the east tree."); savannahProtect = new NpcStep(this, NpcID.FROG_QUEST_MARCELLUS_FARMER, new WorldPoint(1687, 2972, 0), "Pay Marcellus to protect the hardwood tree."); + anglersProtect = new NpcStep(this, NpcID.FARMING_GARDENER_HARDWOOD_TREE_5, new WorldPoint(2470, 2704, 0), + "Pay Argo to protect the hardwood tree."); westHardwoodTreePatchClear.addSubSteps(westHardwoodTreePatchDig, westHardwoodProtect); middleHardwoodTreePatchClear.addSubSteps(middleHardwoodTreePatchDig, middleHardwoodProtect); eastHardwoodTreePatchClear.addSubSteps(eastHardwoodTreePatchDig, eastHardwoodProtect); savannahClear.addSubSteps(savannahDig, savannahProtect); + anglersClear.addSubSteps(anglersDig, anglersProtect); } @Subscribe @@ -785,13 +1027,19 @@ public void onGameTick(GameTick event) allProtectionItemTree.setQuantity(protectionItemTree.getQuantity()); allProtectionItemFruitTree.setQuantity(protectionItemFruitTree.getQuantity()); allProtectionItemHardwood.setQuantity(protectionItemHardwood.getQuantity()); + allProtectionItemCalquat.setQuantity(protectionItemCalquat.getQuantity()); handleTreePatches(PatchImplementation.TREE, - List.of(farmingGuildTreeStates, varrockStates, faladorStates, taverleyStates, lumbridgeStates, gnomeStrongholdTreeStates), + List.of(farmingGuildTreeStates, varrockStates, faladorStates, taverleyStates, lumbridgeStates, gnomeStrongholdTreeStates, auburnvaleStates), farmingWorld.getTabs().get(Tab.TREE), allTreeSaplings, allProtectionItemTree); handleTreePatches(PatchImplementation.FRUIT_TREE, - List.of(farmingGuildFruitStates, brimhavenStates, catherbyStates, gnomeStrongholdFruitStates, gnomeVillageStates, lletyaStates), + List.of(farmingGuildFruitStates, brimhavenStates, catherbyStates, gnomeStrongholdFruitStates, gnomeVillageStates, lletyaStates, + kastoriStates), farmingWorld.getTabs().get(Tab.FRUIT_TREE), allFruitSaplings, allProtectionItemFruitTree); - handleTreePatches(PatchImplementation.HARDWOOD_TREE, List.of(westHardwoodStates, middleHardwoodStates, eastHardwoodStates, savannahStates), + handleTreePatches(PatchImplementation.CALQUAT, + List.of(taiBwoWannaiStates, kastoriStates, greatConchStates), + farmingWorld.getTabs().get(Tab.FRUIT_TREE), allCalquatSaplings, allProtectionItemCalquat); + handleTreePatches(PatchImplementation.HARDWOOD_TREE, List.of(westHardwoodStates, middleHardwoodStates, + eastHardwoodStates, savannahStates, anglersRetreatStates), farmingWorld.getTabs().get(Tab.TREE), allHardwoodSaplings, allProtectionItemHardwood); } @@ -858,6 +1106,8 @@ public void onConfigChanged(ConfigChanged event) this::updateFruitTreeSapling, FruitTreeSapling.APPLE, configManager, questHelperPlugin); FarmingConfigChangeHandler.handleFarmingEnumConfigChange(event, HARDWOOD_TREE_SAPLING, HardwoodTreeSapling.class, this::updateHardwoodTreeSapling, HardwoodTreeSapling.TEAK, configManager, questHelperPlugin); + FarmingConfigChangeHandler.handleFarmingEnumConfigChange(event, CALQUAT_TREE_SAPLING, CalquatTreeSapling.class, + this::updateCalquatTreeSapling, CalquatTreeSapling.CALQUAT, configManager, questHelperPlugin); if (event.getKey().equals(GRACEFUL_OR_FARMING) || event.getKey().equals(PAY_OR_CUT) || event.getKey().equals(PAY_OR_COMPOST)) { @@ -868,6 +1118,7 @@ public void onConfigChanged(ConfigChanged event) private final String TREE_SAPLING = "treeSaplings"; private final String FRUIT_TREE_SAPLING = "fruitTreeSaplings"; private final String HARDWOOD_TREE_SAPLING = "hardwoodTreeSaplings"; + private final String CALQUAT_TREE_SAPLING = "calquatTreeSaplings"; @Override public List getConfigs() @@ -875,16 +1126,17 @@ public List getConfigs() HelperConfig treesConfig = new HelperConfig("Trees", TREE_SAPLING, TreeSapling.values()); HelperConfig fruitTreesConfig = new HelperConfig("Fruit Trees", FRUIT_TREE_SAPLING, FruitTreeSapling.values()); HelperConfig hardwoodTreesConfig = new HelperConfig("Hardwood Trees", HARDWOOD_TREE_SAPLING, HardwoodTreeSapling.values()); + HelperConfig calquatTreesConfig = new HelperConfig("Calquat Trees", CALQUAT_TREE_SAPLING, CalquatTreeSapling.values()); HelperConfig outfitConfig = new HelperConfig("Outfit", GRACEFUL_OR_FARMING, GracefulOrFarming.values()); HelperConfig payOrCutConfig = new HelperConfig("Pay or cut tree removal", PAY_OR_CUT, PayOrCut.values()); HelperConfig payOrCompostConfig = new HelperConfig("Pay farmer or compost", PAY_OR_COMPOST, PayOrCompost.values()); - return Arrays.asList(treesConfig, fruitTreesConfig, hardwoodTreesConfig, outfitConfig, payOrCutConfig, payOrCompostConfig); + return Arrays.asList(treesConfig, fruitTreesConfig, hardwoodTreesConfig, calquatTreesConfig, outfitConfig, payOrCutConfig, payOrCompostConfig); } @Override public List getItemRequirements() { - return Arrays.asList(spade, rake, compost, coins, allTreeSaplings, allFruitSaplings, allHardwoodSaplings, allProtectionItemTree, allProtectionItemFruitTree, allProtectionItemHardwood); + return Arrays.asList(spade, rake, compost, coins, allTreeSaplings, allFruitSaplings, allHardwoodSaplings, allCalquatSaplings, allProtectionItemTree, allProtectionItemFruitTree, allProtectionItemHardwood, allProtectionItemCalquat); } @Override @@ -898,57 +1150,74 @@ public List getPanels() { // IDEA: Can add ID to each step. onLoad and onConfigChanged it checks id ordering. List allSteps = new ArrayList<>(); + + allSteps.add(new PanelDetails("Wait for Herbs", waitForTree).withHideCondition(nor(allGrowing))); + PanelDetails farmingGuildPanel = new PanelDetails("Farming Guild", Arrays.asList(farmingGuildTreePatchCheckHealth, farmingGuildTreePatchClear, - farmingGuildFruitTreePatchCheckHealth, farmingGuildFruitTreePatchClear)).withId(0); + farmingGuildTreePatchPlant, farmingGuildFruitTreePatchCheckHealth, farmingGuildFruitTreePatchClear, + farmingGuildTreePatchPlant)).withId(0); farmingGuildPanel.setLockingStep(farmingGuildStep); - allSteps.add(farmingGuildPanel); - PanelDetails lumbridgePanel = new PanelDetails("Lumbridge", Arrays.asList(lumbridgeTreePatchCheckHealth, lumbridgeTreePatchClear)).withId(1); + PanelDetails lumbridgePanel = new PanelDetails("Lumbridge", Arrays.asList(lumbridgeTreePatchCheckHealth, lumbridgeTreePatchClear, lumbridgeTreePatchPlant)).withId(1); lumbridgePanel.setLockingStep(lumbridgeStep); - allSteps.add(lumbridgePanel); - PanelDetails faladorPanel = new PanelDetails("Falador", Arrays.asList(faladorTreePatchCheckHealth, faladorTreePatchClear)).withId(2); + PanelDetails faladorPanel = new PanelDetails("Falador", Arrays.asList(faladorTreePatchCheckHealth, faladorTreePatchClear, faladorTreePatchPlant)).withId(2); faladorPanel.setLockingStep(faladorStep); - allSteps.add(faladorPanel); - PanelDetails taverleyPanel = new PanelDetails("Taverley", Arrays.asList(taverleyTreePatchCheckHealth, taverleyTreePatchClear)).withId(3); + + PanelDetails taverleyPanel = new PanelDetails("Taverley", Arrays.asList(taverleyTreePatchCheckHealth, taverleyTreePatchClear, taverleyTreePatchPlant)).withId(3); taverleyPanel.setLockingStep(taverleyStep); - allSteps.add(taverleyPanel); - PanelDetails varrockPanel = new PanelDetails("Varrock", Arrays.asList(varrockTreePatchCheckHealth, varrockTreePatchClear)).withId(4); + PanelDetails varrockPanel = new PanelDetails("Varrock", Arrays.asList(varrockTreePatchCheckHealth, varrockTreePatchClear, varrockTreePatchPlant)).withId(4); varrockPanel.setLockingStep(varrockStep); - allSteps.add(varrockPanel); - PanelDetails gnomeStrongholdPanel = new PanelDetails("Gnome Stronghold", Arrays.asList(gnomeStrongholdFruitTreePatchCheckHealth, gnomeVillageFruitTreePatchClear, - gnomeStrongholdTreePatchCheckHealth, gnomeStrongholdTreePatchClear)).withId(5); + PanelDetails gnomeStrongholdPanel = new PanelDetails("Gnome Stronghold", Arrays.asList(gnomeStrongholdFruitTreePatchCheckHealth, gnomeStrongholdFruitTreePatchClear, gnomeStrongholdFruitTreePatchPlant, + gnomeStrongholdTreePatchCheckHealth, gnomeStrongholdTreePatchClear, gnomeStrongholdFruitTreePatchPlant)).withId(5); gnomeStrongholdPanel.setLockingStep(strongholdStep); - allSteps.add(gnomeStrongholdPanel); PanelDetails villagePanel = new PanelDetails("Tree Gnome Village", Arrays.asList(gnomeVillageFruitTreePatchCheckHealth, - gnomeVillageFruitTreePatchClear)).withId(6); + gnomeVillageFruitTreePatchClear, gnomeVillageFruitTreePatchPlant)).withId(6); villagePanel.setLockingStep(villageStep); - allSteps.add(villagePanel); - PanelDetails catherbyPanel = new PanelDetails("Catherby", Arrays.asList(catherbyFruitTreePatchCheckHealth, catherbyFruitTreePatchClear)).withId(7); + PanelDetails catherbyPanel = new PanelDetails("Catherby", Arrays.asList(catherbyFruitTreePatchCheckHealth, catherbyFruitTreePatchClear, catherbyFruitTreePatchPlant)).withId(7); catherbyPanel.setLockingStep(catherbyStep); - allSteps.add(catherbyPanel); - PanelDetails brimhavenPanel = new PanelDetails("Brimhaven", Arrays.asList(brimhavenFruitTreePatchCheckHealth, brimhavenFruitTreePatchClear)).withId(8); + PanelDetails brimhavenPanel = new PanelDetails("Brimhaven", Arrays.asList(brimhavenFruitTreePatchCheckHealth, brimhavenFruitTreePatchClear, brimhavenFruitTreePatchPlant, + taiBwoWannaiCalquatPatchCheckHealth, taiBwoWannaiCalquatPatchClear, taiBwoWannaiCalquatPatchPlant)).withId(8); brimhavenPanel.setLockingStep(brimhavenStep); - allSteps.add(brimhavenPanel); - PanelDetails lletyaPanel = new PanelDetails("Llyeta", Arrays.asList(lletyaFruitTreePatchCheckHealth, lletyaFruitTreePatchClear)).withId(9); + PanelDetails lletyaPanel = new PanelDetails("Lletya", Arrays.asList(lletyaFruitTreePatchCheckHealth, lletyaFruitTreePatchClear, lletyaFruitTreePatchPlant)).withId(9); lletyaPanel.setLockingStep(lletyaStep); - allSteps.add(lletyaPanel); - PanelDetails fossilIslandPanel = new PanelDetails("Fossil Island", Arrays.asList(eastHardwoodTreePatchCheckHealth, eastHardwoodTreePatchClear, - middleHardwoodTreePatchCheckHealth, middleHardwoodTreePatchClear, - westHardwoodTreePatchCheckHealth, westHardwoodTreePatchClear)).withId(10); + PanelDetails fossilIslandPanel = new PanelDetails("Fossil Island", Arrays.asList(eastHardwoodTreePatchCheckHealth, eastHardwoodTreePatchClear, eastHardwoodTreePatchPlant, + middleHardwoodTreePatchCheckHealth, middleHardwoodTreePatchClear, middleHardwoodTreePatchPlant, + westHardwoodTreePatchCheckHealth, westHardwoodTreePatchClear, westHardwoodTreePatchPlant)).withId(10); fossilIslandPanel.setLockingStep(fossilIslandStep); - allSteps.add(fossilIslandPanel); PanelDetails savannahPanel = new PanelDetails("Avium Savannah", Arrays.asList(savannahCheckHealth, savannahClear, savannahPlant)).withId(11); savannahPanel.setLockingStep(savannahStep); - allSteps.add(savannahPanel); + + PanelDetails auburnvalePanel = new PanelDetails("Auburnvale", Arrays.asList(auburnvaleTreePatchCheckHealth, auburnvaleTreePatchClear, auburnvaleTreePatchPlant)).withId(12); + auburnvalePanel.setLockingStep(auburnvaleStep); + + PanelDetails kastoriPanel = new PanelDetails("Kastori", Arrays.asList(kastoriFruitTreePatchCheckHealth, + kastoriFruitTreePatchClear, kastoriFruitTreePatchPlant, kastoriCalquatPatchCheckHealth, + kastoriCalquatPatchClear, kastoriCalquatPatchPlant)).withId(13); + kastoriPanel.setLockingStep(kastoriStep); + + PanelDetails anglersPanel = new PanelDetails("Anglers' Retreat", Arrays.asList(anglersCheckHealth, + anglersClear, anglersPlant)).withId(14); + anglersPanel.setLockingStep(anglersRetreatStep); + + PanelDetails greatConchPanel = new PanelDetails("Great Conch", + Arrays.asList(greatConchCalquatPatchCheckHealth, greatConchCalquatPatchClear, + greatConchCalquatPatchPlant)).withId(15); + greatConchPanel.setLockingStep(greatConchStep); + + TopLevelPanelDetails farmRunSidebar = new TopLevelPanelDetails("Tree Run", farmingGuildPanel, lumbridgePanel, faladorPanel, taverleyPanel, + varrockPanel, gnomeStrongholdPanel, villagePanel, catherbyPanel, brimhavenPanel, lletyaPanel, fossilIslandPanel, savannahPanel, auburnvalePanel, + kastoriPanel, anglersPanel, greatConchPanel); + allSteps.add(farmRunSidebar); + return allSteps; } @@ -982,6 +1251,16 @@ private void updateHardwoodTreeSapling(HardwoodTreeSapling selectedHardwoodTreeS updateHardwoodTreePaymentItem(selectedHardwoodTreeSapling); } + private void updateCalquatTreeSapling(CalquatTreeSapling selectedCalquatTreeSapling) + { + calquatSapling.setId(selectedCalquatTreeSapling.calquatTreeSaplingId); + calquatSapling.setName(itemManager.getItemComposition(selectedCalquatTreeSapling.getPlantableItemId()).getName()); + + allCalquatSaplings.setId(selectedCalquatTreeSapling.calquatTreeSaplingId); + allCalquatSaplings.setName(itemManager.getItemComposition(selectedCalquatTreeSapling.getPlantableItemId()).getName()); + updateCalquatPaymentItem(selectedCalquatTreeSapling); + } + private void updateTreePaymentItem(TreeSapling treeSapling) { protectionItemTree.setId(treeSapling.protectionItemId); @@ -1014,4 +1293,15 @@ private void updateHardwoodTreePaymentItem(HardwoodTreeSapling treeSapling) allProtectionItemHardwood.setName(itemManager.getItemComposition(treeSapling.protectionItemId).getName()); allProtectionItemHardwood.setQuantity(treeSapling.protectionItemQuantity); } + + private void updateCalquatPaymentItem(CalquatTreeSapling treeSapling) + { + protectionItemCalquat.setId(treeSapling.protectionItemId); + protectionItemCalquat.setName(itemManager.getItemComposition(treeSapling.protectionItemId).getName()); + protectionItemCalquat.setQuantity(treeSapling.protectionItemQuantity); + + allProtectionItemCalquat.setId(treeSapling.protectionItemId); + allProtectionItemCalquat.setName(itemManager.getItemComposition(treeSapling.protectionItemId).getName()); + allProtectionItemCalquat.setQuantity(treeSapling.protectionItemQuantity); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/knightswaves/KnightWaves.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/knightswaves/KnightWaves.java index 63eb3625ab9..9f44d8b9a67 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/knightswaves/KnightWaves.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/knightswaves/KnightWaves.java @@ -43,11 +43,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; import java.util.*; @@ -103,7 +100,7 @@ protected void setupRequirements() food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, 25); potions = new ItemRequirement("Attack and strength potions for boost", -1, -1); - talkedToSquire = new VarbitRequirement(3908, 1); + talkedToSquire = new VarbitRequirement(VarbitID.KR_WAVE_INSTR, 1); } public void setupSteps() @@ -135,7 +132,7 @@ public void setupSteps() NpcID.KR_CAM_KAY, NpcID.KR_CAM_KAY_JAIL, NpcID.KR_KNIGHT7, NpcID.KR_CAM_LANCELOT, NpcID.KR_KNIGHT8); ((NpcStep) killKnights).addSafeSpots(new WorldPoint(2752, 3511, 2)); - ((NpcStep) killKnights).addTileMarker(new WorldPoint(2753, 3510, 2), SpriteID.MAP_ICON_HELMET_SHOP); + ((NpcStep) killKnights).addTileMarker(new WorldPoint(2753, 3510, 2), SpriteID.Mapfunction.HELMET_SHOP); killKnightsSteps = new ConditionalStep(this, goToFloor1, "Defeat the 8 Knights of the Round Table in the room" + " on top of Camelot. It's recommended to flinch the knights on one of the dummies around the room, and " + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/strongholdofsecurity/StrongholdOfSecurity.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/strongholdofsecurity/StrongholdOfSecurity.java index 11318f981a1..08eec560ee3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/strongholdofsecurity/StrongholdOfSecurity.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/mischelpers/strongholdofsecurity/StrongholdOfSecurity.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2023, Okke234 + * Copyright (c) 2025, pajlada * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,10 +29,8 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.CombatLevelRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -42,25 +41,19 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class StrongholdOfSecurity extends BasicQuestHelper { - Requirement canSkipWar, canSkipFamine, canSkipPestilence, - notUsedCountCheck, nearCountCheck, inFloorWar, inFloorFamine, inFloorPestilence, inFloorDeath, - inStartRoomWar, inStartRoomFamine, inStartRoomPestilence, - notFlap, notSlap, notIdea, notStamp, hasFlap, hasSlap, hasIdea, hasStamp; - - ItemRequirement food; - Zone countCheck, floorWar, floorFamine, floorPestilence, floorDeath, startRoomWar, startRoomFamine, startRoomPestilence; - - QuestStep talkToCountCheck, enterStronghold, usePortalWar, usePortalFamine, usePortalPestilence; - - DetailedQuestStep openChestWar, openChestFamine, openChestPestilence, openChestDeath, - enterFloorFamine, enterFloorPestilence, enterFloorDeath; - - String[] answers = { + static final String[] CORRECT_ANSWERS = { "No.", "Me.", "Nobody.", @@ -82,67 +75,95 @@ public class StrongholdOfSecurity extends BasicQuestHelper "Don't share your information and report the player.", "Set up two-factor authentication with my email provider.", "No, you should never allow anyone to level your account.", + "No, you should never allow anyone to use your account.", "Authenticator and two-step login on my registered email.", "No way! You'll just take my gold for your own! Reported!", "Don't type in my password backwards and report the player.", "Don't give them the information and send an 'Abuse report'.", "Don't tell them anything and click the 'Report Abuse' button.", "Politely tell them no and then use the 'Report Abuse' button.", + "Politely tell them no, then use the 'Report Abuse' button.", "Don't give out your password to anyone. Not even close friends.", "Do not visit the website and report the player who messaged you.", "Report the stream as a scam. Real Jagex streams have a 'verified' mark.", - "Two-factor authentication on yuor account and your registered email.", - "Nope, you're tricking me into going somewhere dangerous." + "Two-factor authentication on your account and your registered email.", + "Nope, you're tricking me into going somewhere dangerous.", + "It's never used on other websites or accounts.", }; - int[] cbLevels = {26, 51, 76}; + static final int CB_LEVEL_SKIP_WAR = 26; + static final int CB_LEVEL_SKIP_FAMINE = 51; + static final int CB_LEVEL_SKIP_PESTILENCE = 76; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - ConditionalStep goEnterStronghold = new ConditionalStep(this, enterStronghold); - goEnterStronghold.addStep(new Conditions(nearCountCheck, notUsedCountCheck), talkToCountCheck); - goEnterStronghold.addStep(new Conditions(new Conditions(LogicType.OR, canSkipWar, hasFlap), - inFloorWar, inStartRoomWar), usePortalWar); - goEnterStronghold.addStep(new Conditions(notFlap, inFloorWar), openChestWar); - goEnterStronghold.addStep(new Conditions(notStamp, inFloorWar), enterFloorFamine); - - goEnterStronghold.addStep(new Conditions(new Conditions(LogicType.OR, canSkipFamine, hasSlap), - inFloorFamine, inStartRoomFamine), usePortalFamine); - goEnterStronghold.addStep(new Conditions(notSlap, inFloorFamine), openChestFamine); - goEnterStronghold.addStep(new Conditions(notStamp, inFloorFamine), enterFloorPestilence); - - goEnterStronghold.addStep(new Conditions(new Conditions(LogicType.OR, canSkipPestilence, hasIdea), - inFloorPestilence, inStartRoomPestilence), usePortalPestilence); - goEnterStronghold.addStep(new Conditions(notIdea, inFloorPestilence), openChestPestilence); - goEnterStronghold.addStep(new Conditions(notStamp, inFloorPestilence), enterFloorDeath); - - goEnterStronghold.addStep(new Conditions(notStamp, inFloorDeath), openChestDeath); + // Recommended items + ItemRequirement food; - //TODO: Highlight warning confirmation when climbing down ladder - //TODO: Auto start when entering or when teleporting with Count Check? + // Miscellaneous requirements + Requirement canSkipWar; + Requirement canSkipFamine; + Requirement canSkipPestilence; + Requirement notUsedCountCheck; + Requirement nearCountCheck; + Requirement inFloorWar; + Requirement inFloorFamine; + Requirement inFloorPestilence; + Requirement inFloorDeath; + Requirement inStartRoomWar; + Requirement inStartRoomFamine; + Requirement inStartRoomPestilence; + Requirement notFlap; + Requirement notSlap; + Requirement notIdea; + Requirement notStamp; + Requirement hasFlap; + Requirement hasSlap; + Requirement hasIdea; + Requirement hasStamp; + + // Zones + Zone countCheck; + Zone floorWar; + Zone floorFamine; + Zone floorPestilence; + Zone floorDeath; + Zone startRoomWar; + Zone startRoomFamine; + Zone startRoomPestilence; + + // Steps + QuestStep talkToCountCheck; + QuestStep enterStronghold; + QuestStep usePortalWar; + QuestStep usePortalFamine; + QuestStep usePortalPestilence; + DetailedQuestStep openChestWar; + DetailedQuestStep openChestFamine; + DetailedQuestStep openChestPestilence; + DetailedQuestStep openChestDeath; + DetailedQuestStep enterFloorFamine; + DetailedQuestStep enterFloorPestilence; + DetailedQuestStep enterFloorDeath; - steps.put(0, goEnterStronghold); + @Override + protected void setupZones() + { + countCheck = new Zone(new WorldPoint(3120, 3275, 0), new WorldPoint(3267, 3135, 0)); + floorWar = new Zone(new WorldPoint(1855, 5248, 0), new WorldPoint(1920, 5184, 0)); + floorFamine = new Zone(new WorldPoint(1983, 5248, 0), new WorldPoint(2048, 5184, 0)); + floorPestilence = new Zone(new WorldPoint(2111, 5310, 0), new WorldPoint(2176, 5248, 0)); + floorDeath = new Zone(new WorldPoint(2304, 5248, 0), new WorldPoint(2367, 5184, 0)); + startRoomWar = new Zone(new WorldPoint(1855, 5246, 0), new WorldPoint(1866, 5239, 0)); + startRoomFamine = new Zone(new WorldPoint(2040, 5245, 0), new WorldPoint(2046, 5240, 0)); + startRoomPestilence = new Zone(new WorldPoint(2117, 5258, 0), new WorldPoint(2133, 5251, 0)); - return steps; } @Override protected void setupRequirements() { - food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); - } - - public void setupConditions() - { - canSkipWar = new CombatLevelRequirement(cbLevels[0]); - canSkipFamine = new CombatLevelRequirement(cbLevels[1]); - canSkipPestilence = new CombatLevelRequirement(cbLevels[2]); + canSkipWar = new CombatLevelRequirement(CB_LEVEL_SKIP_WAR); + canSkipFamine = new CombatLevelRequirement(CB_LEVEL_SKIP_FAMINE); + canSkipPestilence = new CombatLevelRequirement(CB_LEVEL_SKIP_PESTILENCE); nearCountCheck = new ZoneRequirement(countCheck); inFloorWar = new ZoneRequirement(floorWar); @@ -153,34 +174,22 @@ public void setupConditions() inStartRoomFamine = new ZoneRequirement(startRoomFamine); inStartRoomPestilence = new ZoneRequirement(startRoomPestilence); - notUsedCountCheck = new VarbitRequirement(5371, 0); - notFlap = new VarbitRequirement(2309, 0); - notSlap = new VarbitRequirement(2310, 0); - notIdea = new VarbitRequirement(2311, 0); - notStamp = new VarbitRequirement(2312, 0); - hasFlap = new VarbitRequirement(2309, 1); - hasSlap = new VarbitRequirement(2310, 1); - hasIdea = new VarbitRequirement(2311, 1); - hasStamp = new VarbitRequirement(2312, 1); - } - - @Override - protected void setupZones() - { - countCheck = new Zone(new WorldPoint(3120, 3275, 0), new WorldPoint(3267, 3135, 0)); - floorWar = new Zone(new WorldPoint(1855, 5248, 0), new WorldPoint(1920, 5184, 0)); - floorFamine = new Zone(new WorldPoint(1983, 5248, 0), new WorldPoint(2048, 5184, 0)); - floorPestilence = new Zone(new WorldPoint(2111, 5310, 0), new WorldPoint(2176, 5248, 0)); - floorDeath = new Zone(new WorldPoint(2304, 5248, 0), new WorldPoint(2367, 5184, 0)); - startRoomWar = new Zone(new WorldPoint(1855, 5246, 0), new WorldPoint(1866, 5239, 0)); - startRoomFamine = new Zone(new WorldPoint(2040, 5245, 0), new WorldPoint(2046, 5240, 0)); - startRoomPestilence = new Zone(new WorldPoint(2117, 5258, 0), new WorldPoint(2133, 5251, 0)); + notUsedCountCheck = new VarbitRequirement(VarbitID.SOS_TELEPORTED_BY_COUNT, 0); + notFlap = new VarbitRequirement(VarbitID.SOS_EMOTE_FLAP, 0); + notSlap = new VarbitRequirement(VarbitID.SOS_EMOTE_DOH, 0); + notIdea = new VarbitRequirement(VarbitID.SOS_EMOTE_IDEA, 0); + notStamp = new VarbitRequirement(VarbitID.SOS_EMOTE_STAMP, 0); + hasFlap = new VarbitRequirement(VarbitID.SOS_EMOTE_FLAP, 1); + hasSlap = new VarbitRequirement(VarbitID.SOS_EMOTE_DOH, 1); + hasIdea = new VarbitRequirement(VarbitID.SOS_EMOTE_IDEA, 1); + hasStamp = new VarbitRequirement(VarbitID.SOS_EMOTE_STAMP, 1); + food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); } public void setupSteps() { - List pathFromStartToChest1 = Arrays.asList( + var pathFromStartToChest1 = List.of( new WorldPoint(1859, 5243, 0), new WorldPoint(1859, 5232, 0), new WorldPoint(1864, 5227, 0), @@ -194,7 +203,7 @@ public void setupSteps() new WorldPoint(1905, 5228, 0) ); - List pathFromStartToChest2 = Arrays.asList( + var pathFromStartToChest2 = List.of( new WorldPoint(2042, 5245, 0), new WorldPoint(2034, 5244, 0), new WorldPoint(2033, 5239, 0), @@ -215,7 +224,7 @@ public void setupSteps() new WorldPoint(2020, 5227, 0) ); - List pathFromStartToChest3 = Arrays.asList( + var pathFromStartToChest3 = List.of( new WorldPoint(2123, 5252, 0), new WorldPoint(2132, 5256, 0), new WorldPoint(2132, 5261, 0), @@ -229,7 +238,7 @@ public void setupSteps() new WorldPoint(2147, 5291, 0) ); - List pathFromStartToChest4 = Arrays.asList( + var pathFromStartToChest4 = List.of( new WorldPoint(2358, 5215, 0), new WorldPoint(2356, 5216, 0), new WorldPoint(2355, 5224, 0), @@ -251,22 +260,22 @@ public void setupSteps() talkToCountCheck.addDialogStep("Yes"); enterStronghold = new ObjectStep(this, ObjectID.SOS_DUNG_ENT_OPEN, new WorldPoint(3081, 3420, 0), - "Climb down the entrance to the Stronghold of Security."); + "Climb down the entrance to the Stronghold of Security in Barbarian Village, west of Varrock."); enterFloorFamine = new ObjectStep(this, ObjectID.SOS_WAR_LADD_DOWN, new WorldPoint(1902, 5222, 0), "Go to the 2nd floor of the stronghold."); enterFloorFamine.setLinePoints(pathFromStartToChest1); enterFloorFamine.setHideMinimapLines(true); - enterFloorFamine.addDialogSteps(answers); + enterFloorFamine.addDialogSteps(CORRECT_ANSWERS); enterFloorPestilence = new ObjectStep(this, ObjectID.SOS_FAM_LADD_DOWN, new WorldPoint(2026, 5218, 0), "Go to the 3rd floor of the stronghold."); enterFloorPestilence.setLinePoints(pathFromStartToChest2); enterFloorPestilence.setHideMinimapLines(true); - enterFloorPestilence.addDialogSteps(answers); + enterFloorPestilence.addDialogSteps(CORRECT_ANSWERS); enterFloorDeath = new ObjectStep(this, ObjectID.SOS_PEST_LADD_DOWN, new WorldPoint(2148, 5284, 0), "Go to the 4th floor of the stronghold."); enterFloorDeath.setLinePoints(pathFromStartToChest3); enterFloorDeath.setHideMinimapLines(true); - enterFloorDeath.addDialogSteps(answers); + enterFloorDeath.addDialogSteps(CORRECT_ANSWERS); usePortalWar = new ObjectStep(this, ObjectID.SOS_WAR_PORTAL, new WorldPoint(1863, 5238, 0), "Enter the portal."); @@ -279,55 +288,107 @@ public void setupSteps() new WorldPoint(1907, 5222, 0), "Claim 2k coins and the Flap emote."); openChestWar.setLinePoints(pathFromStartToChest1); openChestWar.setHideMinimapLines(true); - openChestWar.addDialogSteps(answers); + openChestWar.addDialogSteps(CORRECT_ANSWERS); openChestFamine = new ObjectStep(this, ObjectID.SOS_FAM_SACK, new WorldPoint(2021, 5216, 0), "Claim 3k coins and the Slap Head emote."); openChestFamine.setLinePoints(pathFromStartToChest2); openChestFamine.setHideMinimapLines(true); - openChestFamine.addDialogSteps(answers); + openChestFamine.addDialogSteps(CORRECT_ANSWERS); + openChestFamine.addSubSteps(enterFloorFamine, usePortalWar); openChestPestilence = new ObjectStep(this, ObjectID.SOS_PEST_CHEST, new WorldPoint(2144, 5280, 0), "Claim 5k coins and the Idea emote."); openChestPestilence.setLinePoints(pathFromStartToChest3); openChestPestilence.setHideMinimapLines(true); - openChestPestilence.addDialogSteps(answers); + openChestPestilence.addDialogSteps(CORRECT_ANSWERS); + openChestPestilence.addSubSteps(enterFloorPestilence, usePortalFamine); openChestDeath = new ObjectStep(this, ObjectID.SOS_DEATH_PRAM, new WorldPoint(2344, 5214, 0), "Claim Fancy boots or Fighting boots, and the Stamp emote."); openChestDeath.setLinePoints(pathFromStartToChest4); openChestDeath.setHideMinimapLines(true); - openChestDeath.addDialogSteps(answers); + openChestDeath.addDialogSteps(CORRECT_ANSWERS); + openChestDeath.addSubSteps(enterFloorDeath, usePortalPestilence); } @Override - public List getItemRecommended() + public Map loadSteps() { - return Collections.singletonList(food); + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + var goEnterStronghold = new ConditionalStep(this, enterStronghold); + goEnterStronghold.addStep(and(nearCountCheck, notUsedCountCheck), talkToCountCheck); + goEnterStronghold.addStep(and(or(canSkipWar, hasFlap), + inFloorWar, inStartRoomWar), usePortalWar); + goEnterStronghold.addStep(and(notFlap, inFloorWar), openChestWar); + goEnterStronghold.addStep(and(notStamp, inFloorWar), enterFloorFamine); + + goEnterStronghold.addStep(and(or(canSkipFamine, hasSlap), + inFloorFamine, inStartRoomFamine), usePortalFamine); + goEnterStronghold.addStep(and(notSlap, inFloorFamine), openChestFamine); + goEnterStronghold.addStep(and(notStamp, inFloorFamine), enterFloorPestilence); + + goEnterStronghold.addStep(and(or(canSkipPestilence, hasIdea), + inFloorPestilence, inStartRoomPestilence), usePortalPestilence); + goEnterStronghold.addStep(and(notIdea, inFloorPestilence), openChestPestilence); + goEnterStronghold.addStep(and(notStamp, inFloorPestilence), enterFloorDeath); + + goEnterStronghold.addStep(and(notStamp, inFloorDeath), openChestDeath); + + //TODO: Highlight warning confirmation when climbing down ladder + //TODO: Auto start when entering or when teleporting with Count Check? + + steps.put(0, goEnterStronghold); + + return steps; } @Override - public List getUnlockRewards() + public List getItemRecommended() { - return Collections.singletonList(new UnlockReward("Flap, Slap Head, Idea and Stamp emotes.")); + return List.of( + food + ); } public List getItemRewards() { - return Arrays.asList( + return List.of( new ItemReward("Coins", ItemID.COINS, 10000), - new ItemReward("Fancy or Fighting boots", ItemID.SOS_BOOTS, 1)); + new ItemReward("Fancy or Fighting boots", ItemID.SOS_BOOTS, 1) + ); + } + + @Override + public List getUnlockRewards() + { + return List.of( + new UnlockReward("Flap, Slap Head, Idea and Stamp emotes.") + ); } - // Maybe a little unnecessary... @Override public List getPanels() { - List allSteps = new ArrayList<>(); + var steps = new ArrayList(); + + steps.add(new PanelDetails("Entering the stronghold", List.of( + talkToCountCheck, + enterStronghold + ))); + steps.add(new PanelDetails("Claiming coins", List.of( + openChestWar, + openChestFamine, + openChestPestilence + ))); + steps.add(new PanelDetails("Claiming boots", List.of( + openChestDeath + ))); - allSteps.add(new PanelDetails("Entering the stronghold", Arrays.asList(talkToCountCheck, enterStronghold))); - allSteps.add(new PanelDetails("Claiming coins", Arrays.asList(openChestWar, openChestFamine, openChestPestilence))); - allSteps.add(new PanelDetails("Claiming boots", Collections.singletonList(openChestDeath))); - return allSteps; + return steps; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/AKingdomDivided.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/AKingdomDivided.java index e66a5fa4222..69c94ad223d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/AKingdomDivided.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/AKingdomDivided.java @@ -54,6 +54,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -472,7 +473,7 @@ protected void setupRequirements() public void setupConditions() { - hasTalkedToTomasLowry = new VarbitRequirement(12302, 1); + hasTalkedToTomasLowry = new VarbitRequirement(VarbitID.AKD_TOMAS_LIE, 1); inArceuusLibraryHistoricalArchive = new ZoneRequirement(arceuusLibraryHistoricalArchive); judgeOfYamaNearby = new NpcCondition(NpcID.AKD_JUDGE_OF_YAMA_COMBAT); hasBluishKey = new ItemRequirements(bluishKey); @@ -480,7 +481,7 @@ public void setupConditions() inCouncillorsHouseF2 = new ZoneRequirement(councillorsHouseF2); inCouncillorsHouseF3 = new ZoneRequirement(councillorsHouseF3); hasReceipt = new ItemRequirements(receipt); - hasInspectedReceipt = new VarbitRequirement(12298, 1); + hasInspectedReceipt = new VarbitRequirement(VarbitID.AKD_HUGHES_RECEIPT, 1); inPanelZone = new ZoneRequirement(panelArea1, panelArea2); assassinNearby = new NpcCondition(NpcID.AKD_SETTLEMENT_RUINS_ASSASSIN); hasColdKey = new ItemRequirements(coldKey); @@ -501,35 +502,35 @@ public void setupConditions() inLookoutF2 = new ZoneRequirement(lookoutF2); inLookoutF3 = new ZoneRequirement(lookoutF3); inShayzienPrison = new ZoneRequirement(shayzienPrison); - helpingPisc0 = new VarbitRequirement(12318, 0); - helpingArceuus0 = new VarbitRequirement(12319, 0); - helpingLova0 = new VarbitRequirement(12320, 0); - helpingHosidius0 = new VarbitRequirement(12321, 0); - helpingShayzien0 = new VarbitRequirement(12322, 0); - helpingLova2 = new VarbitRequirement(12320, 2); - helpingLova4 = new VarbitRequirement(12320, 4); - helpingLova6 = new VarbitRequirement(12320, 6); - helpingLova8 = new VarbitRequirement(12320, 8); - helpingLova10 = new VarbitRequirement(12320, 10); - helpingLova12 = new VarbitRequirement(12320, 12); - helpingLova14 = new VarbitRequirement(12320, 14); - helpingArceuus2 = new VarbitRequirement(12319, 2); - helpingArceuus4 = new VarbitRequirement(12319, 4); - helpingArceuus6 = new VarbitRequirement(12319, 6); - helpingArceuus8 = new VarbitRequirement(12319, 8); - helpingArceuus10 = new VarbitRequirement(12319, 10); - helpingHosidius2 = new VarbitRequirement(12321, 2); - helpingHosidius4 = new VarbitRequirement(12321, 4); - helpingHosidius6 = new VarbitRequirement(12321, 6); - helpingHosidius8 = new VarbitRequirement(12321, 8); - helpingPisc2 = new VarbitRequirement(12318, 2); - helpingPisc4 = new VarbitRequirement(12318, 4); - helpingPisc6 = new VarbitRequirement(12318, 6); - helpingPisc8 = new VarbitRequirement(12318, 8); - helpingPisc10 = new VarbitRequirement(12318, 10); - helpingShayzien2 = new VarbitRequirement(12322, 2); - helpingShayzien4 = new VarbitRequirement(12322, 4); - helpingShayzien6 = new VarbitRequirement(12322, 6); + helpingPisc0 = new VarbitRequirement(VarbitID.AKD_PISCARILIUS_HELPED, 0); + helpingArceuus0 = new VarbitRequirement(VarbitID.AKD_ARCEUUS_HELPED, 0); + helpingLova0 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 0); + helpingHosidius0 = new VarbitRequirement(VarbitID.AKD_HOSIDIUS_HELPED, 0); + helpingShayzien0 = new VarbitRequirement(VarbitID.AKD_SHAYZIEN_HELPED, 0); + helpingLova2 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 2); + helpingLova4 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 4); + helpingLova6 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 6); + helpingLova8 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 8); + helpingLova10 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 10); + helpingLova12 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 12); + helpingLova14 = new VarbitRequirement(VarbitID.AKD_LOVAKENGJ_HELPED, 14); + helpingArceuus2 = new VarbitRequirement(VarbitID.AKD_ARCEUUS_HELPED, 2); + helpingArceuus4 = new VarbitRequirement(VarbitID.AKD_ARCEUUS_HELPED, 4); + helpingArceuus6 = new VarbitRequirement(VarbitID.AKD_ARCEUUS_HELPED, 6); + helpingArceuus8 = new VarbitRequirement(VarbitID.AKD_ARCEUUS_HELPED, 8); + helpingArceuus10 = new VarbitRequirement(VarbitID.AKD_ARCEUUS_HELPED, 10); + helpingHosidius2 = new VarbitRequirement(VarbitID.AKD_HOSIDIUS_HELPED, 2); + helpingHosidius4 = new VarbitRequirement(VarbitID.AKD_HOSIDIUS_HELPED, 4); + helpingHosidius6 = new VarbitRequirement(VarbitID.AKD_HOSIDIUS_HELPED, 6); + helpingHosidius8 = new VarbitRequirement(VarbitID.AKD_HOSIDIUS_HELPED, 8); + helpingPisc2 = new VarbitRequirement(VarbitID.AKD_PISCARILIUS_HELPED, 2); + helpingPisc4 = new VarbitRequirement(VarbitID.AKD_PISCARILIUS_HELPED, 4); + helpingPisc6 = new VarbitRequirement(VarbitID.AKD_PISCARILIUS_HELPED, 6); + helpingPisc8 = new VarbitRequirement(VarbitID.AKD_PISCARILIUS_HELPED, 8); + helpingPisc10 = new VarbitRequirement(VarbitID.AKD_PISCARILIUS_HELPED, 10); + helpingShayzien2 = new VarbitRequirement(VarbitID.AKD_SHAYZIEN_HELPED, 2); + helpingShayzien4 = new VarbitRequirement(VarbitID.AKD_SHAYZIEN_HELPED, 4); + helpingShayzien6 = new VarbitRequirement(VarbitID.AKD_SHAYZIEN_HELPED, 6); inMountKaruulm = new ZoneRequirement(mountKaruulm); hasSulphurPotion = new ItemRequirements(sulphurPotion); barbarianWarlordNearby = new NpcCondition(NpcID.AKD_BARBARIAN_WARLORD); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/StatuePuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/StatuePuzzle.java index 94e02b416a2..63686dbc531 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/StatuePuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/akingdomdivided/StatuePuzzle.java @@ -39,6 +39,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -197,10 +198,10 @@ public void setupConditions() { inLeglessFaunF1 = new ZoneRequirement(leglessFaunF1); statueStates = new Requirement[]{ - new VarbitRequirement(12306, 0), - new VarbitRequirement(12307, 0), - new VarbitRequirement(12308, 0), - new VarbitRequirement(12309, 0) + new VarbitRequirement(VarbitID.AKD_PISCARILIUS_STATUE_1, 0), + new VarbitRequirement(VarbitID.AKD_PISCARILIUS_STATUE_2, 0), + new VarbitRequirement(VarbitID.AKD_PISCARILIUS_STATUE_3, 0), + new VarbitRequirement(VarbitID.AKD_PISCARILIUS_STATUE_4, 0) }; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anightatthetheatre/ANightAtTheTheatre.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anightatthetheatre/ANightAtTheTheatre.java index 030d32259fc..62a3fa66440 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anightatthetheatre/ANightAtTheTheatre.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anightatthetheatre/ANightAtTheTheatre.java @@ -128,9 +128,9 @@ public Map loadSteps() steps.put(26, speakWithDaerKandConditional); ConditionalStep returnToSpiderCaveConditional = new ConditionalStep(this, returnToSpiderCave); - returnToSpiderCaveConditional.addStep(new Conditions(sulphuricAcid.alsoCheckBank(questBank), inSpiderCave), useSulphuricAcidOnEggSac); - returnToSpiderCaveConditional.addStep(new Conditions(sulphuricAcid.alsoCheckBank(questBank), inSisterhoodSanctuaryF1), climbStairsDownSisterhoodF0); - returnToSpiderCaveConditional.addStep(new Conditions(sulphuricAcid.alsoCheckBank(questBank), inSisterhoodSanctuaryF0), exitSisterhoodSanctuary); + returnToSpiderCaveConditional.addStep(new Conditions(sulphuricAcid.alsoCheckBank(), inSpiderCave), useSulphuricAcidOnEggSac); + returnToSpiderCaveConditional.addStep(new Conditions(sulphuricAcid.alsoCheckBank(), inSisterhoodSanctuaryF1), climbStairsDownSisterhoodF0); + returnToSpiderCaveConditional.addStep(new Conditions(sulphuricAcid.alsoCheckBank(), inSisterhoodSanctuaryF0), exitSisterhoodSanctuary); returnToSpiderCaveConditional.addStep(inSpiderCave, exitSpiderCave); returnToSpiderCaveConditional.addStep(inSisterhoodSanctuaryF0, climbStairsToSisterhoodSanctuaryF1); returnToSpiderCaveConditional.addStep(inSisterhoodSanctuaryF1, speakWithDaerKrand); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anothersliceofham/AnotherSliceOfHam.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anothersliceofham/AnotherSliceOfHam.java index 367059bb5fc..869ddcb4fd3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anothersliceofham/AnotherSliceOfHam.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/anothersliceofham/AnotherSliceOfHam.java @@ -61,7 +61,7 @@ public class AnotherSliceOfHam extends BasicQuestHelper { //Items Required - ItemRequirement lightSource, tinderbox, combatGearRangedMagic, combatGear; + ItemRequirement lightSource, tinderbox, combatGearRangedMagic, combatGear, ropeForEntrance; ItemRequirement lumbridgeTeleports; @@ -70,6 +70,8 @@ public class AnotherSliceOfHam extends BasicQuestHelper FollowerRequirement zanikFollower; + VarbitRequirement addedRopeToHole; + Requirement inBasement, inTunnels, inMines, inCityF0, inCityF1, inRailway, inTower, inGoblinVillage, inSwamp, inBase, atCrate, inFinalRoom; @@ -143,6 +145,8 @@ public Map loadSteps() @Override protected void setupRequirements() { + addedRopeToHole = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); + lightSource = new ItemRequirement("A light source", ItemCollections.LIGHT_SOURCES).isNotConsumed(); lumbridgeTeleports = new ItemRequirement("Lumbridge teleports", ItemID.POH_TABLET_LUMBRIDGETELEPORT, 3); @@ -150,6 +154,8 @@ protected void setupRequirements() zanikFollower = new FollowerRequirement("Zanik following you. If she's not, retrieve her from the " + "Dorgesh-Kaan railway", NpcID.SLICE_ZANIK_FOLLOWER); + ropeForEntrance = new ItemRequirement("Rope", ItemID.ROPE).highlighted().hideConditioned(addedRopeToHole); + tinderbox = new ItemRequirement("Tinderbox", ItemID.TINDERBOX).isNotConsumed(); combatGearRangedMagic = new ItemRequirement("Magic or ranged combat gear", -1, -1).isNotConsumed(); @@ -220,12 +226,12 @@ public void setupConditions() dug5 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_5, 1, Operation.GREATER_EQUAL); dug6 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_6, 1, Operation.GREATER_EQUAL); - handedIn1 = new VarbitRequirement(3551, 2); - handedIn2 = new VarbitRequirement(3552, 2); - handedIn3 = new VarbitRequirement(3553, 2); - handedIn4 = new VarbitRequirement(3554, 2); - handedIn5 = new VarbitRequirement(3555, 2); - handedIn6 = new VarbitRequirement(3556, 2); + handedIn1 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_1, 2); + handedIn2 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_2, 2); + handedIn3 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_3, 2); + handedIn4 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_4, 2); + handedIn5 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_5, 2); + handedIn6 = new VarbitRequirement(VarbitID.SLICE_ARTIFACT_6, 2); cleaned1 = new Conditions(LogicType.OR, handedIn1, armourShard); cleaned2 = new Conditions(LogicType.OR, handedIn2, shieldFragment); @@ -236,12 +242,12 @@ public void setupConditions() cleanedAll = new Conditions(cleaned1, cleaned2, cleaned3, cleaned4, cleaned5, cleaned6); - zanikFollowing = new Conditions(LogicType.OR, new VarbitRequirement(3557, 0), + zanikFollowing = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.SLICE_ZANIK_AT_DIG, 0), new NpcInteractingRequirement(NpcID.SLICE_ZANIK_FOLLOWER)); // 3564 = 1, searjents etc - atCrate = new VarbitRequirement(3558, 1); + atCrate = new VarbitRequirement(VarbitID.SLICE_HIDING, 1); guardsPassed = new NpcCondition(NpcID.SLICE_HAM_GUARD, new WorldPoint(2397, 5551, 0)); guardEngaged = new Conditions(LogicType.OR, new NpcInteractingWithNpcRequirement(NpcID.SLICE_SERGEANT_MOSSFISTS, "Guard"), @@ -330,7 +336,7 @@ public void setupSteps() "Talk to the Sergeants in Lumbridge Swamp.", combatGear, ancientMace, lightSource); enterSwamp = new ObjectStep(this, ObjectID.GOBLIN_CAVE_ENTRANCE, new WorldPoint(3169, 3172, 0), - "Enter the Lumbridge Swamp Caves.", combatGear, ancientMace, lightSource); + "Enter the Lumbridge Swamp Caves.", combatGear, ancientMace, lightSource, ropeForEntrance); climbEnterHamBase = new ObjectStep(this, ObjectID.SLICE_LADDER_SWAMP, new WorldPoint(3171, 9568, 0), "Climb down the ladder to the secret H.A.M. base."); @@ -409,7 +415,7 @@ private void setupConditionalSteps() @Override public List getItemRequirements() { - return Arrays.asList(lightSource, tinderbox, combatGearRangedMagic); + return Arrays.asList(lightSource, tinderbox, combatGearRangedMagic, ropeForEntrance); } @Override @@ -461,7 +467,7 @@ public List getPanels() allSteps.add(new PanelDetails("To Goblin Village", Arrays.asList(goTalkToOldak, talkToGenerals, goUpLadder, killHamMageAndArcher, talkToGeneralsAgain), combatGearRangedMagic)); allSteps.add(new PanelDetails("Saving Zanik", Arrays.asList(talkToSergeant, enterSwamp, climbEnterHamBase, - goToCrate, lureHamMember, enterFinalFight, useSpecial, untieZanik), combatGear, ancientMace, lightSource)); + goToCrate, lureHamMember, enterFinalFight, useSpecial, untieZanik), combatGear, ancientMace, lightSource, ropeForEntrance)); return allSteps; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/asoulsbane/ASoulsBane.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/asoulsbane/ASoulsBane.java index 39266a979f1..c1628783625 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/asoulsbane/ASoulsBane.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/asoulsbane/ASoulsBane.java @@ -46,6 +46,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -146,12 +147,12 @@ protected void setupRequirements() public void setupConditions() { - ropeUsed = new VarbitRequirement(2032, 1); + ropeUsed = new VarbitRequirement(VarbitID.SOULBANE_RIFTROPE_PRES, 1); hasWeapon = new ItemRequirements(LogicType.OR, "", angerBattleaxe, angerMace, angerSpear, angerSword); - hasSword = new VarbitRequirement(2029, 1); - hasSpear = new VarbitRequirement(2029, 2); - hasMace = new VarbitRequirement(2029, 3); - hasBattleaxe = new VarbitRequirement(2029, 4); + hasSword = new VarbitRequirement(VarbitID.SOULBANE_ANGER_WEAPONMULTI, 1); + hasSpear = new VarbitRequirement(VarbitID.SOULBANE_ANGER_WEAPONMULTI, 2); + hasMace = new VarbitRequirement(VarbitID.SOULBANE_ANGER_WEAPONMULTI, 3); + hasBattleaxe = new VarbitRequirement(VarbitID.SOULBANE_ANGER_WEAPONMULTI, 4); inAngerRoom = new ZoneRequirement(rageRoom); inFearRoom = new ZoneRequirement(fearRoom); @@ -160,16 +161,16 @@ public void setupConditions() inHopeRoom = new ZoneRequirement(hopeRoom); inTolnaRoom = new ZoneRequirement(tolnaRoom); - watchedTolnaLeavingCutscene = new VarbitRequirement(2560, 1); + watchedTolnaLeavingCutscene = new VarbitRequirement(VarbitID.SOULBANE_WATCHEDCUTSCENE, 1); - inHole0 = new VarbitRequirement(2012, 0); - inHole1 = new VarbitRequirement(2012, 1); - inHole2 = new VarbitRequirement(2012, 2); - inHole3 = new VarbitRequirement(2012, 3); - inHole4 = new VarbitRequirement(2012, 4); - inHole5 = new VarbitRequirement(2012, 5); + inHole0 = new VarbitRequirement(VarbitID.SOULBANE_FEAR_ENEMYDOOR, 0); + inHole1 = new VarbitRequirement(VarbitID.SOULBANE_FEAR_ENEMYDOOR, 1); + inHole2 = new VarbitRequirement(VarbitID.SOULBANE_FEAR_ENEMYDOOR, 2); + inHole3 = new VarbitRequirement(VarbitID.SOULBANE_FEAR_ENEMYDOOR, 3); + inHole4 = new VarbitRequirement(VarbitID.SOULBANE_FEAR_ENEMYDOOR, 4); + inHole5 = new VarbitRequirement(VarbitID.SOULBANE_FEAR_ENEMYDOOR, 5); - reaperNearby = new VarbitRequirement(2035, 1); + reaperNearby = new VarbitRequirement(VarbitID.SOULBANE_FEAR_MONSPRES, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atailoftwocats/ATailOfTwoCats.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atailoftwocats/ATailOfTwoCats.java index 58a860c7493..e5f243f36e4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atailoftwocats/ATailOfTwoCats.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atailoftwocats/ATailOfTwoCats.java @@ -167,15 +167,15 @@ public void setupConditions() { bobNearby = new NpcRequirement("Bob nearby", NpcID.DEATH_GROWNCAT_BLACK_VIS); - rakedPatch = new VarbitRequirement(1033, 3); + rakedPatch = new VarbitRequirement(VarbitID.TWOCATS_CHORES_TIDYGARDEN, 3); plantedSeed = new VarbitRequirement(VarbitID.TWOCATS_CHORES_TIDYGARDEN, 4, Operation.GREATER_EQUAL); - grownPotatoes = new VarbitRequirement(1033, 8); - madeBed = new VarbitRequirement(1029, 1); - placedLogs = new VarbitRequirement(1030, 1); - litLogs = new VarbitRequirement(1030, 2); - placedCake = new VarbitRequirement(1031, 3); - placedMilk = new VarbitRequirement(1031, 4); - usedShears = new VarbitRequirement(1032, 8); + grownPotatoes = new VarbitRequirement(VarbitID.TWOCATS_CHORES_TIDYGARDEN, 8); + madeBed = new VarbitRequirement(VarbitID.TWOCATS_CHORES_TIDYHOUSE, 1); + placedLogs = new VarbitRequirement(VarbitID.TWOCATS_CHORES_WARMHUMAN, 1); + litLogs = new VarbitRequirement(VarbitID.TWOCATS_CHORES_WARMHUMAN, 2); + placedCake = new VarbitRequirement(VarbitID.TWOCATS_CHORES_FEEDHUMAN, 3); + placedMilk = new VarbitRequirement(VarbitID.TWOCATS_CHORES_FEEDHUMAN, 4); + usedShears = new VarbitRequirement(VarbitID.TWOCATS_CHORES_TIDYHUMAN, 8); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atfirstlight/AtFirstLight.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atfirstlight/AtFirstLight.java index 6063bf7c5f1..96cd49a827e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atfirstlight/AtFirstLight.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/atfirstlight/AtFirstLight.java @@ -47,6 +47,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -56,7 +57,7 @@ public class AtFirstLight extends BasicQuestHelper { //Items Required - ItemRequirement needle, boxTrap, hammer, jerboaTail, jerboaTailOrBoxTrap, jerboaTail2OrBoxTrap; + ItemRequirement needle, costumeNeedle, needleOrCostumeNeedle, boxTrap, hammer, jerboaTail, jerboaTailOrBoxTrap, jerboaTail2OrBoxTrap; // Items Recommended ItemRequirement staminaPotion; @@ -136,9 +137,9 @@ public Map loadSteps() steps.put(9, goWithTrimToFox); ConditionalStep goToVerityWithReport = new ConditionalStep(this, talkToAtzaForTrim); - goToVerityWithReport.addStep(and(inGuild, trimmedFur, handedInReport, needle), useJerboaTailOnBed); - goToVerityWithReport.addStep(and(inGuild, trimmedFur, hadReport, needle), talkToVerityEnd); - goToVerityWithReport.addStep(and(trimmedFur, hadReport, needle), goDownTreeEnd); + goToVerityWithReport.addStep(and(inGuild, trimmedFur, handedInReport, needleOrCostumeNeedle), useJerboaTailOnBed); + goToVerityWithReport.addStep(and(inGuild, trimmedFur, hadReport, needleOrCostumeNeedle), talkToVerityEnd); + goToVerityWithReport.addStep(and(trimmedFur, hadReport, needleOrCostumeNeedle), goDownTreeEnd); goToVerityWithReport.addStep(and(trimmedFur, hadReport), takeNeedle); goToVerityWithReport.addStep(trimmedFur, getReportFromFox); steps.put(10, goToVerityWithReport); @@ -161,7 +162,10 @@ protected void setupRequirements() { // Required needle = new ItemRequirement("Needle", ItemID.NEEDLE).isNotConsumed(); - needle.canBeObtainedDuringQuest(); + costumeNeedle = new ItemRequirement("Costume needle", ItemID.COSTUMENEEDLE); + needleOrCostumeNeedle = new ItemRequirements(LogicType.OR, "Needle or Costume needle", needle, costumeNeedle); + needleOrCostumeNeedle.setDisplayMatchedItemName(true); + needleOrCostumeNeedle.canBeObtainedDuringQuest(); boxTrap = new ItemRequirement("Box trap", ItemID.HUNTING_BOX_TRAP).isNotConsumed(); boxTrap.setTooltip("You can buy one from Imia in the north of the Hunter Guild's surface area for 41gp."); hammer = new ItemRequirement("Hammer", ItemCollections.HAMMER).isNotConsumed(); @@ -188,14 +192,14 @@ protected void setupRequirements() private void setupConditions() { inGuild = new ZoneRequirement(guild); - gotMouse = new VarbitRequirement(9843, 1); - usedMouse = new VarbitRequirement(9839, 1); - checkedBed = new VarbitRequirement(9837, 1); + gotMouse = new VarbitRequirement(VarbitID.AFL_MOUSETAKEN, 1); + usedMouse = new VarbitRequirement(VarbitID.AFL_CATDISTRACT, 1); + checkedBed = new VarbitRequirement(VarbitID.AFL_BEDCHECK, 1); // 9842 0->1, received pelt once - equipmentUsable = new VarbitRequirement(9840, 1); - repairedEquipment = new VarbitRequirement(9840, 2); - handedInReport = new VarbitRequirement(9836, 1); + equipmentUsable = new VarbitRequirement(VarbitID.AFL_HOUSETRAPPED, 1); + repairedEquipment = new VarbitRequirement(VarbitID.AFL_HOUSETRAPPED, 2); + handedInReport = new VarbitRequirement(VarbitID.AFL_REPORT, 1); foxsReport = new ItemRequirement("Fox's report", ItemID.AFL_REPORT).hideConditioned(handedInReport); hadReport = or(foxsReport, handedInReport); @@ -255,11 +259,11 @@ private void setupSteps() "Return back to Fox to get his report."); returnToFoxAfterTrim.addSubSteps(getReportFromFox); goDownTreeEnd = new ObjectStep(this, ObjectID.HUNTERGUILD_STAIRS_DOWN01_COMBINED, new WorldPoint(1557, 3048, 0), - "Go down the stairs in the tree in the Hunters Guild.", foxsReport, trimmedFur, jerboaTail, needle); + "Go down the stairs in the tree in the Hunters Guild.", foxsReport, trimmedFur, jerboaTail, needleOrCostumeNeedle); talkToVerityEnd = new NpcStep(this, NpcID.HG_VERITY, new WorldPoint(1559, 9464, 0), "Talk to Guild Scribe Verity behind the bar again."); useJerboaTailOnBed = new ObjectStep(this, ObjectID.AFL_CATBED_OP, new WorldPoint(1552, 9460, 0), - "Use a jerboa tail on the cat bed.", jerboaTail.highlighted(), trimmedFur, needle); + "Use a jerboa tail on the cat bed.", jerboaTail.highlighted(), trimmedFur, needleOrCostumeNeedle); useJerboaTailOnBed.addIcon(ItemID.HUNTING_JERBOA_TAIL); goUpTreeToFinishQuest = new ObjectStep(this, ObjectID.HUNTERGUILD_STAIRS_UP01, new WorldPoint(1557, 9449, 0), "Go back up the stairs and talk to Guildmaster Apatura to finish the quest."); @@ -278,7 +282,7 @@ private void setupSteps() @Override public List getItemRequirements() { - return Arrays.asList(jerboaTail2OrBoxTrap, hammer, needle); + return Arrays.asList(jerboaTail2OrBoxTrap, hammer, needleOrCostumeNeedle); } @Override @@ -337,7 +341,7 @@ public List getPanels() allSteps.add(new PanelDetails("Bed repairs", List.of( talkToAtza, takeHammer, makeEquipmentPile, talkToAtzaForTrim, returnToFoxAfterTrim, takeNeedle, goDownTreeEnd, talkToVerityEnd, useJerboaTailOnBed, goUpTreeToFinishQuest - ), hammer, needle, jerboaTail)); + ), hammer, needleOrCostumeNeedle, jerboaTail)); return allSteps; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/belowicemountain/BelowIceMountain.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/belowicemountain/BelowIceMountain.java index 04b1900be91..47de8ce5781 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/belowicemountain/BelowIceMountain.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/belowicemountain/BelowIceMountain.java @@ -34,7 +34,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestPointRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitBuilder; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; @@ -45,82 +45,74 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class BelowIceMountain extends BasicQuestHelper { - // varbit 12065 tracks checkal line? - // varbit 12062 -> 1 after learning flex - private static final int VARBIT_CHECKAL_LINE = 12065; - private static final int VARBIT_MARLEY_LINE = 12064; - private static final int VARBIT_BURNTOF_LINE = 12066; - - //Items Required - ItemRequirement cookedMeat, bread, knife, coins, knifeHighlight, breadHighlight, steakSandwich, - beerHighlight; - - ItemRequirement iceMountainTeleport, faladorTeleport, varrockTeleport, combatGearOrPickaxe; - - Requirement needFlex, leftFlexBeforeLearning, haveFlex, recruitedCheckal, needRecipe, haveRecipe, haveIngredients, - fedMarley, recruitedMarley, needBeer,gaveBeer, needRPS, recruitedBurntof, inDungeon; - - QuestStep talkToWillowToStart, recruitCheckal, talkToAtlas, flexCheckal, talkToMarley, talkToCook, getIngredients, - makeSandwich, feedMarley, talkToMarleyAfterFeeding, talkToBurntof, buyBeer, giveBeer, playRPS, goToDungeon, - reenterDungeon, defeatGuardian, watchCutscene; - - ConditionalStep getCheckal, getMarley, getBurntof; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToWillowToStart); - steps.put(5, talkToWillowToStart); - steps.put(7, talkToWillowToStart); - - getCheckal = new ConditionalStep(this, recruitCheckal); - getCheckal.addStep(needFlex, talkToAtlas); - getCheckal.addStep(leftFlexBeforeLearning, talkToAtlas); - getCheckal.addStep(haveFlex, flexCheckal); - getCheckal.setLockingCondition(recruitedCheckal); - steps.put(10, getCheckal); - - getMarley = new ConditionalStep(this, talkToMarley); - getMarley.addStep(fedMarley, talkToMarleyAfterFeeding); - getMarley.addStep(needRecipe, talkToCook); - getMarley.addStep(steakSandwich, feedMarley); - getMarley.addStep(new Conditions(LogicType.AND, haveRecipe, haveIngredients), makeSandwich); - getMarley.addStep(haveRecipe, getIngredients); - getMarley.setLockingCondition(recruitedMarley); - - getBurntof = new ConditionalStep(this, talkToBurntof); - getBurntof.addStep(needRPS, playRPS); - getBurntof.addStep(gaveBeer, playRPS); - getBurntof.addStep(new Conditions(LogicType.AND, needBeer, beerHighlight), giveBeer); - getBurntof.addStep(needBeer, buyBeer); - getBurntof.setLockingCondition(recruitedBurntof); - - ConditionalStep marleyAndBurntof = new ConditionalStep(this, getMarley); - marleyAndBurntof.addStep(recruitedMarley, getBurntof); - steps.put(15, marleyAndBurntof); - - steps.put(20, goToDungeon); - steps.put(25, goToDungeon); - steps.put(30, reenterDungeon); - - ConditionalStep guardian = new ConditionalStep(this, reenterDungeon); - guardian.addStep(inDungeon, defeatGuardian); - steps.put(35, guardian); - - steps.put(40, watchCutscene); - - return steps; - } + // Required items + ItemRequirement cookedMeat; + ItemRequirement bread; + ItemRequirement knife; + ItemRequirement coins; + + // Recommended items + ItemRequirement iceMountainTeleport; + ItemRequirement faladorTeleport; + ItemRequirement varrockTeleport; + ItemRequirement combatGearOrPickaxe; + + // Mid-quest item requirements + ItemRequirement steakSandwich; + ItemRequirement beer; + + // Miscellaneous requirements + Conditions needFlex; + Conditions haveFlex; + VarbitRequirement recruitedCheckal; + VarbitRequirement needRecipe; + VarbitRequirement haveRecipe; + ItemRequirements haveIngredients; + VarbitRequirement fedMarley; + VarbitRequirement recruitedMarley; + VarbitRequirement needBeer; + Conditions gaveBeer; + VarbitRequirement recruitedBurntof; + NpcRequirement inDungeon; + + // Steps + NpcStep talkToWillowToStart; + + NpcStep recruitCheckal; + NpcStep talkToAtlas; + NpcEmoteStep flexCheckal; + + NpcStep talkToMarley; + NpcStep talkToCook; + DetailedQuestStep getIngredients; + DetailedQuestStep makeSandwich; + NpcStep feedMarley; + NpcStep talkToMarleyAfterFeeding; + + NpcStep talkToBurntof; + NpcStep buyBeer; + NpcStep giveBeer; + NpcStep playRPS; + + NpcStep goToDungeon; + + ObjectStep reenterDungeon; + + NpcStep defeatGuardian; + + ObjectStep watchCutscene; @Override protected void setupRequirements() @@ -131,12 +123,9 @@ protected void setupRequirements() knife = new ItemRequirement("Knife", ItemID.KNIFE).isNotConsumed(); coins = new ItemRequirement("Coins", ItemCollections.COINS, 3); - knifeHighlight = knife.highlighted(); - breadHighlight = bread.highlighted(); - steakSandwich = new ItemRequirement("Steak Sandwich", ItemID.BIM_STEAK_SANDWICH); - beerHighlight = new ItemRequirement(true, "Asgarnian Ale", ItemID.ASGARNIAN_ALE); + beer = new ItemRequirement(true, "Asgarnian Ale", ItemID.ASGARNIAN_ALE); iceMountainTeleport = new ItemRequirement("A teleport to near Ice Mountain", ItemCollections.AMULET_OF_GLORIES); iceMountainTeleport.addAlternates(ItemCollections.COMBAT_BRACELETS); @@ -145,27 +134,25 @@ protected void setupRequirements() varrockTeleport = new ItemRequirement("Varrock teleport", ItemID.POH_TABLET_VARROCKTELEPORT); combatGearOrPickaxe = new ItemRequirement("Combat gear or a pickaxe if you don't want to fight", -1, -1).isNotConsumed(); combatGearOrPickaxe.setDisplayItemId(BankSlotIcons.getCombatGear()); - } - public void setupConditions() - { - needFlex = new VarbitRequirement(VARBIT_CHECKAL_LINE, 5); - leftFlexBeforeLearning = new VarbitRequirement(VARBIT_CHECKAL_LINE, 10); - haveFlex = new VarbitRequirement(VARBIT_CHECKAL_LINE, 15); - recruitedCheckal = new VarbitRequirement(VARBIT_CHECKAL_LINE, 40); + var checkalState = new VarbitBuilder(VarbitID.BIM_CHECKAL); + needFlex = or(checkalState.eq(5), checkalState.eq(10)); + haveFlex = or(checkalState.eq(15), checkalState.eq(20)); + recruitedCheckal = checkalState.eq(40); - needRecipe = new VarbitRequirement(VARBIT_MARLEY_LINE, 5); - haveRecipe = new VarbitRequirement(VARBIT_MARLEY_LINE, 10); + var marleyState = new VarbitBuilder(VarbitID.BIM_MARLEY); + needRecipe = marleyState.eq(5); + haveRecipe = marleyState.eq(10); haveIngredients = new ItemRequirements(cookedMeat, bread, knife); - fedMarley = new VarbitRequirement(VARBIT_MARLEY_LINE, 35); - recruitedMarley = new VarbitRequirement(VARBIT_MARLEY_LINE, 40); + fedMarley = marleyState.eq(35); + recruitedMarley = marleyState.eq(40); - needBeer = new VarbitRequirement(VARBIT_BURNTOF_LINE, 5); - gaveBeer = new VarbitRequirement(VARBIT_BURNTOF_LINE, 10); - needRPS = new VarbitRequirement(VARBIT_BURNTOF_LINE, 15); - recruitedBurntof = new VarbitRequirement(VARBIT_BURNTOF_LINE, 40); + var burntofState = new VarbitBuilder(VarbitID.BIM_BURNTOF); + needBeer = burntofState.eq(5); + gaveBeer = or(burntofState.eq(10), burntofState.eq(15)); + recruitedBurntof = burntofState.eq(40); - inDungeon = new NpcRequirement("Ancient Guardian", 10654); + inDungeon = new NpcRequirement("Ancient Guardian", NpcID.BIM_GOLEM_BOSS); } public void setupSteps() @@ -178,13 +165,13 @@ public void setupSteps() "Attempt to recruit Checkal to your team in Barbarian Village."); talkToAtlas = new NpcStep(this, NpcID.BIM_ATLAS, new WorldPoint(3076, 3440, 0), "Speak to Atlas in the Barbarian" + - " Village Inn to learn how to Flex."); + " Village Inn to learn how to Flex. Pick up a cooked meat if you need one.", cookedMeat); talkToAtlas.addDialogStep("Yes."); - flexCheckal = new NpcEmoteStep(this, NpcID.BIM_CHECKAL, QuestEmote.FLEX, new WorldPoint(3087, 3415, 0), "Flex your muscles at Checkal to prove your worth."); + flexCheckal = new NpcEmoteStep(this, NpcID.BIM_CHECKAL, QuestEmote.FLEX, new WorldPoint(3087, 3415, 0), "Talk to Checkal and flex your muscles to prove your worth."); talkToMarley = new NpcStep(this, NpcID.BIM_MARLEY, new WorldPoint(3088, 3470, 0), "Speak to Marley in the Edgeville" + - " Ruins."); + " Ruins. Pick up the cooked meat from the Barbarian longhall if you don't have it already."); talkToCook = new NpcStep(this, NpcID.FAI_VARROCK_BLUEMOON_CHEF, new WorldPoint(3230, 3401, 0), "Ask the Cook at the Blue Moon Inn " + "for a steak sandwich."); @@ -192,11 +179,11 @@ public void setupSteps() getIngredients = new DetailedQuestStep(this, "Collect meat, bread and a knife to make a steak sandwich.", cookedMeat, bread, knife); - makeSandwich = new DetailedQuestStep(this, "Use the knife on the bread to make a steak sandwich. Be careful not to eat it!", knifeHighlight, breadHighlight); + makeSandwich = new DetailedQuestStep(this, "Use the knife on the bread to make a steak sandwich. Be careful not to eat it!", knife.highlighted(), bread.highlighted()); feedMarley = new NpcStep(this, NpcID.BIM_MARLEY, new WorldPoint(3088, 3470, 0), "Return to Marley and give him the steak sandwich. Be careful not to eat it!", steakSandwich); - talkToMarleyAfterFeeding = new NpcStep(this, NpcID.BIM_MARLEY, new WorldPoint(3088, 3470, 0), "Talk to Marley to send him off to the excavation site."); + talkToMarleyAfterFeeding = new NpcStep(this, NpcID.BIM_MARLEY, new WorldPoint(3088, 3470, 0), "Talk to Marley to send him off to the excavation site."); feedMarley.addSubSteps(talkToMarleyAfterFeeding); talkToBurntof = new NpcStep(this, NpcID.BIM_BURNTOF, new WorldPoint(2956, 3367, 0), "Talk to Burntof in the " + @@ -206,7 +193,7 @@ public void setupSteps() coins); buyBeer.addDialogSteps("What ales are you serving?", "One Asgarnian Ale, please."); - giveBeer = new NpcStep(this, NpcID.BIM_BURNTOF, new WorldPoint(2956, 3367, 0), "Give Burntof the Asgarnian Ale.", beerHighlight); + giveBeer = new NpcStep(this, NpcID.BIM_BURNTOF, new WorldPoint(2956, 3367, 0), "Give Burntof the Asgarnian Ale.", beer); playRPS = new NpcStep(this, NpcID.BIM_BURNTOF, new WorldPoint(2956, 3367, 0), "Beat Burntof in a match of Rock-Paper-Scissors. Your choices of Rock, Paper and Scissors do not matter."); @@ -230,32 +217,90 @@ public void setupSteps() } @Override - public List getItemRequirements() + public Map loadSteps() { - List reqs = new ArrayList<>(); - reqs.add(cookedMeat); - reqs.add(bread); - reqs.add(knife); - reqs.add(coins); - return reqs; + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToWillowToStart); + steps.put(5, talkToWillowToStart); + steps.put(7, talkToWillowToStart); + + var getCheckal = new ConditionalStep(this, recruitCheckal); + getCheckal.addStep(needFlex, talkToAtlas); + getCheckal.addStep(haveFlex, flexCheckal); + getCheckal.setLockingCondition(recruitedCheckal); + steps.put(10, getCheckal); + + var getMarley = new ConditionalStep(this, talkToMarley); + getMarley.addStep(fedMarley, talkToMarleyAfterFeeding); + getMarley.addStep(needRecipe, talkToCook); + getMarley.addStep(steakSandwich, feedMarley); + getMarley.addStep(and(haveRecipe, haveIngredients), makeSandwich); + getMarley.addStep(haveRecipe, getIngredients); + getMarley.setLockingCondition(recruitedMarley); + + var getBurntof = new ConditionalStep(this, talkToBurntof); + getBurntof.addStep(gaveBeer, playRPS); + getBurntof.addStep(and(needBeer, beer), giveBeer); + getBurntof.addStep(needBeer, buyBeer); + getBurntof.setLockingCondition(recruitedBurntof); + + var marleyAndBurntof = new ConditionalStep(this, getMarley); + marleyAndBurntof.addStep(recruitedMarley, getBurntof); + steps.put(15, marleyAndBurntof); + + steps.put(20, goToDungeon); + steps.put(25, goToDungeon); + steps.put(30, reenterDungeon); + + var guardian = new ConditionalStep(this, reenterDungeon); + guardian.addStep(inDungeon, defeatGuardian); + steps.put(35, guardian); + + steps.put(40, watchCutscene); + + return steps; } @Override - public List getItemRecommended() + public List getGeneralRequirements() { - return Arrays.asList(iceMountainTeleport, faladorTeleport, varrockTeleport, combatGearOrPickaxe); + return List.of( + new QuestPointRequirement(16) + ); } @Override - public List getCombatRequirements() + public List getItemRequirements() { - return Collections.singletonList("Ancient Guardian (level 25), or 10 mining + a pickaxe"); + return List.of( + cookedMeat, + bread, + knife, + coins + ); } @Override - public List getGeneralRequirements() + public List getItemRecommended() { - return Collections.singletonList(new QuestPointRequirement(16)); + return List.of( + iceMountainTeleport, + faladorTeleport, + varrockTeleport, + combatGearOrPickaxe + ); + } + + @Override + public List getCombatRequirements() + { + return List.of( + "Ancient Guardian (level 25), or 10 mining + a pickaxe" + ); } @Override @@ -267,43 +312,63 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Coins", ItemID.COINS, 2000)); + return List.of( + new ItemReward("Coins", ItemID.COINS, 2000) + ); } @Override public List getUnlockRewards() { - return Arrays.asList( - new UnlockReward("Access to the Ruins of Camdozaal."), - new UnlockReward("Flex Emote"), - new UnlockReward("The ability to make a steak sandwich") + return List.of( + new UnlockReward("Access to the Ruins of Camdozaal."), + new UnlockReward("Flex Emote"), + new UnlockReward("The ability to make a steak sandwich") ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - - allSteps.add(new PanelDetails("Starting Off", Collections.singletonList(talkToWillowToStart))); - - PanelDetails checkalPanel = new PanelDetails("Recruit Checkal", - Arrays.asList(recruitCheckal, talkToAtlas, flexCheckal)); - checkalPanel.setLockingStep(getCheckal); - allSteps.add(checkalPanel); - - PanelDetails marleyPanel = new PanelDetails("Recruit Marley", - Arrays.asList(talkToMarley, talkToCook, getIngredients, makeSandwich, feedMarley), cookedMeat, bread, knife); - marleyPanel.setLockingStep(getMarley); - allSteps.add(marleyPanel); - - PanelDetails burntofPanel = new PanelDetails("Recruit Burntof", - Arrays.asList(talkToBurntof, buyBeer, giveBeer, playRPS), coins); - burntofPanel.setLockingStep(getBurntof); - allSteps.add(burntofPanel); - - allSteps.add(new PanelDetails("Excavation!", Arrays.asList(goToDungeon, defeatGuardian, watchCutscene), combatGearOrPickaxe)); - - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting Off", List.of( + talkToWillowToStart + ))); + + sections.add(new PanelDetails("Recruit Checkal", List.of( + recruitCheckal, + talkToAtlas, + flexCheckal + ))); + + sections.add(new PanelDetails("Recruit Marley", List.of( + talkToMarley, + talkToCook, + getIngredients, + makeSandwich, + feedMarley + ), List.of( + cookedMeat, + bread, + knife + ))); + + sections.add(new PanelDetails("Recruit Burntof", List.of( + talkToBurntof, + buyBeer, + giveBeer, + playRPS + ), List.of( + coins + ))); + + sections.add(new PanelDetails("Excavation!", List.of( + goToDungeon, defeatGuardian, watchCutscene + ), List.of( + combatGearOrPickaxe + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/BeneathCursedSands.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/BeneathCursedSands.java index 7b36aedc0ea..83dd2522d65 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/BeneathCursedSands.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/BeneathCursedSands.java @@ -295,7 +295,7 @@ protected void setupRequirements() stoneTablet.setHighlightInInventory(true); chest = new ItemRequirement("Chest", ItemID.BCS_CHEST); chest.setHighlightInInventory(true); - chest.alsoCheckBank(questBank); + chest.alsoCheckBank(); scarabMould = new ItemRequirement("Scarab mould", ItemID.BCS_EMBLEM_MOULD); scarabEmblem = new ItemRequirement("Scarab emblem", ItemID.BCS_EMBLEM); scarabEmblem.setHighlightInInventory(true); @@ -343,7 +343,7 @@ public void setupConditions() hasReadStoneTablet = new VarbitRequirement(VarbitID.BCS_FOUND_MOULD, 2, Operation.GREATER_EQUAL); isRotatingScarab = new WidgetModelRequirement(750, 3, -1); - scarabRotatedDownwards = new VarbitRequirement(13849, 15); + scarabRotatedDownwards = new VarbitRequirement(VarbitID.BCS_EMBLEM_ROTATION, 15); scarabRotationQuickestRight = new VarbitRequirement(VarbitID.BCS_EMBLEM_ROTATION, 15, Operation.GREATER_EQUAL); firstLeverPulled = new ObjectCondition(ObjectID.BCS_TOMB_LEVER_ON, new WorldPoint(3439, 9225, 0)); @@ -352,14 +352,14 @@ public void setupConditions() shouldDestroyShadowRift = new NpcCondition(NpcID.BCS_CHAMPION_RIFT); inChemistryPuzzle = new WidgetModelRequirement(751, 3, -1); - chemistryValveLeftStepZero = new VarbitRequirement(13863, 0); - chemistryValveLeftStepOne = new VarbitRequirement(13863, 3); - chemistryValveLeftStepTwo = new VarbitRequirement(13863, 6); - chemistryValveLeftStepThree = new VarbitRequirement(13863, 9); - chemistryValveMiddleAtMaximum = new VarbitRequirement(13864, 45); - chemistryValveMiddleNearMax = new VarbitRequirement(13864, 42); - chemistryValveRightAtMaximum = new VarbitRequirement(13865, 45); - chemistryValveRightNearMax = new VarbitRequirement(13865, 42); + chemistryValveLeftStepZero = new VarbitRequirement(VarbitID.BCS_BURNER_1, 0); + chemistryValveLeftStepOne = new VarbitRequirement(VarbitID.BCS_BURNER_1, 3); + chemistryValveLeftStepTwo = new VarbitRequirement(VarbitID.BCS_BURNER_1, 6); + chemistryValveLeftStepThree = new VarbitRequirement(VarbitID.BCS_BURNER_1, 9); + chemistryValveMiddleAtMaximum = new VarbitRequirement(VarbitID.BCS_BURNER_2, 45); + chemistryValveMiddleNearMax = new VarbitRequirement(VarbitID.BCS_BURNER_2, 42); + chemistryValveRightAtMaximum = new VarbitRequirement(VarbitID.BCS_BURNER_3, 45); + chemistryValveRightNearMax = new VarbitRequirement(VarbitID.BCS_BURNER_3, 42); shouldFightMenaphiteShadow = new NpcCondition(NpcID.BCS_MENAPHITE_AKH_SHADOW); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/TombRiddle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/TombRiddle.java index ec3f327401c..9685ae86a35 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/TombRiddle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/beneathcursedsands/TombRiddle.java @@ -14,6 +14,7 @@ import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; @@ -93,10 +94,10 @@ protected void updateSteps() return; } - int currentNorthernEmblem = client.getVarbitValue(13862); - int currentCentreNorthEmblem = client.getVarbitValue(13861); - int currentCentreSouthEmblem = client.getVarbitValue(13860); - int currentSouthernEmblem = client.getVarbitValue(13859); + int currentNorthernEmblem = client.getVarbitValue(VarbitID.BCS_URN_4); + int currentCentreNorthEmblem = client.getVarbitValue(VarbitID.BCS_URN_3); + int currentCentreSouthEmblem = client.getVarbitValue(VarbitID.BCS_URN_2); + int currentSouthernEmblem = client.getVarbitValue(VarbitID.BCS_URN_1); if (currentNorthernEmblem != northernEmblem) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/BetweenARock.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/BetweenARock.java index c06dc596e2c..7ae78ddcd02 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/BetweenARock.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/BetweenARock.java @@ -50,6 +50,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -250,10 +251,10 @@ public void setupConditions() inDwarvenMine = new ZoneRequirement(dwarvenMine); inKhorvakRoom = new ZoneRequirement(khorvakRoom); - hasUsedGoldBar = new VarbitRequirement(301, 1); - shotGoldCannonball = new VarbitRequirement(313, 1); + hasUsedGoldBar = new VarbitRequirement(VarbitID.DWARFROCK_GOLD_CANNONBALL, 1); + shotGoldCannonball = new VarbitRequirement(VarbitID.DWARFROCK_FIRED_GOLD_CANNONBALL, 1); hasCannonball = new Conditions(LogicType.OR, goldCannonball, shotGoldCannonball); - hasSolvedSchematic = new VarbitRequirement(305, 1); + hasSolvedSchematic = new VarbitRequirement(VarbitID.DWARFROCK_SCHEMATICS_SOLVED, 1); inRealm = new ZoneRequirement(realm); avatarNearby = new Conditions(LogicType.OR, new NpcCondition(NpcID.DWARF_ROCK_AVATAR_MAGE), new NpcCondition(NpcID.DWARF_ROCK_AVATAR_MAGE_GREEN), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/PuzzleStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/PuzzleStep.java index 6466f73cdef..5e350da65ee 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/PuzzleStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/betweenarock/PuzzleStep.java @@ -211,7 +211,7 @@ public void makeWidgetOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) Widget widget = client.getWidget(InterfaceID.DWARF_ROCK_SCHEMATICS_CONTROL, entry.getKey()); if (widget != null) { - if (widget.getId() == 7471130) + if (widget.getId() == InterfaceID.DwarfRockSchematicsControl.DR_SELECT3) { widget.setOriginalWidth(15); widget.setOriginalHeight(15); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/biohazard/Biohazard.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/biohazard/Biohazard.java index 5a9a8ffaef5..ce4261b5425 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/biohazard/Biohazard.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/biohazard/Biohazard.java @@ -31,139 +31,175 @@ import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ObjectCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + public class Biohazard extends BasicQuestHelper { - //Items Required - ItemRequirement gasMask, birdFeed, birdCage, rottenApple, medicalGown, key, distillator, plagueSample, ethenea, liquidHoney, sulphuricBroline, - touchPaper, priestGownTop, priestGownBottom, priestGownBottomEquipped, priestGownTopEquipped, medicalGownEquipped, - birdCageHighlighted; - - //Items Recommended - ItemRequirement teleportVarrock, teleportArdougne, teleportRimmington, coins; - - Requirement inMournerBackyard, inWestArdougne, inMournerBuilding, upstairsInMournerBuilding, inVarrockSouthEast, - hasPriestSet, isUpstairsArdougneCastle, hasChemicals; - - QuestStep talkToElena, talkToJerico, getBirdFeed, getBirdFeed2, getPigeonCage, investigateWatchtower, clickPigeonCage, talkToOmartAgain, - talkToOmartToReturnToWest, talkToKilron, enterBackyardOfHeadquarters, pickupRottenApple, useRottenAppleOnCauldron, searchSarahsCupboard, - searchSarahsCupboard2, enterMournerHeadquarters, goUpstairsInMournerBuilding, killMourner, searchCrateForDistillator, - goBackDownstairsInMournersHeadquarters, talkToElenaWithDistillator, talkToTheChemist, goToVarrock, vinciVarrock, chancyVarrock, hopsVarrock, - talkToAsyff, talkToGuidor, returnToElenaAfterSampling, informTheKing, informTheKingGoUpstairs; - + // Required items + ItemRequirement gasMask; + + // Recommended items + ItemRequirement teleportVarrock; + ItemRequirement teleportArdougne; + ItemRequirement teleportRimmington; + ItemRequirement coins; + + // Mid-quest requirements + ItemRequirement birdFeed; + ItemRequirement birdCage; + ItemRequirement rottenApple; + ItemRequirement medicalGown; + ItemRequirement key; + ItemRequirement distillator; + ItemRequirement plagueSample; + ItemRequirement ethenea; + ItemRequirement liquidHoney; + ItemRequirement sulphuricBroline; + ItemRequirement touchPaper; + ItemRequirement coinsForPriestSet; + ItemRequirement priestGownTop; + ItemRequirement priestGownBottom; + ItemRequirement priestGownBottomEquipped; + ItemRequirement priestGownTopEquipped; + ItemRequirement medicalGownEquipped; + ItemRequirement birdCageHighlighted; + + // Zones + Zone westArdougne1; + Zone westArdougne2; + Zone westArdougne3; + Zone mournerBackyard; + Zone mournerBuilding1; + Zone mournerBuilding2; + Zone mournersBuildingUpstairs; + Zone varrockSouthEast; + Zone upstairsArdougneCastle; + + // Miscellaneous requirements + ZoneRequirement inWestArdougne; + ZoneRequirement inMournerBackyard; + + ZoneRequirement inMournerBuilding; + ZoneRequirement upstairsInMournerBuilding; + + ZoneRequirement inVarrockSouthEast; + ZoneRequirement isUpstairsArdougneCastle; + + VarbitRequirement hasNotReceivedFreePriestGownSet; + ItemRequirements hasPriestSet; + Conditions hasChemicals; + + // Steps + NpcStep talkToElena; + + NpcStep talkToJerico; + + ObjectStep getBirdFeed; + ItemStep getPigeonCage; + ObjectStep investigateWatchtower; + + DetailedQuestStep clickPigeonCage; + + NpcStep talkToOmartToEnterWestArdougne; + + NpcStep talkToKilron; + ObjectStep enterBackyardOfHeadquarters; + ItemStep pickupRottenApple; + DetailedQuestStep useRottenAppleOnCauldron; + + ObjectStep exitBackyardOfHeadquarters; + ObjectStep searchSarahsCupboard; + ObjectStep enterMournerHeadquarters; + ObjectStep goUpstairsInMournerBuilding; + NpcStep killMourner; + ObjectStep searchCrateForDistillator; + + ObjectStep goBackDownstairsInMournersHeadquarters; + NpcStep talkToElenaWithDistillator; + + NpcStep talkToTheChemist; + + DetailedQuestStep goToVarrock; GiveIngredientsToHelpersStep giveChemicals; + NpcStep vinciVarrock; + NpcStep chancyVarrock; + NpcStep hopsVarrock; + NpcStep talkToAsyff; + NpcStep talkToAsyffBuy; + NpcStep talkToGuidor; + + NpcStep returnToElenaAfterSampling; - //Zones - Zone westArdougne1, westArdougne2, westArdougne3, mournerBackyard, mournerBuilding1, mournerBuilding2, mournersBuildingUpstairs, varrockSouthEast, upstairsArdougneCastle; + NpcStep informTheKing; + ObjectStep informTheKingGoUpstairs; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToElena); - - steps.put(1, talkToJerico); - - ConditionalStep prepareADistraction = new ConditionalStep(this, getBirdFeed); - prepareADistraction.addStep(new Conditions(birdCage, birdFeed), investigateWatchtower); - prepareADistraction.addStep(birdFeed, getPigeonCage); - prepareADistraction.addStep(new ObjectCondition(ObjectID.JERICOSCUPBOARDOPEN), getBirdFeed2); - steps.put(2, prepareADistraction); - - ConditionalStep causeADistraction = new ConditionalStep(this, getPigeonCage); - causeADistraction.addStep(birdCage, clickPigeonCage); - steps.put(3, causeADistraction); - - steps.put(4, talkToOmartAgain); - - ConditionalStep poisonFood = new ConditionalStep(this, talkToOmartToReturnToWest); - poisonFood.addStep(new Conditions(inMournerBackyard, rottenApple), useRottenAppleOnCauldron); - poisonFood.addStep(inMournerBackyard, pickupRottenApple); - poisonFood.addStep(inWestArdougne, enterBackyardOfHeadquarters); - - steps.put(5, poisonFood); - - ConditionalStep infiltrateMourners = new ConditionalStep(this, talkToOmartToReturnToWest); - infiltrateMourners.addStep(new Conditions(key, upstairsInMournerBuilding), searchCrateForDistillator); - infiltrateMourners.addStep(upstairsInMournerBuilding, killMourner); - infiltrateMourners.addStep(inMournerBuilding, goUpstairsInMournerBuilding); - infiltrateMourners.addStep(new Conditions(inWestArdougne, medicalGown), enterMournerHeadquarters); - infiltrateMourners.addStep(new Conditions(inWestArdougne, new ObjectCondition(ObjectID.BIONURSESCUPBOARDOPEN)), searchSarahsCupboard2); - infiltrateMourners.addStep(inWestArdougne, searchSarahsCupboard); - - steps.put(6, infiltrateMourners); - - ConditionalStep returnToElenaWithDistillator = new ConditionalStep(this, talkToOmartToReturnToWest); - returnToElenaWithDistillator.addStep(new Conditions(upstairsInMournerBuilding, distillator), goBackDownstairsInMournersHeadquarters); - returnToElenaWithDistillator.addStep(new Conditions(distillator, inWestArdougne), talkToKilron); - returnToElenaWithDistillator.addStep(distillator, talkToElenaWithDistillator); - - returnToElenaWithDistillator.addStep(new Conditions(key, upstairsInMournerBuilding), searchCrateForDistillator); - returnToElenaWithDistillator.addStep(upstairsInMournerBuilding, killMourner); - returnToElenaWithDistillator.addStep(inMournerBuilding, goUpstairsInMournerBuilding); - returnToElenaWithDistillator.addStep(new Conditions(inWestArdougne, medicalGown), enterMournerHeadquarters); - returnToElenaWithDistillator.addStep(new Conditions(inWestArdougne, new ObjectCondition(ObjectID.BIONURSESCUPBOARDOPEN)), searchSarahsCupboard2); - returnToElenaWithDistillator.addStep(inWestArdougne, searchSarahsCupboard); - - steps.put(7, returnToElenaWithDistillator); - - steps.put(10, talkToTheChemist); - - ConditionalStep smuggleInChemicals = new ConditionalStep(this, goToVarrock); - smuggleInChemicals.addStep(new Conditions(inVarrockSouthEast, liquidHoney, ethenea, sulphuricBroline, hasPriestSet), talkToGuidor); - smuggleInChemicals.addStep(new Conditions(inVarrockSouthEast, liquidHoney, ethenea, sulphuricBroline), talkToAsyff); - smuggleInChemicals.addStep(new Conditions(inVarrockSouthEast, liquidHoney, ethenea), hopsVarrock); - smuggleInChemicals.addStep(new Conditions(inVarrockSouthEast, liquidHoney), vinciVarrock); - smuggleInChemicals.addStep(inVarrockSouthEast, chancyVarrock); - smuggleInChemicals.addStep(hasChemicals, giveChemicals); - - steps.put(12, smuggleInChemicals); - - steps.put(14, returnToElenaAfterSampling); - - ConditionalStep talkToTheKing = new ConditionalStep(this, informTheKingGoUpstairs); - talkToTheKing.addStep(isUpstairsArdougneCastle, informTheKing); - - steps.put(15, talkToTheKing); - // Finishing gives: 72: 0->17, 71: 0->4117, 70: 0->1 - return steps; + mournerBackyard = new Zone(new WorldPoint(2542, 3328, 0), new WorldPoint(2555, 3333, 0)); + westArdougne1 = new Zone(new WorldPoint(2460, 3279, 0), new WorldPoint(2556, 3334, 2)); + westArdougne2 = new Zone(new WorldPoint(2434, 3305, 0), new WorldPoint(2464, 3323, 2)); + westArdougne3 = new Zone(new WorldPoint(2510, 3265, 0), new WorldPoint(2556, 3280, 2)); + mournerBuilding1 = new Zone(new WorldPoint(2547, 3321, 0), new WorldPoint(2555, 3327, 0)); + mournerBuilding2 = new Zone(new WorldPoint(2542, 3324, 0), new WorldPoint(2546, 3327, 0)); + mournersBuildingUpstairs = new Zone(new WorldPoint(2542, 3321, 1), new WorldPoint(2555, 3327, 1)); + varrockSouthEast = new Zone(new WorldPoint(3265, 3376, 0), new WorldPoint(3287, 3407, 1)); + upstairsArdougneCastle = new Zone(new WorldPoint(2570, 3283, 1), new WorldPoint(2590, 3310, 1)); } @Override protected void setupRequirements() { + inWestArdougne = new ZoneRequirement(westArdougne1, westArdougne2, westArdougne3); + inMournerBackyard = new ZoneRequirement(mournerBackyard); + + inMournerBuilding = new ZoneRequirement(mournerBuilding1, mournerBuilding2); + upstairsInMournerBuilding = new ZoneRequirement(mournersBuildingUpstairs); + + inVarrockSouthEast = new ZoneRequirement(varrockSouthEast); + isUpstairsArdougneCastle = new ZoneRequirement(upstairsArdougneCastle); + gasMask = new ItemRequirement("Gas mask", ItemID.GASMASK, 1, true).isNotConsumed(); gasMask.setTooltip("You can get another from the cupboard in Edmond's house west of Elena's house."); - birdCage = new ItemRequirement("Pigeon cage", ItemID.PIGEONS); - birdCageHighlighted = new ItemRequirement("Pigeon cage", ItemID.PIGEONS); - birdCageHighlighted.setHighlightInInventory(true); + + teleportVarrock = new ItemRequirement("Teleport to Varrock", ItemID.POH_TABLET_VARROCKTELEPORT); + teleportArdougne = new ItemRequirement("Teleport to Ardougne", ItemID.POH_TABLET_ARDOUGNETELEPORT, 3); + teleportRimmington = new ItemRequirement("Teleport to Rimmington", ItemID.NZONE_TELETAB_RIMMINGTON); + coins = new ItemRequirement("Coins", ItemCollections.COINS, 30); + coins.setTooltip("For travelling from Ardougne to Rimmington."); + + coinsForPriestSet = new ItemRequirement("Coins", ItemCollections.COINS, 12); + coinsForPriestSet.setTooltip("For buying the Priest Gown set"); + birdFeed = new ItemRequirement("Bird feed", ItemID.BIRDFEED); + birdCage = new ItemRequirement("Pigeon cage", ItemID.PIGEONS); + birdCageHighlighted = birdCage.highlighted(); + rottenApple = new ItemRequirement("Rotten apple", ItemID.ROTTENAPPLES); rottenApple.setHighlightInInventory(true); medicalGown = new ItemRequirement("Medical gown", ItemID.DOCTOR_GOWN).isNotConsumed(); - medicalGownEquipped = new ItemRequirement("Medical gown", ItemID.DOCTOR_GOWN, 1, true); + medicalGownEquipped = medicalGown.equipped(); key = new ItemRequirement("Key", ItemID.MOURNERKEYTW); distillator = new ItemRequirement("Distillator", ItemID.DISTILLATOR); plagueSample = new ItemRequirement("Plague sample", ItemID.PLAGUESAMPLE); @@ -176,42 +212,17 @@ protected void setupRequirements() sulphuricBroline.setTooltip("You can get another from Elena in East Ardougne."); touchPaper = new ItemRequirement("Touch paper", ItemID.TOUCH_PAPER); touchPaper.setTooltip("You can get more from the Chemist in Rimmington."); + priestGownBottom = new ItemRequirement("Priest gown (bottom)", ItemID.PRIEST_ROBE).isNotConsumed(); priestGownTop = new ItemRequirement("Priest gown (top)", ItemID.PRIEST_GOWN).isNotConsumed(); priestGownBottomEquipped = priestGownBottom.equipped(); priestGownTopEquipped = priestGownTop.equipped(); - teleportVarrock = new ItemRequirement("Teleport to Varrock", ItemID.POH_TABLET_VARROCKTELEPORT); - teleportArdougne = new ItemRequirement("Teleport to Ardougne", ItemID.POH_TABLET_ARDOUGNETELEPORT, 3); - teleportRimmington = new ItemRequirement("Teleport to Rimmington", ItemID.NZONE_TELETAB_RIMMINGTON); - coins = new ItemRequirement("Coins", ItemCollections.COINS, 30); - } - @Override - protected void setupZones() - { - mournerBackyard = new Zone(new WorldPoint(2542, 3328, 0), new WorldPoint(2555, 3333, 0)); - westArdougne1 = new Zone(new WorldPoint(2460, 3279, 0), new WorldPoint(2556, 3334, 2)); - westArdougne2 = new Zone(new WorldPoint(2434, 3305, 0), new WorldPoint(2464, 3323, 2)); - westArdougne3 = new Zone(new WorldPoint(2510, 3265, 0), new WorldPoint(2556, 3280, 2)); - mournerBuilding1 = new Zone(new WorldPoint(2547, 3321, 0), new WorldPoint(2555, 3327, 0)); - mournerBuilding2 = new Zone(new WorldPoint(2542, 3324, 0), new WorldPoint(2546, 3327, 0)); - mournersBuildingUpstairs = new Zone(new WorldPoint(2542, 3321, 1), new WorldPoint(2555, 3327, 1)); - varrockSouthEast = new Zone(new WorldPoint(3265, 3376, 0), new WorldPoint(3287, 3407, 1)); - upstairsArdougneCastle = new Zone(new WorldPoint(2570, 3283, 1), new WorldPoint(2590, 3310, 1)); - } + hasChemicals = or(ethenea, liquidHoney, sulphuricBroline); - public void setupConditions() - { - inWestArdougne = new ZoneRequirement(westArdougne1, westArdougne2, westArdougne3); - inMournerBackyard = new ZoneRequirement(mournerBackyard); + hasNotReceivedFreePriestGownSet = new VarbitRequirement(VarbitID.BIOHAZARD_FREE_CLOTHES, 0); - inMournerBuilding = new ZoneRequirement(mournerBuilding1, mournerBuilding2); - upstairsInMournerBuilding = new ZoneRequirement(mournersBuildingUpstairs); - - hasChemicals = new Conditions(LogicType.OR, ethenea, liquidHoney, sulphuricBroline); - inVarrockSouthEast = new ZoneRequirement(varrockSouthEast); hasPriestSet = new ItemRequirements(priestGownBottom, priestGownTop); - isUpstairsArdougneCastle = new ZoneRequirement(upstairsArdougneCastle); } public void setupSteps() @@ -221,45 +232,42 @@ public void setupSteps() talkToJerico = new NpcStep(this, NpcID.JERICO, new WorldPoint(2612, 3324, 0), "Talk to Jerico in his house south of the northern Ardougne bank"); - getBirdFeed = new ObjectStep(this, ObjectID.JERICOSCUPBOARDSHUT, new WorldPoint(2612, 3326, 0), "Get birdfeed from the cupboard in Jerico's house."); - getBirdFeed2 = new ObjectStep(this, ObjectID.JERICOSCUPBOARDOPEN, new WorldPoint(2612, 3326, 0), "Get birdfeed from the cupboard in Jerico's house."); - - getBirdFeed.addSubSteps(getBirdFeed2); + getBirdFeed = new ObjectStep(this, ObjectID.JERICOSCUPBOARDSHUT, new WorldPoint(2612, 3326, 0), "Get bird feed from the cupboard in Jerico's house."); + getBirdFeed.addAlternateObjects(ObjectID.JERICOSCUPBOARDOPEN); - getPigeonCage = new DetailedQuestStep(this, new WorldPoint(2618, 3325, 0), "Get a pigeon cage from behind Jerico's house.", birdCage, birdFeed); + getPigeonCage = new ItemStep(this, new WorldPoint(2618, 3325, 0), "Get a pigeon cage from behind Jerico's house.", birdCage); investigateWatchtower = new ObjectStep(this, ObjectID.BIOWATCHTOWER_OP, new WorldPoint(2562, 3301, 0), "Investigate the watchtower near the entrance to West Ardougne.", birdFeed, birdCage); clickPigeonCage = new DetailedQuestStep(this, new WorldPoint(2562, 3300, 0), "Open the Pigeon cage next to the watchtower.", birdCageHighlighted); - talkToOmartAgain = new NpcStep(this, NpcID.OMART_VIS, new WorldPoint(2559, 3266, 0), "Talk to Omart to enter West Ardougne.", gasMask); - talkToOmartAgain.addDialogStep("Okay, lets do it."); - talkToOmartToReturnToWest = new NpcStep(this, NpcID.OMART_VIS, new WorldPoint(2559, 3266, 0), "Talk to Omart to return to West Ardougne"); - talkToOmartToReturnToWest.addDialogStep("Okay, lets do it."); - talkToOmartAgain.addSubSteps(talkToOmartToReturnToWest); + talkToOmartToEnterWestArdougne = new NpcStep(this, NpcID.OMART_VIS, new WorldPoint(2559, 3266, 0), "Talk to Omart, south of the watchtower, to enter West Ardougne.", gasMask); + talkToOmartToEnterWestArdougne.addDialogStep("Okay, lets do it."); + talkToOmartToEnterWestArdougne.addDialogStep("Okay, let's do it."); enterBackyardOfHeadquarters = new ObjectStep(this, ObjectID.MOURNERSTEWFENCE, new WorldPoint(2541, 3331, 0), "Squeeze through the fence to enter the Mourner's Headquarters yard in the north east of West Ardougne."); - pickupRottenApple = new DetailedQuestStep(this, new WorldPoint(2549, 3332, 0), "Pick up the rotten apple in the yard.", rottenApple); + pickupRottenApple = new ItemStep(this, new WorldPoint(2549, 3332, 0), "Pick up the rotten apple in the yard.", rottenApple); useRottenAppleOnCauldron = new ObjectStep(this, ObjectID.MOURNERCAULDRON, new WorldPoint(2543, 3332, 0), "Use the rotten apple on the cauldron.", rottenApple); useRottenAppleOnCauldron.addIcon(ItemID.ROTTENAPPLES); - searchSarahsCupboard = new ObjectStep(this, ObjectID.BIONURSESCUPBOARDSHUT, new WorldPoint(2518, 3276, 0), "Search the cupboard in Sarah's house south-west of the West Ardougne church."); - searchSarahsCupboard2 = new ObjectStep(this, ObjectID.BIONURSESCUPBOARDOPEN, new WorldPoint(2518, 3276, 0), "Search the cupboard in Sarah's house south-west of the West Ardougne church."); - searchSarahsCupboard.addSubSteps(searchSarahsCupboard2); + exitBackyardOfHeadquarters = new ObjectStep(this, ObjectID.MOURNERSTEWFENCE, new WorldPoint(2541, 3331, 0), "Search the cupboard in Sarah's house south-west of the West Ardougne church for a disguise."); + searchSarahsCupboard = new ObjectStep(this, ObjectID.BIONURSESCUPBOARDSHUT, new WorldPoint(2518, 3276, 0), "Search the cupboard in Sarah's house south-west of the West Ardougne church for a disguise."); + searchSarahsCupboard.addAlternateObjects(ObjectID.BIONURSESCUPBOARDOPEN); + searchSarahsCupboard.addSubSteps(exitBackyardOfHeadquarters); enterMournerHeadquarters = new ObjectStep(this, ObjectID.MOURNERSTEWDOOR, new WorldPoint(2551, 3320, 0), "Enter the Mourners' Headquarters whilst wearing the medical gown.", medicalGownEquipped); - goUpstairsInMournerBuilding = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2543, 3325, 0), "Go upstairs and kill the mourner there."); + goUpstairsInMournerBuilding = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2543, 3325, 0), "Go upstairs and kill the mourner."); killMourner = new NpcStep(this, NpcID.MOURNERSTEW2_VIS, new WorldPoint(2549, 3325, 1), "Kill the mourner here for a key to the caged area."); goUpstairsInMournerBuilding.addSubSteps(killMourner); searchCrateForDistillator = new ObjectStep(this, ObjectID.MOURNERCRATEUP, new WorldPoint(2554, 3327, 1), "Search the crate in the caged area for Elena's Distillator."); - goBackDownstairsInMournersHeadquarters = new ObjectStep(this, ObjectID.SPIRALSTAIRSTOP, new WorldPoint(2543, 3325, 1), "Return to Elena. Go back downstairs or teleport out."); + goBackDownstairsInMournersHeadquarters = new ObjectStep(this, ObjectID.SPIRALSTAIRSTOP, new WorldPoint(2543, 3325, 1), "Return to Elena. Go back downstairs or teleport out.", distillator); - talkToKilron = new NpcStep(this, NpcID.KILRON_VIS, new WorldPoint(2556, 3266, 0), "Return to Elena. Talk to Kilron to return back to East Ardougne."); + talkToKilron = new NpcStep(this, NpcID.KILRON_VIS, new WorldPoint(2556, 3266, 0), "Return to Elena. Talk to Kilron south-east of the West Ardougne church to return back to East Ardougne.", distillator); talkToKilron.addDialogStep("Yes I do."); - talkToElenaWithDistillator = new NpcStep(this, NpcID.ELENA2_VIS, new WorldPoint(2592, 3336, 0), "Return to Elena."); + talkToElenaWithDistillator = new NpcStep(this, NpcID.ELENA2_VIS, new WorldPoint(2592, 3336, 0), "Return to Elena.", distillator); talkToElenaWithDistillator.addSubSteps(goBackDownstairsInMournersHeadquarters, talkToKilron); talkToTheChemist = new NpcStep(this, NpcID.CHEMIST, new WorldPoint(2933, 3210, 0), @@ -275,6 +283,11 @@ public void setupSteps() talkToAsyff = new NpcStep(this, NpcID.TAILORP, new WorldPoint(3277, 3397, 0), "Talk to Asyff to get a free priest gown. You can only get the free set once."); talkToAsyff.addDialogStep("Do you have a spare Priest Gown?"); + talkToAsyffBuy = new NpcStep(this, NpcID.TAILORP, new WorldPoint(3277, 3397, 0), "Talk to Asyff and buy a priest gown set.", coinsForPriestSet); + talkToAsyffBuy.addDialogStep("Okay, let's see what you've got then."); + talkToAsyffBuy.addWidgetHighlight(WidgetHighlight.createShopItemHighlight(ItemID.PRIEST_GOWN)); + talkToAsyffBuy.addWidgetHighlight(WidgetHighlight.createShopItemHighlight(ItemID.PRIEST_ROBE)); + talkToAsyff.addSubSteps(talkToAsyffBuy); talkToGuidor = new NpcStep(this, NpcID.GUIDOR, new WorldPoint(3284, 3382, 0), "Talk to Guidor in his house to the south.", @@ -289,31 +302,106 @@ public void setupSteps() informTheKing.addSubSteps(informTheKingGoUpstairs); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToElena); + + steps.put(1, talkToJerico); + + var prepareADistraction = new ConditionalStep(this, investigateWatchtower); + prepareADistraction.addStep(not(birdFeed), getBirdFeed); + prepareADistraction.addStep(not(birdCage), getPigeonCage); + steps.put(2, prepareADistraction); + + var causeADistraction = new ConditionalStep(this, getPigeonCage); + causeADistraction.addStep(birdCage, clickPigeonCage); + steps.put(3, causeADistraction); + + steps.put(4, talkToOmartToEnterWestArdougne); + + var poisonFood = new ConditionalStep(this, talkToOmartToEnterWestArdougne); + poisonFood.addStep(and(inMournerBackyard, rottenApple), useRottenAppleOnCauldron); + poisonFood.addStep(inMournerBackyard, pickupRottenApple); + poisonFood.addStep(inWestArdougne, enterBackyardOfHeadquarters); + + steps.put(5, poisonFood); + + var infiltrateMourners = new ConditionalStep(this, talkToOmartToEnterWestArdougne); + infiltrateMourners.addStep(inMournerBackyard, exitBackyardOfHeadquarters); + infiltrateMourners.addStep(and(key, upstairsInMournerBuilding), searchCrateForDistillator); + infiltrateMourners.addStep(upstairsInMournerBuilding, killMourner); + infiltrateMourners.addStep(inMournerBuilding, goUpstairsInMournerBuilding); + infiltrateMourners.addStep(and(inWestArdougne, medicalGown), enterMournerHeadquarters); + infiltrateMourners.addStep(inWestArdougne, searchSarahsCupboard); + + steps.put(6, infiltrateMourners); + + var returnToElenaWithDistillator = new ConditionalStep(this, talkToOmartToEnterWestArdougne); + returnToElenaWithDistillator.addStep(and(upstairsInMournerBuilding, distillator), goBackDownstairsInMournersHeadquarters); + returnToElenaWithDistillator.addStep(and(distillator, inWestArdougne), talkToKilron); + returnToElenaWithDistillator.addStep(distillator, talkToElenaWithDistillator); + + returnToElenaWithDistillator.addStep(and(key, upstairsInMournerBuilding), searchCrateForDistillator); + returnToElenaWithDistillator.addStep(upstairsInMournerBuilding, killMourner); + returnToElenaWithDistillator.addStep(inMournerBuilding, goUpstairsInMournerBuilding); + returnToElenaWithDistillator.addStep(and(inWestArdougne, medicalGown), enterMournerHeadquarters); + returnToElenaWithDistillator.addStep(inWestArdougne, searchSarahsCupboard); + + steps.put(7, returnToElenaWithDistillator); + + steps.put(10, talkToTheChemist); + + var smuggleInChemicals = new ConditionalStep(this, goToVarrock); + smuggleInChemicals.addStep(and(inVarrockSouthEast, liquidHoney, ethenea, sulphuricBroline, hasPriestSet), talkToGuidor); + smuggleInChemicals.addStep(and(inVarrockSouthEast, liquidHoney, ethenea, sulphuricBroline, hasNotReceivedFreePriestGownSet), talkToAsyff); + smuggleInChemicals.addStep(and(inVarrockSouthEast, liquidHoney, ethenea, sulphuricBroline), talkToAsyffBuy); + smuggleInChemicals.addStep(and(inVarrockSouthEast, liquidHoney, ethenea), hopsVarrock); + smuggleInChemicals.addStep(and(inVarrockSouthEast, liquidHoney), vinciVarrock); + smuggleInChemicals.addStep(inVarrockSouthEast, chancyVarrock); + smuggleInChemicals.addStep(hasChemicals, giveChemicals); + steps.put(12, smuggleInChemicals); + + steps.put(14, returnToElenaAfterSampling); + + var talkToTheKing = new ConditionalStep(this, informTheKingGoUpstairs); + talkToTheKing.addStep(isUpstairsArdougneCastle, informTheKing); + + steps.put(15, talkToTheKing); + + return steps; + } + @Override public List getCombatRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add("Mourner (level 13)"); - return reqs; + return List.of( + "Mourner (level 13)" + ); } @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(gasMask); - return reqs; + return List.of( + gasMask + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(teleportArdougne); - reqs.add(teleportRimmington); - reqs.add(teleportVarrock); - reqs.add(coins); - return reqs; + return List.of( + teleportArdougne, + teleportRimmington, + teleportVarrock, + coins + ); } @Override @@ -325,27 +413,62 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.THIEVING, 1250)); + return List.of( + new ExperienceReward(Skill.THIEVING, 1250) + ); + } + + @Override + public List getUnlockRewards() + { + return List.of( + new UnlockReward("Full West Ardougne Access"), + new UnlockReward("Combat Training Camp Access") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Start the quest", Collections.singletonList(talkToElena), gasMask)); - allSteps.add(new PanelDetails("Getting back into West Ardougne", - Arrays.asList(talkToJerico, getBirdFeed, getPigeonCage, investigateWatchtower, clickPigeonCage, talkToOmartAgain))); - allSteps.add(new PanelDetails("Getting the Distillator", - enterBackyardOfHeadquarters, pickupRottenApple, useRottenAppleOnCauldron, searchSarahsCupboard, - enterMournerHeadquarters, goUpstairsInMournerBuilding, searchCrateForDistillator, talkToElenaWithDistillator)); + List sections = new ArrayList<>(); + + sections.add(new PanelDetails("Start the quest", List.of( + talkToElena + ), List.of( + gasMask + ))); + + sections.add(new PanelDetails("Getting back into West Ardougne", List.of( + talkToJerico, + getBirdFeed, + getPigeonCage, + investigateWatchtower, + clickPigeonCage, + talkToOmartToEnterWestArdougne + ))); + + sections.add(new PanelDetails("Getting the Distillator", List.of( + enterBackyardOfHeadquarters, + pickupRottenApple, + useRottenAppleOnCauldron, + searchSarahsCupboard, + enterMournerHeadquarters, + goUpstairsInMournerBuilding, + searchCrateForDistillator, + talkToElenaWithDistillator + ))); List testingSteps = QuestUtil.toArrayList(talkToTheChemist); testingSteps.addAll(giveChemicals.getDisplaySteps()); testingSteps.addAll(Arrays.asList(goToVarrock, talkToAsyff, talkToGuidor)); - allSteps.add(new PanelDetails("Testing the plague sample", testingSteps, plagueSample, liquidHoney, ethenea, sulphuricBroline, touchPaper)); + sections.add(new PanelDetails("Testing the plague sample", testingSteps, plagueSample, liquidHoney, ethenea, sulphuricBroline, touchPaper)); + + sections.add(new PanelDetails("Revealing the truth", List.of( + returnToElenaAfterSampling, + informTheKing + ))); - allSteps.add(new PanelDetails("Revealing the truth", returnToElenaAfterSampling, informTheKing)); - return allSteps; + return sections; } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/blackknightfortress/BlackKnightFortress.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/blackknightfortress/BlackKnightFortress.java index 53550d9f889..519d968d126 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/blackknightfortress/BlackKnightFortress.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/blackknightfortress/BlackKnightFortress.java @@ -5,104 +5,126 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestPointRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class BlackKnightFortress extends BasicQuestHelper { - //Items Required - ItemRequirement ironChainbody, cabbage, bronzeMed; - - //Items Recommended - ItemRequirement teleportFalador, armour, food; - - Requirement onTopOfFortress, inBasement, inSecretRoomGroundFloor, inSecretRoomFirstFloor, inSecretRoomSecondFloor, inCentralAreaFloor1, inMainEntrance, inWestRoomFloor1, - inEastRoomFloor0, inEastRoomFloor1, inEastRoomFloor2, inListeningRoom, inCabbageHoleRoom, inPathToCabbageRoom - , inEastTurret, inFaladorF1, inFaladorF2; - - Zone secretRoomFloor0, secretRoomFloor1, secretRoomFloor2, secretRoomFloor3, secretBasement, mainEntrance1, mainEntrance2, mainEntrance3, mainEntrance4, westFloor1, - eastRoom1Floor0, eastRoom2Floor0, listeningRoom1, listeningRoom2, eastRoomFloor2, centralArea1Floor1, centralArea2Floor1, centralArea3Floor1, - northPathToCabbageHole1, northPathToCabbageHole2, northPathToCabbageHole3, cabbageHoleRoom, eastRoom1Floor1, eastRoom2Floor1, eastRoom3Floor1, eastRoom4Floor1, - eastTurret, whiteKnightsCastleF1, whiteKnightsCastleF2; - - QuestStep speakToAmik, enterFortress, pushWall, climbUpLadder1, climbUpLadder2, climbUpLadder3, climbUpLadder4, climbUpLadder5, climbUpLadder6, - climbDownLadder1, climbDownLadder2, climbDownLadder3, climbDownLadder4, climbDownLadder5, climbDownLadder6, listenAtGrill, pushWall2, - returnToAmik, exitBasement, exitTopOfFortress, exitEastTurret, exitWestRoomFirstFloor, goBackDownFromCabbageZone, goUpLadderToCabbageZone; - QuestStep climbToWhiteKnightsCastleF1, climbToWhiteKnightsCastleF2, climbToWhiteKnightsCastleF1ToFinish, - climbToWhiteKnightsCastleF2ToFinish; - + // Required items + ItemRequirement ironChainbody; + ItemRequirement cabbage; + ItemRequirement bronzeMed; + + // Recommended items + ItemRequirement teleportFalador; + ItemRequirement armour; + ItemRequirement food; + + // Zones + Zone secretRoomFloor0; + Zone secretRoomFloor1; + Zone secretRoomFloor2; + Zone secretRoomFloor3; + Zone secretBasement; + Zone mainEntrance1; + Zone mainEntrance2; + Zone mainEntrance3; + Zone mainEntrance4; + Zone westFloor1; + Zone eastRoom1Floor0; + Zone eastRoom2Floor0; + Zone listeningRoom1; + Zone listeningRoom2; + Zone eastRoomFloor2; + Zone centralArea1Floor1; + Zone centralArea2Floor1; + Zone centralArea3Floor1; + Zone northPathToCabbageHole1; + Zone northPathToCabbageHole2; + Zone northPathToCabbageHole3; + Zone cabbageHoleRoom; + Zone eastRoom1Floor1; + Zone eastRoom2Floor1; + Zone eastRoom3Floor1; + Zone eastRoom4Floor1; + Zone eastTurret; + Zone whiteKnightsCastleF1; + Zone whiteKnightsCastleF2; + + // Miscellaneous requirements + ZoneRequirement onTopOfFortress; + ZoneRequirement inBasement; + ZoneRequirement inSecretRoomGroundFloor; + ZoneRequirement inSecretRoomFirstFloor; + ZoneRequirement inSecretRoomSecondFloor; + ZoneRequirement inCentralAreaFloor1; + ZoneRequirement inMainEntrance; + ZoneRequirement inWestRoomFloor1; + ZoneRequirement inEastRoomFloor0; + ZoneRequirement inEastRoomFloor1; + ZoneRequirement inEastRoomFloor2; + ZoneRequirement inListeningRoom; + ZoneRequirement inCabbageHoleRoom; + ZoneRequirement inPathToCabbageRoom; + ZoneRequirement inEastTurret; + ZoneRequirement inFaladorF1; + ZoneRequirement inFaladorF2; + + // Steps + ObjectStep climbToWhiteKnightsCastleF1; + ObjectStep climbToWhiteKnightsCastleF2; + NpcStep speakToAmik; + + ObjectStep climbDownToWhiteKnightsCastleF1; + ObjectStep climbDownToWhiteKnightsCastleF0; + ObjectStep enterFortress; + ObjectStep pushWall; + ObjectStep climbUpLadder1; + ObjectStep climbUpLadder2; + ObjectStep climbDownLadder3; + ObjectStep climbUpLadder4; + ObjectStep climbDownLadder5; + ObjectStep climbDownLadder6; + ObjectStep listenAtGrill; + + ObjectStep climbUpLadder6; + ObjectStep climbUpLadder5; + ObjectStep climbDownLadder4; + ObjectStep climbUpLadder3; + ObjectStep climbDownLadder2; + ObjectStep climbDownLadder1; + ObjectStep goUpLadderToCabbageZone; + ObjectStep pushWall2; ObjectStep useCabbageOnHole; - @Override - public Map loadSteps() - { - Map steps = new HashMap<>(); - initializeRequirements(); - setupConditions(); - setupSteps(); - - ConditionalStep goStartQuest = new ConditionalStep(this, climbToWhiteKnightsCastleF1); - goStartQuest.addStep(inFaladorF2, speakToAmik); - goStartQuest.addStep(inFaladorF1, climbToWhiteKnightsCastleF2); - steps.put(0, goStartQuest); - - ConditionalStep infiltrateTheFortress = new ConditionalStep(this, enterFortress); - infiltrateTheFortress.addStep(inListeningRoom, listenAtGrill); - infiltrateTheFortress.addStep(inEastRoomFloor1, climbDownLadder6); - infiltrateTheFortress.addStep(inEastRoomFloor2, climbDownLadder5); - infiltrateTheFortress.addStep(inCentralAreaFloor1, climbUpLadder4); - infiltrateTheFortress.addStep(inSecretRoomSecondFloor, climbDownLadder3); - infiltrateTheFortress.addStep(inSecretRoomFirstFloor, climbUpLadder2); - infiltrateTheFortress.addStep(inSecretRoomGroundFloor, climbUpLadder1); - infiltrateTheFortress.addStep(new Conditions(false, LogicType.OR, inMainEntrance, inEastRoomFloor0), pushWall); - infiltrateTheFortress.addStep(inWestRoomFloor1, exitWestRoomFirstFloor); - infiltrateTheFortress.addStep(inBasement, exitBasement); - infiltrateTheFortress.addStep(onTopOfFortress, exitTopOfFortress); - infiltrateTheFortress.addStep(inEastTurret, exitEastTurret); - infiltrateTheFortress.addStep(new Conditions(false, LogicType.OR, inCabbageHoleRoom, inPathToCabbageRoom), goBackDownFromCabbageZone); - - steps.put(1, infiltrateTheFortress); - - ConditionalStep sabotageThePotion = new ConditionalStep(this, enterFortress); - sabotageThePotion.addStep(new Conditions(false, LogicType.OR, inSecretRoomGroundFloor, inMainEntrance, inEastRoomFloor0), goUpLadderToCabbageZone); - sabotageThePotion.addStep(inCabbageHoleRoom, useCabbageOnHole); - sabotageThePotion.addStep(inPathToCabbageRoom, pushWall2); - sabotageThePotion.addStep(inSecretRoomFirstFloor, climbDownLadder1); - sabotageThePotion.addStep(inSecretRoomSecondFloor, climbDownLadder2); - sabotageThePotion.addStep(inCentralAreaFloor1, climbUpLadder3); - sabotageThePotion.addStep(inEastRoomFloor2, climbDownLadder4); - sabotageThePotion.addStep(inEastRoomFloor1, climbUpLadder5); - sabotageThePotion.addStep(inListeningRoom, climbUpLadder6); - sabotageThePotion.addStep(inWestRoomFloor1, exitWestRoomFirstFloor); - sabotageThePotion.addStep(inBasement, exitBasement); - sabotageThePotion.addStep(onTopOfFortress, exitTopOfFortress); - sabotageThePotion.addStep(inEastTurret, exitEastTurret); - - steps.put(2, sabotageThePotion); + ObjectStep climbToWhiteKnightsCastleF1ToFinish; + ObjectStep climbToWhiteKnightsCastleF2ToFinish; + NpcStep returnToAmik; - ConditionalStep goFinishQuest = new ConditionalStep(this, climbToWhiteKnightsCastleF1ToFinish); - goFinishQuest.addStep(inFaladorF2, returnToAmik); - goFinishQuest.addStep(inFaladorF1, climbToWhiteKnightsCastleF2ToFinish); - steps.put(3, goFinishQuest); - - return steps; - } + ObjectStep exitBasement; + ObjectStep exitTopOfFortress; + ObjectStep exitEastTurret; + ObjectStep exitWestRoomFirstFloor; + ObjectStep goBackDownFromCabbageZone; @Override protected void setupZones() @@ -162,10 +184,7 @@ protected void setupRequirements() armour = new ItemRequirement("Armour", -1, -1).isNotConsumed(); armour.setDisplayItemId(BankSlotIcons.getArmour()); food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); - } - private void setupConditions() - { inFaladorF1 = new ZoneRequirement(whiteKnightsCastleF1); inFaladorF2 = new ZoneRequirement(whiteKnightsCastleF2); onTopOfFortress = new ZoneRequirement(secretRoomFloor3); @@ -196,12 +215,17 @@ private void setupSteps() "Speak to Sir Amik Varze on the 2nd floor of Falador Castle."); speakToAmik.addDialogStep("I seek a quest!"); speakToAmik.addDialogStep("I laugh in the face of danger!"); - speakToAmik.addDialogStep("Ok, I'll do my best."); + speakToAmik.addDialogStep("Yes."); speakToAmik.addSubSteps(climbToWhiteKnightsCastleF1, climbToWhiteKnightsCastleF2); /* Path to grill */ + climbDownToWhiteKnightsCastleF1 = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRSTOP, new WorldPoint(2960, 3339, 2), + "Enter the Black Knights' Fortress. Be prepared for multiple level 33 Black Knights to attack you.", ironChainbody, bronzeMed, cabbage); + climbDownToWhiteKnightsCastleF0 = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRSTOP, new WorldPoint(2955, 3338, 1), + "Enter the Black Knights' Fortress. Be prepared for multiple level 33 Black Knights to attack you.", ironChainbody, bronzeMed, cabbage); enterFortress = new ObjectStep(this, ObjectID.BKFORTRESSDOOR1, new WorldPoint(3016, 3514, 0), "Enter the Black Knights' Fortress. Be prepared for multiple level 33 Black Knights to attack you.", ironChainbody, bronzeMed, cabbage); + enterFortress.addSubSteps(climbDownToWhiteKnightsCastleF1, climbDownToWhiteKnightsCastleF0); pushWall = new ObjectStep(this, ObjectID.BKSECRETDOOR, new WorldPoint(3016, 3517, 0), "Push the wall to enter a secret room."); climbUpLadder1 = new ObjectStep(this, ObjectID.DK_LADDER, new WorldPoint(3015, 3519, 0), "Climb up the ladder."); @@ -235,56 +259,130 @@ private void setupSteps() "Go into the east room and climb the ladder there. When trying to go through the door to the room, you'll have to go through some dialog. Select option 2.", cabbage); goUpLadderToCabbageZone.addDialogStep("I don't care. I'm going in anyway."); pushWall2 = new ObjectStep(this, ObjectID.BKSECRETDOOR, new WorldPoint(3030, 3510, 1), - "Push the wall to enter the storage room", cabbage); + "Push the wall to the south-east to enter the storage room", cabbage); useCabbageOnHole = new ObjectStep(this, ObjectID.BLACKKNIGHTHOLE, new WorldPoint(3031, 3507, 1), - "USE the cabbage on the hole here. Be careful not to eat it.", cabbage.highlighted()); + "USE the cabbage on the hole. Be careful not to eat it.", cabbage.highlighted()); useCabbageOnHole.addIcon(ItemID.CABBAGE); - goBackDownFromCabbageZone = new ObjectStep(this, ObjectID.DK_MEETING_LADDERTOP, new WorldPoint(3022, 3518, 1), - "Climb back down the ladder to continue."); + climbToWhiteKnightsCastleF1ToFinish = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRS, new WorldPoint(2955, 3339, 0), "Return to Sir Amik Varze in Falador Castle to complete the quest."); + climbToWhiteKnightsCastleF1ToFinish.addTeleport(teleportFalador); + climbToWhiteKnightsCastleF2ToFinish = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRS, new WorldPoint(2961, 3339, 1), "Return to Sir Amik Varze in Falador Castle to complete the quest."); + + returnToAmik = new NpcStep(this, NpcID.SIR_AMIK_VARZE, new WorldPoint(2959, 3339, 2), + "Return to Sir Amik Varze in Falador Castle to complete the quest."); + returnToAmik.addSubSteps(climbToWhiteKnightsCastleF1ToFinish, climbToWhiteKnightsCastleF2ToFinish); + + // Recovery steps inside the Black Knights' Fortress + goBackDownFromCabbageZone = new ObjectStep(this, ObjectID.DK_MEETING_LADDERTOP, new WorldPoint(3022, 3518, 1), "Climb back down the ladder to continue."); exitEastTurret = new ObjectStep(this, ObjectID.DK_SPIRALSTAIRSTOP, new WorldPoint(3029, 3507, 3), "Go back downstairs to continue."); exitBasement = new ObjectStep(this, ObjectID.KR_BKF_BASEMENT_LADDER, new WorldPoint(1867, 4244, 0), "Leave the basement to continue."); exitTopOfFortress = new ObjectStep(this, ObjectID.DK_SPIRALSTAIRSTOP, new WorldPoint(3010, 3516, 3), "Leave the basement to continue."); exitWestRoomFirstFloor = new ObjectStep(this, ObjectID.DK_SPIRALSTAIRSTOP, new WorldPoint(3011, 3515, 1), "Go back downstairs to continue"); + enterFortress.addSubSteps(goBackDownFromCabbageZone, exitEastTurret, exitBasement, exitTopOfFortress, exitWestRoomFirstFloor); + } - climbToWhiteKnightsCastleF1ToFinish = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRS, new WorldPoint(2955, 3339, - 0), - "Return to Sir Amik Varze in Falador Castle to complete the quest."); - climbToWhiteKnightsCastleF2ToFinish = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRS, new WorldPoint(2961, 3339, - 1), - "Return to Sir Amik Varze in Falador Castle to complete the quest."); + @Override + public Map loadSteps() + { + var steps = new HashMap(); - returnToAmik = new NpcStep(this, NpcID.SIR_AMIK_VARZE, new WorldPoint(2959, 3339, 2), - "Return to Sir Amik Varze in Falador Castle to complete the quest."); - returnToAmik.addSubSteps(climbToWhiteKnightsCastleF1ToFinish, climbToWhiteKnightsCastleF2ToFinish); + initializeRequirements(); + setupSteps(); + + var goStartQuest = new ConditionalStep(this, climbToWhiteKnightsCastleF1); + goStartQuest.addStep(inFaladorF2, speakToAmik); + goStartQuest.addStep(inFaladorF1, climbToWhiteKnightsCastleF2); + steps.put(0, goStartQuest); + + var infiltrateTheFortress = new ConditionalStep(this, enterFortress); + infiltrateTheFortress.addStep(inFaladorF2, climbDownToWhiteKnightsCastleF1); + infiltrateTheFortress.addStep(inFaladorF1, climbDownToWhiteKnightsCastleF0); + infiltrateTheFortress.addStep(inListeningRoom, listenAtGrill); + infiltrateTheFortress.addStep(inEastRoomFloor1, climbDownLadder6); + infiltrateTheFortress.addStep(inEastRoomFloor2, climbDownLadder5); + infiltrateTheFortress.addStep(inCentralAreaFloor1, climbUpLadder4); + infiltrateTheFortress.addStep(inSecretRoomSecondFloor, climbDownLadder3); + infiltrateTheFortress.addStep(inSecretRoomFirstFloor, climbUpLadder2); + infiltrateTheFortress.addStep(inSecretRoomGroundFloor, climbUpLadder1); + infiltrateTheFortress.addStep(or(inMainEntrance, inEastRoomFloor0), pushWall); + infiltrateTheFortress.addStep(inWestRoomFloor1, exitWestRoomFirstFloor); + infiltrateTheFortress.addStep(inBasement, exitBasement); + infiltrateTheFortress.addStep(onTopOfFortress, exitTopOfFortress); + infiltrateTheFortress.addStep(inEastTurret, exitEastTurret); + infiltrateTheFortress.addStep(or(inCabbageHoleRoom, inPathToCabbageRoom), goBackDownFromCabbageZone); + + steps.put(1, infiltrateTheFortress); + + var pushWall3 = new ObjectStep(this, ObjectID.BKSECRETDOOR, new WorldPoint(3016, 3517, 0), "Go into the east room and climb the ladder there. When trying to go through the door to the room, you'll have to go through some dialog. Select option 2.", cabbage); + goUpLadderToCabbageZone.addSubSteps(pushWall3); + + var watchCutscene = new DetailedQuestStep(this, "Watch the cutscene."); + useCabbageOnHole.addSubSteps(watchCutscene); + var inCabbageCutscene = and(new ZoneRequirement(new WorldPoint(3017, 3497, 0)), new VarbitRequirement(VarbitID.CUTSCENE_STATUS, 1)); + + var sabotageThePotion = new ConditionalStep(this, enterFortress); + sabotageThePotion.addStep(inSecretRoomGroundFloor, pushWall3); + sabotageThePotion.addStep(or(inSecretRoomGroundFloor, inMainEntrance, inEastRoomFloor0), goUpLadderToCabbageZone); + sabotageThePotion.addStep(inCabbageCutscene, watchCutscene); + sabotageThePotion.addStep(inCabbageHoleRoom, useCabbageOnHole); + sabotageThePotion.addStep(inPathToCabbageRoom, pushWall2); + sabotageThePotion.addStep(inSecretRoomFirstFloor, climbDownLadder1); + sabotageThePotion.addStep(inSecretRoomFirstFloor, climbDownLadder1); + sabotageThePotion.addStep(inSecretRoomSecondFloor, climbDownLadder2); + sabotageThePotion.addStep(inCentralAreaFloor1, climbUpLadder3); + sabotageThePotion.addStep(inEastRoomFloor2, climbDownLadder4); + sabotageThePotion.addStep(inEastRoomFloor1, climbUpLadder5); + sabotageThePotion.addStep(inListeningRoom, climbUpLadder6); + sabotageThePotion.addStep(inWestRoomFloor1, exitWestRoomFirstFloor); + sabotageThePotion.addStep(inBasement, exitBasement); + sabotageThePotion.addStep(onTopOfFortress, exitTopOfFortress); + sabotageThePotion.addStep(inEastTurret, exitEastTurret); + + steps.put(2, sabotageThePotion); + + var goFinishQuest = new ConditionalStep(this, climbToWhiteKnightsCastleF1ToFinish); + goFinishQuest.addStep(inFaladorF2, returnToAmik); + goFinishQuest.addStep(inFaladorF1, climbToWhiteKnightsCastleF2ToFinish); + steps.put(3, goFinishQuest); + + return steps; } @Override - public List getItemRequirements() + public List getGeneralRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(bronzeMed); - reqs.add(ironChainbody); - reqs.add(cabbage); + return List.of( + new QuestPointRequirement(12) + ); + } + - return reqs; + @Override + public List getItemRequirements() + { + return List.of( + bronzeMed, + ironChainbody, + cabbage + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(teleportFalador); - reqs.add(food); - reqs.add(armour); - - return reqs; + return List.of( + teleportFalador, + food, + armour + ); } @Override public List getCombatRequirements() { - return Collections.singletonList("Able to survive being attacked by multiple level 33 Black Knights"); + return List.of( + "Able to survive being attacked by multiple level 33 Black Knights" + ); } @Override @@ -296,29 +394,52 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Coins", ItemID.COINS, 2500)); + return List.of( + new ItemReward("Coins", ItemID.COINS, 2500) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - - allSteps.add(new PanelDetails("Talk to Sir Amik Varze", Collections.singletonList(speakToAmik))); - allSteps.add(new PanelDetails("Infiltrate the fortress", - Arrays.asList(enterFortress, pushWall, climbUpLadder1, climbUpLadder2, climbDownLadder3, - climbUpLadder4, climbDownLadder5, climbDownLadder6, listenAtGrill), - bronzeMed, ironChainbody, cabbage)); - allSteps.add(new PanelDetails("Sabotage the potion", - Arrays.asList(climbUpLadder6, climbUpLadder5, climbDownLadder4, climbUpLadder3, climbDownLadder2, climbDownLadder1, - goUpLadderToCabbageZone, pushWall2, useCabbageOnHole))); - allSteps.add(new PanelDetails("Return to Sir Amik Varze", Collections.singletonList(returnToAmik))); - return allSteps; - } - - @Override - public List getGeneralRequirements() - { - return Collections.singletonList(new QuestPointRequirement(12)); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Talk to Sir Amik Varze", List.of( + speakToAmik + ))); + + sections.add(new PanelDetails("Infiltrate the fortress", List.of( + enterFortress, + pushWall, + climbUpLadder1, + climbUpLadder2, + climbDownLadder3, + climbUpLadder4, + climbDownLadder5, + climbDownLadder6, + listenAtGrill + ), List.of( + bronzeMed, + ironChainbody, + cabbage + ))); + + sections.add(new PanelDetails("Sabotage the potion", List.of( + climbUpLadder6, + climbUpLadder5, + climbDownLadder4, + climbUpLadder3, + climbDownLadder2, + climbDownLadder1, + goUpLadderToCabbageZone, + pushWall2, + useCabbageOnHole + ))); + + sections.add(new PanelDetails("Return to Sir Amik Varze", List.of( + returnToAmik + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/bonevoyage/BoneVoyage.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/bonevoyage/BoneVoyage.java index 5c6eefca4df..90b3cefaca5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/bonevoyage/BoneVoyage.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/bonevoyage/BoneVoyage.java @@ -279,9 +279,8 @@ public List getItemRecommended() @Override public List getGeneralRequirements() { - final int KUDOS_VARBIT = 3637; ArrayList req = new ArrayList<>(); - req.add(new VarbitRequirement(KUDOS_VARBIT, Operation.GREATER_EQUAL, 100, "100 Kudos")); + req.add(new VarbitRequirement(VarbitID.VM_KUDOS, Operation.GREATER_EQUAL, 100, "100 Kudos")); req.add(new QuestRequirement(QuestHelperQuest.THE_DIG_SITE, QuestState.FINISHED)); return req; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cabinfever/CabinFever.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cabinfever/CabinFever.java index fc811f4e24e..60a3399bc29 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cabinfever/CabinFever.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cabinfever/CabinFever.java @@ -49,6 +49,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -411,38 +412,38 @@ public void setupConditions() onEnemySail = new ZoneRequirement(enemySail); onEnemyBoat = new ZoneRequirement(enemyBoatF0, enemyBoatF1, enemyBoatF2, enemySail); - hasSetSail = new VarbitRequirement(1741, 1); + hasSetSail = new VarbitRequirement(VarbitID.FEVER_CANNON, 1); - addedFuse = new VarbitRequirement(1756, 2); + addedFuse = new VarbitRequirement(VarbitID.FEVER_GUNPOWDER_BARREL, 2); hasFuseOrAdded = new Conditions(LogicType.OR, fuse1, addedFuse); - explodedBarrel = new VarbitRequirement(1756, 1); + explodedBarrel = new VarbitRequirement(VarbitID.FEVER_GUNPOWDER_BARREL, 1); // 1740 1 if swinging - planked1 = new VarbitRequirement(1751, 1); - planked2 = new VarbitRequirement(1757, 1); - planked3 = new VarbitRequirement(1758, 1); - pasted1 = new VarbitRequirement(1751, 2); - pasted2 = new VarbitRequirement(1757, 2); - pasted3 = new VarbitRequirement(1758, 2); + planked1 = new VarbitRequirement(VarbitID.FEVER_HOLE_1, 1); + planked2 = new VarbitRequirement(VarbitID.FEVER_HOLE_2, 1); + planked3 = new VarbitRequirement(VarbitID.FEVER_HOLE_3, 1); + pasted1 = new VarbitRequirement(VarbitID.FEVER_HOLE_1, 2); + pasted2 = new VarbitRequirement(VarbitID.FEVER_HOLE_2, 2); + pasted3 = new VarbitRequirement(VarbitID.FEVER_HOLE_3, 2); - hasPlanked1 = new VarbitRequirement(1759, 1); - hasPlanked2 = new VarbitRequirement(1759, 2); - hasPlanked3 = new VarbitRequirement(1759, 3); + hasPlanked1 = new VarbitRequirement(VarbitID.FEVER_HOLES_PATCHED, 1); + hasPlanked2 = new VarbitRequirement(VarbitID.FEVER_HOLES_PATCHED, 2); + hasPlanked3 = new VarbitRequirement(VarbitID.FEVER_HOLES_PATCHED, 3); - hasRepaired1 = new VarbitRequirement(1760, 1); - hasRepaired2 = new VarbitRequirement(1760, 2); - hasRepaired3 = new VarbitRequirement(1760, 3); + hasRepaired1 = new VarbitRequirement(VarbitID.FEVER_HOLES_PROOFED, 1); + hasRepaired2 = new VarbitRequirement(VarbitID.FEVER_HOLES_PROOFED, 2); + hasRepaired3 = new VarbitRequirement(VarbitID.FEVER_HOLES_PROOFED, 3); - lootedAll = new Conditions(new VarbitRequirement(1753, 1), new VarbitRequirement(1754, 1), new VarbitRequirement(1755, 1)); + lootedAll = new Conditions(new VarbitRequirement(VarbitID.FEVER_CRATE, 1), new VarbitRequirement(VarbitID.FEVER_CHEST, 1), new VarbitRequirement(VarbitID.FEVER_BARREL, 1)); - cannonBroken = new VarbitRequirement(1741, 1); - addedPowder = new VarbitRequirement(1742, 1); - usedRamrod = new VarbitRequirement(1743, 1); - usedCanister = new VarbitRequirement(1744, 2); - usedBalls = new VarbitRequirement(1744, 1); - usedFuse = new VarbitRequirement(1741, 3); - firedCannon = new VarbitRequirement(1746, 1); + cannonBroken = new VarbitRequirement(VarbitID.FEVER_CANNON, 1); + addedPowder = new VarbitRequirement(VarbitID.FEVER_CANNON_POWDER, 1); + usedRamrod = new VarbitRequirement(VarbitID.FEVER_CANNON_TAMP, 1); + usedCanister = new VarbitRequirement(VarbitID.FEVER_CANNON_AMMO, 2); + usedBalls = new VarbitRequirement(VarbitID.FEVER_CANNON_AMMO, 1); + usedFuse = new VarbitRequirement(VarbitID.FEVER_CANNON, 3); + firedCannon = new VarbitRequirement(VarbitID.FEVER_CANNON_CLEAN, 1); // SHOTS CAN FAIL @@ -452,7 +453,7 @@ public void setupConditions() // Third succesful shot: // 1750 2->3 - canisterInWrong = new VarbitRequirement(1747, 1); + canisterInWrong = new VarbitRequirement(VarbitID.FEVER_CANNON_GONNA_BLOW, 1); // 1752 = num plunder stashed } @@ -544,7 +545,7 @@ public void setupSteps() useRopeOnSailToLoot = new ObjectStep(this, ObjectID.FEVER_SAIL1_HOISTEDL_CLIMB, new WorldPoint(1817, 4830, 2), "Use a rope on the hoisted sail.", ropeHighlight); useRopeOnSailToLoot.addIcon(ItemID.ROPE); - lootEnemyShip = new ObjectStep(this, ObjectID.FEVER_MULTI_CHEST, "Plunder the chest, loot the crate and ransack the barrel for 10 plunder.", loot10); + lootEnemyShip = new ObjectStep(this, ObjectID.FEVER_MULTI_CHEST, "Plunder the chest, loot the crate and ransack the barrel for 10 plunder. Switch world after looting to make plunder respawn instantly.", loot10); lootEnemyShip.addAlternateObjects(ObjectID.FEVER_MULTI_CRATE, ObjectID.FEVER_MULTI_BARREL); hopWorld = new DetailedQuestStep(this, "Hop worlds so that the chest resets."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/childrenofthesun/ChildrenOfTheSun.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/childrenofthesun/ChildrenOfTheSun.java index 9c28e33328c..ecd69d4c0bd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/childrenofthesun/ChildrenOfTheSun.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/childrenofthesun/ChildrenOfTheSun.java @@ -27,7 +27,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -38,6 +37,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -46,75 +46,67 @@ public class ChildrenOfTheSun extends BasicQuestHelper { - DetailedQuestStep talkToAlina, followGuard, attemptToEnterHouse, talkToTobyn, - reportBackToTobyn, goUpVarrockF0ToF1, goUpVarrockF1toF2, finishQuest; + final int GUARD_1_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_1; + final int GUARD_2_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_2; + final int GUARD_3_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_3; + final int GUARD_4_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_4; + final int WRONG_GUARD_1_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_5; + final int WRONG_GUARD_2_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_6; + final int WRONG_GUARD_3_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_7; + final int WRONG_GUARD_4_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_8; + final int WRONG_GUARD_5_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_9; + final int WRONG_GUARD_6_CHANGE_VARBIT = VarbitID.VMQ1_GUARD_10; - PuzzleWrapperStep followGuardPuzzleWrapper, markGuard1, markGuard2, markGuard3, markGuard4, unmarkWrongGuard1, unmarkWrongGuard2, unmarkWrongGuard3, unmarkWrongGuard4, - unmarkWrongGuard5, unmarkWrongGuard6; + // Zones + Zone castleF1; + Zone castleF2; - Zone castleF1, castleF2; + // Miscellaneous requirements + Requirement isFollowing; + Requirement markedGuard1; + Requirement markedGuard2; + Requirement markedGuard3; + Requirement markedGuard4; + Requirement markedWrongGuard1; + Requirement markedWrongGuard2; + Requirement markedWrongGuard3; + Requirement markedWrongGuard4; + Requirement markedWrongGuard5; + Requirement markedWrongGuard6; + Requirement inCastleF1; + Requirement inCastleF2; - Requirement isFollowing, markedGuard1, markedGuard2, markedGuard3, markedGuard4, markedWrongGuard1, - markedWrongGuard2, markedWrongGuard3, markedWrongGuard4, markedWrongGuard5, markedWrongGuard6, inCastleF1, inCastleF2; - - final int GUARD_1_CHANGE_VARBIT = 9633; - final int GUARD_2_CHANGE_VARBIT = 9634; - final int GUARD_3_CHANGE_VARBIT = 9635; - final int GUARD_4_CHANGE_VARBIT = 9636; - final int WRONG_GUARD_1_CHANGE_VARBIT = 9637; - final int WRONG_GUARD_2_CHANGE_VARBIT = 9640; - final int WRONG_GUARD_3_CHANGE_VARBIT = 9641; - final int WRONG_GUARD_4_CHANGE_VARBIT = 9642; - final int WRONG_GUARD_5_CHANGE_VARBIT = 9643; - final int WRONG_GUARD_6_CHANGE_VARBIT = 9644; + // Steps + DetailedQuestStep talkToAlina; + DetailedQuestStep followGuard; + DetailedQuestStep attemptToEnterHouse; + DetailedQuestStep talkToTobyn; + DetailedQuestStep reportBackToTobyn; + DetailedQuestStep goUpVarrockF0ToF1; + DetailedQuestStep goUpVarrockF1toF2; + DetailedQuestStep finishQuest; + PuzzleWrapperStep followGuardPuzzleWrapper; + PuzzleWrapperStep markGuard1; + PuzzleWrapperStep markGuard2; + PuzzleWrapperStep markGuard3; + PuzzleWrapperStep markGuard4; + PuzzleWrapperStep unmarkOneOfTheGuards; + PuzzleWrapperStep unmarkWrongGuard1; + PuzzleWrapperStep unmarkWrongGuard2; + PuzzleWrapperStep unmarkWrongGuard3; + PuzzleWrapperStep unmarkWrongGuard4; + PuzzleWrapperStep unmarkWrongGuard5; + PuzzleWrapperStep unmarkWrongGuard6; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - // Before start, 9646 0->1, talked a bit to Alina - steps.put(0, talkToAlina); - steps.put(2, talkToAlina); - steps.put(4, talkToAlina); - ConditionalStep goFollowGuard = new ConditionalStep(this, talkToAlina); - goFollowGuard.addStep(isFollowing, followGuardPuzzleWrapper); - steps.put(6, goFollowGuard); - steps.put(8, attemptToEnterHouse); - steps.put(10, talkToTobyn); - ConditionalStep markGuards = new ConditionalStep(this, markGuard1); - markGuards.addStep(markedWrongGuard1, unmarkWrongGuard1); - markGuards.addStep(markedWrongGuard2, unmarkWrongGuard2); - markGuards.addStep(markedWrongGuard3, unmarkWrongGuard3); - markGuards.addStep(markedWrongGuard4, unmarkWrongGuard4); - markGuards.addStep(markedWrongGuard5, unmarkWrongGuard5); - markGuards.addStep(markedWrongGuard6, unmarkWrongGuard6); - markGuards.addStep(and(markedGuard1, markedGuard2, markedGuard3, markedGuard4), reportBackToTobyn); - markGuards.addStep(and(markedGuard1, markedGuard2, markedGuard4), markGuard3); - markGuards.addStep(and(markedGuard1, markedGuard2), markGuard4); - markGuards.addStep(markedGuard1, markGuard2); - steps.put(12, markGuards); - steps.put(14, reportBackToTobyn); - ConditionalStep goFinishQuest = new ConditionalStep(this, goUpVarrockF0ToF1); - goFinishQuest.addStep(inCastleF2, finishQuest); - goFinishQuest.addStep(inCastleF1, goUpVarrockF1toF2); - steps.put(16, goFinishQuest); - steps.put(18, goFinishQuest); - steps.put(20, goFinishQuest); - steps.put(22, goFinishQuest); - return steps; + castleF1 = new Zone(new WorldPoint(3199, 3465, 1), new WorldPoint(3227, 3500, 1)); + castleF2 = new Zone(new WorldPoint(3199, 3465, 2), new WorldPoint(3227, 3500, 2)); } @Override protected void setupRequirements() - { - - } - - public void setupConditions() { isFollowing = new NpcRequirement("Guard", NpcID.VMQ1_BAG_GUARD); markedGuard1 = new VarbitRequirement(GUARD_1_CHANGE_VARBIT, 2); @@ -129,8 +121,6 @@ public void setupConditions() markedWrongGuard5 = new VarbitRequirement(WRONG_GUARD_5_CHANGE_VARBIT, 2); markedWrongGuard6 = new VarbitRequirement(WRONG_GUARD_6_CHANGE_VARBIT, 2); - castleF1 = new Zone(new WorldPoint(3199, 3465, 1), new WorldPoint(3227, 3500, 1)); - castleF2 = new Zone(new WorldPoint(3199, 3465, 2), new WorldPoint(3227, 3500, 2)); inCastleF1 = new ZoneRequirement(castleF1); inCastleF2 = new ZoneRequirement(castleF2); } @@ -173,17 +163,17 @@ public void setupSteps() ); followGuardPuzzleWrapper = new PuzzleWrapperStep(this, followGuard, "Follow the guard, keeping out of sight whilst also not letting them get too far away."); - final int BASE_GUARD_ID = 6923; + final int BASE_GUARD_ID = NpcID.VMQ1_GUARD_1; attemptToEnterHouse = new ObjectStep(this, ObjectID.VMQ1_BANDIT_DOOR, new WorldPoint(3259, 3400, 0), "Attempt to enter the house in the south-east of Varrock, north of the Zamorak Temple, and watch the cutscene."); talkToTobyn = new NpcStep(this, NpcID.VMQ1_GUARD_SERGEANT_VIS, new WorldPoint(3211, 3437, 0), "Talk to Sergeant Tobyn in Varrock Square."); markGuard1 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_1_UNMARKED, new WorldPoint(3208, 3422, 0), - "Mark the guard outside Aris's tent.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Mark the guard outside Aris's tent.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); markGuard2 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_2_UNMARKED, new WorldPoint(3221, 3430, 0), - "Mark the guard south east of Benny's news stand, who isn't wearing a helmet and has long hair.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Mark the guard south east of Benny's news stand, who isn't wearing a helmet and has long hair.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards.").withNoHelpHiddenInSidebar(true); markGuard3 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_3_UNMARKED, new WorldPoint(3246, 3429, 0), @@ -194,31 +184,44 @@ public void setupSteps() "Mark the guard leaning on the north wall of Lowe's Archery Emporium, east of the square.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards.").withNoHelpHiddenInSidebar(true); + var realUnmarkOneOfTheGuards = new DetailedQuestStep(this, "One of the guards is incorrectly marked, unmark the one as indicated by the overlay."); + unmarkWrongGuard1 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_5_MARKED, new WorldPoint(3227, 3424, 0), - "Unmark the guard east of ELiza.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Unmark the guard east of Eliza.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); unmarkWrongGuard2 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_6_MARKED, new WorldPoint(3218, 3424, 0), - "Unmark the guard next to Eliza.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Unmark the guard next to Eliza.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); unmarkWrongGuard3 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_7_MARKED, new WorldPoint(3230, 3430, 0), - "Unmark the guard roaming south of Horvik.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Unmark the guard roaming south of Horvik.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); unmarkWrongGuard4 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_8_MARKED, new WorldPoint(3206, 3431, 0), - "Unmark the guard outside Zaff's Superior Staffs.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Unmark the guard outside Zaff's Superior Staffs.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); unmarkWrongGuard5 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_9_MARKED, new WorldPoint(3239, 3433, 0), - "Unmark the guard next to the small fountain east of Horvik.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Unmark the guard next to the small fountain east of Horvik.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); unmarkWrongGuard6 = new PuzzleWrapperStep(this, new MultiNpcStep(this, NpcID.VMQ1_GUARD_10_MARKED, new WorldPoint(3218, 3433, 0), - "Unmark the guard next to Baraek.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), + "Unmark the guard next to Baraek.", GUARD_1_CHANGE_VARBIT, BASE_GUARD_ID), "Mark the suspect guards."); + realUnmarkOneOfTheGuards.addSubSteps( + unmarkWrongGuard1, + unmarkWrongGuard2, + unmarkWrongGuard3, + unmarkWrongGuard4, + unmarkWrongGuard5, + unmarkWrongGuard6 + ); + + unmarkOneOfTheGuards = realUnmarkOneOfTheGuards.puzzleWrapStep(true); + reportBackToTobyn = new NpcStep(this, NpcID.VMQ1_GUARD_SERGEANT_VIS, new WorldPoint(3211, 3437, 0), "Report back to Sergeant Tobyn."); goUpVarrockF0ToF1 = new ObjectStep(this, ObjectID.FAI_VARROCK_STAIRS_TALLER_NEW_FIX, new WorldPoint(3212, 3474, 0), @@ -228,18 +231,64 @@ public void setupSteps() finishQuest = new NpcStep(this, NpcID.VMQ1_GUARD_SERGEANT_VIS, new WorldPoint(3202, 3473, 2), "Talk to Tobyn on the Varrock Castle's roof to finish the quest."); finishQuest.addSubSteps(goUpVarrockF1toF2, goUpVarrockF0ToF1); - } - @Override - public List getItemRequirements() - { - return null; + // Upon finishing the quest: + // [2025-08-05T22:15:32Z 385] varbit VMQ1_QUESTCOMPLETE_TYPE (9645) 0 -> 2 + // [2025-08-05T22:15:32Z 385] varbit VMQ2_FIRST_TRAVEL (9652) 0 -> 1 + // + // When talking to Regulus Cento after finishing the quest: + // [2025-08-06T09:20:25Z 306] varbit VMQ2_FIRST_TRAVEL (9652) 1 -> 2 + // Dialogue option is: "Let's do it!" + // + // After traveling: + // [2025-08-06T09:21:47Z 442] varbit VARLAMORE_VISITED (9650) 0 -> 1 + // [2025-08-06T09:21:47Z 442] varbit VMQ2_FIRST_TRAVEL (9652) 2 -> 3 + // + // When landing, you're put in a conversation with Regulus. + // When finishing that conversation: + // [2025-08-06T09:22:54Z 554] varbit VMQ2_FIRST_TRAVEL (9652) 3 -> 4 + } @Override - public List getItemRecommended() + public Map loadSteps() { - return null; + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + // Before start, 9646 0->1, talked a bit to Alina + steps.put(0, talkToAlina); + steps.put(2, talkToAlina); + steps.put(4, talkToAlina); + var goFollowGuard = new ConditionalStep(this, talkToAlina); + goFollowGuard.addStep(isFollowing, followGuardPuzzleWrapper); + steps.put(6, goFollowGuard); + steps.put(8, attemptToEnterHouse); + steps.put(10, talkToTobyn); + var markGuards = new ConditionalStep(this, markGuard1); + markGuards.addStep(markedWrongGuard1, unmarkWrongGuard1); + markGuards.addStep(markedWrongGuard2, unmarkWrongGuard2); + markGuards.addStep(markedWrongGuard3, unmarkWrongGuard3); + markGuards.addStep(markedWrongGuard4, unmarkWrongGuard4); + markGuards.addStep(markedWrongGuard5, unmarkWrongGuard5); + markGuards.addStep(markedWrongGuard6, unmarkWrongGuard6); + markGuards.addStep(and(markedGuard1, markedGuard2, markedGuard3, markedGuard4), reportBackToTobyn); + markGuards.addStep(and(markedGuard1, markedGuard2, markedGuard4), markGuard3); + markGuards.addStep(and(markedGuard1, markedGuard2), markGuard4); + markGuards.addStep(markedGuard1, markGuard2); + steps.put(12, markGuards); + steps.put(14, reportBackToTobyn); + var goFinishQuest = new ConditionalStep(this, goUpVarrockF0ToF1); + goFinishQuest.addStep(inCastleF2, finishQuest); + goFinishQuest.addStep(inCastleF1, goUpVarrockF1toF2); + steps.put(16, goFinishQuest); + steps.put(18, goFinishQuest); + steps.put(20, goFinishQuest); + steps.put(22, goFinishQuest); + + return steps; } @Override @@ -259,9 +308,22 @@ public List getUnlockRewards() @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Intrigue", Arrays.asList(talkToAlina, followGuardPuzzleWrapper, - attemptToEnterHouse, talkToTobyn, markGuard1, markGuard2, markGuard4, markGuard3, reportBackToTobyn, finishQuest))); + var allSteps = new ArrayList(); + + allSteps.add(new PanelDetails("Intrigue", List.of( + talkToAlina, + followGuardPuzzleWrapper, + attemptToEnterHouse, + talkToTobyn, + markGuard1, + markGuard2, + markGuard4, + markGuard3, + unmarkOneOfTheGuards, + reportBackToTobyn, + finishQuest + ))); + return allSteps; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clientofkourend/ClientOfKourend.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clientofkourend/ClientOfKourend.java index c0feee85135..4c082429a5c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clientofkourend/ClientOfKourend.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clientofkourend/ClientOfKourend.java @@ -29,12 +29,12 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; @@ -43,84 +43,71 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class ClientOfKourend extends BasicQuestHelper { - //Items Required + // Required items ItemRequirement feather; - - //Items Recommended - ItemRequirement gamesNecklace; - - //Other items used - ItemRequirement enchantedScroll, enchantedQuill, mysteriousOrb; - - Requirement talkedToLeenz, talkedToHorace, talkedToJennifer, talkedToMunty, talkedToRegath; - - QuestStep talkToVeos, useFeatherOnScroll, talkToLeenz, talkToHorace, talkToJennifer, talkToMunty, talkToRegath, returnToVeos, goToAltar, finishQuest; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToVeos); - - ConditionalStep makeEnchantedQuill = new ConditionalStep(this, talkToVeos); - makeEnchantedQuill.addStep(new Conditions(enchantedQuill, talkedToLeenz, talkedToRegath, talkedToMunty, talkedToJennifer), talkToHorace); - makeEnchantedQuill.addStep(new Conditions(enchantedQuill, talkedToLeenz, talkedToRegath, talkedToMunty), talkToJennifer); - makeEnchantedQuill.addStep(new Conditions(enchantedQuill, talkedToLeenz, talkedToRegath), talkToMunty); - makeEnchantedQuill.addStep(new Conditions(enchantedQuill, talkedToLeenz), talkToRegath); - makeEnchantedQuill.addStep(new Conditions(enchantedQuill), talkToLeenz); - makeEnchantedQuill.addStep(enchantedScroll, useFeatherOnScroll); - steps.put(1, makeEnchantedQuill); - - steps.put(2, returnToVeos); - ConditionalStep takeOrbToAltar = new ConditionalStep(this, returnToVeos); - takeOrbToAltar.addStep(mysteriousOrb, goToAltar); + // Recommended items + ItemRequirement gamesNecklace; + ItemRequirement coinsForMinecart; - steps.put(3, returnToVeos); + // Miscellaneus requirements + ItemRequirement enchantedScroll; + ItemRequirement enchantedQuill; + ItemRequirement mysteriousOrb; + VarbitRequirement talkedToLeenz; + VarbitRequirement talkedToHorace; + VarbitRequirement talkedToJennifer; + VarbitRequirement talkedToMunty; + VarbitRequirement talkedToRegath; - steps.put(4, takeOrbToAltar); + // Steps + QuestStep talkToVeos; + QuestStep useFeatherOnScroll; + QuestStep talkToLeenz; + QuestStep talkToHorace; + QuestStep talkToJennifer; + QuestStep talkToMunty; + QuestStep talkToRegath; + QuestStep returnToVeos; + QuestStep goToAltar; + QuestStep finishQuest; - steps.put(5, finishQuest); - steps.put(6, finishQuest); - - return steps; - } @Override protected void setupRequirements() { + talkedToLeenz = new VarbitRequirement(VarbitID.VEOS_PISCARILIUS, 1); + talkedToRegath = new VarbitRequirement(VarbitID.VEOS_ARCEUUS, 1); + talkedToMunty = new VarbitRequirement(VarbitID.VEOS_LOVAKENGJ, 1); + talkedToJennifer = new VarbitRequirement(VarbitID.VEOS_SHAYZIEN, 1); + talkedToHorace = new VarbitRequirement(VarbitID.VEOS_HOSIDIUS, 1); + feather = new ItemRequirement("Feather", ItemID.FEATHER); feather.setTooltip("Can be purchased from Gerrant's Fishy Business in Port Sarim."); feather.addAlternates(ItemID.HUNTING_POLAR_FEATHER, ItemID.HUNTING_WOODLAND_FEATHER, ItemID.HUNTING_JUNGLE_FEATHER, ItemID.HUNTING_DESERT_FEATHER, ItemID.HUNTING_EAGLE_FEATHER, ItemID.HUNTING_STRIPY_BIRD_FEATHER); feather.setHighlightInInventory(true); gamesNecklace = new ItemRequirement("Games necklace", ItemCollections.GAMES_NECKLACES); + coinsForMinecart = new ItemRequirement("Coins", ItemCollections.COINS, 100); + coinsForMinecart.setTooltip("For travel with the Lovakengj Minecart Network."); enchantedScroll = new ItemRequirement("Enchanted scroll", ItemID.VEOS_SCROLL); - enchantedScroll.setHighlightInInventory(true); mysteriousOrb = new ItemRequirement("Mysterious orb", ItemID.VEOS_ORB); mysteriousOrb.setHighlightInInventory(true); enchantedQuill = new ItemRequirement("Enchanted quill", ItemID.VEOS_QUILL); } - public void setupConditions() - { - talkedToLeenz = new VarbitRequirement(5620, 1); - talkedToRegath = new VarbitRequirement(5621, 1); - talkedToMunty = new VarbitRequirement(5622, 1); - talkedToJennifer = new VarbitRequirement(5623, 1); - talkedToHorace = new VarbitRequirement(5624, 1); - } - public void setupSteps() { talkToVeos = new NpcStep(this, NpcID.VEOS_VIS_AMULET, new WorldPoint(1824, 3690, 0), @@ -130,54 +117,92 @@ public void setupSteps() talkToVeos.addDialogStep("Have you got any quests for me?"); talkToVeos.addDialogStep("Let's talk about your client..."); talkToVeos.addDialogStep("I've lost something you've given me."); + talkToVeos.addDialogStep("Yes."); - useFeatherOnScroll = new DetailedQuestStep(this, "Use a feather on the Enchanted Scroll.", feather, enchantedScroll); + useFeatherOnScroll = new DetailedQuestStep(this, "Use a feather on the Enchanted Scroll.", feather, enchantedScroll.highlighted()); - talkToLeenz = new NpcStep(this, NpcID.PISCARILIUS_GENERALSTORE_KEEPER, new WorldPoint(1807, 3726, 0), "Talk to Leenz in Port Piscarilius general store.", enchantedQuill); + talkToLeenz = new NpcStep(this, NpcID.PISCARILIUS_GENERALSTORE_KEEPER, new WorldPoint(1807, 3726, 0), "Talk to Leenz in Port Piscarilius general store.", enchantedScroll, enchantedQuill); talkToLeenz.addDialogStep("Can I ask you about Port Piscarilius?"); talkToLeenz.addDialogStep("What is there to do in Port Piscarilius?"); - talkToHorace = new NpcStep(this, NpcID.HOSIDIUS_GENERALSTORE, new WorldPoint(1774, 3589, 0), "Talk to Horace in the Hosidius general store.", enchantedQuill); + talkToHorace = new NpcStep(this, NpcID.HOSIDIUS_GENERALSTORE, new WorldPoint(1774, 3589, 0), "Talk to Horace in the Hosidius general store. You can take the Lovakengj Minecart Network to Hosidius South.", enchantedScroll, enchantedQuill); talkToHorace.addDialogStep("Can I ask you about Hosidius?"); talkToHorace.addDialogStep("What is there to do in Hosidius?"); - talkToJennifer = new NpcStep(this, NpcID.SHAYZIEN_GENERALSTORE, new WorldPoint(1518, 3586, 0), "Talk to Jennifer in Shayzien general store.", enchantedQuill); + talkToJennifer = new NpcStep(this, NpcID.SHAYZIEN_GENERALSTORE, new WorldPoint(1518, 3586, 0), "Talk to Jennifer in Shayzien general store. You can run west towards the bank and use the Lovakengj Minecart Network to Shayzien East.", enchantedScroll, enchantedQuill); talkToJennifer.addDialogStep("Can I ask you about Shayzien?"); talkToJennifer.addDialogStep("What is there to do in Shayzien?"); - talkToMunty = new NpcStep(this, NpcID.LOVAKENGJ_GENERALSTORE, new WorldPoint(1551, 3752, 0), "Talk to Munty in Lovakengj general store.", enchantedQuill); + talkToMunty = new NpcStep(this, NpcID.LOVAKENGJ_GENERALSTORE, new WorldPoint(1551, 3752, 0), "Talk to Munty in Lovakengj general store. You can run south towards Kingstown and use the Lovakengj Minecart Network to Lovakengj.", enchantedScroll, enchantedQuill); talkToMunty.addDialogStep("Can I ask you about Lovakengj?"); talkToMunty.addDialogStep("What is there to do in Lovakengj?"); - talkToRegath = new NpcStep(this, NpcID.ARCEUUS_GENERALSTORE, new WorldPoint(1720, 3724, 0), "Talk to Regath in Arceuus general store.", enchantedQuill); + talkToRegath = new NpcStep(this, NpcID.ARCEUUS_GENERALSTORE, new WorldPoint(1720, 3724, 0), "Talk to Regath in Arceuus general store.", enchantedScroll, enchantedQuill); talkToRegath.addDialogStep("Can I ask you about Arceuus?"); talkToRegath.addDialogStep("What is there to do in Arceuus?"); returnToVeos = new NpcStep(this, NpcID.VEOS_VIS_AMULET, new WorldPoint(1824, 3690, 0), "Return to Veos on Piscarilius docks."); returnToVeos.addDialogStep("Let's talk about your client..."); returnToVeos.addDialogStep("I've lost something you've given me."); - goToAltar = new DetailedQuestStep(this, new WorldPoint(1712, 3883, 0), "Activate the mysterious orb at the Dark Altar. You can either run there through Arceuus, teleport to Wintertodt with the Games Necklace and run south, or teleport straight there on the Arceuus spellbook.", mysteriousOrb); + goToAltar = new DetailedQuestStep(this, new WorldPoint(1712, 3883, 0), "Activate the mysterious orb at the Dark Altar. You can either run there through Arceuus, teleport to Wintertodt with the Games Necklace and run south, teleport straight there on the Arceuus spellbook, or use the Lovakengj Minecart Network to travel to Arceuus.", mysteriousOrb); - finishQuest = new NpcStep(this, NpcID.VEOS_VIS_AMULET, new WorldPoint(1824, 3690, 0), "Return to Veos on Piscarilius docks."); + finishQuest = new NpcStep(this, NpcID.VEOS_VIS_AMULET, new WorldPoint(1824, 3690, 0), "Return to Veos on Piscarilius docks. You can take the Lovakengj Minecart Network from Arceuus to Port Piscarilius and run south-east."); finishQuest.addDialogStep("Let's talk about your client..."); } @Override - public List getItemRequirements() + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToVeos); + + var makeEnchantedQuill = new ConditionalStep(this, talkToVeos); + makeEnchantedQuill.addStep(and(enchantedScroll, enchantedQuill, talkedToLeenz, talkedToRegath, talkedToMunty, talkedToJennifer), talkToHorace); + makeEnchantedQuill.addStep(and(enchantedScroll, enchantedQuill, talkedToLeenz, talkedToRegath, talkedToMunty), talkToJennifer); + makeEnchantedQuill.addStep(and(enchantedScroll, enchantedQuill, talkedToLeenz, talkedToRegath), talkToMunty); + makeEnchantedQuill.addStep(and(enchantedScroll, enchantedQuill, talkedToLeenz), talkToRegath); + makeEnchantedQuill.addStep(and(enchantedScroll, enchantedQuill), talkToLeenz); + makeEnchantedQuill.addStep(enchantedScroll, useFeatherOnScroll); + steps.put(1, makeEnchantedQuill); + + steps.put(2, returnToVeos); + + var takeOrbToAltar = new ConditionalStep(this, returnToVeos); + takeOrbToAltar.addStep(mysteriousOrb, goToAltar); + + steps.put(3, returnToVeos); + + steps.put(4, takeOrbToAltar); + + steps.put(5, finishQuest); + steps.put(6, finishQuest); + + return steps; + } + + @Override + public List getGeneralRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(feather); - return reqs; + return List.of( + new QuestRequirement(QuestHelperQuest.X_MARKS_THE_SPOT, QuestState.FINISHED) + ); } - + @Override - public List getItemRecommended() + public List getItemRequirements() { - return Arrays.asList(gamesNecklace); + return List.of( + feather + ); } - + @Override - public List getGeneralRequirements() + public List getItemRecommended() { - List reqs = new ArrayList<>(); - reqs.add(new QuestRequirement(QuestHelperQuest.X_MARKS_THE_SPOT, QuestState.FINISHED)); - return reqs; + return List.of( + gamesNecklace, + coinsForMinecart + ); } @Override @@ -189,19 +214,46 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Arrays.asList( - new ItemReward("500 Experience Lamps (Any Skill)", ItemID.THOSF_REWARD_LAMP, 2), //4447 Placeholder until confirmed. - new ItemReward("Kharedst's Memoirs", ItemID.VEOS_KHAREDSTS_MEMOIRS, 1)); + return List.of( + new ItemReward("500 Experience Lamps (Any Skill)", ItemID.THOSF_REWARD_LAMP, 2), //4447 Placeholder until confirmed. + new ItemReward("Kharedst's Memoirs", ItemID.VEOS_KHAREDSTS_MEMOIRS, 1) + ); + } + + @Override + public List getUnlockRewards() + { + return List.of( + new UnlockReward("Ability to use the Kourend Castle Teleport spell") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToVeos, + useFeatherOnScroll + ), List.of( + feather + ))); + + sections.add(new PanelDetails("Learn about Kourend", List.of( + talkToLeenz, + talkToRegath, + talkToMunty, + talkToJennifer, + talkToHorace, + returnToVeos + ))); + + sections.add(new PanelDetails("The Dark Altar", List.of( + goToAltar, + finishQuest + ))); - allSteps.add(new PanelDetails("Starting off", Arrays.asList(talkToVeos, useFeatherOnScroll), feather)); - allSteps.add(new PanelDetails("Learn about Kourend", Arrays.asList(talkToLeenz, talkToRegath, talkToMunty, talkToJennifer, talkToHorace, returnToVeos))); - allSteps.add(new PanelDetails("The Dark Altar", Arrays.asList(goToAltar, finishQuest))); - return allSteps; + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clocktower/ClockTower.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clocktower/ClockTower.java index 795c01f1d08..46acb955f27 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clocktower/ClockTower.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/clocktower/ClockTower.java @@ -48,109 +48,110 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; public class ClockTower extends BasicQuestHelper { - ItemRequirement bucketOfWater, noteAboutWater, staminaPotions, ardougneCloak, redCog, blueCog, blackCog, whiteCog, ratPoison; - - Zone basement, firstFloor, secondFloor, groundFloor, secretPath, secretPath2, secretPath3, secretPath4, - secretPath5, secretPath6, cell; - - Requirement inBasement, inGroundFloor, inFirstFloor, inSecondFloor, inSecretPath, inCell, startedQuestDuringSession, - synced, firstLeverDown, pulledFirstLeverUp, secondLeverUp, poisonedRats, placedRedCog, placedBlueCog, placedWhiteCog, - placedBlackCog; - - QuestStep talkToKojo, syncStep; - - QuestStep enterBasement, pickUpRedCog, climbToGroundFloorFromBasement, redCogOnRedSpindle; - - QuestStep goToLadderCedric, pushWall, climbCellLadder, pickUpBlueCog, climbToFirstFloor, blueCogOnBlueSpindle; - - QuestStep climbFromFirstFloorToGround, pickupBlackCog, blackCogOnBlackSpindle; - - QuestStep northWesternDoor, pickUpRatPoison, pullFirstLever, ratPoisonFood, westernGate, pickUpWhiteCog, climbWhiteLadder, - climbToSecondFloor, whiteCogOnWhiteSpindle, climbFromSecondFloorToFirst; - - QuestStep kojoReward; - - ConditionalStep getRedCog, getBlueCog, getBlackCog, getWhiteCog; - - ConditionalStep goToBasementForRed, goToBasementForBlue, goToBasementForBlack, goToBasementForWhite, - goToFirstFloorWithBlueCog, goToGroundFloorWithRedCog, goToBasementWithBlackCog, goToSecondFloorWithWhiteCog, - goFinishQuest; - - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - - Map steps = new HashMap<>(); - - ConditionalStep goStart = new ConditionalStep(this, talkToKojo); - // This is so we can lock the startedQuestDuringSession to true, so we don't need to ask to sync after - goStart.addStep(startedQuestDuringSession, talkToKojo); - - steps.put(0, talkToKojo); - - getRedCog = new ConditionalStep(this, goToBasementForRed); - getRedCog.addStep(redCog, goToGroundFloorWithRedCog); - getRedCog.addStep(inBasement, pickUpRedCog); - - getBlueCog = new ConditionalStep(this, goToBasementForBlue); - getBlueCog.addStep(blueCog, goToFirstFloorWithBlueCog); - getBlueCog.addStep(inCell, pickUpBlueCog); - getBlueCog.addStep(inSecretPath, pushWall); - - getBlackCog = new ConditionalStep(this, goToBasementForBlack); - getBlackCog.addStep(blackCog, goToBasementWithBlackCog); - getBlackCog.addStep(inBasement, pickupBlackCog); - - getWhiteCog = new ConditionalStep(this, goToBasementForWhite); - getWhiteCog.addStep(new Conditions(whiteCog, inBasement), climbWhiteLadder); - getWhiteCog.addStep(new Conditions(whiteCog), goToSecondFloorWithWhiteCog); - getWhiteCog.addStep(new Conditions(inBasement, pulledFirstLeverUp, poisonedRats), pickUpWhiteCog); - getWhiteCog.addStep(new Conditions(inBasement, ratPoison, pulledFirstLeverUp), ratPoisonFood); - getWhiteCog.addStep(new Conditions(inBasement, ratPoison), pullFirstLever); - getWhiteCog.addStep(inBasement, pickUpRatPoison); - - ConditionalStep doQuest = new ConditionalStep(this, syncStep); - doQuest.addStep(new Conditions(placedRedCog, placedBlueCog, placedBlackCog, placedWhiteCog, synced), goFinishQuest); - doQuest.addStep(new Conditions(placedRedCog, placedBlueCog, placedBlackCog, synced), getWhiteCog); - doQuest.addStep(new Conditions(placedRedCog, placedBlueCog, synced), getBlackCog); - doQuest.addStep(new Conditions(placedRedCog, synced), getBlueCog); - doQuest.addStep(synced, getRedCog); - steps.put(1, doQuest); - steps.put(2, doQuest); - steps.put(3, doQuest); - steps.put(4, doQuest); - steps.put(5, goFinishQuest); - steps.put(6, goFinishQuest); - steps.put(7, goFinishQuest); - - return steps; - } - - @Override - protected void setupRequirements() - { - bucketOfWater = new ItemRequirement("Bucket of Water or a pair of ice gloves or smiths gloves(i)", ItemID.BUCKET_WATER); - bucketOfWater.addAlternates(ItemID.ICE_GLOVES, ItemID.SMITHING_UNIFORM_GLOVES_ICE); - bucketOfWater.setTooltip("There is a bucket spawn next to the well east of the Clocktower. You can fill it on" + - " the well"); - noteAboutWater = new ItemRequirement("There's a bucket and a well and just next to brother cedric for the black cog", -1, -1); - staminaPotions = new ItemRequirement("Stamina Potions", ItemCollections.STAMINA_POTIONS); - ardougneCloak = new ItemRequirement("Ardougne Cloak to teleport to monastery", ItemID.ARDY_CAPE_EASY); - ardougneCloak.addAlternates(ItemID.ARDY_CAPE_MEDIUM, ItemID.ARDY_CAPE_HARD, ItemID.ARDY_CAPE_ELITE); - redCog = new ItemRequirement("Red Cog", ItemID.REDCOG); - blueCog = new ItemRequirement("Blue Cog", ItemID.BLUECOG); - whiteCog = new ItemRequirement("White Cog", ItemID.WHITECOG); - blackCog = new ItemRequirement("Black Cog", ItemID.BLACKCOG); - ratPoison = new ItemRequirement("Rat Poison", ItemID.RAT_POISON); - } + // Required items + ItemRequirement bucketOfWater; + + // Recommended items + ItemRequirement staminaPotions; + ItemRequirement ardougneCloak; + + // Zones + Zone basement; + Zone firstFloor; + Zone secondFloor; + Zone groundFloor; + Zone secretPath; + Zone secretPath2; + Zone secretPath3; + Zone secretPath4; + Zone secretPath5; + Zone secretPath6; + Zone cell; + + // Miscellaneous requirements + ItemRequirement emptyBucket; + ItemRequirement noteAboutWater; + ItemRequirement redCog; + ItemRequirement blueCog; + ItemRequirement blackCog; + ItemRequirement whiteCog; + ItemRequirement ratPoison; + + ZoneRequirement inBasement; + ZoneRequirement inGroundFloor; + ZoneRequirement inFirstFloor; + ZoneRequirement inSecondFloor; + ZoneRequirement inSecretPath; + ZoneRequirement inCell; + Requirement startedQuestDuringSession; + Requirement synced; + ObjectCondition firstLeverDown; + ObjectCondition pulledFirstLeverUp; + ObjectCondition secondLeverUp; + ChatMessageRequirement poisonedRats; + Requirement placedRedCog; + Requirement placedBlueCog; + Requirement placedWhiteCog; + Requirement placedBlackCog; + + // Steps + NpcStep talkToKojo; + QuestStep syncStep; + + ObjectStep enterBasement; + DetailedQuestStep pickUpRedCog; + ObjectStep climbToGroundFloorFromBasement; + ObjectStep redCogOnRedSpindle; + + ItemStep getBucket; + ObjectStep fillBucket; + ObjectStep goToLadderCedric; + ObjectStep pushWall; + ObjectStep climbCellLadder; + DetailedQuestStep pickUpBlueCog; + ObjectStep climbToFirstFloor; + ObjectStep blueCogOnBlueSpindle; + + ObjectStep climbFromFirstFloorToGround; + DetailedQuestStep pickupBlackCog; + ObjectStep blackCogOnBlackSpindle; + + ObjectStep northWesternDoor; + DetailedQuestStep pickUpRatPoison; + ObjectStep pullFirstLever; + ObjectStep ratPoisonFood; + ObjectStep westernGate; + DetailedQuestStep pickUpWhiteCog; + ObjectStep climbWhiteLadder; + ObjectStep climbToSecondFloor; + ObjectStep whiteCogOnWhiteSpindle; + ObjectStep climbFromSecondFloorToFirst; + + NpcStep finishQuest; + + ConditionalStep getRedCog; + ConditionalStep getBlueCog; + ConditionalStep getBlackCog; + ConditionalStep getWhiteCog; + + ConditionalStep goToBasementForRed; + ConditionalStep goToBasementForBlue; + ConditionalStep goToBasementForBlack; + ConditionalStep goToBasementForWhite; + ConditionalStep goToFirstFloorWithBlueCog; + ConditionalStep goToGroundFloorWithRedCog; + ConditionalStep goToBasementWithBlackCog; + ConditionalStep goToSecondFloorWithWhiteCog; + ConditionalStep goFinishQuest; @Override protected void setupZones() @@ -168,7 +169,8 @@ protected void setupZones() cell = new Zone(new WorldPoint(2571, 9630, 0), new WorldPoint(2575, 9633, 0)); } - public void setupConditions() + @Override + protected void setupRequirements() { inSecondFloor = new ZoneRequirement(secondFloor); inFirstFloor = new ZoneRequirement(firstFloor); @@ -180,7 +182,7 @@ public void setupConditions() startedQuestDuringSession = new Conditions(true, new VarplayerRequirement(QuestVarPlayer.QUEST_CLOCK_TOWER.getId(), 0)); synced = new Conditions(true, LogicType.OR, - new WidgetTextRequirement(InterfaceID.QuestjournalOverview.TITLE, "Clock Tower"), + new WidgetTextRequirement(InterfaceID.Questjournal.TITLE, "Clock Tower"), startedQuestDuringSession ); @@ -205,13 +207,29 @@ public void setupConditions() new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "I have successfully placed the White Cog on its spindle"), new ChatMessageRequirement(inSecondFloor, "The cog fits perfectly.") ); + + bucketOfWater = new ItemRequirement("Bucket of Water or a pair of ice gloves or smiths gloves(i)", ItemID.BUCKET_WATER); + bucketOfWater.addAlternates(ItemID.ICE_GLOVES, ItemID.SMITHING_UNIFORM_GLOVES_ICE); + bucketOfWater.setTooltip("There is a bucket spawn next to the well east of the Clock Tower. You can fill it on the well"); + + emptyBucket = new ItemRequirement("Bucket", ItemID.BUCKET_EMPTY); + + noteAboutWater = new ItemRequirement("There's a bucket and a well and just next to brother cedric for the black cog", -1, -1); + staminaPotions = new ItemRequirement("Stamina Potions", ItemCollections.STAMINA_POTIONS); + ardougneCloak = new ItemRequirement("Ardougne Cloak to teleport to monastery", ItemID.ARDY_CAPE_EASY); + ardougneCloak.addAlternates(ItemID.ARDY_CAPE_MEDIUM, ItemID.ARDY_CAPE_HARD, ItemID.ARDY_CAPE_ELITE); + redCog = new ItemRequirement("Red Cog", ItemID.REDCOG); + blueCog = new ItemRequirement("Blue Cog", ItemID.BLUECOG); + whiteCog = new ItemRequirement("White Cog", ItemID.WHITECOG); + blackCog = new ItemRequirement("Black Cog", ItemID.BLACKCOG); + ratPoison = new ItemRequirement("Rat Poison", ItemID.RAT_POISON); } public void setupSteps() { // TODO: Need to determine to what degree PuzzleWrapperStep should be used in this quest - talkToKojo = new NpcStep(this, NpcID.BROTHER_KOJO, new WorldPoint(2570, 3245, 0), "Talk to Brother Kojo at the clock tower."); - talkToKojo.addDialogStep("OK old monk, what can I do?"); + talkToKojo = new NpcStep(this, NpcID.BROTHER_KOJO, new WorldPoint(2570, 3245, 0), "Talk to Brother Kojo in the Clock Tower to start the quest."); + talkToKojo.addDialogStep("Yes."); syncStep = new DetailedQuestStep(this, "Open your Quest Journal to sync your current state."); @@ -221,24 +239,26 @@ public void setupSteps() "Use the red cog on the red spindle.", redCog.highlighted()); redCogOnRedSpindle.addIcon(ItemID.REDCOG); + getBucket = new ItemStep(this, new WorldPoint(2616, 3255, 0), "Get the bucket next to Brother Cedric, north of the monastery, and fill it up on the well next to it for the Black cog step. If you have other plans for the black cog, you can ignore this step by going down the nearby ladder.", emptyBucket); + fillBucket = new ObjectStep(this, ObjectID.WELL, new WorldPoint(2612, 3254, 0), "Get the bucket next to Brother Cedric, north of the monastery, and fill it up on the well next to it for the Black cog step. If you have other plans for the black cog, you can ignore this step by going down the nearby ladder.", emptyBucket); + + getBucket.addSubSteps(fillBucket); + goToLadderCedric = new ObjectStep(this, ObjectID.LADDER_CELLAR, new WorldPoint(2621, 3261, 0), ""); - pushWall = new ObjectStep(this, ObjectID.SECRETDOOR2, new WorldPoint(2575, 9631, 0), "Follow the tunnel and " + - "push the wall at the end."); + pushWall = new ObjectStep(this, ObjectID.SECRETDOOR2, new WorldPoint(2575, 9631, 0), "Follow the tunnel and push the wall at the end."); pickUpBlueCog = new DetailedQuestStep(this, new WorldPoint(2574, 9633, 0), "Pick up the blue cog.", blueCog); climbCellLadder = new ObjectStep(this, ObjectID.LADDER_FROM_CELLAR, new WorldPoint(2572, 9631, 0), ""); blueCogOnBlueSpindle = new ObjectStep(this, ObjectID.BROKECLOCKPOLE_BLUE, new WorldPoint(2569, 3240, 1), "Use the blue cog on the blue spindle.", blueCog.highlighted()); blueCogOnBlueSpindle.addIcon(ItemID.BLUECOG); - pickupBlackCog = new DetailedQuestStep(this, new WorldPoint(2613, 9639, 0), "Enter the north east door, and " + - "pick up the black cog with a bucket of water, alternatively you can equip ice gloves or smith gloves(i).", bucketOfWater, blackCog); + pickupBlackCog = new DetailedQuestStep(this, new WorldPoint(2613, 9639, 0), "Enter the north east door, and pick up the black cog with a bucket of water, alternatively you can equip ice gloves or smith gloves(i).", bucketOfWater, blackCog); blackCogOnBlackSpindle = new ObjectStep(this, ObjectID.BROKECLOCKPOLE_BLACK, new WorldPoint(2570, 9642, 0), "", blackCog.highlighted()); blackCogOnBlackSpindle.addIcon(ItemID.BLACKCOG); northWesternDoor = new ObjectStep(this, ObjectID.POORDOOR, new WorldPoint(2575, 9651, 0), "Go through the north-western door."); - pickUpRatPoison = new DetailedQuestStep(this, new WorldPoint(2564, 9662, 0), "Pick up the rat poison in the " + - "north west of the dungeon.", ratPoison); + pickUpRatPoison = new DetailedQuestStep(this, new WorldPoint(2564, 9662, 0), "Pick up the rat poison in the north west of the dungeon.", ratPoison); pullFirstLever = new ObjectStep(this, ObjectID.CTLEVERA, new WorldPoint(2591, 9661, 0), "Pull the marked lever up."); ratPoisonFood = new ObjectStep(this, ObjectID.CTFOODTROUGH, new WorldPoint(2587, 9654, 0), @@ -250,7 +270,6 @@ public void setupSteps() whiteCogOnWhiteSpindle = new ObjectStep(this, ObjectID.BROKECLOCKPOLE_WHITE, new WorldPoint(2567, 3241, 2), "", whiteCog.highlighted()); whiteCogOnWhiteSpindle.addIcon(ItemID.WHITECOG); - kojoReward = new NpcStep(this, NpcID.BROTHER_KOJO, new WorldPoint(2570, 3245, 0), "Talk to Brother Kojo for your reward."); enterBasement = new ObjectStep(this, ObjectID.LADDER_CELLAR, new WorldPoint(2566, 3242, 0), ""); climbFromFirstFloorToGround = new ObjectStep(this, ObjectID.SPIRALSTAIRSMIDDLE, new WorldPoint(2573, 3241, 1), ""); @@ -262,80 +281,136 @@ public void setupSteps() climbToSecondFloor = new ObjectStep(this, ObjectID.SPIRALSTAIRSMIDDLE, new WorldPoint(2573, 3241, 1), ""); climbToSecondFloor.addDialogStep("Climb up the stairs."); - ConditionalStep goToBasementSteps = new ConditionalStep(this, enterBasement); + var goToBasementSteps = new ConditionalStep(this, enterBasement); goToBasementSteps.addStep(inSecondFloor, climbFromSecondFloorToFirst); goToBasementSteps.addStep(inFirstFloor, climbFromFirstFloorToGround); - goToBasementSteps.addStep(new Conditions(LogicType.OR, inSecretPath, inCell), climbCellLadder); + goToBasementSteps.addStep(or(inSecretPath, inCell), climbCellLadder); - ConditionalStep goToCellSteps = new ConditionalStep(this, goToLadderCedric); + var goToCellSteps = new ConditionalStep(this, goToLadderCedric); goToCellSteps.addStep(inBasement, climbToGroundFloorFromBasement); goToCellSteps.addStep(inSecondFloor, climbFromSecondFloorToFirst); goToCellSteps.addStep(inFirstFloor, climbFromFirstFloorToGround); - ConditionalStep goToGroundFloor = new ConditionalStep(this, new DetailedQuestStep(this, "")); - goToGroundFloor.addStep(new Conditions(LogicType.OR, inSecretPath, inCell), climbCellLadder); + var goToGroundFloor = new ConditionalStep(this, new DetailedQuestStep(this, "")); + goToGroundFloor.addStep(or(inSecretPath, inCell), climbCellLadder); goToGroundFloor.addStep(inBasement, climbToGroundFloorFromBasement); goToGroundFloor.addStep(inSecondFloor, climbFromSecondFloorToFirst); goToGroundFloor.addStep(inFirstFloor, climbFromFirstFloorToGround); - ConditionalStep goToFirstFloor = new ConditionalStep(this, climbToFirstFloor); - goToFirstFloor.addStep(new Conditions(LogicType.OR, inSecretPath, inCell), climbCellLadder); + var goToFirstFloor = new ConditionalStep(this, climbToFirstFloor); + goToFirstFloor.addStep(or(inSecretPath, inCell), climbCellLadder); goToFirstFloor.addStep(inBasement, climbToGroundFloorFromBasement); goToFirstFloor.addStep(inSecondFloor, climbFromSecondFloorToFirst); - ConditionalStep goToSecondFloor = new ConditionalStep(this, climbToFirstFloor); - goToSecondFloor.addStep(new Conditions(LogicType.OR, inSecretPath, inCell), climbCellLadder); + var goToSecondFloor = new ConditionalStep(this, climbToFirstFloor); + goToSecondFloor.addStep(or(inSecretPath, inCell), climbCellLadder); goToSecondFloor.addStep(inBasement, climbToGroundFloorFromBasement); goToSecondFloor.addStep(inFirstFloor, climbToSecondFloor); - goToBasementForRed = new ConditionalStep(this, goToBasementSteps, "Enter the clocktower's basement for the " + - "red cog."); - goToBasementForBlue = new ConditionalStep(this, goToCellSteps, "Climb down the ladder to the east of the " + - "Clocktower, next to Brother Cedric."); - goToBasementForWhite = new ConditionalStep(this, goToBasementSteps, "Enter the clocktower's basement for the " + - "white cog."); - goToBasementForBlack = new ConditionalStep(this, goToBasementSteps, "Enter the clocktower's basement for the " + - "black cog."); - - goToFirstFloorWithBlueCog = new ConditionalStep(this, goToFirstFloor, - "Place the blue cog on the peg on the first floor."); + goToBasementForRed = new ConditionalStep(this, goToBasementSteps, "Enter the Clock Tower basement for the red cog."); + goToBasementForBlue = new ConditionalStep(this, goToCellSteps, "Climb down the ladder to the east of the Clock Tower, next to Brother Cedric."); + goToBasementForWhite = new ConditionalStep(this, goToBasementSteps, "Enter the Clock Tower basement for the white cog."); + goToBasementForBlack = new ConditionalStep(this, goToBasementSteps, "Enter the Clock Tower basement for the black cog.", bucketOfWater); + + goToFirstFloorWithBlueCog = new ConditionalStep(this, goToFirstFloor, "Place the blue cog on the peg on the first floor."); goToFirstFloorWithBlueCog.addStep(inFirstFloor, blueCogOnBlueSpindle); goToGroundFloorWithRedCog = goToGroundFloor.copy(); goToGroundFloorWithRedCog.setText("Place the red cog on the peg on the ground floor."); goToGroundFloorWithRedCog.addStep(null, redCogOnRedSpindle); - goToBasementWithBlackCog = new ConditionalStep(this, goToBasementSteps, - "Place the black cog on the peg in the basement."); - goToBasementWithBlackCog.addStep(new Conditions(inBasement, new Conditions(LogicType.NOR, inSecretPath, inCell)), + goToBasementWithBlackCog = new ConditionalStep(this, goToBasementSteps, "Place the black cog on the peg in the basement."); + goToBasementWithBlackCog.addStep(and(inBasement, nor(inSecretPath, inCell)), blackCogOnBlackSpindle); - goToSecondFloorWithWhiteCog = new ConditionalStep(this, goToSecondFloor, - "Place the white cog on the peg on the second floor."); + goToSecondFloorWithWhiteCog = new ConditionalStep(this, goToSecondFloor, "Place the white cog on the peg on the second floor."); goToSecondFloorWithWhiteCog.addStep(inSecondFloor, whiteCogOnWhiteSpindle); goToSecondFloorWithWhiteCog.addSubSteps(climbWhiteLadder); + finishQuest = new NpcStep(this, NpcID.BROTHER_KOJO, new WorldPoint(2570, 3245, 0), ""); + goFinishQuest = goToGroundFloor.copy(); - goFinishQuest.setText("Talk to Kojo for your reward."); - goFinishQuest.addStep(null, kojoReward); + goFinishQuest.setText("Talk to Brother Kojo in the Clock Tower for your reward."); + goFinishQuest.addStep(null, finishQuest); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + var goStart = new ConditionalStep(this, talkToKojo); + // This is so we can lock the startedQuestDuringSession to true, so we don't need to ask to sync after + goStart.addStep(startedQuestDuringSession, talkToKojo); + + steps.put(0, talkToKojo); + + getRedCog = new ConditionalStep(this, goToBasementForRed); + getRedCog.addStep(redCog, goToGroundFloorWithRedCog); + getRedCog.addStep(inBasement, pickUpRedCog); + + getBlueCog = new ConditionalStep(this, goToBasementForBlue); + getBlueCog.addStep(blueCog, goToFirstFloorWithBlueCog); + getBlueCog.addStep(inCell, pickUpBlueCog); + getBlueCog.addStep(inSecretPath, pushWall); + getBlueCog.addStep(and(not(bucketOfWater), emptyBucket, not(placedBlackCog)), fillBucket); + getBlueCog.addStep(and(not(bucketOfWater), not(placedBlackCog)), getBucket); + + getBlackCog = new ConditionalStep(this, goToBasementForBlack); + getBlackCog.addStep(blackCog, goToBasementWithBlackCog); + getBlackCog.addStep(inBasement, pickupBlackCog); + + getWhiteCog = new ConditionalStep(this, goToBasementForWhite); + getWhiteCog.addStep(and(whiteCog, inBasement), climbWhiteLadder); + getWhiteCog.addStep(and(whiteCog), goToSecondFloorWithWhiteCog); + getWhiteCog.addStep(and(inBasement, pulledFirstLeverUp, poisonedRats), pickUpWhiteCog); + getWhiteCog.addStep(and(inBasement, ratPoison, pulledFirstLeverUp), ratPoisonFood); + getWhiteCog.addStep(and(inBasement, ratPoison), pullFirstLever); + getWhiteCog.addStep(inBasement, pickUpRatPoison); + + var doQuest = new ConditionalStep(this, syncStep); + doQuest.addStep(and(placedRedCog, placedBlueCog, placedBlackCog, placedWhiteCog, synced), goFinishQuest); + doQuest.addStep(and(placedRedCog, placedBlueCog, placedBlackCog, synced), getWhiteCog); + doQuest.addStep(and(placedRedCog, placedBlueCog, synced), getBlackCog); + doQuest.addStep(and(placedRedCog, synced), getBlueCog); + doQuest.addStep(synced, getRedCog); + steps.put(1, doQuest); + steps.put(2, doQuest); + steps.put(3, doQuest); + steps.put(4, doQuest); + steps.put(5, goFinishQuest); + steps.put(6, goFinishQuest); + steps.put(7, goFinishQuest); + + return steps; } @Override public List getItemRequirements() { - return Collections.singletonList(bucketOfWater); + return List.of( + bucketOfWater + ); } - @Override - public List getItemRecommended() - { - return Arrays.asList(staminaPotions, ardougneCloak); - } + @Override + public List getItemRecommended() + { + return List.of( + staminaPotions, + ardougneCloak + ); + } @Override public List getCombatRequirements() { - return Collections.singletonList("Able to survive a hit or 2 from an Ogre (level 53)"); + return List.of( + "Able to survive a hit or 2 from an Ogre (level 53)" + ); } @Override @@ -347,36 +422,59 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Coins", ItemID.COINS, 500)); + return List.of( + new ItemReward("Coins", ItemID.COINS, 500) + ); } @Override public List getPanels() { - ArrayList allSteps = new ArrayList<>(); - - PanelDetails gettingStarted = new PanelDetails("Getting Started", new ArrayList<>(Collections.singletonList(talkToKojo))); - allSteps.add(gettingStarted); - - PanelDetails redCog = new PanelDetails("Obtaining the red cog", new ArrayList<>(Arrays.asList(goToBasementForRed, - pickUpRedCog, goToGroundFloorWithRedCog))); - allSteps.add(redCog); - PanelDetails blueCog = new PanelDetails("Obtaining the blue cog", - new ArrayList<>(Arrays.asList(goToBasementForBlue, pushWall, pickUpBlueCog, goToFirstFloorWithBlueCog)), - noteAboutWater); - allSteps.add(blueCog); - PanelDetails blackCog = new PanelDetails("Obtaining the black cog", - new ArrayList<>(Arrays.asList(goToBasementForBlack, pickupBlackCog, goToBasementWithBlackCog)), - bucketOfWater); - allSteps.add(blackCog); - PanelDetails whiteCog = new PanelDetails("Obtaining the white cog", - new ArrayList<>(Arrays.asList(goToBasementForWhite, pickUpRatPoison, pullFirstLever, - ratPoisonFood, westernGate, pickUpWhiteCog, goToSecondFloorWithWhiteCog))); - allSteps.add(whiteCog); - PanelDetails finishingOff = new PanelDetails("Finishing off", - new ArrayList<>(Collections.singletonList(goFinishQuest))); - allSteps.add(finishingOff); - - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Getting Started", List.of( + talkToKojo, + syncStep + ))); + + sections.add(new PanelDetails("Obtaining the red cog", List.of( + goToBasementForRed, + pickUpRedCog, + goToGroundFloorWithRedCog + ))); + + sections.add(new PanelDetails("Obtaining the blue cog", List.of( + getBucket, + goToBasementForBlue, + pushWall, + pickUpBlueCog, + goToFirstFloorWithBlueCog + ), List.of( + noteAboutWater + ))); + + sections.add(new PanelDetails("Obtaining the black cog", List.of( + goToBasementForBlack, + pickupBlackCog, + goToBasementWithBlackCog + ), List.of( + bucketOfWater + ))); + + sections.add(new PanelDetails("Obtaining the white cog", List.of( + goToBasementForWhite, + pickUpRatPoison, + pullFirstLever, + ratPoisonFood, + westernGate, + pickUpWhiteCog, + goToSecondFloorWithWhiteCog + ))); + + sections.add(new PanelDetails("Finishing off", List.of( + goFinishQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/coldwar/ColdWar.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/coldwar/ColdWar.java index e3ad3fe090a..ce54b25dd75 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/coldwar/ColdWar.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/coldwar/ColdWar.java @@ -240,13 +240,13 @@ protected void setupZones() public void setupConditions() { isOnIceberg = new ZoneRequirement(onIceberg); - birdHideBuilt = new VarbitRequirement(3294, 1); + birdHideBuilt = new VarbitRequirement(VarbitID.PENG_MULTI_HIDE, 1); tableNearby = new Conditions(LogicType.OR, new ObjectCondition(ObjectID.POH_CLOCKMAKING_3), new ObjectCondition(ObjectID.POH_CLOCKMAKING_4)); - isPenguin = new VarbitRequirement(3306, 1); + isPenguin = new VarbitRequirement(VarbitID.PENG_TRANSMOG, 1); isInPenguinPen = new ZoneRequirement(inPenguinPen, inPenguinPen2); - isEmoting = new VarbitRequirement(3308, 1); + isEmoting = new VarbitRequirement(VarbitID.PENG_DOING_GREETING, 1); isAtZoo = new ZoneRequirement(atZoo); isAtLumbridgeSheepFarm = new ZoneRequirement(atLumbridgeSheepFarm); isInAgilityStart = new ZoneRequirement(inAgilityStart); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cooksassistant/CooksAssistant.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cooksassistant/CooksAssistant.java index 30c33d4aabf..4ad5754e8c3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cooksassistant/CooksAssistant.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/cooksassistant/CooksAssistant.java @@ -29,9 +29,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.DialogRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -39,16 +36,8 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ItemStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; @@ -56,6 +45,13 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + public class CooksAssistant extends BasicQuestHelper { // Required items @@ -179,7 +175,7 @@ public void setupSteps() finishQuest = new NpcStep(this, NpcID.COOK, new WorldPoint(3206, 3214, 0), "Give the Cook in Lumbridge Castle's kitchen the required items to finish the quest.", egg, milk, flour); - finishQuest.addAlternateNpcs(NpcID.POH_SERVANT_COOK_WOMAN); + finishQuest.addAlternateNpcs(NpcID.COOK); finishQuest.addDialogSteps("What's wrong?", "Can I help?", "Yes."); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/creatureoffenkenstrain/CreatureOfFenkenstrain.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/creatureoffenkenstrain/CreatureOfFenkenstrain.java index 73cd4840736..4fdea31910f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/creatureoffenkenstrain/CreatureOfFenkenstrain.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/creatureoffenkenstrain/CreatureOfFenkenstrain.java @@ -51,6 +51,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -198,15 +199,15 @@ public void setupConditions() inCanifisBar = new ZoneRequirement(barZone); inCastleFloor0 = new ZoneRequirement(castleZoneFloor0); inCastleFloor1 = new ZoneRequirement(castleZoneFloor1); - putStarOnGrave = new VarbitRequirement(192, 1); + putStarOnGrave = new VarbitRequirement(VarbitID.FENK_COFFIN, 1); hasMarbleAmulet = new Conditions(LogicType.OR, marbleAmulet, putStarOnGrave); hasObsidianAmulet = new Conditions(LogicType.OR, obsidianAmulet, putStarOnGrave); hasStarAmulet = new Conditions(LogicType.OR, starAmulet, putStarOnGrave); - followingGardenerForHead = new VarbitRequirement(185, 1); + followingGardenerForHead = new VarbitRequirement(VarbitID.FENK_GARDENER_DIRECTIONS, 1); hasDecapitatedHeadWithBrain = new Conditions(LogicType.OR, decapitatedHeadWithBrain, - new VarbitRequirement(189, 1) + new VarbitRequirement(VarbitID.FENK_HEAD, 1) ); inExperiementCave = new ZoneRequirement(experimentCave); @@ -214,29 +215,29 @@ public void setupConditions() hasCavernKey = new Conditions(LogicType.OR, cavernKey, - new VarbitRequirement(199, 1) + new VarbitRequirement(VarbitID.FENK_UNLOCKED_CAVERN, 1) ); keyNearby = new ItemOnTileRequirement(cavernKey); hasTorso = new Conditions(LogicType.OR, torso, - new VarbitRequirement(188, 1) + new VarbitRequirement(VarbitID.FENK_TORSO, 1) ); hasLegs = new Conditions(LogicType.OR, legs, - new VarbitRequirement(187, 1) + new VarbitRequirement(VarbitID.FENK_LEGS, 1) ); hasArm = new Conditions(LogicType.OR, arms, - new VarbitRequirement(186, 1) + new VarbitRequirement(VarbitID.FENK_ARMS, 1) ); // Needle given, 190 = 1 // Thread given, 191 0->5 - usedShedKey = new VarbitRequirement(200, 1); + usedShedKey = new VarbitRequirement(VarbitID.FENK_UNLOCKED_SHED, 1); inCastleTower = new ZoneRequirement(castleTower); - usedTowerKey = new VarbitRequirement(198, 1); + usedTowerKey = new VarbitRequirement(VarbitID.FENK_UNLOCKED_TOWER, 1); inMonsterTower = new ZoneRequirement(monsterTower); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/currentaffairs/CurrentAffairs.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/currentaffairs/CurrentAffairs.java new file mode 100644 index 00000000000..97ce8a564dc --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/currentaffairs/CurrentAffairs.java @@ -0,0 +1,403 @@ +/* + * Copyright (c) 2025, TTvanWillegen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.quests.currentaffairs; + +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; +import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; +import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.api.QuestState; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; + +public class CurrentAffairs extends BasicQuestHelper +{ + // Required items + ItemRequirement charcoalRequirement; + ItemRequirement coinsRequirement; + + // Mid-quest item requirements + ItemRequirement hasFormCr4p; + ItemRequirement hasTinyNet; + ItemRequirement hasMayoralFishbowl; + ItemRequirement hasMayor; + ItemRequirement hasForm7r45h; + ItemRequirement hasForm7r45hSigned; + ItemRequirement hasDuck; + + // Miscellaneous requirements + Requirement filledFormCr4p; + Requirement formCr4pGiven; + Requirement boughtFishbowl; + Requirement auditStarted; + Requirement onboardShip; + Requirement duckCanBeFollowed; + Requirement duckHasStopped; + Requirement catherbyCharted; + FreeInventorySlotRequirement twoFreeInvSlots; + FreeInventorySlotRequirement oneFreeInvSlot; + + // Steps + NpcStep startQuest; + + NpcStep talkToCouncillor; + + ObjectStep grabCharcoal; + DetailedQuestStep fillFormCr4p; + NpcStep handOverFormCr4p; + NpcStep talkAfterFormHandedIn; + + NpcStep talkToArhein; + + NpcStep talkToHarry; + NpcStep getNewFishbowl; + NpcStep showArheinMayor; + ObjectStep fishInAquarium; + ConditionalStep cGetMayor; + + NpcStep getNewMayor; + NpcStep showCatherineMayor; + NpcStep doAudit; + ConditionalStep cShowCatherineMayor; + + NpcStep getForm7r45h; + DetailedQuestStep signForm7r45h; + NpcStep showCatherineForm; + ConditionalStep cSign7r45h; + + NpcStep giveArheimNews; + + NpcStep getDuck; + BoardShipStep boardShip; + SailStep sailToStart; + DetailedQuestStep releaseDuck; + DetailedQuestStep followThatDuck; + NpcStep collectDuck; + NpcStep showCurrentsArhein; + ConditionalStep cBoardShip; + ConditionalStep cSailToStart; + + private static final Map q1Answers = Map.of(1, "Pleasure.", 2, "Trade.", 3, "Piracy."); + private static final Map q2Answers = Map.of(1, "0", 2, "1", 3, "2+"); + private static final Map q3Answers = Map.of(1, "Cargo spillage.", 2, "Theft.", 3, "Both."); + private static final Map q4Answers = Map.of(1, "No.", 2, "Yes.", 3, "Partial."); + private static final Map q5Answers = Map.of(1, "Partial.", 2, "No.", 3, "Yes."); + private static final Map q6Answers = Map.of(1, "Yes.", 2, "Partial.", 3, "No."); + private static final Map q7Answers = Map.of(1, "Less than a month.", 2, "Less than a year.", 3, "A year or more."); + private static final Map q8Answers = Map.of(1, "Varrock.", 2, "Falador.", 3, "Edgeville."); + + @Override + protected void setupRequirements() + { + //Quest Requirements + charcoalRequirement = new ItemRequirement("Charcoal", ItemID.CHARCOAL).isNotConsumed().canBeObtainedDuringQuest(); + charcoalRequirement.setTooltip("You can pick this up in the cabinet near Councillor Catherine in the north-east of Catherby."); + coinsRequirement = new ItemRequirement("Coins", ItemID.COINS, 50); + + hasFormCr4p = new ItemRequirement("Form cr-4p", ItemID.CURRENT_AFFAIRS_FORM); + hasFormCr4p.setTooltip("You can receive a new one from Councillor Catherine in the north-east of Catherby."); + hasForm7r45h = new ItemRequirement("Form 7r4-5h", ItemID.CURRENT_AFFAIRS_FORM_2); + hasForm7r45h.setTooltip("You can receive a new one from Councillor Catherine in the north-east of Catherby."); + hasForm7r45hSigned = new ItemRequirement("Form 7r4-5h", ItemID.CURRENT_AFFAIRS_FORM_2_SIGNED); + hasForm7r45hSigned.setTooltip("You can receive a new one from Councillor Catherine in the north-east of Catherby."); + + hasTinyNet = new ItemRequirement("Tiny net", ItemID.TINY_NET).isNotConsumed().canBeObtainedDuringQuest(); + hasTinyNet.setTooltip("You can receive a new one in the fish shop in the south-east of Catherby."); + hasMayoralFishbowl = new ItemRequirement("Mayoral fishbowl", ItemID.CURRENT_AFFAIRS_MAYORAL_FISHBOWL).canBeObtainedDuringQuest().isNotConsumed(); + hasMayoralFishbowl.setTooltip("You can receive a new one in the fish shop in the south-east of Catherby."); + hasMayor = new ItemRequirement("Mayor of Catherby", ItemID.CURRENT_AFFAIRS_MAYOR_OF_CATHERBY).canBeObtainedDuringQuest().isNotConsumed(); + hasMayor.setTooltip("You can receive a new one in the fish shop in the south-east of Catherby."); + + hasDuck = new ItemRequirement("Current Duck", ItemID.SAILING_CHARTING_CURRENT_DUCK).canBeObtainedDuringQuest().isNotConsumed(); + hasForm7r45hSigned.setTooltip("You can receive a new one from Arheim on the Catherby Docks."); + + duckCanBeFollowed = new NpcRequirement(NpcID.SAILING_CHARTING_CURRENT_DUCK_MOVING); + duckHasStopped = new NpcCondition(NpcID.SAILING_CHARTING_CURRENT_DUCK_STOPPED, new WorldPoint(2802, 3322, 0)); + + filledFormCr4p = and( + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q1, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q2, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q3, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q4, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q5, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q6, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q7, 0, Operation.GREATER), + new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_Q8, 0, Operation.GREATER)); + formCr4pGiven = new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_FORM_GIVEN, 1); + boughtFishbowl = new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_KIT_PURCHASED, 1); + auditStarted = new VarbitRequirement(VarbitID.CURRENT_AFFAIRS_AUDIT_START, 1); + onboardShip = new VarbitRequirement(VarbitID.SAILING_BOARDED_BOAT, 1); + catherbyCharted = new VarbitRequirement(VarbitID.SAILING_CHARTING_CURRENT_DUCK_CATHERBY_BAY_COMPLETE, 1); + + charcoalRequirement.setConditionToHide(filledFormCr4p); + coinsRequirement.setConditionToHide(boughtFishbowl); + + twoFreeInvSlots = new FreeInventorySlotRequirement(2); + oneFreeInvSlot = new FreeInventorySlotRequirement(1); + } + + public void setupSteps() + { + startQuest = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Talk to Arhein on the northern part of the Catherby Docks to start the quest.", true); + startQuest.addDialogStep("What's with the duck?"); + startQuest.addDialogStep("Yes."); + + talkToCouncillor = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Talk to Councillor Catherine in the north-east of Catherby."); + talkAfterFormHandedIn = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Finish talking to Councillor Catherine in the north-east of Catherby."); + grabCharcoal = new ObjectStep(this, ObjectID.CURRENT_AFFAIRS_CABINET, new WorldPoint(2827, 3453, 0), "Grab a piece of charcoal from the cabinet."); + fillFormCr4p = new DetailedQuestStep(this, "Fill form cr-4p. The answers you provide do not matter.", hasFormCr4p.highlighted(), charcoalRequirement); + fillFormCr4p.addSubSteps(grabCharcoal); + + //Answer values range from 1-3 + fillFormCr4p.addDialogSteps("Pleasure.", "Trade.", "Piracy."); + fillFormCr4p.addDialogSteps("0", "1", "2+"); + fillFormCr4p.addDialogSteps("Cargo spillage.", "Theft.", "Both."); + fillFormCr4p.addDialogSteps("No.", "Yes.", "Partial."); + fillFormCr4p.addDialogSteps("Partial.", "No.", "Yes."); + fillFormCr4p.addDialogSteps("Yes.", "Partial.", "No."); + fillFormCr4p.addDialogSteps("Less than a month.", "Less than a year.", "A year or more."); + fillFormCr4p.addDialogSteps("Varrock.", "Falador.", "Edgeville."); + + handOverFormCr4p = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Hand over the filled form to Councillor Catherine.", hasFormCr4p); + handOverFormCr4p.addDialogStep("Yes, I have it here."); + + talkToArhein = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Talk to Arhein on the docks about the mayor.", true); + talkToArhein.addDialogStep("I need to find the Mayor of Catherby."); + + talkToHarry = new NpcStep(this, NpcID.HARRY, new WorldPoint(2831, 3444, 0), "Talk to Harry in the fish shop in south-east Catherby about a new mayor.", true, coinsRequirement, twoFreeInvSlots); + talkToHarry.addDialogStep("I'm here about the mayor."); + talkToHarry.addDialogStep("Yes."); + fishInAquarium = new ObjectStep(this, ObjectID.AQUARIUM, new WorldPoint(2831, 3444, 0), "Fish a new mayor from the aquarium.", true, hasTinyNet, hasMayoralFishbowl); + getNewFishbowl = new NpcStep(this, NpcID.HARRY, new WorldPoint(2831, 3444, 0), "Talk to Harry in the fish shop in south-east Catherby about a new mayoral fishbowl.", true); + getNewFishbowl.addDialogStep("I'm here about the mayor."); + talkToHarry.addSubSteps(getNewFishbowl); + showArheinMayor = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Introduce Arhein on the Catherby docks to the new Mayor of Catherby.", true, hasMayor); + showArheinMayor.addDialogStep("About the mayor..."); + showCatherineMayor = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Talk to Councillor Catherine about changing the by-laws.", hasMayor); + showCatherineMayor.addDialogStep("Yes, I have it here."); + getNewMayor = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Talk to Arhein on the Catherby docks for a new mayor.", true); + getNewMayor.addDialogStep("About the mayor..."); + showCatherineMayor.addSubSteps(getNewMayor); + + doAudit = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Talk to Councillor Catherine to complete the audit."); + doAudit.addDialogConsideringLastLineAndVarbit("What is your main reason for making port at Catherby?", VarbitID.CURRENT_AFFAIRS_FORM_Q1, q1Answers); + doAudit.addDialogConsideringLastLineAndVarbit("How many hulls does your ship have?", VarbitID.CURRENT_AFFAIRS_FORM_Q2, q2Answers); + doAudit.addDialogConsideringLastLineAndVarbit("Is your ship insured against cargo spillage and theft?", VarbitID.CURRENT_AFFAIRS_FORM_Q3, q3Answers); + doAudit.addDialogConsideringLastLineAndVarbit("Does your first mate have first aid training?", VarbitID.CURRENT_AFFAIRS_FORM_Q4, q4Answers); + doAudit.addDialogConsideringLastLineAndVarbit("Does your second mate have second aid training?", VarbitID.CURRENT_AFFAIRS_FORM_Q5, q5Answers); + doAudit.addDialogConsideringLastLineAndVarbit("Have you experienced symptoms of plague in the last two weeks?", VarbitID.CURRENT_AFFAIRS_FORM_Q6, q6Answers); + doAudit.addDialogConsideringLastLineAndVarbit("How much experience do you have sailing?", VarbitID.CURRENT_AFFAIRS_FORM_Q7, q7Answers); + doAudit.addDialogConsideringLastLineAndVarbit("Where would you say your home port is?", VarbitID.CURRENT_AFFAIRS_FORM_Q8, q8Answers); + + getForm7r45h = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Talk to Councillor Catherine in the north-east of Catherby to receive a new form 7r4-5h.", oneFreeInvSlot); + signForm7r45h = new DetailedQuestStep(this, "Use form 7r4-5h on the Mayor of Catherby.", hasForm7r45h.highlighted(), hasMayor.highlighted()); + showCatherineForm = new NpcStep(this, NpcID.CURRENT_AFFAIRS_COUNCILLOR, new WorldPoint(2825, 3454, 0), "Show Councillor Catherine the signed form.", hasForm7r45hSigned); + + giveArheimNews = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Give Arhein on the Catherby docks the good news.", true); + giveArheimNews.addDialogStep("The by-law has been changed!"); + + // TODO: We might be able to check if the duck is in the cargo hold and only recommend that? + getDuck = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Get a new duck from Arhein on the Catherby docks, or from your ship's cargo hold.", true); + getDuck.addDialogStep("About that duck..."); + + boardShip = new BoardShipStep(this, hasDuck); + sailToStart = new SailStep(this, new WorldPoint(2835, 3418, 0), "Sail to the small island east of Catherby, then release the Current duck.", hasDuck); + releaseDuck = new DetailedQuestStep(this, "Release the Current duck.", hasDuck.highlighted()); + + followThatDuck = new DetailedQuestStep(this, new WorldPoint(2802, 3322, 0), "Follow the Current duck! It'll end up south-west of Entrana."); //It ends up at (2802,3322,0) + + collectDuck = new NpcStep(this, NpcID.SAILING_CHARTING_CURRENT_DUCK_STOPPED, "Collect your Current duck."); + + showCurrentsArhein = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2803, 3430, 0), "Share what you've learned with Arhein on the Catherby docks.", true); + showCurrentsArhein.addDialogStep("I've charted the currents!"); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + Map steps = new HashMap<>(); + steps.put(0, startQuest); + steps.put(5, talkToCouncillor); + ConditionalStep cFillForm = new ConditionalStep(this, talkToCouncillor); + cFillForm.addStep(formCr4pGiven, talkAfterFormHandedIn); + cFillForm.addStep(and(not(formCr4pGiven), hasFormCr4p, filledFormCr4p), handOverFormCr4p); + cFillForm.addStep(and(not(formCr4pGiven), charcoalRequirement, not(filledFormCr4p), hasFormCr4p.highlighted()), fillFormCr4p); + cFillForm.addStep(and(not(formCr4pGiven), hasFormCr4p, not(charcoalRequirement)), grabCharcoal); + steps.put(10, cFillForm); + steps.put(15, talkToArhein); + cGetMayor = new ConditionalStep(this, talkToHarry); + cGetMayor.setShouldPassthroughText(true); + cGetMayor.addStep(hasMayor, showArheinMayor); + cGetMayor.addStep(and(hasMayoralFishbowl, hasTinyNet), fishInAquarium); + cGetMayor.addStep(boughtFishbowl, getNewFishbowl); + steps.put(20, cGetMayor); + cShowCatherineMayor = new ConditionalStep(this, getNewMayor); + cShowCatherineMayor.addStep(and(auditStarted), doAudit); + cShowCatherineMayor.addStep(and(not(auditStarted), hasMayor), showCatherineMayor); + steps.put(25, cShowCatherineMayor); + cSign7r45h = new ConditionalStep(this, getNewMayor); + cSign7r45h.addStep(and(hasForm7r45hSigned), showCatherineForm); + cSign7r45h.addStep(and(hasForm7r45h, hasMayor), signForm7r45h); + cSign7r45h.addStep(and(hasMayor, not(hasForm7r45h)), getForm7r45h); + steps.put(30, cSign7r45h); + steps.put(35, giveArheimNews); + + cBoardShip = new ConditionalStep(this, getDuck); + cBoardShip.setShouldPassthroughText(true); + cBoardShip.addStep(and(not(catherbyCharted), hasDuck, not(onboardShip)), boardShip); + cSailToStart = new ConditionalStep(this, cBoardShip); + cSailToStart.addStep(catherbyCharted, showCurrentsArhein); + cSailToStart.addStep(and(not(catherbyCharted), hasDuck, onboardShip, sailToStart.getZoneRequirement()), releaseDuck); + cSailToStart.addStep(and(not(catherbyCharted), hasDuck, onboardShip), sailToStart); + cSailToStart.addStep(duckHasStopped, collectDuck); + cSailToStart.addStep(duckCanBeFollowed, followThatDuck); + steps.put(40, cSailToStart); + return steps; + } + + @Override + public List getGeneralRequirements() + { + return List.of( + new QuestRequirement(QuestHelperQuest.PANDEMONIUM, QuestState.FINISHED), + new SkillRequirement(Skill.SAILING, 22, false), + new SkillRequirement(Skill.FISHING, 10, false), + twoFreeInvSlots + ); + } + + @Override + public List getItemRequirements() + { + return List.of( + charcoalRequirement, + coinsRequirement + ); + } + + @Override + public QuestPointReward getQuestPointReward() + { + return new QuestPointReward(1); + } + + @Override + public List getExperienceRewards() + { + return List.of( + new ExperienceReward(Skill.SAILING, 1400), + new ExperienceReward(Skill.FISHING, 1000) + ); + } + + @Override + public List getItemRewards() + { + return List.of( + new ItemReward("Current Duck", ItemID.SAILING_CHARTING_CURRENT_DUCK), + new ItemReward("Mayor of Catherby", ItemID.CURRENT_AFFAIRS_MAYOR_OF_CATHERBY), + new ItemReward("Sawmill Coupon (oak plank)", ItemID.SAWMILL_COUPON, 25) + ); + } + + @Override + public List getUnlockRewards() + { + return List.of( + new UnlockReward("Access to charting currents") + ); + } + + @Override + public List getPanels() + { + var sections = new ArrayList(); + + sections.add(new PanelDetails("Arhein's employee", List.of( + startQuest, + talkToCouncillor, + fillFormCr4p, + handOverFormCr4p, + talkAfterFormHandedIn + ), List.of( + charcoalRequirement + ))); + + sections.add(new PanelDetails("A new mayor", List.of( + talkToArhein, + talkToHarry, + fishInAquarium, + showArheinMayor, + showCatherineMayor, + doAudit, + getForm7r45h, + signForm7r45h, + showCatherineForm, + giveArheimNews + ), List.of( + coinsRequirement + ))); + + sections.add(new PanelDetails("Map the currents!", List.of( + cBoardShip, + sailToStart, + releaseDuck, + followThatDuck, + collectDuck, + showCurrentsArhein + ), List.of( + hasDuck + ))); + + return sections; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/darknessofhallowvale/DarknessOfHallowvale.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/darknessofhallowvale/DarknessOfHallowvale.java index afaed7485ed..da1e26a2e14 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/darknessofhallowvale/DarknessOfHallowvale.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/darknessofhallowvale/DarknessOfHallowvale.java @@ -268,12 +268,12 @@ public void setupConditions() inVanstromFight = new Conditions(onDrakanWalls, new InInstanceRequirement()); inLab = new ZoneRequirement(lab); - pushedBoat = new VarbitRequirement(2587, 1); - knockedDownBoard = new VarbitRequirement(2589, 1); + pushedBoat = new VarbitRequirement(VarbitID.MYQ3_SEA_BOAT_VISIBLE, 1); + knockedDownBoard = new VarbitRequirement(VarbitID.MYQ3_WALL_FLOORBOARDS_DOWN, 1); - pathDoorOpen = new VarbitRequirement(2578, 1); + pathDoorOpen = new VarbitRequirement(VarbitID.MYQ3_AGIL_GHETTO_LOCKED_DOOR, 1); - fixedLadder = new VarbitRequirement(2598, 2); + fixedLadder = new VarbitRequirement(VarbitID.MYQ3_AGIL_LADDERTOP_WALL, 2); wallPressed = new VarbitRequirement(VarbitID.MYQ3_HIDEOUT_TRAPDOOR, 1, Operation.GREATER_EQUAL); searchedRockySurface = new Conditions(true, new WidgetTextRequirement(229, 1, "a mechanical click.")); @@ -282,11 +282,11 @@ public void setupConditions() cutPortrait = new VarbitRequirement(VarbitID.MYQ3_STATUE_KEY_PAINTING_STATE, 1, Operation.GREATER_EQUAL); - handedInSketches = new VarbitRequirement(2575, 1); - tapestryCut = new VarbitRequirement(2594, 1); - keyPlaced = new VarbitRequirement(2596, 1); + handedInSketches = new VarbitRequirement(VarbitID.MYQ3_SKETCHES_GIVEN, 1); + tapestryCut = new VarbitRequirement(VarbitID.MYQ3_TAPESTRY_STATE, 1); + keyPlaced = new VarbitRequirement(VarbitID.MYQ3_STATUE_STATE, 1); - searchedRuneCase = new VarbitRequirement(2584, 1); + searchedRuneCase = new VarbitRequirement(VarbitID.MYQ3_RUNECASE_SEARCHED, 1); hasTeleGrabRunesOrSearchedCase = new Conditions(LogicType.OR, searchedRuneCase, new ItemRequirements(lawRune, airRune)); // Repaired boat, 2585 = 1 diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathontheisle/DeathOnTheIsle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathontheisle/DeathOnTheIsle.java index 86efc717ba6..8388fcbd67c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathontheisle/DeathOnTheIsle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathontheisle/DeathOnTheIsle.java @@ -29,9 +29,11 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; import net.runelite.client.plugins.microbot.questhelper.requirements.item.TeleportItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NoFollowerRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; @@ -68,195 +70,158 @@ */ public class DeathOnTheIsle extends BasicQuestHelper { - // TODO: Fix npc ID, I can't find it in runelite atm - final static private int CUSTOMER_NPC_ID = 13837; - - /// Recommended items - private FreeInventorySlotRequirement emptyInvSlots; - - /// Steps - private NpcStep talkToPatziToStartQuest; - private ObjectStep enterUniformHouse; - private ObjectStep stealUniformFromWardrobe; - private ObjectStep leaveUniformHouse; - private NpcStep talkToPatziAfterStealingUniform; - private ConditionalStep stealButlerUniform; - private NpcStep continueTalkingToPatzi; - private NpcStep equipButlersOutfitAndHeadInside; - private ConditionalStep introduceYourself; - private ConditionalStep enterTheCellarStep; - private ConditionalStep getWineStep; - private ConditionalStep investigateManStep; - private ConditionalStep beInterrogatedByThePoliceStep; - private ConditionalStep investigateMurder; - private ConditionalStep investigateMurder2; - private ConditionalStep talkToGuardsAgainToTellThemYouAreReadyStep; - private ConditionalStep speakToSuspects; - private ConditionalStep getAdalasConfessionStep; - private ConditionalStep talkToGuardsAboutAdalaStep; - private ConditionalStep getToTheGuardsAtTheatreStep; - private ConditionalStep investigateTheatreStep; - private ConditionalStep investigateTheatreCellar; - private ConditionalStep snitchToGuardsStep; - private ConditionalStep confrontNaiatliStep; - private NpcStep talkToGuardsToFinishTheQuest; - private NpcStep headInsideAndTalkToPatzi; - private NpcStep introduceYourselfToConstantinius; - private NpcStep introduceYourselfToCozyac; - private NpcStep introduceYourselfToPavo; - private NpcStep introduceYourselfToXocotla; - private NpcStep returnToPatzi; - private ObjectStep getWine; - private NpcStep investigateMan; - private NpcStep beInterrogatedByThePolice; - private ObjectStep enterTheCellarAgain; - private ObjectStep investigateJug; - private ObjectStep investigateSmallBoxInSouthRoom; - private ObjectStep investigateBrokenStoolInSouthRoom; - private ObjectStep investigateWineStorageInEastRoom; - private ObjectStep investigateBrokenPotteryInEastRoom; - private NpcStep investigateLiviusInEastRoom; - private ObjectStep leaveCellar; - private NpcStep investigateConstantinius; - private NpcStep investigateCozyac; - private NpcStep investigatePavo; - private NpcStep investigateXocotla; - private NpcStep interrogatePatziAndAdala; - private NpcStep returnToTheGuards; - private NpcStep pickpocketAdala; - private NpcStep pickpocketCozyac; - private NpcStep pickpocketPavo; - private NpcStep pickpocketXocotla; - private DetailedQuestStep inspectWineLabels; - private DetailedQuestStep inspectThreateningNote; - private DetailedQuestStep inspectDrinkingFlask; - private DetailedQuestStep inspectShippingContract; - private NpcStep returnStolenItemsToTheGuards; - private NpcStep talkToGuardsAgainToTellThemYouAreReady; - private NpcStep interrogateConstantiniusAgain; - private NpcStep interrogateXocotlaAgain; - private NpcStep interrogateCozyacAgain; - private NpcStep interrogatePavoAgain; - private NpcStep accuseAdala; - private NpcStep getAdalasConfession; - private NpcStep talkToGuardsAboutAdala; - private NpcStep talkToGuardsAtTheatre; - private NpcStep talkToCostumer; - private ObjectStep searchCrateNextToStairs; - private ObjectStep searchBookshelf; - private ObjectStep searchCostumeRack; - private NpcStep talkToCostumerAgain; - private NpcStep speakToGuards; - private NpcStep talkToStradiusToEnterTheTheatre; - private NpcStep confrontNaiatli; - private NpcStep talkToNaiatli; - - /// Zones - private Zone butlerCostumeHouse1; - private Zone butlerCostumeHouse2; - private Zone butlerCostumeHouse3; - private Zone butlerCostumeHouse4; - private Zone villaOutsideTheatre1; - private Zone villaOutsideTheatre2; - private Zone villaPlatueOnTheWayToTheatre; - private Zone outsideTheatreZone1; - private Zone outsideTheatreZone2; - private Zone villaCellar; - private Zone villaTopFloor; - private Zone villaMiddleFloor; - private Zone theatreCellar; - - /// Requirements - private ZoneRequirement inButlerCostumeHouse; - private ZoneRequirement aroundVilla; - private ZoneRequirement outsideVillaByLooseRocks; - private ZoneRequirement outsideTheatre; - - private TeleportItemRequirement startTeleport; - private ItemRequirements uniform; - private ItemRequirement uniformEquipped; - private VarbitRequirement inVilla; - private ConditionalStep headInsideAndTalkToPatziStep; - private VarbitRequirement introducedYourselfToConstantinius; - private VarbitRequirement introducedYourselfToCozyac; - private VarbitRequirement introducedYourselfToPavo; - private VarbitRequirement introducedYourselfToXocotla; - private VarbitRequirement investigatedJug; - private VarbitRequirement investigatedSmallBoxInSouthRoom; - private VarbitRequirement investigatedBrokenStoolInSouthRoom; - private VarbitRequirement investigatedWineStorageInEastRoom; - private VarbitRequirement investigatedBrokenPotteryInEastRoom; - private VarbitRequirement investigatedLiviusInEastRoom; - private VarbitRequirement investigatedConstantinius; - private VarbitRequirement investigatedCozyac; - private VarbitRequirement investigatedPavo; - private VarbitRequirement investigatedXocotla; - private VarbitRequirement interrogatedPatziAndAdala; - private ZoneRequirement inVillaCellar; - private ZoneRequirement inVillaTopFloor; - private ZoneRequirement inVillaMiddleFloor; - private ZoneRequirement inTheatreCellar; - private ItemRequirement wineLabels; - private ItemRequirement threateningNote; - private ItemRequirement drinkingFlask; - private ItemRequirement shippingContract; - private VarbitRequirement inspectedWineLabels; - private VarbitRequirement inspectedThreateningNote; - private VarbitRequirement inspectedDrinkingFlask; - private VarbitRequirement inspectedShippingContract; - private VarbitRequirement interrogatedConstantiniusAgain; - private VarbitRequirement interrogatedXocotlaAgain; - private VarbitRequirement interrogatedCozyacAgain; - private VarbitRequirement interrogatedPavoAgain; - private VarbitRequirement talkedtoGuardsAtTheatre; - private VarbitRequirement searchedCrateNextToStairs; - private VarbitRequirement searchedBookshelf; - private VarbitRequirement searchedCostumeRack; - private VarbitRequirement trapSprung; - private VarbitRequirement trapFailed; - private VarbitRequirement naiatliDowned; - private VarbitRequirement handedOverCluesToGuards; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupSteps(); - - var steps = new HashMap(); - - steps.put(0, talkToPatziToStartQuest); - steps.put(2, talkToPatziToStartQuest); - steps.put(4, stealButlerUniform); - steps.put(6, stealButlerUniform); - steps.put(8, continueTalkingToPatzi); - steps.put(10, equipButlersOutfitAndHeadInside); - steps.put(12, equipButlersOutfitAndHeadInside); - steps.put(14, headInsideAndTalkToPatziStep); - steps.put(15, introduceYourself); - steps.put(16, enterTheCellarStep); - steps.put(18, getWineStep); - steps.put(19, investigateManStep); - steps.put(20, beInterrogatedByThePoliceStep); - steps.put(21, beInterrogatedByThePoliceStep); - steps.put(22, investigateMurder); - steps.put(24, investigateMurder); - steps.put(26, investigateMurder2); - steps.put(27, talkToGuardsAgainToTellThemYouAreReadyStep); - steps.put(28, speakToSuspects); - steps.put(30, speakToSuspects); - steps.put(32, getAdalasConfessionStep); - steps.put(33, talkToGuardsAboutAdalaStep); - steps.put(34, getToTheGuardsAtTheatreStep); - steps.put(36, investigateTheatreStep); - steps.put(38, investigateTheatreCellar); - steps.put(40, snitchToGuardsStep); - steps.put(42, confrontNaiatliStep); - steps.put(45, confrontNaiatliStep); - steps.put(49, talkToGuardsToFinishTheQuest); - - return steps; - } + // Recommended items + FreeInventorySlotRequirement emptyInvSlots; + TeleportItemRequirement startTeleport; + + // Zones + Zone butlerCostumeHouse1; + Zone butlerCostumeHouse2; + Zone butlerCostumeHouse3; + Zone butlerCostumeHouse4; + Zone villaOutsideTheatre1; + Zone villaOutsideTheatre2; + Zone villaPlatueOnTheWayToTheatre; + Zone outsideTheatreZone1; + Zone outsideTheatreZone2; + Zone villaCellar; + Zone villaTopFloor; + Zone villaMiddleFloor; + Zone theatreCellar; + + // Mid-quest item requirements + ItemRequirement uniformTop; + ItemRequirement uniformBottom; + ItemRequirements uniform; + NoFollowerRequirement noPet; + + // Miscellaneous requirements + ItemRequirement uniformEquipped; + ZoneRequirement inButlerCostumeHouse; + ZoneRequirement aroundVilla; + ZoneRequirement outsideVillaByLooseRocks; + ZoneRequirement outsideTheatre; + VarbitRequirement inVilla; + ConditionalStep headInsideAndTalkToPatziStep; + VarbitRequirement introducedYourselfToConstantinius; + VarbitRequirement introducedYourselfToCozyac; + VarbitRequirement introducedYourselfToPavo; + VarbitRequirement introducedYourselfToXocotla; + VarbitRequirement investigatedJug; + VarbitRequirement investigatedSmallBoxInSouthRoom; + VarbitRequirement investigatedBrokenStoolInSouthRoom; + VarbitRequirement investigatedWineStorageInEastRoom; + VarbitRequirement investigatedBrokenPotteryInEastRoom; + VarbitRequirement investigatedLiviusInEastRoom; + VarbitRequirement investigatedConstantinius; + VarbitRequirement investigatedCozyac; + VarbitRequirement investigatedPavo; + VarbitRequirement investigatedXocotla; + VarbitRequirement interrogatedPatziAndAdala; + ZoneRequirement inVillaCellar; + ZoneRequirement inVillaTopFloor; + ZoneRequirement inVillaMiddleFloor; + ZoneRequirement inTheatreCellar; + ItemRequirement wineLabels; + ItemRequirement threateningNote; + ItemRequirement drinkingFlask; + ItemRequirement shippingContract; + VarbitRequirement inspectedWineLabels; + VarbitRequirement inspectedThreateningNote; + VarbitRequirement inspectedDrinkingFlask; + VarbitRequirement inspectedShippingContract; + VarbitRequirement interrogatedConstantiniusAgain; + VarbitRequirement interrogatedXocotlaAgain; + VarbitRequirement interrogatedCozyacAgain; + VarbitRequirement interrogatedPavoAgain; + NpcCondition adalaBossSpawned; + VarbitRequirement talkedtoGuardsAtTheatre; + VarbitRequirement searchedCrateNextToStairs; + VarbitRequirement searchedBookshelf; + VarbitRequirement searchedCostumeRack; + VarbitRequirement trapSprung; + VarbitRequirement trapFailed; + VarbitRequirement naiatliDowned; + VarbitRequirement handedOverCluesToGuards; + + // Steps + NpcStep talkToPatziToStartQuest; + ObjectStep enterUniformHouse; + ObjectStep stealUniformFromWardrobe; + ObjectStep leaveUniformHouse; + NpcStep talkToPatziAfterStealingUniform; + ConditionalStep stealButlerUniform; + NpcStep continueTalkingToPatzi; + NpcStep equipButlersOutfitAndHeadInside; + ConditionalStep introduceYourself; + ConditionalStep enterTheCellarStep; + ConditionalStep getWineStep; + ConditionalStep investigateManStep; + ConditionalStep beInterrogatedByThePoliceStep; + ConditionalStep investigateMurder; + ConditionalStep investigateMurder2; + ConditionalStep talkToGuardsAgainToTellThemYouAreReadyStep; + ConditionalStep speakToSuspects; + ConditionalStep getAdalasConfessionStep; + ConditionalStep talkToGuardsAboutAdalaStep; + ConditionalStep getToTheGuardsAtTheatreStep; + ConditionalStep investigateTheatreStep; + ConditionalStep investigateTheatreCellar; + ConditionalStep snitchToGuardsStep; + ConditionalStep confrontNaiatliStep; + NpcStep talkToGuardsToFinishTheQuest; + NpcStep headInsideAndTalkToPatzi; + NpcStep introduceYourselfToConstantinius; + NpcStep introduceYourselfToCozyac; + NpcStep introduceYourselfToPavo; + NpcStep introduceYourselfToXocotla; + NpcStep returnToPatzi; + ObjectStep getWine; + NpcStep investigateMan; + NpcStep beInterrogatedByThePolice; + ObjectStep enterTheCellarAgain; + ObjectStep investigateJug; + ObjectStep investigateSmallBoxInSouthRoom; + ObjectStep investigateBrokenStoolInSouthRoom; + ObjectStep investigateWineStorageInEastRoom; + ObjectStep investigateBrokenPotteryInEastRoom; + NpcStep investigateLiviusInEastRoom; + ObjectStep leaveCellar; + NpcStep investigateConstantinius; + NpcStep investigateCozyac; + NpcStep investigatePavo; + NpcStep investigateXocotla; + NpcStep interrogatePatziAndAdala; + NpcStep returnToTheGuards; + NpcStep pickpocketAdala; + NpcStep pickpocketCozyac; + NpcStep pickpocketPavo; + NpcStep pickpocketXocotla; + DetailedQuestStep inspectWineLabels; + DetailedQuestStep inspectThreateningNote; + DetailedQuestStep inspectDrinkingFlask; + DetailedQuestStep inspectShippingContract; + NpcStep returnStolenItemsToTheGuards; + NpcStep talkToGuardsAgainToTellThemYouAreReady; + NpcStep interrogateConstantiniusAgain; + NpcStep interrogateXocotlaAgain; + NpcStep interrogateCozyacAgain; + NpcStep interrogatePavoAgain; + NpcStep accuseAdala; + NpcStep fightAdala; + NpcStep getAdalasConfession; + NpcStep talkToGuardsAboutAdala; + NpcStep talkToGuardsAtTheatre; + NpcStep talkToCostumer; + ObjectStep searchCrateNextToStairs; + ObjectStep searchBookshelf; + ObjectStep searchCostumeRack; + NpcStep talkToCostumerAgain; + NpcStep speakToGuards; + NpcStep talkToStradiusToEnterTheTheatre; + NpcStep confrontNaiatli; + NpcStep talkToNaiatli; @Override protected void setupZones() @@ -293,25 +258,29 @@ protected void setupRequirements() // TODO: Add alternates /// Mid-quest item requirements - var uniformTop = new ItemRequirement("Butler's uniform shirt", ItemID.DOTI_BUTLERUNIFORM); - var uniformBottom = new ItemRequirement("Butler's uniform pants", ItemID.DOTI_BUTLERUNIFORM_LEGS); + uniformTop = new ItemRequirement("Butler's uniform shirt", ItemID.DOTI_BUTLERUNIFORM); + uniformTop.addAlternates(ItemID.DOTI_BUTLERUNIFORM_VILLA); + uniformBottom = new ItemRequirement("Butler's uniform pants", ItemID.DOTI_BUTLERUNIFORM_LEGS); + uniformBottom.addAlternates(ItemID.DOTI_BUTLERUNIFORM_LEGS_VILLA); uniform = new ItemRequirements("Butler's uniform", uniformTop, uniformBottom); + noPet = new NoFollowerRequirement("No pet following you"); var uniformTopEquipped = uniformTop.equipped().highlighted(); var uniformBottomEquipped = uniformBottom.equipped().highlighted(); - uniformEquipped = new ItemRequirements("Butler's uniform (equipped)", uniformTopEquipped, uniformBottomEquipped).highlighted(); + uniformEquipped = new ItemRequirements("Butler's uniform", uniformTopEquipped, uniformBottomEquipped).highlighted(); uniformEquipped.setTooltip("This can be obtained from the wardrobe north of Villa Lucens."); + uniformEquipped.setMustBeEquipped(true); wineLabels = new ItemRequirement("Wine labels", ItemID.DOTI_LABELS); threateningNote = new ItemRequirement("Threatening note", ItemID.DOTI_LETTER); drinkingFlask = new ItemRequirement("Drinking flask", ItemID.DOTI_FLASK); shippingContract = new ItemRequirement("Shipping contract", ItemID.DOTI_CONTRACT); - handedOverCluesToGuards = new VarbitRequirement(11233, 1); + handedOverCluesToGuards = new VarbitRequirement(VarbitID.DOTI_GIVEN_ITEMS, 1); /// Zones inButlerCostumeHouse = new ZoneRequirement(butlerCostumeHouse1, butlerCostumeHouse2, butlerCostumeHouse3, butlerCostumeHouse4); - inVilla = new VarbitRequirement(14283, 5); + inVilla = new VarbitRequirement(VarbitID.HOLDING_INVENTORY_LOCATION, 5); aroundVilla = new ZoneRequirement(villaOutsideTheatre1, villaOutsideTheatre2); outsideVillaByLooseRocks = new ZoneRequirement( villaPlatueOnTheWayToTheatre @@ -323,46 +292,48 @@ protected void setupRequirements() inTheatreCellar = new ZoneRequirement(theatreCellar); /// States - introducedYourselfToConstantinius = new VarbitRequirement(11214, 1); - introducedYourselfToCozyac = new VarbitRequirement(11212, 1); - introducedYourselfToPavo = new VarbitRequirement(11213, 1); - introducedYourselfToXocotla = new VarbitRequirement(11211, 1); - - investigatedJug = new VarbitRequirement(11218, 1); - investigatedSmallBoxInSouthRoom = new VarbitRequirement(11221, 1); - investigatedBrokenStoolInSouthRoom = new VarbitRequirement(11222, 1); - investigatedWineStorageInEastRoom = new VarbitRequirement(11220, 1); - investigatedBrokenPotteryInEastRoom = new VarbitRequirement(11219, 1); - investigatedLiviusInEastRoom = new VarbitRequirement(11223, 1); - - investigatedConstantinius = new VarbitRequirement(11227, 1); - investigatedCozyac = new VarbitRequirement(11225, 1); - investigatedPavo = new VarbitRequirement(11226, 1); - investigatedXocotla = new VarbitRequirement(11224, 1); - interrogatedPatziAndAdala = new VarbitRequirement(11234, 1); - - // pickpocketedAdala = new VarbitRequirement(11228, 1); - // pickpocketedCozyac = new VarbitRequirement(11216, 1); - // pickpocketedPavo = new VarbitRequirement(11217, 1); - // pickpocketedXocotla = new VarbitRequirement(11215, 1); - - inspectedWineLabels = new VarbitRequirement(11236, 1); - inspectedThreateningNote = new VarbitRequirement(11237, 1); - inspectedDrinkingFlask = new VarbitRequirement(11235, 1); - inspectedShippingContract = new VarbitRequirement(11238, 1); - - interrogatedConstantiniusAgain = new VarbitRequirement(11244, 1); - interrogatedXocotlaAgain = new VarbitRequirement(11245, 1); - interrogatedCozyacAgain = new VarbitRequirement(11243, 1); - interrogatedPavoAgain = new VarbitRequirement(11246, 1); - - talkedtoGuardsAtTheatre = new VarbitRequirement(11249, 1); - - searchedCrateNextToStairs = new VarbitRequirement(11251, 1); - searchedBookshelf = new VarbitRequirement(11250, 1); - searchedCostumeRack = new VarbitRequirement(11252, 1); - - trapSprung = new VarbitRequirement(11258, 2); + introducedYourselfToConstantinius = new VarbitRequirement(VarbitID.DOTI_MET_CONSTANTINIUS, 1); + introducedYourselfToCozyac = new VarbitRequirement(VarbitID.DOTI_MET_COZYAC, 1); + introducedYourselfToPavo = new VarbitRequirement(VarbitID.DOTI_MET_PAVO, 1); + introducedYourselfToXocotla = new VarbitRequirement(VarbitID.DOTI_MET_XOCOTLA, 1); + + investigatedJug = new VarbitRequirement(VarbitID.DOTI_CLUE1, 1); + investigatedSmallBoxInSouthRoom = new VarbitRequirement(VarbitID.DOTI_CLUE4, 1); + investigatedBrokenStoolInSouthRoom = new VarbitRequirement(VarbitID.DOTI_CLUE5, 1); + investigatedWineStorageInEastRoom = new VarbitRequirement(VarbitID.DOTI_CLUE3, 1); + investigatedBrokenPotteryInEastRoom = new VarbitRequirement(VarbitID.DOTI_CLUE2, 1); + investigatedLiviusInEastRoom = new VarbitRequirement(VarbitID.DOTI_BODYCHECK, 1); + + investigatedConstantinius = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_CONSTANTINIUS, 1); + investigatedCozyac = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_COZYAC, 1); + investigatedPavo = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_PAVO, 1); + investigatedXocotla = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_XOCOTLA, 1); + interrogatedPatziAndAdala = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_PATZI, 1); + + // pickpocketedAdala = new VarbitRequirement(VarbitID.DOTI_PICKPOCKET_ADALA, 1); + // pickpocketedCozyac = new VarbitRequirement(VarbitID.DOTI_PICKPOCKET_COZYAC, 1); + // pickpocketedPavo = new VarbitRequirement(VarbitID.DOTI_PICKPOCKET_PAVO, 1); + // pickpocketedXocotla = new VarbitRequirement(VarbitID.DOTI_PICKPOCKET_XOCOTLA, 1); + + inspectedWineLabels = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_LABELS, 1); + inspectedThreateningNote = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_LETTER, 1); + inspectedDrinkingFlask = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_FLASK, 1); + inspectedShippingContract = new VarbitRequirement(VarbitID.DOTI_INVESTIGATED_CONTRACT, 1); + + interrogatedConstantiniusAgain = new VarbitRequirement(VarbitID.DOTI_QUESTIONED_CONSTANTINIUS, 1); + interrogatedXocotlaAgain = new VarbitRequirement(VarbitID.DOTI_QUESTIONED_XOCOTLA, 1); + interrogatedCozyacAgain = new VarbitRequirement(VarbitID.DOTI_QUESTIONED_COZYAC, 1); + interrogatedPavoAgain = new VarbitRequirement(VarbitID.DOTI_QUESTIONED_PAVO, 1); + + adalaBossSpawned = new NpcCondition(NpcID.DOTI_ADALA_BOSS); + + talkedtoGuardsAtTheatre = new VarbitRequirement(VarbitID.DOTI_BACKSTAGE_INTRO, 1); + + searchedCrateNextToStairs = new VarbitRequirement(VarbitID.DOTI_POISON_CLUE, 1); + searchedBookshelf = new VarbitRequirement(VarbitID.DOTI_BOOKSHELF_CLUE, 1); + searchedCostumeRack = new VarbitRequirement(VarbitID.DOTI_CLOTHING_CLUE, 1); + + trapSprung = new VarbitRequirement(VarbitID.DOTI_FINAL_FIGHT, 2); trapFailed = new VarbitRequirement(VarbitID.DOTI_FINAL_FIGHT, 3, Operation.GREATER_EQUAL); naiatliDowned = new VarbitRequirement(VarbitID.DOTI_FINAL_FIGHT, 6, Operation.GREATER_EQUAL); } @@ -395,7 +366,7 @@ public void setupSteps() talkToPatziAfterStealingUniform.addSubSteps(continueTalkingToPatzi); /// 10 + 12 - equipButlersOutfitAndHeadInside = new NpcStep(this, NpcID.DOTI_HEADBUTLER_CORE, new WorldPoint(1426, 2919, 0), "Equip the Butler's uniform pieces and talk to the Head Butler up the stone stairs and to the south.", uniformEquipped); + equipButlersOutfitAndHeadInside = new NpcStep(this, NpcID.DOTI_HEADBUTLER_CORE, new WorldPoint(1426, 2919, 0), "Equip the Butler's uniform pieces and talk to the Head Butler up the stone stairs and to the south.", uniformEquipped, noPet); equipButlersOutfitAndHeadInside.addDialogStep("I am."); equipButlersOutfitAndHeadInside.addSubSteps(returnToButlerAndHeadInside); @@ -524,9 +495,14 @@ public void setupSteps() // 11242 0->1 accused Pavo accuseAdala = new NpcStep(this, NpcID.DOTI_ADALA_MASK_INSIDE, new WorldPoint(1446, 2933, 2), "Accuse Adala of the crime, ready for a fight you cannot lose."); + accuseAdala.addAlternateNpcs(NpcID.DOTI_ADALA_BOSS); accuseAdala.addDialogStep("Accuse Adala."); + fightAdala = new NpcStep(this, NpcID.DOTI_ADALA_MASK_INSIDE, new WorldPoint(1446, 2933, 2), "Fight Adala. You cannot lose this fight."); + accuseAdala.addSubSteps(fightAdala); + speakToSuspects = new ConditionalStep(this, accuseAdala); + speakToSuspects.addStep(adalaBossSpawned, fightAdala); speakToSuspects.addStep(not(inVilla), returnToButlerAndHeadInside); speakToSuspects.addStep(not(interrogatedConstantiniusAgain), interrogateConstantiniusAgain); speakToSuspects.addStep(not(interrogatedXocotlaAgain), interrogateXocotlaAgain); @@ -561,7 +537,7 @@ public void setupSteps() talkToGuardsAtTheatre.addSubSteps(headDownFromTopFloor); var enterBackstage = new ObjectStep(this, ObjectID.ALDARIN_BACKSTAGE_ENTRANCE, new WorldPoint(1477, 2927, 0), "Enter the theatre through the backstage entrance."); - talkToCostumer = new NpcStep(this, CUSTOMER_NPC_ID, new WorldPoint(1466, 9330, 0), "Talk to the Costumer in the theatre cellar."); + talkToCostumer = new NpcStep(this, NpcID.DOTI_COSTUMER_VIS, new WorldPoint(1466, 9330, 0), "Talk to the Costumer in the theatre cellar."); talkToCostumer.addSubSteps(enterBackstage); var investigateTheatre = new ConditionalStep(this, talkToCostumer); @@ -577,27 +553,27 @@ public void setupSteps() searchCrateNextToStairs = new ObjectStep(this, ObjectID.DOTI_POISON_CRATE_OP, new WorldPoint(1469, 9330, 0), "Search the crate next to the stairs."); searchBookshelf = new ObjectStep(this, ObjectID.DOTI_BOOKSHELF_CLOSED, new WorldPoint(1461, 9331, 0), "Search the bookshelf on the west wall."); searchCostumeRack = new ObjectStep(this, ObjectID.DOTI_DAMAGED_COSTUME_OP, new WorldPoint(1464, 9337, 0), "Search the costume rack to the north."); - talkToCostumerAgain = new NpcStep(this, CUSTOMER_NPC_ID, new WorldPoint(1466, 9330, 0), "Talk to the Costumer about what you found."); + talkToCostumerAgain = new NpcStep(this, NpcID.DOTI_COSTUMER_VIS, new WorldPoint(1466, 9330, 0), "Talk to the Costumer about what you found."); var talkToCostumerAboutActors = talkToCostumerAgain.copy(); talkToCostumerAboutActors.addDialogStep("What can you tell me about the actors?"); talkToCostumerAgain.addSubSteps(talkToCostumerAboutActors); - var talkedAboutActors = new VarbitRequirement(11253, 1); + var talkedAboutActors = new VarbitRequirement(VarbitID.DOTI_ACTORS_CHAT, 1); var talkToCostumerAboutPoison = talkToCostumerAgain.copy(); talkToCostumerAboutPoison.addDialogStep("What's the crate of poison for?"); talkToCostumerAgain.addSubSteps(talkToCostumerAboutPoison); - var talkedAboutPoison = new VarbitRequirement(11255, 1); + var talkedAboutPoison = new VarbitRequirement(VarbitID.DOTI_POISON_CHAT, 1); var talkToCostumerAboutStainedCostume = talkToCostumerAgain.copy(); talkToCostumerAboutStainedCostume.addDialogStep("It seems one of the costumes has a stain on it."); talkToCostumerAgain.addSubSteps(talkToCostumerAboutStainedCostume); - var talkedAboutStainedCostume = new VarbitRequirement(11256, 1); + var talkedAboutStainedCostume = new VarbitRequirement(VarbitID.DOTI_CLOTHING_CHAT, 1); var talkToCostumerAboutHiddenPassage = talkToCostumerAgain.copy(); talkToCostumerAboutHiddenPassage.addDialogStep("Did you know there was a hidden passage in here?"); talkToCostumerAgain.addSubSteps(talkToCostumerAboutHiddenPassage); - // var talkedAboutHiddenPassage = new VarbitRequirement(11254, 1); + // var talkedAboutHiddenPassage = new VarbitRequirement(VarbitID.DOTI_BOOKSHELF_CHAT, 1); investigateTheatreCellar = new ConditionalStep(this, talkToCostumerAboutHiddenPassage); investigateTheatreCellar.addStep(not(inVilla), returnToButlerAndHeadInside); @@ -617,6 +593,7 @@ public void setupSteps() speakToGuards = new NpcStep(this, NpcID.DOTI_STRADIUS, new WorldPoint(1472, 2925, 0), "Report back to Stradius near the theatre and accuse Naiatli."); speakToGuards.addDialogStepWithExclusion("More options...", "Naiatli."); speakToGuards.addDialogStep("Naiatli."); + speakToGuards.addDialogStep("Previous options..."); speakToGuards.addSubSteps(climbUpFromTheatreCellar); // varbit 11257=1 if spoken to stradius a bit @@ -652,15 +629,54 @@ public void setupSteps() } @Override - public List getItemRequirements() + public Map loadSteps() { - return List.of(); + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToPatziToStartQuest); + steps.put(2, talkToPatziToStartQuest); + steps.put(4, stealButlerUniform); + steps.put(6, stealButlerUniform); + steps.put(8, continueTalkingToPatzi); + steps.put(10, equipButlersOutfitAndHeadInside); + steps.put(12, equipButlersOutfitAndHeadInside); + steps.put(14, headInsideAndTalkToPatziStep); + steps.put(15, introduceYourself); + steps.put(16, enterTheCellarStep); + steps.put(18, getWineStep); + steps.put(19, investigateManStep); + steps.put(20, beInterrogatedByThePoliceStep); + steps.put(21, beInterrogatedByThePoliceStep); + steps.put(22, investigateMurder); + steps.put(24, investigateMurder); + steps.put(26, investigateMurder2); + steps.put(27, talkToGuardsAgainToTellThemYouAreReadyStep); + steps.put(28, speakToSuspects); + steps.put(30, speakToSuspects); + steps.put(32, getAdalasConfessionStep); + steps.put(33, talkToGuardsAboutAdalaStep); + steps.put(34, getToTheGuardsAtTheatreStep); + steps.put(36, investigateTheatreStep); + steps.put(38, investigateTheatreCellar); + steps.put(40, snitchToGuardsStep); + steps.put(42, confrontNaiatliStep); + steps.put(45, confrontNaiatliStep); + steps.put(49, talkToGuardsToFinishTheQuest); + + return steps; } @Override - public List getItemRecommended() + public List getGeneralRequirements() { - return List.of(); + return List.of( + new QuestRequirement(QuestHelperQuest.CHILDREN_OF_THE_SUN, QuestState.FINISHED), + new SkillRequirement(Skill.THIEVING, 34), + new SkillRequirement(Skill.AGILITY, 32) + ); } @Override @@ -672,13 +688,15 @@ public List getGeneralRecommended() } @Override - public List getGeneralRequirements() + public List getItemRequirements() { - return List.of( - new QuestRequirement(QuestHelperQuest.CHILDREN_OF_THE_SUN, QuestState.FINISHED), - new SkillRequirement(Skill.THIEVING, 34), - new SkillRequirement(Skill.AGILITY, 32) - ); + return List.of(); + } + + @Override + public List getItemRecommended() + { + return List.of(); } @Override @@ -724,13 +742,83 @@ public List getUnlockRewards() @Override public List getPanels() { - var panels = new ArrayList(); - - panels.add(new PanelDetails("Getting the right fit", List.of(talkToPatziToStartQuest, enterUniformHouse, stealUniformFromWardrobe, leaveUniformHouse, talkToPatziAfterStealingUniform, equipButlersOutfitAndHeadInside), List.of(emptyInvSlots))); - panels.add(new PanelDetails("Inside Villa Lucens", List.of(headInsideAndTalkToPatzi, introduceYourselfToConstantinius, introduceYourselfToCozyac, introduceYourselfToPavo, introduceYourselfToXocotla, returnToPatzi, getWine, investigateMan, beInterrogatedByThePolice), List.of())); - panels.add(new PanelDetails("Playing detective", List.of(enterTheCellarAgain, investigateJug, investigateSmallBoxInSouthRoom, investigateBrokenStoolInSouthRoom, investigateWineStorageInEastRoom, investigateBrokenPotteryInEastRoom, investigateLiviusInEastRoom, leaveCellar, investigateConstantinius, investigateCozyac, investigatePavo, investigateXocotla, interrogatePatziAndAdala, returnToTheGuards, pickpocketAdala, pickpocketCozyac, pickpocketPavo, pickpocketXocotla, inspectWineLabels, inspectThreateningNote, inspectDrinkingFlask, inspectShippingContract, returnStolenItemsToTheGuards, talkToGuardsAgainToTellThemYouAreReady, interrogateConstantiniusAgain, interrogateXocotlaAgain, interrogateCozyacAgain, interrogatePavoAgain, accuseAdala, getAdalasConfession, talkToGuardsAboutAdala), List.of())); - panels.add(new PanelDetails("The show must go on", List.of(talkToGuardsAtTheatre, talkToCostumer, searchCrateNextToStairs, searchBookshelf, searchCostumeRack, talkToCostumerAgain, speakToGuards, talkToStradiusToEnterTheTheatre, confrontNaiatli, talkToNaiatli, talkToGuardsToFinishTheQuest), List.of())); - - return panels; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Getting the right fit", List.of( + talkToPatziToStartQuest, + enterUniformHouse, + stealUniformFromWardrobe, + leaveUniformHouse, + talkToPatziAfterStealingUniform, + equipButlersOutfitAndHeadInside + ), List.of( + emptyInvSlots, + noPet + ))); + + sections.add(new PanelDetails("Inside Villa Lucens", List.of( + headInsideAndTalkToPatzi, + introduceYourselfToConstantinius, + introduceYourselfToCozyac, + introduceYourselfToPavo, + introduceYourselfToXocotla, + returnToPatzi, + getWine, + investigateMan, + beInterrogatedByThePolice + ), List.of( + uniformTop, + uniformBottom + ))); + + sections.add(new PanelDetails("Playing detective", List.of( + enterTheCellarAgain, + investigateJug, + investigateSmallBoxInSouthRoom, + investigateBrokenStoolInSouthRoom, + investigateWineStorageInEastRoom, + investigateBrokenPotteryInEastRoom, + investigateLiviusInEastRoom, + leaveCellar, + investigateConstantinius, + investigateCozyac, + investigatePavo, + investigateXocotla, + interrogatePatziAndAdala, + returnToTheGuards, + pickpocketAdala, + pickpocketCozyac, + pickpocketPavo, + pickpocketXocotla, + inspectWineLabels, + inspectThreateningNote, + inspectDrinkingFlask, + inspectShippingContract, + returnStolenItemsToTheGuards, + talkToGuardsAgainToTellThemYouAreReady, + interrogateConstantiniusAgain, + interrogateXocotlaAgain, + interrogateCozyacAgain, + interrogatePavoAgain, + accuseAdala, + getAdalasConfession, + talkToGuardsAboutAdala + ))); + + sections.add(new PanelDetails("The show must go on", List.of( + talkToGuardsAtTheatre, + talkToCostumer, + searchCrateNextToStairs, + searchBookshelf, + searchCostumeRack, + talkToCostumerAgain, + speakToGuards, + talkToStradiusToEnterTheTheatre, + confrontNaiatli, + talkToNaiatli, + talkToGuardsToFinishTheQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathplateau/DeathPlateau.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathplateau/DeathPlateau.java index d05e73c33e4..d15e23ab568 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathplateau/DeathPlateau.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathplateau/DeathPlateau.java @@ -121,8 +121,8 @@ public Map loadSteps() finalSteps.addStep(new Conditions(isFarEnough, inBarUpstairs), goToHaroldDoor3); finalSteps.addStep(new Conditions(isFarEnough), goToHaroldDoor3); finalSteps.addStep(new Conditions(secretMap), goNorth); - finalSteps.addStep(new Conditions(spikedBoots.alsoCheckBank(questBank)), talkToTenzing2); - finalSteps.addStep(new Conditions(climbingBoots, certificate.alsoCheckBank(questBank)), talkToDunstan2); + finalSteps.addStep(new Conditions(spikedBoots.alsoCheckBank()), talkToTenzing2); + finalSteps.addStep(new Conditions(climbingBoots, certificate.alsoCheckBank()), talkToDunstan2); finalSteps.addStep(new Conditions(climbingBoots, talkedToDunstan), talkToDenulthForDunstan); finalSteps.addStep(new Conditions(climbingBoots), talkToDunstan1); finalSteps.addStep(new Conditions(talkedToSaba, inSabaCave), leaveSabaCave); @@ -278,7 +278,7 @@ public void setupSteps() talkToTenzing2 = new NpcStep(this, NpcID.DEATH_SHERPA, new WorldPoint(2820, 3555, 0), "Bring the spiked boots, along with (unnoted) 10 bread and 10 trout to Tenzing.", spikedBoots, bread, trout); - goNorth = new DetailedQuestStep(this, new WorldPoint(2865, 3609, 0), "Exit Tenzing's house through the north door, and go north, past the Death Plateau warning, and around to the east until you stop and say you've gone far enough.", secretMap); + goNorth = new DetailedQuestStep(this, new WorldPoint(2865, 3609, 0), "Exit Tenzing's house into the backyard THROUGH THE NORTH DOOR and OVER THE STILE. Continue north past the Death Plateau warning, and around to the east until you stop and say you've gone far enough.", secretMap); goToHaroldStairs3 = new ObjectStep(this, ObjectID.STAIRS, new WorldPoint(2915, 3540, 0), "If you lost the Combination, retrieve it from Harold."); goToHaroldDoor3 = new ObjectStep(this, ObjectID.DEATH_HAROLD_DOOR, new WorldPoint(2906, 3543, 1), "If you lost the Combination, retrieve it from Harold."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathtothedorgeshuun/DeathToTheDorgeshuun.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathtothedorgeshuun/DeathToTheDorgeshuun.java index ccbf0c639f3..793be31c670 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathtothedorgeshuun/DeathToTheDorgeshuun.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deathtothedorgeshuun/DeathToTheDorgeshuun.java @@ -48,10 +48,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.*; @@ -252,33 +249,33 @@ public void setupConditions() inMill = new ZoneRequirement(mill1, mill2); - talkedToDuke = new VarbitRequirement(2259, 1); - talkedToAereck = new VarbitRequirement(2260, 1); - talkedToGoblins = new VarbitRequirement(2261, 1); - talkedToWoman = new VarbitRequirement(2262, 1); - goneOutside = new VarbitRequirement(2263, 1); + talkedToDuke = new VarbitRequirement(VarbitID.DTTD_TOUR_DUKE, 1); + talkedToAereck = new VarbitRequirement(VarbitID.DTTD_TOUR_PRIEST, 1); + talkedToGoblins = new VarbitRequirement(VarbitID.DTTD_TOUR_GOBLINS, 1); + talkedToWoman = new VarbitRequirement(VarbitID.DTTD_TOUR_CITIZENS, 1); + goneOutside = new VarbitRequirement(VarbitID.DTTD_TOUR_SUN, 1); zanikIsFollowing = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, List.of(NpcID.DTTD_ZANIK_FOLLOWER, NpcID.DTTD_ZANIK_FOLLOWER_HAM), 16); - talkedToShopkeeper = new VarbitRequirement(2265, 1); - heardSpeaker = new VarbitRequirement(2268, 1); - talkedToJohn = new VarbitRequirement(2269, 1); + talkedToShopkeeper = new VarbitRequirement(VarbitID.DTTD_TOUR_SHOP, 1); + heardSpeaker = new VarbitRequirement(VarbitID.DTTD_TOUR_HAM_DEACON, 1); + talkedToJohn = new VarbitRequirement(VarbitID.DTTD_TOUR_HAM_JOHANHUS, 1); - killedGuard1 = new VarbitRequirement(2275, 1); - killedGuard2 = new VarbitRequirement(2277, 1); - killedGuard3 = new VarbitRequirement(2278, 1); - killedGuard4 = new VarbitRequirement(2280, 1); - killedGuard5 = new VarbitRequirement(2282, 1); + killedGuard1 = new VarbitRequirement(VarbitID.DTTD_GUARD_1_DEAD, 1); + killedGuard2 = new VarbitRequirement(VarbitID.DTTD_GUARD_2_DEAD, 1); + killedGuard3 = new VarbitRequirement(VarbitID.DTTD_GUARD_3_DEAD, 1); + killedGuard4 = new VarbitRequirement(VarbitID.DTTD_GUARD_4_DEAD, 1); + killedGuard5 = new VarbitRequirement(VarbitID.DTTD_GUARD_5_DEAD, 1); isDisguisedZanikFollowing = new NpcInteractingRequirement(NpcID.DTTD_ZANIK_FOLLOWER_HAM); zanikWaitingFor4 = new Conditions(new Conditions(LogicType.NOR, isDisguisedZanikFollowing), new NpcCondition(NpcID.DTTD_ZANIK_FOLLOWER_HAM, new Zone(new WorldPoint(2575, 5195, 0), new WorldPoint(2576, 5195, 0)))); zanikWaitingFor5 = new Conditions(new Conditions(LogicType.NOR, isDisguisedZanikFollowing), new NpcCondition(NpcID.DTTD_ZANIK_FOLLOWER_HAM, new Zone(new WorldPoint(2577, 5199, 0), new WorldPoint(2577, 5200, 0)))); - zanikPickedUp = new VarbitRequirement(2271, 0); + zanikPickedUp = new VarbitRequirement(VarbitID.DTTD_ZANIK_CORPSE, 0); - ropeAddedToHole = new VarbitRequirement(279, 1); - minedRocks = new VarbitRequirement(538, 1); + ropeAddedToHole = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); + minedRocks = new VarbitRequirement(VarbitID.LOST_TRIBE_HOLE_2_DUG, 1); - killedGuards = new VarbitRequirement(2283, 3); + killedGuards = new VarbitRequirement(VarbitID.DTTD_MILL_GUARDS_DEAD, 3); } public void setupSteps() @@ -296,7 +293,7 @@ public void setupSteps() talkToMistagToTravel.addDialogStep("Can you show me the way out of the mines?"); talkToZanik = new NpcStep(this, NpcID.DTTD_ZANIK_MARKED, new WorldPoint(3212, 9620, 0), ""); - talkToCook = new NpcStep(this, NpcID.POH_SERVANT_COOK_WOMAN, new WorldPoint(3209, 3215, 0), ""); + talkToCook = new NpcStep(this, NpcID.COOK, new WorldPoint(3209, 3215, 0), ""); talkToDuke = new NpcStep(this, NpcID.DUKE_OF_LUMBRIDGE, new WorldPoint(3210, 3222, 1), ""); talkToHans = new NpcStep(this, NpcID.HANS, new WorldPoint(3222, 3218, 0), ""); talkToWoman = new NpcStep(this, NpcID.DSKIN_W_ARDOUNGECITIZEN2, new WorldPoint(3224, 3218, 0), "", true); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/defenderofvarrock/DefenderOfVarrock.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/defenderofvarrock/DefenderOfVarrock.java index 646a2e11595..87d4824ef69 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/defenderofvarrock/DefenderOfVarrock.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/defenderofvarrock/DefenderOfVarrock.java @@ -35,7 +35,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.TeleportItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; @@ -93,13 +92,13 @@ public Map loadSteps() steps.put(2, talkToElias); ConditionalStep searchWithElias = new ConditionalStep(this, inspectTrapdoor); - searchWithElias.addStep(LogicHelper.nor(inspectedPlant1), inspectPlant); - searchWithElias.addStep(LogicHelper.nor(inspectedRock1), inspectRock); - searchWithElias.addStep(LogicHelper.nor(inspectedPlant2), inspectPlant2); - searchWithElias.addStep(LogicHelper.nor(inspectedBush1), inspectBush1); - searchWithElias.addStep(LogicHelper.nor(inspectedBush2), inspectBush2); - searchWithElias.addStep(LogicHelper.nor(inspectedBush3), inspectBush3); - searchWithElias.addStep(LogicHelper.nor(inspectedTrapdoor), inspectTrapdoor); + searchWithElias.addStep(nor(inspectedPlant1), inspectPlant); + searchWithElias.addStep(nor(inspectedRock1), inspectRock); + searchWithElias.addStep(nor(inspectedPlant2), inspectPlant2); + searchWithElias.addStep(nor(inspectedBush1), inspectBush1); + searchWithElias.addStep(nor(inspectedBush2), inspectBush2); + searchWithElias.addStep(nor(inspectedBush3), inspectBush3); + searchWithElias.addStep(nor(inspectedTrapdoor), inspectTrapdoor); ConditionalStep findBase = new ConditionalStep(this, talkToElias); findBase.addStep(eliasFollowing, searchWithElias); @@ -186,22 +185,22 @@ public Map loadSteps() // 9667 = page of census ConditionalStep talkToCandidates = new ConditionalStep(this, talkToHalen); - talkToCandidates.addStep(and(LogicHelper.nor(talkedToRoald), inVarrockInvasion), talkToRoald); - talkToCandidates.addStep(LogicHelper.nor(talkedToRoald), talkToRoaldOutsideInstance); + talkToCandidates.addStep(and(nor(talkedToRoald), inVarrockInvasion), talkToRoald); + talkToCandidates.addStep(nor(talkedToRoald), talkToRoaldOutsideInstance); - talkToCandidates.addStep(and(LogicHelper.nor(talkedToAeonisig), inVarrockInvasion), talkToAeonisig); - talkToCandidates.addStep(LogicHelper.nor(talkedToAeonisig), talkToAeonisigOutsideInstance); + talkToCandidates.addStep(and(nor(talkedToAeonisig), inVarrockInvasion), talkToAeonisig); + talkToCandidates.addStep(nor(talkedToAeonisig), talkToAeonisigOutsideInstance); - talkToCandidates.addStep(and(LogicHelper.nor(talkedToPrysin), inVarrockInvasion), talkToPrysin); - talkToCandidates.addStep(LogicHelper.nor(talkedToPrysin), talkToPrysinOutsideInstance); + talkToCandidates.addStep(and(nor(talkedToPrysin), inVarrockInvasion), talkToPrysin); + talkToCandidates.addStep(nor(talkedToPrysin), talkToPrysinOutsideInstance); - talkToCandidates.addStep(and(LogicHelper.nor(talkedToRomeo), inVarrockInvasion), talkToRomeoFromInstance); - talkToCandidates.addStep(LogicHelper.nor(talkedToRomeo), talkToRomeo); + talkToCandidates.addStep(and(nor(talkedToRomeo), inVarrockInvasion), talkToRomeoFromInstance); + talkToCandidates.addStep(nor(talkedToRomeo), talkToRomeo); - talkToCandidates.addStep(and(LogicHelper.nor(talkedToHorvik), inVarrockInvasion), talkToHorvikFromInstance); - talkToCandidates.addStep(LogicHelper.nor(talkedToHorvik), talkToHorvik); + talkToCandidates.addStep(and(nor(talkedToHorvik), inVarrockInvasion), talkToHorvikFromInstance); + talkToCandidates.addStep(nor(talkedToHorvik), talkToHorvik); - talkToCandidates.addStep(and(LogicHelper.nor(talkedToHalen), inVarrockInvasion), talkToHalenFromInstance); + talkToCandidates.addStep(and(nor(talkedToHalen), inVarrockInvasion), talkToHalenFromInstance); steps.put(46, talkToCandidates); ConditionalStep goTalkToDim = new ConditionalStep(this, talkToDimintheis); @@ -256,18 +255,17 @@ protected void setupZones() public void setupConditions() { - // TODO: Reported value is 12754, but uncertain why this'd be the case. Perhaps to do with different version of him? - eliasFollowing = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, List.of(NpcID.ELIAS_WHITE_VIS, NpcID.ELIAS_WHITE_CUTSCENE, 12754), 16); + eliasFollowing = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, List.of(NpcID.ELIAS_WHITE_VIS, NpcID.ELIAS_WHITE_CUTSCENE, NpcID.DOV_ELIAS_WHITE_FOLLOWER), 16); // 9655 4->6 // 9659 0->1 - inspectedPlant1 = new VarbitRequirement(9659, 1); - inspectedRock1 = new VarbitRequirement(9660, 1); - inspectedPlant2 = new VarbitRequirement(9661, 1); - inspectedBush1 = new VarbitRequirement(9662, 1); - inspectedBush2 = new VarbitRequirement(9663, 1); - inspectedBush3 = new VarbitRequirement(9664, 1); - inspectedTrapdoor = new VarbitRequirement(9665, 1); + inspectedPlant1 = new VarbitRequirement(VarbitID.DOV_HUNTING_TRAIL_1, 1); + inspectedRock1 = new VarbitRequirement(VarbitID.DOV_HUNTING_TRAIL_2, 1); + inspectedPlant2 = new VarbitRequirement(VarbitID.DOV_HUNTING_TRAIL_3, 1); + inspectedBush1 = new VarbitRequirement(VarbitID.DOV_HUNTING_TRAIL_4, 1); + inspectedBush2 = new VarbitRequirement(VarbitID.DOV_HUNTING_TRAIL_5, 1); + inspectedBush3 = new VarbitRequirement(VarbitID.DOV_HUNTING_TRAIL_6, 1); + inspectedTrapdoor = new VarbitRequirement(VarbitID.SETTINGS_DISABLE_TOOLTIP_IN_INTERFACE, 1); inDungeon = new ZoneRequirement(new Zone(14151)); redMistNearby = new ObjectCondition(ObjectID.DOV_RED_MIST); @@ -279,13 +277,13 @@ public void setupConditions() inCastleF1Invasion = new ZoneRequirement(castleF1Invasion); inCastleF2Invasion = new ZoneRequirement(castleF2Invasion); - talkedToRoald = new VarbitRequirement(9669, 1); - talkedToAeonisig = new VarbitRequirement(9670, 1); - talkedToPrysin = new VarbitRequirement(9671, 1); - talkedToHorvik = new VarbitRequirement(9672, 1); - talkedToRomeo = new VarbitRequirement(9673, 1); + talkedToRoald = new VarbitRequirement(VarbitID.DOV_SHIELD_ROALD, 1); + talkedToAeonisig = new VarbitRequirement(VarbitID.DOV_SHIELD_AEONISIG, 1); + talkedToPrysin = new VarbitRequirement(VarbitID.DOV_SHIELD_PRYSIN, 1); + talkedToHorvik = new VarbitRequirement(VarbitID.DOV_SHIELD_HORVIK, 1); + talkedToRomeo = new VarbitRequirement(VarbitID.DOV_SHIELD_ROMEO, 1); // NOTE: Missing 74/75? - talkedToHalen = new VarbitRequirement(9676, 1); + talkedToHalen = new VarbitRequirement(VarbitID.DOV_SHIELD_HAIG, 1); givenShield = new VarbitRequirement(VarbitID.DOV, 50, Operation.GREATER_EQUAL); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/DemonSlayer.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/DemonSlayer.java index aa68bec0a35..bed24ba5eb2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/DemonSlayer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/DemonSlayer.java @@ -28,11 +28,8 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -43,76 +40,103 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class DemonSlayer extends BasicQuestHelper { - //Items Required - ItemRequirement bucket, bucketOfWater, key1, key2, key3, bones, silverlight, combatGear, silverlightEquipped, coin, food, bucketOfWaterOptional; - - //Items Recommended - ItemRequirement varrockTeleport, wizardsTowerTeleport; - - Requirement inVarrockSewer, inCastleNWFloor1, inCastleNWFloor2, inCastleNEFloor1, - hasPouredWaterIntoDrain, inTowerFloor1, obtainedSilverlight, delrithNearby, delrithWeakenedNearby, inInstance; - - QuestStep talkToPrysin, goUpToRovin, goUpToRovin2, talkToRovin, goDownstairsFromRovin, goDownstairsFromRovin2, - goUpToBucket, pickupBucket, - goDownFromBucket, fillBucket, useFilledBucketOnDrain, goDownManhole, pickupSecondKey, goUpManhole, goUpstairsWizard, talkToTraiborn, returnToPrysin, - getSilverlightBack, killDelrith, killDelrithStep; - + // Required items + ItemRequirement bucketOfWaterOptional; + ItemRequirement bones; + ItemRequirement coin; + ItemRequirement combatGear; + ItemRequirement food; + + // Recommended items + ItemRequirement varrockTeleport; + ItemRequirement wizardsTowerTeleport; + + // Mid-quest item requirements + ItemRequirement bucketOfWater; + ItemRequirement bucket; + ItemRequirement key1; + ItemRequirement key2; + ItemRequirement key3; + ItemRequirement silverlight; + ItemRequirement silverlightEquipped; + + // Zones + Zone varrockSewer; + Zone castleNWFloor1; + Zone castleNWFloor2; + Zone castleNEFloor1; + Zone towerFloor1; + + // Miscellaneous requirements + ZoneRequirement inVarrockSewer; + ZoneRequirement inCastleNWFloor1; + ZoneRequirement inCastleNWFloor2; + ZoneRequirement inCastleNEFloor1; + VarbitRequirement hasPouredWaterIntoDrain; + ZoneRequirement inTowerFloor1; + VarbitRequirement obtainedSilverlight; + NpcCondition delrithNearby; + NpcCondition delrithWeakenedNearby; + VarbitRequirement inInstance; + + // Steps + // -- Starting off NpcStep talkToAris; + NpcStep talkToPrysin; - ConditionalStep getFirstKey, getSecondKey, getThirdKey, goAndKillDelrith; - - //Zones - Zone varrockSewer, castleNWFloor1, castleNWFloor2, castleNEFloor1, towerFloor1; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToAris); - steps.put(1, talkToPrysin); + // -- Get Rovin's key + ConditionalStep getFirstKey; + ObjectStep goUpToRovin; + ObjectStep goUpToRovin2; + NpcStep talkToRovin; - getFirstKey = new ConditionalStep(this, goUpToRovin); - getFirstKey.addStep(inCastleNWFloor2, talkToRovin); - getFirstKey.addStep(inCastleNWFloor1, goUpToRovin2); - getFirstKey.setLockingCondition(new Conditions(LogicType.OR, obtainedSilverlight, key1.alsoCheckBank(questBank))); + // -- Get Prysin's key + ConditionalStep getSecondKey; + ObjectStep goDownstairsFromRovin; + ObjectStep goDownstairsFromRovin2; - getSecondKey = new ConditionalStep(this, goUpToBucket); - getSecondKey.addStep(new Conditions(hasPouredWaterIntoDrain, inVarrockSewer), pickupSecondKey); - getSecondKey.addStep(hasPouredWaterIntoDrain, goDownManhole); - getSecondKey.addStep(inCastleNWFloor1, goDownstairsFromRovin2); - getSecondKey.addStep(inCastleNWFloor2, goDownstairsFromRovin); - getSecondKey.addStep(bucketOfWater, useFilledBucketOnDrain); - getSecondKey.addStep(new Conditions(inCastleNEFloor1, bucketOfWater), goDownFromBucket); - getSecondKey.addStep(bucket, fillBucket); - getSecondKey.addStep(inCastleNEFloor1, pickupBucket); - getSecondKey.setLockingCondition(new Conditions(LogicType.OR, obtainedSilverlight, key2.alsoCheckBank(questBank))); + ObjectStep goUpToBucket; + ItemStep pickupBucket; + ObjectStep goDownFromBucket; + ObjectStep fillBucket; - getThirdKey = new ConditionalStep(this, goUpstairsWizard); - getThirdKey.addStep(inTowerFloor1, talkToTraiborn); - getThirdKey.addStep(inVarrockSewer, goUpManhole); - getThirdKey.setLockingCondition(new Conditions(LogicType.OR, obtainedSilverlight, key3.alsoCheckBank(questBank))); + ObjectStep useFilledBucketOnDrain; + ObjectStep goDownManhole; + ObjectStep pickupSecondKey; - goAndKillDelrith = new ConditionalStep(this, getSilverlightBack); - goAndKillDelrith.addStep(silverlight.alsoCheckBank(questBank), killDelrith); + // -- Get Traiborn's key + ConditionalStep getThirdKey; + ObjectStep goUpManhole; + ObjectStep goUpstairsWizard; - ConditionalStep getKeys = new ConditionalStep(this, getFirstKey); - getKeys.addStep(obtainedSilverlight, goAndKillDelrith); - getKeys.addStep(new Conditions(key1, key2, key3), returnToPrysin); - getKeys.addStep(new Conditions(key1, key2), getThirdKey); - getKeys.addStep(key1, getSecondKey); + NpcStep talkToTraiborn; - steps.put(2, getKeys); + // -- Kill Delrith + NpcStep returnToPrysin; + NpcStep getSilverlightBack; + IncantationStep killDelrith; + NpcStep killDelrithStep; - return steps; + @Override + protected void setupZones() + { + varrockSewer = new Zone(new WorldPoint(3151, 9855, 0), new WorldPoint(3290, 9919, 0)); + castleNWFloor1 = new Zone(new WorldPoint(3200, 3490, 1), new WorldPoint(3206, 3500, 1)); + castleNWFloor2 = new Zone(new WorldPoint(3200, 3494, 2), new WorldPoint(3206, 3500, 2)); + castleNEFloor1 = new Zone(new WorldPoint(3207, 3487, 1), new WorldPoint(3225, 3497, 1)); + towerFloor1 = new Zone(new WorldPoint(3102, 3154, 1), new WorldPoint(3114, 3165, 1)); } @Override @@ -138,50 +162,41 @@ protected void setupRequirements() wizardsTowerTeleport = new ItemRequirement("Teleport to the Wizards' Tower", ItemID.NECKLACE_OF_PASSAGE_5); coin = new ItemRequirement("Coin", ItemCollections.COINS); food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); - } - public void setupConditions() - { inCastleNEFloor1 = new ZoneRequirement(castleNEFloor1); inCastleNWFloor1 = new ZoneRequirement(castleNWFloor1); inCastleNWFloor2 = new ZoneRequirement(castleNWFloor2); inVarrockSewer = new ZoneRequirement(varrockSewer); inTowerFloor1 = new ZoneRequirement(towerFloor1); // 2568 going to 2 means you've taken the key, thus the key won't be there to be picked up should the key be deleted - hasPouredWaterIntoDrain = new VarbitRequirement(2568, 1); - obtainedSilverlight = new VarbitRequirement(2567, 1); + hasPouredWaterIntoDrain = new VarbitRequirement(VarbitID.DELRITH_DRAIN_KEY, 1); + obtainedSilverlight = new VarbitRequirement(VarbitID.DELRITH_SILVERLIGHT_CASE, 1); delrithNearby = new NpcCondition(NpcID.DELRITH); delrithWeakenedNearby = new NpcCondition(NpcID.DELRITH_WEAKENED); - inInstance = new VarbitRequirement(2569, 1); - } - - @Override - protected void setupZones() - { - varrockSewer = new Zone(new WorldPoint(3151, 9855, 0), new WorldPoint(3290, 9919, 0)); - castleNWFloor1 = new Zone(new WorldPoint(3200, 3490, 1), new WorldPoint(3206, 3500, 1)); - castleNWFloor2 = new Zone(new WorldPoint(3200, 3494, 2), new WorldPoint(3206, 3500, 2)); - castleNEFloor1 = new Zone(new WorldPoint(3207, 3487, 1), new WorldPoint(3225, 3497, 1)); - towerFloor1 = new Zone(new WorldPoint(3102, 3154, 1), new WorldPoint(3114, 3165, 1)); + inInstance = new VarbitRequirement(VarbitID.DELRITH_SEEN_SUMMONING_CUTSCENE, 1); } public void setupSteps() { + // -- Starting off talkToAris = new NpcStep(this, NpcID.ARIS, new WorldPoint(3204, 3424, 0), "Talk to Aris in her tent in Varrock Square.", coin); talkToAris.addDialogStep("The Demon Slayer Quest"); talkToAris.addDialogStep("Yes."); talkToAris.addDialogStep("Ok, here you go."); talkToAris.addDialogStep("Okay, where is he? I'll kill him for you!"); talkToAris.addDialogStep("So how did Wally kill Delrith?"); - talkToAris.addAlternateNpcs(11868); + talkToPrysin = new NpcStep(this, NpcID.SIR_PRYSIN, new WorldPoint(3203, 3472, 0), "Talk to Sir Prysin in the south west corner of Varrock Castle."); talkToPrysin.addDialogStep("Aris said I should come and talk to you."); talkToPrysin.addDialogStep("I need to find Silverlight."); talkToPrysin.addDialogStep("He's back and unfortunately I've got to deal with him."); talkToPrysin.addDialogStep("So give me the keys!"); talkToPrysin.addDialogStep("Can you give me your key?"); + + // -- Get Rovin's key goUpToRovin = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRS_TALLER, new WorldPoint(3203, 3498, 0), "Talk to Captain Rovin upstairs in the north west of Varrock Castle."); goUpToRovin2 = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRS_MIDDLE_TALLER, new WorldPoint(3203, 3498, 1), "Talk to Captain Rovin upstairs in the north west of Varrock Castle."); + goUpToRovin2.addDialogStep("Climb up"); talkToRovin = new NpcStep(this, NpcID.CAPTAIN_ROVIN, new WorldPoint(3205, 3498, 2), "Talk to Captain Rovin upstairs in the north west of Varrock Castle."); talkToRovin.addDialogStep("Yes I know, but this is important."); talkToRovin.addDialogStep("There's a demon who wants to invade this city."); @@ -191,23 +206,28 @@ public void setupSteps() talkToRovin.addDialogStep("Why did he give you one of the keys then?"); talkToRovin.addSubSteps(goUpToRovin, goUpToRovin2); + // -- Get Prysin's key goDownstairsFromRovin = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRSTOP, new WorldPoint(3203, 3498, 2), "Go to the Varrock Castle kitchen."); goDownstairsFromRovin2 = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRS_MIDDLE_TALLER, new WorldPoint(3203, 3498, 1), "Go to the Varrock Castle kitchen."); + goUpToBucket = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRS, new WorldPoint(3219, 3497, 0), "Get a bucket from above the Varrock Castle kitchen."); - pickupBucket = new DetailedQuestStep(this, new WorldPoint(3221, 3497, 1), "Pick up the bucket nearby.", bucket); + pickupBucket = new ItemStep(this, new WorldPoint(3221, 3497, 1), "Pick up the bucket nearby.", bucket); goDownFromBucket = new ObjectStep(this, ObjectID.VARROCK_SPIRALSTAIRSTOP, new WorldPoint(3219, 3497, 1), "Go back down to the kitchen."); fillBucket = new ObjectStep(this, ObjectID.FAI_VARROCK_POSH_SINK, new WorldPoint(3224, 3495, 0), "Use the bucket on the sink.", bucket); fillBucket.addIcon(ItemID.BUCKET_EMPTY); + useFilledBucketOnDrain = new ObjectStep(this, ObjectID.QIP_DS_QUESTDRAIN_KEY, new WorldPoint(3225, 3496, 0), "Use the bucket of water on the drain outside the kitchen.", bucketOfWater); - ((ObjectStep) useFilledBucketOnDrain).addAlternateObjects(ObjectID.QIP_DS_QUESTDRAIN_NOKEY); + useFilledBucketOnDrain.addAlternateObjects(ObjectID.QIP_DS_QUESTDRAIN_NOKEY); useFilledBucketOnDrain.addIcon(ItemID.BUCKET_WATER); useFilledBucketOnDrain.addSubSteps(goDownstairsFromRovin, goDownstairsFromRovin2, goUpToBucket, pickupBucket, goDownFromBucket, fillBucket); goDownManhole = new ObjectStep(this, ObjectID.MANHOLEOPEN, new WorldPoint(3237, 3458, 0), "Go down into Varrock Sewer via the Manhole south east of Varrock Castle."); - ((ObjectStep) goDownManhole).addAlternateObjects(ObjectID.MANHOLECLOSED); + goDownManhole.addAlternateObjects(ObjectID.MANHOLECLOSED); pickupSecondKey = new ObjectStep(this, ObjectID.QIP_DS_SEWER_KEY, new WorldPoint(3225, 9897, 0), "Pick up the Rusty Key north of the Sewer entrance."); + // -- Get Traiborn's key goUpManhole = new ObjectStep(this, ObjectID.FAI_VARROCK_MANHOLE_LADDER, new WorldPoint(3237, 9858, 0), "Bring Wizard Traiborn 25 bones in the Wizards' Tower.", bones); goUpstairsWizard = new ObjectStep(this, ObjectID.FAI_WIZTOWER_SPIRALSTAIRS, new WorldPoint(3104, 3160, 0), "Bring Wizard Traiborn 25 bones in the Wizards' Tower.", bones); + talkToTraiborn = new NpcStep(this, NpcID.TRAIBORN, new WorldPoint(3114, 3163, 1), "Bring Wizard Traiborn 25 bones in the Wizards' Tower. You don't need to bring them all at once.", bones); talkToTraiborn.addDialogStep("Talk about Demon Slayer."); talkToTraiborn.addDialogStep("I need to get a key given to you by Sir Prysin."); @@ -215,31 +235,88 @@ public void setupSteps() talkToTraiborn.addDialogStep("I'll get the bones for you."); talkToTraiborn.addSubSteps(goUpManhole, goUpstairsWizard); + // -- Kill Delrith returnToPrysin = new NpcStep(this, NpcID.SIR_PRYSIN, new WorldPoint(3203, 3472, 0), "Return to Sir Prysin in the south west of Varrock Castle.", key1, key2, key3); getSilverlightBack = new NpcStep(this, NpcID.SIR_PRYSIN, new WorldPoint(3203, 3472, 0), "Get Silverlight back from Sir Prysin in the south west of Varrock Castle."); returnToPrysin.addSubSteps(getSilverlightBack); killDelrithStep = new NpcStep(this, NpcID.DELRITH, new WorldPoint(3227, 3370, 0), "Kill Delrith (level 27) using Silverlight at the dark wizards south of Varrock. Once defeated, you'll need to say the magic words to banish him.", silverlightEquipped, combatGear); - killDelrith = new IncantationStep(this, killDelrithStep); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToAris); + steps.put(1, talkToPrysin); + + getFirstKey = new ConditionalStep(this, goUpToRovin); + getFirstKey.addStep(inCastleNWFloor2, talkToRovin); + getFirstKey.addStep(inCastleNWFloor1, goUpToRovin2); + getFirstKey.setLockingCondition(or(obtainedSilverlight, key1.alsoCheckBank())); + + getSecondKey = new ConditionalStep(this, goUpToBucket); + getSecondKey.addStep(and(hasPouredWaterIntoDrain, inVarrockSewer), pickupSecondKey); + getSecondKey.addStep(hasPouredWaterIntoDrain, goDownManhole); + getSecondKey.addStep(inCastleNWFloor1, goDownstairsFromRovin2); + getSecondKey.addStep(inCastleNWFloor2, goDownstairsFromRovin); + getSecondKey.addStep(and(inCastleNEFloor1, or(bucket, bucketOfWater)), goDownFromBucket); + getSecondKey.addStep(bucketOfWater, useFilledBucketOnDrain); + getSecondKey.addStep(bucket, fillBucket); + getSecondKey.addStep(inCastleNEFloor1, pickupBucket); + getSecondKey.setLockingCondition(or(obtainedSilverlight, key2.alsoCheckBank())); + + getThirdKey = new ConditionalStep(this, goUpstairsWizard); + getThirdKey.addStep(inTowerFloor1, talkToTraiborn); + getThirdKey.addStep(inVarrockSewer, goUpManhole); + getThirdKey.setLockingCondition(or(obtainedSilverlight, key3.alsoCheckBank())); + + var goAndKillDelrith = new ConditionalStep(this, getSilverlightBack); + goAndKillDelrith.addStep(silverlight.alsoCheckBank(), killDelrith); + + var getKeys = new ConditionalStep(this, getFirstKey); + getKeys.addStep(obtainedSilverlight, goAndKillDelrith); + getKeys.addStep(and(key1, key2, key3), returnToPrysin); + getKeys.addStep(and(key1, key2), getThirdKey); + getKeys.addStep(key1, getSecondKey); + + steps.put(2, getKeys); + + return steps; + } + @Override public List getItemRequirements() { - return Arrays.asList(coin, bones, bucketOfWaterOptional, combatGear, food); + return List.of( + coin, + bones, + bucketOfWaterOptional, + combatGear, + food + ); } @Override public List getItemRecommended() { - return Arrays.asList(varrockTeleport, wizardsTowerTeleport); + return List.of( + varrockTeleport, + wizardsTowerTeleport + ); } @Override public List getCombatRequirements() { - return Collections.singletonList("Delrith (level 27)"); + return List.of( + "Delrith (level 27)" + ); } @Override @@ -251,29 +328,59 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Silverlight", ItemID.SILVERLIGHT, 1)); + return List.of( + new ItemReward("Silverlight", ItemID.SILVERLIGHT, 1) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - - allSteps.add(new PanelDetails("Starting off", Arrays.asList(talkToAris, talkToPrysin), coin, bucketOfWaterOptional)); - PanelDetails rovinPanel = new PanelDetails("Get Rovin's key", Collections.singletonList(talkToRovin), bucketOfWaterOptional); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToAris, + talkToPrysin + ), List.of( + coin, + bucketOfWaterOptional + ))); + + var rovinPanel = new PanelDetails("Get Rovin's key", List.of( + talkToRovin + ), List.of( + bucketOfWaterOptional + )); rovinPanel.setLockingStep(getFirstKey); - allSteps.add(rovinPanel); + sections.add(rovinPanel); - PanelDetails prysinPanel = new PanelDetails("Get Prysin's key", Arrays.asList(useFilledBucketOnDrain, goDownManhole, pickupSecondKey)); + var prysinPanel = new PanelDetails("Get Prysin's key", List.of( + useFilledBucketOnDrain, + goDownManhole, + pickupSecondKey + )); prysinPanel.setLockingStep(getSecondKey); - allSteps.add(prysinPanel); + sections.add(prysinPanel); - PanelDetails traibornPanel = new PanelDetails("Get Traiborn's key", Collections.singletonList(talkToTraiborn), bones); + var traibornPanel = new PanelDetails("Get Traiborn's key", List.of( + talkToTraiborn + ), List.of( + bones + )); traibornPanel.setLockingStep(getThirdKey); - allSteps.add(traibornPanel); - - PanelDetails killDelrithPanel = new PanelDetails("Kill Delrith", Arrays.asList(returnToPrysin, killDelrithStep), silverlight, combatGear, food); - allSteps.add(killDelrithPanel); - return allSteps; + sections.add(traibornPanel); + + sections.add(new PanelDetails("Kill Delrith", List.of( + returnToPrysin, + killDelrithStep + ), List.of( + key1, + key2, + key3, + combatGear, + food + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/IncantationStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/IncantationStep.java index 76cdf212bde..92ddb2cc211 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/IncantationStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/demonslayer/IncantationStep.java @@ -36,7 +36,7 @@ public class IncantationStep extends ConditionalStep { - private final HashMap words = new HashMap() + private final HashMap words = new HashMap<>() {{ put(0, "Carlem"); put(1, "Aber"); @@ -44,10 +44,9 @@ public class IncantationStep extends ConditionalStep put(3, "Purchai"); put(4, "Gabindo"); }}; - + private final QuestStep incantationStep; private String[] incantationOrder; private int incantationPosition = 0; - private final QuestStep incantationStep; public IncantationStep(QuestHelper questHelper, QuestStep incantationStep) { @@ -56,10 +55,10 @@ public IncantationStep(QuestHelper questHelper, QuestStep incantationStep) this.steps.get(null).getText().add("Incantation is currently unknown."); } - @Override /** * {@inheritDoc} */ + @Override public void onWidgetLoaded(WidgetLoaded event) { int groupId = event.getGroupId(); @@ -113,26 +112,26 @@ private void updateChoiceIfRequired() private boolean shouldUpdateChoice() { - Widget widget = client.getWidget(InterfaceID.CHATMENU, 1); + var widget = client.getWidget(InterfaceID.Chatmenu.OPTIONS); if (widget == null) { return false; } - Widget[] children = widget.getChildren(); + var children = widget.getChildren(); if (children == null || children.length < 3) { return false; } - Widget childWidget = widget.getChild(2); + var childWidget = widget.getChild(2); return childWidget != null && "Aber".equals(childWidget.getText()); } - @Override /** * {@inheritDoc} */ + @Override protected void updateSteps() { if (incantationOrder != null || (client.getVarbitValue(VarbitID.DELRITH_INCANTATION_1) == 0 && client.getVarbitValue(VarbitID.DELRITH_INCANTATION_2) == 0)) @@ -147,7 +146,7 @@ protected void updateSteps() words.get(client.getVarbitValue(VarbitID.DELRITH_INCANTATION_4)), words.get(client.getVarbitValue(VarbitID.DELRITH_INCANTATION_5)), }; - String incantString = "Say the following in order: " + String.join(", ", incantationOrder); + var incantString = "Say the following in order: " + String.join(", ", incantationOrder); steps.get(null).getText().set(1, incantString); startUpStep(incantationStep); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasure/DesertTreasure.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasure/DesertTreasure.java index 32901db71fe..d3b33518193 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasure/DesertTreasure.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasure/DesertTreasure.java @@ -49,7 +49,6 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; -import net.runelite.api.NullItemID; import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; @@ -59,6 +58,7 @@ import net.runelite.api.gameval.VarbitID; import java.util.*; + import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class DesertTreasure extends BasicQuestHelper @@ -202,11 +202,11 @@ protected void setupRequirements() { coins650 = new ItemRequirement("Coins", ItemCollections.COINS, 650); magicLogs12 = new ItemRequirement("Magic logs (can be noted)", ItemID.MAGIC_LOGS, 12); - magicLogs12.addAlternates(NullItemID.NULL_1514); + magicLogs12.addAlternates(ItemID.Cert.MAGIC_LOGS); steelBars6 = new ItemRequirement("Steel bar (can be noted)", ItemID.STEEL_BAR, 6); - steelBars6.addAlternates(NullItemID.NULL_2354); + steelBars6.addAlternates(ItemID.Cert.STEEL_BAR); moltenGlass6 = new ItemRequirement("Molten glass (can be noted)", ItemID.MOLTEN_GLASS, 6); - moltenGlass6.addAlternates(NullItemID.NULL_1776); + moltenGlass6.addAlternates(ItemID.Cert.MOLTEN_GLASS); ashes = new ItemRequirement("Ashes", ItemID.ASHES); charcoal = new ItemRequirement("Charcoal", ItemID.CHARCOAL); bloodRune = new ItemRequirement("Blood rune", ItemID.BLOODRUNE); @@ -344,22 +344,22 @@ protected void setupZones() public void setupConditions() { // Given all items, 392 = 1; - killedDamis = new VarbitRequirement(383, 5); + killedDamis = new VarbitRequirement(VarbitID.FD_SHADOWWARRIOR_QUEST, 5); hadSmokeDiamond = new Conditions(true, smokeDiamond); gotIceDiamond = new Conditions(true, iceDiamond); - gotBloodDiamond = new VarbitRequirement(373, 4); + gotBloodDiamond = new VarbitRequirement(VarbitID.FDVW_SUBQUEST, 4); inSmokeDungeon = new ZoneRequirement(smokeDungeon); inFareedRoom = new ZoneRequirement(fareedRoom); - litTorch1 = new VarbitRequirement(360, 1); - litTorch2 = new VarbitRequirement(361, 1); - litTorch3 = new VarbitRequirement(363, 1); - litTorch4 = new VarbitRequirement(362, 1); - unlockedFareedDoor = new VarbitRequirement(386, 1); - killedFareed = new VarbitRequirement(376, 1); - talkedToRasolo = new VarbitRequirement(383, 2); + litTorch1 = new VarbitRequirement(VarbitID.FD_TORCH_COUNT1, 1); + litTorch2 = new VarbitRequirement(VarbitID.FD_TORCH_COUNT2, 1); + litTorch3 = new VarbitRequirement(VarbitID.FD_TORCH_COUNT4, 1); + litTorch4 = new VarbitRequirement(VarbitID.FD_TORCH_COUNT3, 1); + unlockedFareedDoor = new VarbitRequirement(VarbitID.FD_FIREWARGATE, 1); + killedFareed = new VarbitRequirement(VarbitID.FD_KILLED_FIREWARRIOR, 1); + talkedToRasolo = new VarbitRequirement(VarbitID.FD_SHADOWWARRIOR_QUEST, 2); gotRing = new VarbitRequirement(VarbitID.FD_SHADOWWARRIOR_QUEST, 3, Operation.GREATER_EQUAL); - unlockedCrossChest = new VarbitRequirement(384, 1); + unlockedCrossChest = new VarbitRequirement(VarbitID.FD_BANDITCHEST_DISARMED, 1); inShadowDungeon = new ZoneRequirement(shadowDungeon); @@ -367,35 +367,35 @@ public void setupConditions() damis2Nearby = new NpcInteractingRequirement(NpcID.FD_DAMIS_TOUGHER); // 385 0->1, in Damis spawn area? - talkedToMalak = new VarbitRequirement(373, 1); - askedAboutKillingDessous = new VarbitRequirement(373, 2); + talkedToMalak = new VarbitRequirement(VarbitID.FDVW_SUBQUEST, 1); + askedAboutKillingDessous = new VarbitRequirement(VarbitID.FDVW_SUBQUEST, 2); inDraynorSewer = new ZoneRequirement(draynorSewer); dessousNearby = new NpcCondition(NpcID.BLOODDIAMOND_VAMPIREWARRIOR); - killedDessous = new VarbitRequirement(373, 3); + killedDessous = new VarbitRequirement(VarbitID.FDVW_SUBQUEST, 3); - gaveCake = new VarbitRequirement(382, 1); + gaveCake = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_SUBQUEST, 1); talkedToTrollChild = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_SUBQUEST, 2, Operation.GREATER_EQUAL); // Killed kamil also results in 377 0->1 killedKamil = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_SUBQUEST, 3, Operation.GREATER_EQUAL); - freedTrolls = new VarbitRequirement(382, 4); - gotIceDiamond = new VarbitRequirement(382, 5); + freedTrolls = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_SUBQUEST, 4); + gotIceDiamond = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_SUBQUEST, 5); - killedTrolls = new VarbitRequirement(378, 5); + killedTrolls = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_TROLLSKILLED, 5); inTrollArea = new ZoneRequirement(trollArea); inPath = new ZoneRequirement(path1, path2); onIcePath = new ZoneRequirement(icePath); onIceBridge = new ZoneRequirement(iceBridge); - smashedIce1 = new VarbitRequirement(380, 1); + smashedIce1 = new VarbitRequirement(VarbitID.FD_ICEWARRIOR_DADFREE, 1); - placedSmoke = new VarbitRequirement(387, 1); - placedShadow = new VarbitRequirement(388, 1); - placedIce = new VarbitRequirement(389, 1); - placedBlood = new VarbitRequirement(390, 1); + placedSmoke = new VarbitRequirement(VarbitID.FD_COLUMN_FIRE, 1); + placedShadow = new VarbitRequirement(VarbitID.FD_COLUMN_SHADOW, 1); + placedIce = new VarbitRequirement(VarbitID.FD_COLUMN_ICE, 1); + placedBlood = new VarbitRequirement(VarbitID.FD_COLUMN_BLOOD, 1); inFloor1 = new ZoneRequirement(floor1); inFloor2 = new ZoneRequirement(floor2); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/ChestCodeStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/ChestCodeStep.java index 4a0efc8e0c7..b264b8389b7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/ChestCodeStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/ChestCodeStep.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarClientIntChanged; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarClientID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.FontManager; @@ -74,7 +75,7 @@ private void updateSolvedPositionState() { for (int i = 0; i < NUMBER_OF_DIALS; i++) { - int START_VARCLIENTINT_POS = 1113; + int START_VARCLIENTINT_POS = VarClientID.COMBINATION_LOCK_VALUE_0; int varcIntID = START_VARCLIENTINT_POS + i; int START_DOWN_ARROW = 3; int ARROW_INTERVAL = 7; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/DesertTreasureII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/DesertTreasureII.java index 078746c6a70..b37cd432956 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/DesertTreasureII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/DesertTreasureII.java @@ -27,6 +27,7 @@ import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankSlotIcons; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.panel.TopLevelPanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestVarbits; @@ -63,11 +64,12 @@ import java.util.*; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; public class DesertTreasureII extends BasicQuestHelper { + List allSteps = new ArrayList<>(); + DetailedQuestStep attemptToEnterVaultDoor, attemptToEnterVaultDoor2, talkToAsgarnia, inspectStatueSE, inspectStatueSW, inspectStatueNE, inspectStatueNW, inspectPlaque, talkToAsgarniaAgain, talkToBalando, operateWinch, talkToBanikan, getPickaxe, mineRocks, @@ -126,6 +128,8 @@ public Map loadSteps() initializeRequirements(); setupConditions(); setupSteps(); + prepopulateSidebarPanels(); + Map steps = new HashMap<>(); steps.put(0, attemptToEnterVaultDoor); steps.put(2, attemptToEnterVaultDoor); @@ -232,10 +236,10 @@ public Map loadSteps() sucellusSteps.setLockingCondition(finishedSucellus); perseriyaSteps.setLockingCondition(finishedPerseriya); - ConditionalStep findingTheFour = new ConditionalStep(this, vardorvisSteps); - findingTheFour.addStep(and(finishedVardorvis, finishedPerseriya, finishedSucellus), whispererSteps); - findingTheFour.addStep(and(finishedVardorvis, finishedPerseriya), sucellusSteps); - findingTheFour.addStep(finishedVardorvis, perseriyaSteps); + ReorderableConditionalStep findingTheFour = new ReorderableConditionalStep(this, whispererSteps); + findingTheFour.addStep(not(finishedVardorvis), vardorvisSteps); + findingTheFour.addStep(not(finishedPerseriya), perseriyaSteps); + findingTheFour.addStep(not(finishedSucellus), sucellusSteps); steps.put(42, findingTheFour); /* Entered stranglewood */ steps.put(44, findingTheFour); @@ -427,28 +431,28 @@ public void setupConditions() inGolemRoom = new ZoneRequirement(golemRoom); inFinalRoom = new ZoneRequirement(finalRoom); - inspectedPlaque = new VarbitRequirement(15105, 1); - inspectedStatueNE = new VarbitRequirement(15106, 1); - inspectedStatueSE = new VarbitRequirement(15107, 1); - inspectedStatueSW = new VarbitRequirement(15108, 1); - inspectedStatueNW = new VarbitRequirement(15109, 1); + inspectedPlaque = new VarbitRequirement(VarbitID.DT2_VAULT_PLAQUE, 1); + inspectedStatueNE = new VarbitRequirement(VarbitID.DT2_VAULT_STATUE_VARDORVIS, 1); + inspectedStatueSE = new VarbitRequirement(VarbitID.DT2_VAULT_STATUE_PERSERIYA, 1); + inspectedStatueSW = new VarbitRequirement(VarbitID.DT2_VAULT_STATUE_SUCELLUS, 1); + inspectedStatueNW = new VarbitRequirement(VarbitID.DT2_VAULT_STATUE_WHISPERER, 1); // 12139 0->1 (cutscene specific ID) // VarPlayer 3575 3840 -> 7936 inspectedGolem = new VarbitRequirement(QuestVarbits.QUEST_DESERT_TREASURE_II.getId(), 30, Operation.GREATER_EQUAL); // TODO: FIX CHECK FOR INSPECTED ALTAR, THOUGHT IT WAS 15111 BUT IT WASN'T - inspectedAltar = new VarbitRequirement(15109, 1); + inspectedAltar = new VarbitRequirement(VarbitID.DT2_VAULT_STATUE_WHISPERER, 1); // CAST BLOOD BARRAGE // 15116 0->4 // 15119 0->1 - smokeBeenCast = new VarbitRequirement(15117, 1); - shadowBeenCast = new VarbitRequirement(15118, 1); - bloodBeenCast = new VarbitRequirement(15119, 1); - iceBeenCast = new VarbitRequirement(15120, 1); + smokeBeenCast = new VarbitRequirement(VarbitID.DT2_WAR_ROOM_SMOKE_TOTEM, 1); + shadowBeenCast = new VarbitRequirement(VarbitID.DT2_WAR_ROOM_SHADOW_TOTEM, 1); + bloodBeenCast = new VarbitRequirement(VarbitID.DT2_WAR_ROOM_BLOOD_TOTEM, 1); + iceBeenCast = new VarbitRequirement(VarbitID.DT2_WAR_ROOM_ICE_TOTEM, 1); - castAllSpells = new VarbitRequirement(15116, 15); + castAllSpells = new VarbitRequirement(VarbitID.DT2_WAR_ROOM_ALTAR, 15); inPuzzle = new WidgetTextRequirement(838, 10, "One cell per row!"); @@ -521,10 +525,10 @@ public void setupConditions() // 14862 86->88 // 15129 0->1 - cellUnlocked = new VarbitRequirement(15124, 1); + cellUnlocked = new VarbitRequirement(VarbitID.DT2_HIDEOUT_GATE_UNLOCKED, 1); // Left cell, 88->90 - itemsRetrieved = new VarbitRequirement(14283, 0); + itemsRetrieved = new VarbitRequirement(VarbitID.HOLDING_INVENTORY_LOCATION, 0); // Stranger cutscene // 4606 0->3 // 12139 0->1 @@ -717,10 +721,10 @@ public void setupSteps() talkToElissa.addDialogStep("I hear you visited Lovakengj recently."); talkToElissa.addTeleport(senntistenTeleport); - vardorvisSteps = new VardorvisSteps(this, talkToElissa, questBank); + vardorvisSteps = new VardorvisSteps(this, talkToElissa); perseriyaSteps = new PerseriyaSteps(this, new DetailedQuestStep(this, "Do Perseriya steps.")); sucellusSteps = new SucellusSteps(this, new DetailedQuestStep(this, "Do Sucellus steps.")); - whispererSteps = new WhispererSteps(this, new DetailedQuestStep(this, "Do Whisperer steps."), questBank); + whispererSteps = new WhispererSteps(this, new DetailedQuestStep(this, "Do Whisperer steps.")); returnToDesertWithFinalMedallion = new ObjectStep(this, ObjectID.DT2_DESERT_VAULT_DOOR, new WorldPoint(3511, 2971, 0), @@ -847,10 +851,10 @@ public List getUnlockRewards() new UnlockReward("Access to four new bosses")); } - @Override - public List getPanels() + private void prepopulateSidebarPanels() { - List allSteps = new ArrayList<>(); + allSteps.clear(); + allSteps.add(new PanelDetails("The Vault", Arrays.asList(attemptToEnterVaultDoor, talkToAsgarnia, inspectPlaque, inspectStatueNE, inspectStatueNW, inspectStatueSW, inspectStatueSE, talkToAsgarniaAgain), @@ -869,50 +873,57 @@ public List getPanels() PanelDetails vardorvisPanel = new PanelDetails("Vardorvis", vardorvisSteps.getDisplaySteps(), Collections.singletonList(combatGear), - Arrays.asList(xericTalisman, freezes)); + Arrays.asList(xericTalisman, freezes)).withId(0); vardorvisPanel.setLockingStep(vardorvisSteps); - allSteps.add(vardorvisPanel); + vardorvisSteps.withId(0); - PanelDetails perseriyaPanel = new PanelDetails("Perseriya", + PanelDetails perseriyaPanel = new PanelDetails("Perseriya - The Abyss", perseriyaSteps.getStartSteps(), Arrays.asList(combatGear, facemask), Arrays.asList(eyeTeleport, staminaPotions, arclight)); - perseriyaPanel.setLockingStep(perseriyaSteps); - allSteps.add(perseriyaPanel); - allSteps.add(new PanelDetails("Perseriya - Room 1", + PanelDetails perseriyaPanel2 = new PanelDetails("Perseriya - Room 1", perseriyaSteps.getRoom1Steps(), Collections.singletonList(facemask), - Arrays.asList(eyeTeleport, staminaPotions, arclight))); - allSteps.add(new PanelDetails("Perseriya - Room 2", + Arrays.asList(eyeTeleport, staminaPotions, arclight)); + PanelDetails perseriyaPanel3 = new PanelDetails("Perseriya - Room 2", perseriyaSteps.getRoom2Steps(), List.of(facemask), - Arrays.asList(eyeTeleport, staminaPotions, arclight))); - allSteps.add(new PanelDetails("Perseriya - Room 3", + Arrays.asList(eyeTeleport, staminaPotions, arclight)); + PanelDetails perseriyaPanel4 = new PanelDetails("Perseriya - Room 3", perseriyaSteps.getRoom3Steps(), List.of(facemask), - Arrays.asList(eyeTeleport, staminaPotions, arclight))); - allSteps.add(new PanelDetails("Perseriya - The battle", + Arrays.asList(eyeTeleport, staminaPotions, arclight)); + PanelDetails perseriyaPanel5 = new PanelDetails("Perseriya - The battle", perseriyaSteps.getBattleSteps(), Arrays.asList(rangedCombatGear, shadowBurstRunes), - Arrays.asList(eyeTeleport, staminaPotions, food, prayerPotions))); + Arrays.asList(eyeTeleport, staminaPotions, food, prayerPotions)); + var perseriyaPanels = new TopLevelPanelDetails("Perseriya", perseriyaPanel, perseriyaPanel2, perseriyaPanel3, perseriyaPanel4, perseriyaPanel5).withId(1); + perseriyaPanels.setLockingStep(perseriyaSteps); + perseriyaSteps.withId(1); PanelDetails sucellusPanel = new PanelDetails("Sucellus", sucellusSteps.getDisplaySteps(), Arrays.asList(meleeCombatGear, food), - Arrays.asList(prayerPotions, staminaPotions, icyBasalt)); + Arrays.asList(prayerPotions, staminaPotions, icyBasalt)).withId(2); + sucellusSteps.withId(2); sucellusPanel.setLockingStep(sucellusSteps); - allSteps.add(sucellusPanel); - PanelDetails whispererPanel = new PanelDetails("The Whisperer", + PanelDetails whispererPanel = new PanelDetails("The Whisperer - The Unknown", whispererSteps.getDisplaySteps(), Arrays.asList(magicCombatGear, ringOfVisibility, food), Arrays.asList(prayerPotions, staminaPotions, lassarTeleport)); - whispererPanel.setLockingStep(whispererSteps); - allSteps.add(whispererPanel); - allSteps.add(new PanelDetails("The Whisperer - Choir", + + var whispererPanel2 = new PanelDetails("The Whisperer - Choir", whispererSteps.getDisplayStepsSilentChoir(), Arrays.asList(magicCombatGear, ringOfVisibility, food), - Arrays.asList(prayerPotions, staminaPotions, lassarTeleport))); + Arrays.asList(prayerPotions, staminaPotions, lassarTeleport)); + + var whispererPanels = new TopLevelPanelDetails("The Whisperer", whispererPanel, whispererPanel2).withId(3); + whispererPanels.setLockingStep(whispererSteps); + whispererSteps.withId(3); + + var theForgottenFourSections = new TopLevelPanelDetails("The Forgotten Four", vardorvisPanel, perseriyaPanels, sucellusPanel, whispererPanels); + allSteps.add(theForgottenFourSections); allSteps.add(new PanelDetails("Secrets", Arrays.asList(returnToDesertWithFinalMedallion, searchBedForHairClip, unlockCell, @@ -921,6 +932,12 @@ public List getPanels() talkToAzzanandra), Arrays.asList(meleeCombatGear, rangedCombatGear, food, prayerPotions), Arrays.asList(nardahTeleport, staminaPotions))); + + } + + @Override + public List getPanels() + { return allSteps; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/PerseriyaSteps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/PerseriyaSteps.java index 6c7317db9d6..b53c01c74e9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/PerseriyaSteps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/PerseriyaSteps.java @@ -38,7 +38,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.player.PrayerRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SpellbookRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.util.ItemSlots; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Spellbook; @@ -47,12 +46,8 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Prayer; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.*; import java.util.Arrays; import java.util.List; @@ -63,8 +58,6 @@ public class PerseriyaSteps extends ConditionalStep { ItemRequirement eyeTeleport, facemask; - final int PERSERIYA_VARBIT = 15128; - DetailedQuestStep enterWizardBasement, enterPortalToTempleOfTheEye, killDemons, hopOverSteppingStone, talkToPersten, enterPassage1, enterPathfinderRoom; @@ -375,11 +368,11 @@ protected void setupConditions() // 13095 0->100 // 5934 0->1->2->3->4??? - defeatedDemons = new VarbitRequirement(PERSERIYA_VARBIT, 8, Operation.GREATER_EQUAL); + defeatedDemons = new VarbitRequirement(VarbitID.DT2_SCAR, 8, Operation.GREATER_EQUAL); - attemptedToBoardBoat = new VarbitRequirement(PERSERIYA_VARBIT, 10, Operation.GREATER_EQUAL); + attemptedToBoardBoat = new VarbitRequirement(VarbitID.DT2_SCAR, 10, Operation.GREATER_EQUAL); // 12139 1->0 after boat attempt - talkedToPersten = new VarbitRequirement(PERSERIYA_VARBIT, 14, Operation.GREATER_EQUAL); + talkedToPersten = new VarbitRequirement(VarbitID.DT2_SCAR, 14, Operation.GREATER_EQUAL); // In room 1 // 15128 14->16 @@ -394,12 +387,12 @@ protected void setupConditions() onPath5 = new ZoneRequirement(path5); onPath6 = new ZoneRequirement(path6); - destroyedTether = new VarbitRequirement(15258, 1); + destroyedTether = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_1_DONE, 1); isNearCatalystRoom = new ZoneRequirement(nearCatalystRoom1, nearCatalystRoom2); inCatalystRoom = new ZoneRequirement(catalystRoom); - completedCatalystRoom = new VarbitRequirement(15259, 1); + completedCatalystRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_2_DONE, 1); isNearGrowthRoom = new ZoneRequirement(nearGrowth1, nearGrowth2); // On login to main area, 12164 0->1 // 13989 0->1 @@ -428,24 +421,24 @@ protected void setupConditions() // 202 inGrowthRoom = new ZoneRequirement(growthRoom); - repairedGrowths = new VarbitRequirement(15210, 4); - solvedGrowthRoom = new VarbitRequirement(15260, 1); + repairedGrowths = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_LIGHTS, 4); + solvedGrowthRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_3_DONE, 1); // Entered boat room, 15261 0->1 inBoatRoom1 = new ZoneRequirement(boatRoom1); // TODO: Verify if order is random for this stuff, and thus variable needs to consider some shift based on area?h haveReadTablet = new Conditions(LogicType.OR, - new VarbitRequirement(PERSERIYA_VARBIT, 18), - new VarbitRequirement(PERSERIYA_VARBIT, 26), - new VarbitRequirement(PERSERIYA_VARBIT, 34) + new VarbitRequirement(VarbitID.DT2_SCAR, 18), + new VarbitRequirement(VarbitID.DT2_SCAR, 26), + new VarbitRequirement(VarbitID.DT2_SCAR, 34) ); // 18->20, burned ship // 15128 20->22, talked to Persten // Attempted to enter room 2, 22->24 - completedRoom1 = new VarbitRequirement(PERSERIYA_VARBIT, 20, Operation.GREATER_EQUAL); - talkedToPerstenAfterRoom1 = new VarbitRequirement(PERSERIYA_VARBIT, 22, Operation.GREATER_EQUAL); + completedRoom1 = new VarbitRequirement(VarbitID.DT2_SCAR, 20, Operation.GREATER_EQUAL); + talkedToPerstenAfterRoom1 = new VarbitRequirement(VarbitID.DT2_SCAR, 22, Operation.GREATER_EQUAL); // Room 2 inAxonRoom = new ZoneRequirement(axonRoom1, axonRoom2, axonRoom3); @@ -456,7 +449,7 @@ protected void setupConditions() waterAxonPresent = new NpcRequirement(NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Water)"); fireAxonPresent = new NpcRequirement(NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Fire)"); natureAxonPresent = new NpcRequirement(NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Nature)"); - completedAxonRoom = new VarbitRequirement(15258, 1); + completedAxonRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_1_DONE, 1); nothingInHands = and(new NoItemRequirement("Weapon", ItemSlots.WEAPON), new NoItemRequirement("Shield", ItemSlots.SHIELD)); @@ -472,14 +465,14 @@ protected void setupConditions() dustNerveBroken = new ObjectCondition(ObjectID.DT2_SCAR_MAZE_3_COMBINATION_ENDING_DUST, new WorldPoint(1784, 6433, 0)); steamNerveBroken = new ObjectCondition(ObjectID.DT2_SCAR_MAZE_3_COMBINATION_ENDING_STEAM, new WorldPoint(1783, 6430, 0)); - completedNerveRoom = new VarbitRequirement(15259, 1); + completedNerveRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_2_DONE, 1); inNervePassage = new ZoneRequirement(nervePassage); impsNearby = new NpcRequirement("Scarred imp", NpcID.DT2_SCAR_MAZE_3_LINK_NPC); - completedSummoningRoom = new VarbitRequirement(15260, 1); + completedSummoningRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_3_DONE, 1); // Entered boat room, 15261 0->1. Seems to indicate 'teleport to boat room if they leave' - shouldReadTablet1 = new VarbitRequirement(PERSERIYA_VARBIT, 16); - shouldReadTablet2 = new VarbitRequirement(PERSERIYA_VARBIT, 24); - shouldReadTablet3 = new VarbitRequirement(PERSERIYA_VARBIT, 32); + shouldReadTablet1 = new VarbitRequirement(VarbitID.DT2_SCAR, 16); + shouldReadTablet2 = new VarbitRequirement(VarbitID.DT2_SCAR, 24); + shouldReadTablet3 = new VarbitRequirement(VarbitID.DT2_SCAR, 32); // 15128 26->28 burnt second boat // 15260 1->0 // 15259 1->0 @@ -487,8 +480,8 @@ protected void setupConditions() // 15261 0->1 // PERSTEN 2 = 28 - completedRoom2 = new VarbitRequirement(PERSERIYA_VARBIT, 28, Operation.GREATER_EQUAL); - talkedToPerstenAfterRoom2 = new VarbitRequirement(PERSERIYA_VARBIT, 30, Operation.GREATER_EQUAL); + completedRoom2 = new VarbitRequirement(VarbitID.DT2_SCAR, 28, Operation.GREATER_EQUAL); + talkedToPerstenAfterRoom2 = new VarbitRequirement(VarbitID.DT2_SCAR, 30, Operation.GREATER_EQUAL); // ENTER ROOM 3 // 15212 0->1 @@ -513,18 +506,18 @@ protected void setupConditions() inLeechRoom = new ZoneRequirement(leechRoom); inBoatRoom3 = new ZoneRequirement(boatRoom3); - solvedMemoryRoom = new VarbitRequirement(15258, 1); - solvedTreeRoom = new VarbitRequirement(15260, 1); - solvedLeechRoom = new VarbitRequirement(15259, 1); + solvedMemoryRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_1_DONE, 1); + solvedTreeRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_3_DONE, 1); + solvedLeechRoom = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_CHALLENGE_2_DONE, 1); protectFromMagic = new PrayerRequirement("Protect from Magic", Prayer.PROTECT_FROM_MAGIC); inSwRoom3 = new ZoneRequirement(swRoom3P1, swRoom3P2, swRoom3P3, swRoom3P4, swRoom3P5); - repairedGrowthRoom3 = new VarbitRequirement(15210, 4); - repairedCrimsonVeins = new VarbitRequirement(15219, 3); + repairedGrowthRoom3 = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_LIGHTS, 4); + repairedCrimsonVeins = new VarbitRequirement(VarbitID.DT2_SCAR_MAZE_2_RED_BLOOD_COUNT, 3); - completedRoom3 = new VarbitRequirement(PERSERIYA_VARBIT, 36, Operation.GREATER_EQUAL); + completedRoom3 = new VarbitRequirement(VarbitID.DT2_SCAR, 36, Operation.GREATER_EQUAL); - readyToFightLeviathan = new VarbitRequirement(PERSERIYA_VARBIT, 38, Operation.GREATER_EQUAL); + readyToFightLeviathan = new VarbitRequirement(VarbitID.DT2_SCAR, 38, Operation.GREATER_EQUAL); inLeviathanArea = new ZoneRequirement(leviathanArea); // Killed leviathan @@ -534,10 +527,10 @@ protected void setupConditions() // 1683 12215->-1 // 12401 1->0 (healthbar?) - defeatedLeviathan = new VarbitRequirement(PERSERIYA_VARBIT, 42, Operation.GREATER_EQUAL); + defeatedLeviathan = new VarbitRequirement(VarbitID.DT2_SCAR, 42, Operation.GREATER_EQUAL); inNELeviathanArea = new ZoneRequirement(neLeviathanArea); - perstenAtShip = new VarbitRequirement(PERSERIYA_VARBIT, 44, Operation.GREATER_EQUAL); - perstenLeft = new VarbitRequirement(PERSERIYA_VARBIT, 46, Operation.GREATER_EQUAL); + perstenAtShip = new VarbitRequirement(VarbitID.DT2_SCAR, 44, Operation.GREATER_EQUAL); + perstenLeft = new VarbitRequirement(VarbitID.DT2_SCAR, 46, Operation.GREATER_EQUAL); // Searched debris // 15128 46->48 @@ -550,7 +543,7 @@ protected void setupConditions() // Obtain medallion again, resets // Seemed to cap at 10 - foundPerseriyasMedallion = new VarbitRequirement(PERSERIYA_VARBIT, 48, Operation.GREATER_EQUAL); + foundPerseriyasMedallion = new VarbitRequirement(VarbitID.DT2_SCAR, 48, Operation.GREATER_EQUAL); } protected void setupSteps() @@ -621,7 +614,7 @@ protected void setupSteps() DetailedQuestStep doPath1RealStep = new DetailedQuestStep(getQuestHelper(), new WorldPoint(2197, 6444, 0), "Move the nearest pathfinder from the north, and follow it within a 3x3 area until the next pathfinder."); - doPath1RealStep.addTileMarker(new WorldPoint(2195, 6451, 0), SpriteID.RS2_SWORD_POINTED_LEFT); + doPath1RealStep.addTileMarker(new WorldPoint(2195, 6451, 0), SpriteID.Sworddecor.LEFT); doPath1RealStep.setLinePoints(Arrays.asList( new WorldPoint(2195, 6450, 0), new WorldPoint(2195, 6444, 0), @@ -632,7 +625,7 @@ protected void setupSteps() DetailedQuestStep doPath2RealStep = new DetailedQuestStep(getQuestHelper(), new WorldPoint(2202, 6442, 0), "Move the next pathfinder from the west, and step off when safe to the south pathfinder."); - doPath2RealStep.addTileMarker(new WorldPoint(2197, 6444, 0), SpriteID.RS2_SWORD_POINTED_LEFT); + doPath2RealStep.addTileMarker(new WorldPoint(2197, 6444, 0), SpriteID.Sworddecor.LEFT); doPath2RealStep.setLinePoints(Arrays.asList( new WorldPoint(2199, 6444, 0), new WorldPoint(2202, 6444, 0), @@ -643,7 +636,7 @@ protected void setupSteps() DetailedQuestStep doPath3RealStep = new DetailedQuestStep(getQuestHelper(), new WorldPoint(2198, 6438, 0), "Move the next pathbreaker from the north, and step off when safe to the west pathbreaker."); - doPath3RealStep.addTileMarker(new WorldPoint(2202, 6442, 0), SpriteID.RS2_SWORD_POINTED_LEFT); + doPath3RealStep.addTileMarker(new WorldPoint(2202, 6442, 0), SpriteID.Sworddecor.LEFT); doPath3RealStep.setLinePoints(Arrays.asList( new WorldPoint(2202, 6440, 0), new WorldPoint(2201, 6439, 0), @@ -654,7 +647,7 @@ protected void setupSteps() DetailedQuestStep doPath4RealStep = new DetailedQuestStep(getQuestHelper(), new WorldPoint(2196, 6435, 0), "Move the next pathbreaker from the west, and step off when safe to the south-west pathbreaker."); - doPath4RealStep.addTileMarker(new WorldPoint(2198, 6438, 0), SpriteID.RS2_SWORD_POINTED_LEFT); + doPath4RealStep.addTileMarker(new WorldPoint(2198, 6438, 0), SpriteID.Sworddecor.LEFT); doPath4RealStep.setLinePoints(Arrays.asList( new WorldPoint(2197, 6438, 0), new WorldPoint(2196, 6435, 0) @@ -663,7 +656,7 @@ protected void setupSteps() DetailedQuestStep doPath5RealStep = new DetailedQuestStep(getQuestHelper(), new WorldPoint(2207, 6436, 0), "Move the next pathbreaker from the east, and step off when safe to the east pathbreaker."); - doPath5RealStep.addTileMarker(new WorldPoint(2196, 6435, 0), SpriteID.RS2_SWORD_POINTED_LEFT); + doPath5RealStep.addTileMarker(new WorldPoint(2196, 6435, 0), SpriteID.Sworddecor.LEFT); doPath5RealStep.setLinePoints(Arrays.asList( new WorldPoint(2196, 6435, 0), new WorldPoint(2207, 6436, 0) @@ -672,7 +665,7 @@ protected void setupSteps() DetailedQuestStep doPath6RealStep = new ObjectStep(getQuestHelper(), ObjectID.DT2_SCAR_MAZE_ELECTRIC_FINISH, new WorldPoint(2210, 6433, 0), "Move the next pathbreaker from the south, and step off to destroy the abyssal tether."); - doPath6RealStep.addTileMarker(new WorldPoint(2207, 6436, 0), SpriteID.RS2_SWORD_POINTED_LEFT); + doPath6RealStep.addTileMarker(new WorldPoint(2207, 6436, 0), SpriteID.Sworddecor.LEFT); doPath6RealStep.setLinePoints(Arrays.asList( new WorldPoint(2207, 6436, 0), new WorldPoint(2207, 6433, 0), @@ -736,7 +729,7 @@ protected void setupSteps() // [9816, 9672, 9777] NpcStep hitCosmicAxonRealStep = new NpcStep(getQuestHelper(), NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Cosmic)", new WorldPoint(1743, 6421, 0), "Hit the Cosmic Axon towards the Cosmic terminal. Avoid the lightning strikes."); - hitCosmicAxonRealStep.addTileMarker(new WorldPoint(1746, 6414, 0), SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS); + hitCosmicAxonRealStep.addTileMarker(new WorldPoint(1746, 6414, 0), SpriteID.AchievementDiaryIcons.BLUE_QUESTS); hitCosmicAxonRealStep.setLinePoints(Arrays.asList( // Cosmic Axon new WorldPoint(1749, 6419, 0), @@ -748,7 +741,7 @@ protected void setupSteps() // [553, 573, 542] NpcStep hitFireAxonRealStep = new NpcStep(getQuestHelper(), NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Fire)", new WorldPoint(1743, 6421, 0), "Hit the Fire Axon towards the Fire terminal. Avoid the lightning strikes."); - hitFireAxonRealStep.addTileMarker(new WorldPoint(1748, 6426, 0), SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS); + hitFireAxonRealStep.addTileMarker(new WorldPoint(1748, 6426, 0), SpriteID.AchievementDiaryIcons.BLUE_QUESTS); hitFireAxonRealStep.setLinePoints(Arrays.asList( new WorldPoint(1744, 6413, 0), new WorldPoint(1744, 6421, 0), @@ -763,7 +756,7 @@ protected void setupSteps() // [20013, 19904, 20126] NpcStep hitNatureAxonRealStep = new NpcStep(getQuestHelper(), NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Nature)", new WorldPoint(1743, 6421, 0), "Hit the Nature Axon towards the Nature terminal. Avoid the lightning strikes."); - hitNatureAxonRealStep.addTileMarker(new WorldPoint(1733, 6426, 0), SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS); + hitNatureAxonRealStep.addTileMarker(new WorldPoint(1733, 6426, 0), SpriteID.AchievementDiaryIcons.BLUE_QUESTS); hitNatureAxonRealStep.setLinePoints(Arrays.asList( new WorldPoint(1743, 6424, 0), new WorldPoint(1740, 6424, 0), @@ -776,7 +769,7 @@ protected void setupSteps() // [-25047, -25024, -25058] NpcStep hitWaterAxonRealStep = new NpcStep(getQuestHelper(), NpcID.DT2_SCAR_MAZE_3_PATHING_NPC, "Abyssal Axon (Water)", new WorldPoint(1743, 6421, 0), "Hit the Water Axon towards the Water terminal. Avoid the lightning strikes."); - hitWaterAxonRealStep.addTileMarker(new WorldPoint(1736, 6414, 0), SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS); + hitWaterAxonRealStep.addTileMarker(new WorldPoint(1736, 6414, 0), SpriteID.AchievementDiaryIcons.BLUE_QUESTS); hitWaterAxonRealStep.setLinePoints(Arrays.asList( new WorldPoint(1735, 6422, 0), new WorldPoint(1743, 6422, 0), @@ -827,17 +820,17 @@ protected void setupSteps() repairNerve.addStep(and(lavaNerveBroken, lavaNerve), repairLavaNerve); repairNerve.addStep(and(lavaNerveBroken, fireNerve, earthNerve), makeLavaNerve); repairNerve.addStep(and(lavaNerveBroken, fireNerve), getEarthNerve); - repairNerve.addStep(LogicHelper.and(lavaNerveBroken), getFireNerve); + repairNerve.addStep(and(lavaNerveBroken), getFireNerve); repairNerve.addStep(and(dustNerveBroken, dustNerve), repairDustNerve); repairNerve.addStep(and(dustNerveBroken, airNerve, earthNerve), makeDustNerve); repairNerve.addStep(and(dustNerveBroken, airNerve), getEarthNerve); - repairNerve.addStep(LogicHelper.and(dustNerveBroken), getAirNerve); + repairNerve.addStep(and(dustNerveBroken), getAirNerve); repairNerve.addStep(and(smokeNerveBroken, smokeNerve), repairSmokeNerve); repairNerve.addStep(and(smokeNerveBroken, fireNerve, airNerve), makeSmokeNerve); repairNerve.addStep(and(smokeNerveBroken, fireNerve), getAirNerve); - repairNerve.addStep(LogicHelper.and(smokeNerveBroken), getFireNerve); + repairNerve.addStep(and(smokeNerveBroken), getFireNerve); repairNerve.addStep(and(steamNerve), repairSteamNerve); repairNerve.addStep(and(waterNerve, fireNerve), makeSteamNerve); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/SucellusSteps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/SucellusSteps.java index 69c3dc66ba6..ee906f199ad 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/SucellusSteps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/SucellusSteps.java @@ -32,7 +32,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetTextRequirement; @@ -91,9 +90,9 @@ public SucellusSteps(QuestHelper questHelper, QuestStep defaultStep) addStep(and(oddKeyDoorUnlocked, or(inDukeBossArena, inDukeEntrance)), talkToAssassinAfterDuke); addStep(and(oddKey, or(inDukeBossArena, inDukeEntrance)), enterRoomWestOfDuke); addStep(and(inDukeEntrance, killedDuke), retrieveKeyFromDoor); - addStep(LogicHelper.and(oddKeyNearby), pickUpOddKey); - addStep(LogicHelper.and(inDukeBossArena), defeatDuke); - addStep(LogicHelper.and(inDukeEntrance), enterDukeBossArea); + addStep(and(oddKeyNearby), pickUpOddKey); + addStep(and(inDukeBossArena), defeatDuke); + addStep(and(inDukeEntrance), enterDukeBossArea); addStep(and(inPrisonF2, dukeArenaUnlocked), enterDukeArena); addStep(and(inPrisonF2, defeatedJhallan), talkToAssassinAfterJhallanFight); addStep(and(inPrisonF2, inJhallanFight), survive3Mins); @@ -272,7 +271,7 @@ protected void setupConditions() gotGear = new VarbitRequirement(VarbitID.DT2_GHORROCK, 50, Operation.GREATER_EQUAL); talkedToAssassinWithGear = new VarbitRequirement(VarbitID.DT2_GHORROCK, 52, Operation.GREATER_EQUAL); - unlockedSECrevice = new VarbitRequirement(15177, 1); + unlockedSECrevice = new VarbitRequirement(VarbitID.DT2_GHORROCK_SHORTCUT_1, 1); inJhallanFight = new VarbitRequirement(VarbitID.DT2_GHORROCK, 54, Operation.GREATER_EQUAL); defeatedJhallan = new VarbitRequirement(VarbitID.DT2_GHORROCK, 56, Operation.GREATER_EQUAL); @@ -288,7 +287,7 @@ protected void setupConditions() // Global state 70->72 oddKeyNearby = new ItemOnTileRequirement(oddKey); - oddKeyDoorUnlocked = new VarbitRequirement(15179, 1); + oddKeyDoorUnlocked = new VarbitRequirement(VarbitID.DT2_GHORROCK_ASYLUM_GATE, 1); talkedToAssassinAfterDuke = new VarbitRequirement(VarbitID.DT2_GHORROCK, 66, Operation.GREATER_EQUAL); @@ -574,7 +573,7 @@ protected void setupSteps() "Talk to the assassin."); goLightFirecrackers = new ObjectStep(getQuestHelper(), ObjectID.DT2_GHORROCK_FIRECRACKER_PACK, new WorldPoint(2972, 6367, 2), "Get a full inventory of food, and return to the refugee camp in the south-eastern room. " + - "Light the firecrackers there. Once you do, you'll need to survive Jhallan attacking you for 3 minutes."); + "Light the firecrackers there. Once you do, you'll need to survive Jhallan attacking you for 2 minutes."); ((ObjectStep) goLightFirecrackers).setLinePoints(Arrays.asList( new WorldPoint(2905, 6375, 2), new WorldPoint(2905, 6348, 2), @@ -593,7 +592,7 @@ protected void setupSteps() goLightFirecrackersThroughCrevice = new ObjectStep(getQuestHelper(), ObjectID.DT2_GHORROCK_FIRECRACKER_PACK, new WorldPoint(2972, 6367, 2), "Get a full inventory of food, and return to the refugee camp in the south-eastern room. " + - "Light the firecrackers there. Once you do, you'll need to survive Jhallan attacking you for 3 minutes."); + "Light the firecrackers there. Once you do, you'll need to survive Jhallan attacking you for 2 minutes."); ((ObjectStep) goLightFirecrackersThroughCrevice).setLinePoints(Arrays.asList( new WorldPoint(2905, 6375, 2), new WorldPoint(2905, 6348, 2), @@ -608,7 +607,7 @@ protected void setupSteps() goLightFirecrackers.addSubSteps(goLightFirecrackersThroughCrevice); survive3Mins = new NpcStep(getQuestHelper(), NpcID.DT2_JHALLAN_CUTSCENE, new WorldPoint(2975, 6362, 2), - "Survive Jhallan's attacks for 3 minutes. Protect from Mage, keep your health high, and avoid the shadow attacks."); + "Survive Jhallan's attacks for 2 minutes. Protect from Mage, keep your health high, and avoid the shadow attacks."); ((NpcStep) survive3Mins).addAlternateNpcs(NpcID.SOTN_JHALLAN_GHORROCK, NpcID.SOTN_JHALLAN_CUTSCENE, NpcID.DT2_JHALLAN_COMBAT, NpcID.DT2_JHALLAN_CHASE); talkToAssassinAfterJhallanFight = new NpcStep(getQuestHelper(), NpcID.DT2_ASSASSIN_GHORROCK_VIS, new WorldPoint(2978, 6371, 2), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/VardorvisSteps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/VardorvisSteps.java index 6247bdafbac..e672cc304cb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/VardorvisSteps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/VardorvisSteps.java @@ -24,7 +24,6 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.deserttreasureii; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankSlotIcons; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; @@ -70,12 +69,9 @@ public class VardorvisSteps extends ConditionalStep vardorvisMedallion, food; Zone stranglewood, towerDefenseRoom, stranglewoodPyramidRoom, vardorvisArea, vault; - QuestBank questBank; - - public VardorvisSteps(QuestHelper questHelper, NpcStep defaultStep, QuestBank questBank) // talkToElissa + public VardorvisSteps(QuestHelper questHelper, NpcStep defaultStep) // talkToElissa { super(questHelper, defaultStep); - this.questBank = questBank; talkToElissa = defaultStep; setupItemRequirements(); @@ -109,8 +105,8 @@ public VardorvisSteps(QuestHelper questHelper, NpcStep defaultStep, QuestBank qu addStep(new Conditions(inStrangewood, finishedStranglewoodCutscene), talkToKasonde); addStep(new Conditions(inStrangewood), runIntoStanglewood); addStep(new Conditions(haveDrunkPotion), boardBoat); - addStep(new Conditions(haveReadPotionNote, strangePotion.alsoCheckBank(questBank)), drinkPotion); - addStep(new Conditions(new Conditions(LogicType.NOR, haveReadPotionNote), potionNote.alsoCheckBank(questBank)), readPotionNote); + addStep(new Conditions(haveReadPotionNote, strangePotion.alsoCheckBank()), drinkPotion); + addStep(new Conditions(new Conditions(LogicType.NOR, haveReadPotionNote), potionNote.alsoCheckBank()), readPotionNote); addStep(talkedToBarus, searchDesk); addStep(talkedToElissa, talkToBarus); } @@ -194,17 +190,17 @@ protected void setupConditions() toldAboutHerbAndBerry = new VarbitRequirement(VarbitID.DT2_STRANGLEWOOD, 24, Operation.GREATER_EQUAL); // 15136 0->2 taken herb // 15125 24->26, herb taken - herbTaken = new VarbitRequirement(15136, 2); + herbTaken = new VarbitRequirement(VarbitID.DT2_STRANGLEWOOD_INGREDIENT_1, 2); // 15125 26->28, picked berry // 15137, 0->1 berry taken - berryTaken = new VarbitRequirement(15137, 1); + berryTaken = new VarbitRequirement(VarbitID.DT2_STRANGLEWOOD_INGREDIENT_2, 1); // 15125 28->30->32 when entering pyramid inStranglewoodPyramidRoom = new ZoneRequirement(stranglewoodPyramidRoom); defendedKasondeWithHerb = new VarbitRequirement(VarbitID.DT2_STRANGLEWOOD, 34, Operation.GREATER_EQUAL); receivedSerum = new VarbitRequirement(VarbitID.DT2_STRANGLEWOOD, 36, Operation.GREATER_EQUAL); - addedHerb = serumWithHerb.alsoCheckBank(questBank); - addedBerry = stranglerSerum.alsoCheckBank(questBank); + addedHerb = serumWithHerb.alsoCheckBank(); + addedBerry = stranglerSerum.alsoCheckBank(); drankPotion = new VarbitRequirement(VarbitID.DT2_STRANGLEWOOD, 38, Operation.GREATER_EQUAL); inAnyStranglewood = new Conditions(LogicType.OR, inStranglewoodPyramidRoom, inStrangewood); @@ -409,8 +405,8 @@ protected void setupSteps() returnToKasondeWithTempleKey = new ConditionalStep(getQuestHelper(), boardBoat, "Return to Kasonde with the temple key, who is inside the main pyramid of the area to the north. " + "Be ready for another fight.", combatGear, templeKey.hideConditioned(givenKasondeKey)); - returnToKasondeWithTempleKey.addStep(new Conditions(inStranglewoodPyramidRoom, templeKey.alsoCheckBank(questBank)), giveKasondeKey); - returnToKasondeWithTempleKey.addStep(new Conditions(inAnyStranglewood, or(templeKey.alsoCheckBank(questBank), givenKasondeKey)), enterKasondeWithKey); + returnToKasondeWithTempleKey.addStep(new Conditions(inStranglewoodPyramidRoom, templeKey.alsoCheckBank()), giveKasondeKey); + returnToKasondeWithTempleKey.addStep(new Conditions(inAnyStranglewood, or(templeKey.alsoCheckBank(), givenKasondeKey)), enterKasondeWithKey); returnToKasondeWithTempleKey.addStep(templeKeyNearby, pickUpTempleKey); returnToKasondeWithTempleKey.addStep(inAnyStranglewood, getTempleKeyFromRocks); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/WhispererSteps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/WhispererSteps.java index 308ebbe29c3..19ddc89833a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/WhispererSteps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deserttreasureii/WhispererSteps.java @@ -24,7 +24,6 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.deserttreasureii; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankSlotIcons; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; @@ -37,7 +36,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.location.TileIsLoadedRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.runelite.RuneliteRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; @@ -59,8 +57,6 @@ public class WhispererSteps extends ConditionalStep { - QuestBank questBank; - QuestStep enterRuinsOfCamdozaal, talkToRamarno, talkToPrescott, attachRope, descendDownRope, activateTeleporter1, activateTeleporter2, activateTeleporter3, activateTeleporter4, activateTeleporter5, activateTeleporter6, activateTeleporter7, recallShadowBlocker, useTeleporterToKetla, useTeleporterToScienceDistrict, @@ -120,10 +116,9 @@ public class WhispererSteps extends ConditionalStep lassarShadowRealmSW, drainF0, drainF1, visionRegion, startingRoom, scienceDistrict, residentialDistrict, eastShadowRealm, realPub; - public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank questBank) + public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep) { super(questHelper, defaultStep); - this.questBank = questBank; setupItemRequirements(); setupZones(); setupConditions(); @@ -137,7 +132,7 @@ public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank lockedDoorSteps.addStep(and(inEastShadowRealm, blueShadowKey), activateBlackstoneFragment3); lockedDoorSteps.addStep(and(inLassarShadowRealm, basicShadowTorchSchematic), activateBlackstoneFragment); lockedDoorSteps.addStep(and(basicShadowTorchSchematic), bringKetlaTheBasicTorchSchematic); - lockedDoorSteps.addStep(and(inFurnaceHouse, LogicHelper.nor(givenTorchSchematic)), takeShadowTorchSchematic); + lockedDoorSteps.addStep(and(inFurnaceHouse, nor(givenTorchSchematic)), takeShadowTorchSchematic); lockedDoorSteps.addStep(and(inLassarShadowRealm, hadPurpleKey, blockerPlacedAtDoor), unlockDoor); lockedDoorSteps.addStep(and(hadPurpleKey, blockerPlacedAtDoor), enterSciencePuddle); lockedDoorSteps.addStep(and(hadPurpleKey, blockerNearby), retrieveShadowBlocker); @@ -145,12 +140,12 @@ public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank lockedDoorSteps.addStep(and(hadPurpleKey, shadowBlocker, inStartingRoom), useTeleporterToScienceDistrict); lockedDoorSteps.addStep(and(hadPurpleKey, shadowBlocker), placeBlockerInFurnaceBuilding); lockedDoorSteps.addStep(and(hadPurpleKey, inStartingRoom), useTeleporterToKetla); - lockedDoorSteps.addStep(LogicHelper.and(hadPurpleKey), claimShadowBlocker); + lockedDoorSteps.addStep(and(hadPurpleKey), claimShadowBlocker); ConditionalStep blueKeySteps = new ConditionalStep(getQuestHelper(), claimRevitalisingIdol); blueKeySteps.addStep(and(inLassarShadowRealm, destroyedTentacles2), activateBlackstoneFragment3); blueKeySteps.addStep(and(inLassar, destroyedTentacles2), getBlueShadowKeyRealRealm); - blueKeySteps.addStep(LogicHelper.and(inLassarShadowRealm), destroyTentacles2); + blueKeySteps.addStep(and(inLassarShadowRealm), destroyTentacles2); blueKeySteps.addStep(and(idolPlaced, basicShadowTorch), enterResidentialPuddleAgain); blueKeySteps.addStep(and(idolNearby, basicShadowTorch, activatedTeleporter7), pickUpIdol); blueKeySteps.addStep(and(revitalisingIdol, basicShadowTorch, activatedTeleporter7), placeIdol); @@ -183,7 +178,7 @@ public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank ConditionalStep getPerfectedSchematicSteps = new ConditionalStep(getQuestHelper(), placeBlockerWhiteChest); getPerfectedSchematicSteps.addStep(and(inLassarShadowRealm, braziersLit), openFinalChest); getPerfectedSchematicSteps.addStep(and(inLassarShadowRealm, lowSanity, idolShadowRealmFullNearby), restoreSanity); - getPerfectedSchematicSteps.addStep(LogicHelper.and(inLassarShadowRealm), lightBraziers); + getPerfectedSchematicSteps.addStep(and(inLassarShadowRealm), lightBraziers); getPerfectedSchematicSteps.addStep(and(placedBlockerWhiteChest, placedAnimaWhiteChest, placedIdolWhiteChest), enterPlazaPuddle2); getPerfectedSchematicSteps.addStep(and(placedBlockerWhiteChest, placedAnimaWhiteChest), placeIdolWhiteChest); getPerfectedSchematicSteps.addStep(placedBlockerWhiteChest, placeAnimaWhiteChest); @@ -191,7 +186,7 @@ public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank ConditionalStep silentChoirSteps = new ConditionalStep(getQuestHelper(), enterPuddleNearPub); silentChoirSteps.addStep(and(inPubShadowRealm, touchedPubRemnant), activateBlackstoneFragment8); - silentChoirSteps.addStep(LogicHelper.and(inDrainF0), inspectPillar); + silentChoirSteps.addStep(and(inDrainF0), inspectPillar); silentChoirSteps.addStep(and(inDrainF1, iconUsed), goDownDrainLadder); silentChoirSteps.addStep(and(inDrainF1, strangeIcon), useIconInDrain); silentChoirSteps.addStep(and(inLassar, touchedPubRemnant, or(strangeIcon, iconUsed)), enterDrain); @@ -225,7 +220,7 @@ public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank addStep(and(inLassar, unlockedPerfectShadowTorch), claimPerfectShadowTorch); // NOTE: I was not told to do this addStep(and(inCamdozaal, unlockedPerfectShadowTorch), descendDownRopeFight); - addStep(LogicHelper.and(unlockedPerfectShadowTorch), enterRuinsOfCamdozaalFight); + addStep(and(unlockedPerfectShadowTorch), enterRuinsOfCamdozaalFight); addStep(and(inLassar, escapedVision), talkToKetlaAfterVision); addStep(inVision, talkToMe); @@ -268,7 +263,7 @@ public WhispererSteps(QuestHelper questHelper, QuestStep defaultStep, QuestBank addStep(and(inLassar, activatedTeleporter1, activatedTeleporter2, activatedTeleporter3), takeShadowBlockerSchematic); addStep(and(inLassar, activatedTeleporter1, activatedTeleporter2), activateTeleporter3); addStep(and(inLassar, activatedTeleporter1), activateTeleporter2); - addStep(LogicHelper.and(inLassar), activateTeleporter1); + addStep(and(inLassar), activateTeleporter1); addStep(and(inCamdozaal, ropeAttached), descendDownRope); addStep(and(inCamdozaal, talkedToPrescott, veryLongRope), attachRope); addStep(and(inCamdozaal, talkedToRamarno), talkToPrescott); @@ -298,8 +293,8 @@ protected void setupItemRequirements() /* Quest items */ whisperersMedallion = new ItemRequirement("Whisperer's medallion", ItemID.DT2_MEDALLION_WHISPERER) - .alsoCheckBank(questBank); - veryLongRope = new ItemRequirement("Very long rope", ItemID.DT2_LASSAR_ROPE).alsoCheckBank(questBank); + .alsoCheckBank(); + veryLongRope = new ItemRequirement("Very long rope", ItemID.DT2_LASSAR_ROPE).alsoCheckBank(); shadowBlockerSchematic = new ItemRequirement("Shadow blocker schematic", ItemID.DT2_LASSAR_SHADOW_BLOCKER_SCHEMATIC); greenShadowKey = new ItemRequirement("Shadow key", ItemID.DT2_LASSAR_KEY_5); purpleShadowKey = new ItemRequirement("Shadow key", ItemID.DT2_LASSAR_KEY_1); @@ -373,34 +368,32 @@ protected void setupConditions() inResidentialDistrict = new ZoneRequirement(residentialDistrict); inEastShadowRealm = new ZoneRequirement(eastShadowRealm); - int WHISPERER_VARBIT = 15126; - // Varbit is for learning about the area from the previous quest talkedToRamarno = new VarbitRequirement(VarbitID.CAMDOZAAL_RAMARNO_INTRO, 2, Operation.GREATER_EQUAL); - talkedToPrescott = new VarbitRequirement(WHISPERER_VARBIT, 4, Operation.GREATER_EQUAL); - ropeAttached = new VarbitRequirement(WHISPERER_VARBIT, 6, Operation.GREATER_EQUAL); + talkedToPrescott = new VarbitRequirement(VarbitID.DT2_LASSAR, 4, Operation.GREATER_EQUAL); + ropeAttached = new VarbitRequirement(VarbitID.DT2_LASSAR, 6, Operation.GREATER_EQUAL); // Entered undercity: // 15064 0->100 // 15126 6->8 // 14862 78->80 // varplayer 3575 36691712 -> 36699904 - activatedTeleporter1 = new VarbitRequirement(15088, 1); - activatedTeleporter2 = new VarbitRequirement(15089, 1); - activatedTeleporter3 = new VarbitRequirement(15091, 1); - activatedTeleporter4 = new VarbitRequirement(15092, 1); - activatedTeleporter5 = new VarbitRequirement(15093, 1); - activatedTeleporter6 = new VarbitRequirement(15090, 1); - activatedTeleporter7 = new VarbitRequirement(15094, 1); + activatedTeleporter1 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_PALACE, 1); + activatedTeleporter2 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_PLAZA, 1); + activatedTeleporter3 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_SCIENCE_NORTH, 1); + activatedTeleporter4 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_SCIENCE_SOUTH, 1); + activatedTeleporter5 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_RESIDENTIAL_WEST, 1); + activatedTeleporter6 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_CATHEDRAL, 1); + activatedTeleporter7 = new VarbitRequirement(VarbitID.DT2_LASSAR_TELEPORTER_RESIDENTIAL_EAST, 1); - passedOutAtCathedral = new VarbitRequirement(WHISPERER_VARBIT, 10, Operation.GREATER_EQUAL); + passedOutAtCathedral = new VarbitRequirement(VarbitID.DT2_LASSAR, 10, Operation.GREATER_EQUAL); // 10->12, ketla wants to see the ring // 12->14, fragment is now safe // 14->16, tried to give me fragment - finishedTalkingToKetla = new VarbitRequirement(WHISPERER_VARBIT, 16, Operation.GREATER_EQUAL); - givenShadowBlockerSchematic = new VarbitRequirement(15082, 1); + finishedTalkingToKetla = new VarbitRequirement(VarbitID.DT2_LASSAR, 16, Operation.GREATER_EQUAL); + givenShadowBlockerSchematic = new VarbitRequirement(VarbitID.DT2_LASSAR_SHADOW_BLOCKER_SCHEMATIC, 1); // Entered science puddle // 15162 0->1 (probably just 'is in shadow realm'?) // 15163 0->3->13->14->15->16->17...100, ticks up to 100 @@ -460,7 +453,7 @@ protected void setupConditions() // 15126 18->20 // Unsure when 16->18 happened - givenTorchSchematic = new VarbitRequirement(15085, 1); + givenTorchSchematic = new VarbitRequirement(VarbitID.DT2_LASSAR_SHADOW_TORCH_T1_SCHEMATIC, 1); ObjectCondition realWorldTentacleExists = new ObjectCondition(ObjectID.DT2_LASSAR_BARRIER_NORMAL_T1, new Zone(new WorldPoint(2673, 6413, 0), @@ -484,7 +477,7 @@ protected void setupConditions() realWorldTentacleExists) ); - givenIdolSchematic = new VarbitRequirement(15083, 1); + givenIdolSchematic = new VarbitRequirement(VarbitID.DT2_LASSAR_REVITALISING_IDOL_SCHEMATIC, 1); idolPlaced = new ObjectCondition(ObjectID.DT2_LASSAR_REVITALISING_IDOL_NORMAL, new Zone(new WorldPoint(2685, 6414, 0), new WorldPoint(2700, 6427, 0))); @@ -537,7 +530,7 @@ protected void setupConditions() // Picked up superior schematics // 15126 20->22 - givenSuperiorTorchSchematic = new VarbitRequirement(15086, 1); + givenSuperiorTorchSchematic = new VarbitRequirement(VarbitID.DT2_LASSAR_SHADOW_TORCH_T2_SCHEMATIC, 1); // 22->24 destroyedTentacles3 = new Conditions( @@ -547,7 +540,7 @@ protected void setupConditions() // Anima portal real world block: // 48207, new W(2578, y=6398, 0) Shadow Realm: ObjectID.DT2_LASSAR_BARRIER_SHADOW_T2 - givenAnimaPortalSchematic = new VarbitRequirement(15084, 1); + givenAnimaPortalSchematic = new VarbitRequirement(VarbitID.DT2_LASSAR_ANIMA_PORTAL_SCHEMATIC, 1); /* Tentacle 4 */ Conditions withinRangeOfTentacle4 = new Conditions( @@ -602,13 +595,13 @@ protected void setupConditions() )); // Schematic got - obtainedPerfectedSchematic = new VarbitRequirement(WHISPERER_VARBIT, 26, Operation.GREATER_EQUAL); + obtainedPerfectedSchematic = new VarbitRequirement(VarbitID.DT2_LASSAR, 26, Operation.GREATER_EQUAL); // 15126 24->26 - perfectSchematicGiven = new VarbitRequirement(WHISPERER_VARBIT, 28, Operation.GREATER_EQUAL); + perfectSchematicGiven = new VarbitRequirement(VarbitID.DT2_LASSAR, 28, Operation.GREATER_EQUAL); - learntAboutSilentChoir = new VarbitRequirement(WHISPERER_VARBIT, 30, Operation.GREATER_EQUAL); + learntAboutSilentChoir = new VarbitRequirement(VarbitID.DT2_LASSAR, 30, Operation.GREATER_EQUAL); - touchedPubRemnant = new VarbitRequirement(WHISPERER_VARBIT, 32, Operation.GREATER_EQUAL); + touchedPubRemnant = new VarbitRequirement(VarbitID.DT2_LASSAR, 32, Operation.GREATER_EQUAL); /* Tentacle 5 */ Conditions withinRangeOfTentacle5 = new Conditions( @@ -694,13 +687,13 @@ protected void setupConditions() // 32->34, maybe when made idol? - iconUsed = new VarbitRequirement(WHISPERER_VARBIT, 36, Operation.GREATER_EQUAL); + iconUsed = new VarbitRequirement(VarbitID.DT2_LASSAR, 36, Operation.GREATER_EQUAL); // animation 2757, fade-in - escapedVision = new VarbitRequirement(WHISPERER_VARBIT, 38, Operation.GREATER_EQUAL); + escapedVision = new VarbitRequirement(VarbitID.DT2_LASSAR, 38, Operation.GREATER_EQUAL); // 38->40, unlocked shadow torch - unlockedPerfectShadowTorch = new VarbitRequirement(15087, 1); + unlockedPerfectShadowTorch = new VarbitRequirement(VarbitID.DT2_LASSAR_SHADOW_TORCH_T3_SCHEMATIC, 1); Conditions withinRangeOfCathedralTentacle = new Conditions( or( @@ -724,7 +717,7 @@ protected void setupConditions() ); // 14862 80->82 - enteredCathedral = new VarbitRequirement(WHISPERER_VARBIT, 42, Operation.GREATER_EQUAL); + enteredCathedral = new VarbitRequirement(VarbitID.DT2_LASSAR, 42, Operation.GREATER_EQUAL); // Killed Whisperer: // 15064 0->100 (insanity?) @@ -732,7 +725,7 @@ protected void setupConditions() // 15126 42->44 // 14862 82->84 // - killedWhisperer = new VarbitRequirement(WHISPERER_VARBIT, 44, Operation.GREATER_EQUAL); + killedWhisperer = new VarbitRequirement(VarbitID.DT2_LASSAR, 44, Operation.GREATER_EQUAL); // Obtained medallion // 15126 44->46 // 14862 84->86 diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deviousminds/DeviousMinds.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deviousminds/DeviousMinds.java index 6e675842bfa..54925d6b55c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deviousminds/DeviousMinds.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/deviousminds/DeviousMinds.java @@ -83,16 +83,16 @@ public Map loadSteps() steps.put(0, talkToMonk); ConditionalStep makeEntireBowSword = new ConditionalStep(this, makeBlade); - makeEntireBowSword.addStep(bowSword.alsoCheckBank(questBank), talkToMonk2); - makeEntireBowSword.addStep(slenderBlade.alsoCheckBank(questBank), makeBowSword); + makeEntireBowSword.addStep(bowSword.alsoCheckBank(), talkToMonk2); + makeEntireBowSword.addStep(slenderBlade.alsoCheckBank(), makeBowSword); steps.put(10, makeEntireBowSword); steps.put(20, talkToMonk2); //Finished talking ConditionalStep entranaAltarPouch = new ConditionalStep(this, makeIllumPouch); - entranaAltarPouch.addStep(new Conditions(illumPouch.alsoCheckBank(questBank), onEntrana), usePouchOnAltar); - entranaAltarPouch.addStep(new Conditions(illumPouch.alsoCheckBank(questBank), inLawAlter), leaveLawAltar); - entranaAltarPouch.addStep(new Conditions(illumPouch.alsoCheckBank(questBank), inAbyss), enterLawRift); - entranaAltarPouch.addStep(illumPouch.alsoCheckBank(questBank), teleToAbyss); + entranaAltarPouch.addStep(new Conditions(illumPouch.alsoCheckBank(), onEntrana), usePouchOnAltar); + entranaAltarPouch.addStep(new Conditions(illumPouch.alsoCheckBank(), inLawAlter), leaveLawAltar); + entranaAltarPouch.addStep(new Conditions(illumPouch.alsoCheckBank(), inAbyss), enterLawRift); + entranaAltarPouch.addStep(illumPouch.alsoCheckBank(), teleToAbyss); steps.put(30, entranaAltarPouch); steps.put(40, entranaAltarPouch); //Cutscene finished diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayer/DragonSlayer.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayer/DragonSlayer.java index cc31d5e3835..2fceb71686c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayer/DragonSlayer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayer/DragonSlayer.java @@ -45,10 +45,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.*; @@ -286,7 +283,7 @@ public void setupConditions() askedAboutShip = new VarplayerRequirement(VarPlayerID.DRAGONQUESTVAR, false, 14); askedAboutShield = new VarplayerRequirement(VarPlayerID.DRAGONQUESTVAR, false, 15); askedAllQuestions = new Conditions(askedAboutShip, askedAboutShield, askedAboutMelzar, askedAboutThalzar, askedAboutLozar); - askedOracleAboutMap = new VarbitRequirement(1832, 1); + askedOracleAboutMap = new VarbitRequirement(VarbitID.DRAGONSLAYER_SECRET_TOLD, 1); inDwarvenMines = new ZoneRequirement(dwarvenMines); silkUsed = new VarplayerRequirement(VarPlayerID.DRAGONQUESTVAR, true, 17); unfiredBowlUsed = new VarplayerRequirement(VarPlayerID.DRAGONQUESTVAR, true, 18); @@ -319,11 +316,11 @@ public void setupConditions() onShipDeck = new ZoneRequirement(shipDeck); inShipHull = new ZoneRequirement(shipHull); - hasBoughtBoat = new VarplayerRequirement(176, 3); + hasBoughtBoat = new VarplayerRequirement(VarPlayerID.DRAGONQUEST, 3); - hasRepairedHullOnce = new VarbitRequirement(1835, 1); - hasRepairedHullTwice = new VarbitRequirement(1836, 1); - fullyRepairedHull = new VarbitRequirement(1837, 1); + hasRepairedHullOnce = new VarbitRequirement(VarbitID.DRAGONSLAYER_SHIP_ONETHIRD_FIXED, 1); + hasRepairedHullTwice = new VarbitRequirement(VarbitID.DRAGONSLAYER_SHIP_TWOTHIRD_FIXED, 1); + fullyRepairedHull = new VarbitRequirement(VarbitID.DRAGONSLAYER_SHIP_FULLYFIXED, 1); onCrandorSurface = new ZoneRequirement(crandorSurface); inCrandorUnderground = new ZoneRequirement(crandorUnderground); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayerii/DragonSlayerII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayerii/DragonSlayerII.java index 802fbf18baf..1f69bafc3d0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayerii/DragonSlayerII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dragonslayerii/DragonSlayerII.java @@ -626,43 +626,43 @@ public void setupConditions() emptyInv24 = new FreeInventorySlotRequirement(24); - hadMap1 = new Conditions(LogicType.OR, map1, new VarbitRequirement(6116, 1)); - hadMap2 = new Conditions(LogicType.OR, map2, new VarbitRequirement(6117, 1)); - hadMap3 = new Conditions(LogicType.OR, map3, new VarbitRequirement(6118, 1)); - hadMap4 = new Conditions(LogicType.OR, map4, new VarbitRequirement(6119, 1)); - hadMap5 = new Conditions(LogicType.OR, map5, new VarbitRequirement(6120, 1)); + hadMap1 = new Conditions(LogicType.OR, map1, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_A1, 1)); + hadMap2 = new Conditions(LogicType.OR, map2, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_A3, 1)); + hadMap3 = new Conditions(LogicType.OR, map3, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_A4, 1)); + hadMap4 = new Conditions(LogicType.OR, map4, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_A6, 1)); + hadMap5 = new Conditions(LogicType.OR, map5, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_B1, 1)); hadChest1MapPieces = new Conditions(hadMap1, hadMap2, hadMap3, hadMap4, hadMap5); - hadMap6 = new Conditions(LogicType.OR, map6, new VarbitRequirement(6121, 1)); - hadMap7 = new Conditions(LogicType.OR, map7, new VarbitRequirement(6122, 1)); - hadMap8 = new Conditions(LogicType.OR, map8, new VarbitRequirement(6123, 1)); + hadMap6 = new Conditions(LogicType.OR, map6, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_B2, 1)); + hadMap7 = new Conditions(LogicType.OR, map7, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_B4, 1)); + hadMap8 = new Conditions(LogicType.OR, map8, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_B5, 1)); hadChest2MapPieces = new Conditions(hadMap6, hadMap7, hadMap8); - hadMap9 = new Conditions(LogicType.OR, map9, new VarbitRequirement(6124, 1)); - hadMap10 = new Conditions(LogicType.OR, map10, new VarbitRequirement(6125, 1)); - hadMap11 = new Conditions(LogicType.OR, map11, new VarbitRequirement(6126, 1)); - hadMap12 = new Conditions(LogicType.OR, map12, new VarbitRequirement(6127, 1)); + hadMap9 = new Conditions(LogicType.OR, map9, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_C1, 1)); + hadMap10 = new Conditions(LogicType.OR, map10, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_C3, 1)); + hadMap11 = new Conditions(LogicType.OR, map11, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_C4, 1)); + hadMap12 = new Conditions(LogicType.OR, map12, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_C5, 1)); hadFungiMapPieces = new Conditions(hadMap9, hadMap10, hadMap11, hadMap12); - hadMap13 = new Conditions(LogicType.OR, map13, new VarbitRequirement(6128, 1)); - hadMap14 = new Conditions(LogicType.OR, map14, new VarbitRequirement(6129, 1)); - hadMap15 = new Conditions(LogicType.OR, map15, new VarbitRequirement(6130, 1)); - hadMap16 = new Conditions(LogicType.OR, map16, new VarbitRequirement(6131, 1)); - hadMap17 = new Conditions(LogicType.OR, map17, new VarbitRequirement(6132, 1)); - hadMap18 = new Conditions(LogicType.OR, map18, new VarbitRequirement(6133, 1)); - hadMap19 = new Conditions(LogicType.OR, map19, new VarbitRequirement(6134, 1)); + hadMap13 = new Conditions(LogicType.OR, map13, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_D2, 1)); + hadMap14 = new Conditions(LogicType.OR, map14, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_D4, 1)); + hadMap15 = new Conditions(LogicType.OR, map15, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_D5, 1)); + hadMap16 = new Conditions(LogicType.OR, map16, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_D6, 1)); + hadMap17 = new Conditions(LogicType.OR, map17, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_E1, 1)); + hadMap18 = new Conditions(LogicType.OR, map18, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_E2, 1)); + hadMap19 = new Conditions(LogicType.OR, map19, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_E3, 1)); hadBriarMapPieces = new Conditions(hadMap13, hadMap14, hadMap15, hadMap16, hadMap17, hadMap18, hadMap19); - hadMap20 = new Conditions(LogicType.OR, map20, new VarbitRequirement(6135, 1)); - hadMap21 = new Conditions(LogicType.OR, map21, new VarbitRequirement(6136, 1)); - hadMap22 = new Conditions(LogicType.OR, map22, new VarbitRequirement(6137, 1)); - hadMap23 = new Conditions(LogicType.OR, map23, new VarbitRequirement(6138, 1)); - hadMap24 = new Conditions(LogicType.OR, map24, new VarbitRequirement(6138, 1)); + hadMap20 = new Conditions(LogicType.OR, map20, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_E5, 1)); + hadMap21 = new Conditions(LogicType.OR, map21, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_F2, 1)); + hadMap22 = new Conditions(LogicType.OR, map22, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_F4, 1)); + hadMap23 = new Conditions(LogicType.OR, map23, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_F5, 1)); + hadMap24 = new Conditions(LogicType.OR, map24, new VarbitRequirement(VarbitID.FOSSIL_MAP_PIECE_F5, 1)); hadMushtreeMapPieces = new Conditions(hadMap20, hadMap21, hadMap22, hadMap23, hadMap24); inMapPuzzle = new WidgetModelRequirement(305, 1, 35060); - litBrazier = new VarbitRequirement(2430, 1); + litBrazier = new VarbitRequirement(VarbitID.LUNAR_BRAZIER_LIT, 1); hasTheKourendKeyPiece = new VarbitRequirement(VarbitID.DS2_ZEAH, 35, Operation.GREATER_EQUAL); hasTheKaramjaKeyPiece = new VarbitRequirement(VarbitID.DS2_KARAM, 20, Operation.GREATER_EQUAL); @@ -702,11 +702,11 @@ public void setupConditions() // West dragon lit, 6109 = 1 // North dragon lit, 6110 = 1 // East dragon lit, 6111 = 1 - litFurnace = new Conditions(new VarbitRequirement(6109, 1), new VarbitRequirement(6110, 1), new VarbitRequirement(6111, 1)); + litFurnace = new Conditions(new VarbitRequirement(VarbitID.DS2_DRAGON_HEAD_WEST, 1), new VarbitRequirement(VarbitID.DS2_DRAGON_HEAD_NORTH, 1), new VarbitRequirement(VarbitID.DS2_DRAGON_HEAD_EAST, 1)); - recruitedBrundt = new VarbitRequirement(6114, 1); - recruitedAmik = new VarbitRequirement(6115, 1); - recruitedLathas = new VarbitRequirement(6113, 1); + recruitedBrundt = new VarbitRequirement(VarbitID.DS2_BRUNDT, 1); + recruitedAmik = new VarbitRequirement(VarbitID.DS2_AMIK, 1); + recruitedLathas = new VarbitRequirement(VarbitID.DS2_LATHAS, 1); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dreammentor/DreamMentor.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dreammentor/DreamMentor.java index 0298592c0bf..f44e6092f5a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dreammentor/DreamMentor.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dreammentor/DreamMentor.java @@ -230,11 +230,11 @@ public void setupConditions() lookingAtBank = new WidgetTextRequirement(260, 41, "Cyrisus's Bank"); gotItems = new CyrisusBankConditional(); - cyrisusDressed = new VarbitRequirement(3623, 100); + cyrisusDressed = new VarbitRequirement(VarbitID.DREAM_ARMAMENT, 100); - litBrazier = new VarbitRequirement(2430, 1); + litBrazier = new VarbitRequirement(VarbitID.LUNAR_BRAZIER_LIT, 1); - unlockedDream = new VarbitRequirement(3625, 1); + unlockedDream = new VarbitRequirement(VarbitID.DREAM_CUTSCENE_SEEN, 1); inadaquacyNearby = new NpcCondition(NpcID.DREAM_INADEQUACY); everlastingNearby = new NpcCondition(NpcID.DREAM_EVERLASTING); untouchableNearby = new NpcCondition(NpcID.DREAM_UNTOUCHABLE); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/druidicritual/DruidicRitual.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/druidicritual/DruidicRitual.java index 4153bab22b4..80cc332f196 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/druidicritual/DruidicRitual.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/druidicritual/DruidicRitual.java @@ -26,8 +26,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -44,130 +42,185 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; + +/** + * The quest guide for the "Druidic Ritual" OSRS quest + *

+ * The OSRS wiki guide was referenced for this guide + */ public class DruidicRitual extends BasicQuestHelper { - //Items Required - ItemRequirement rawRat, rawBear, rawBeef, rawChicken, rawRatHighlighted, rawBearHighlighted, rawBeefHighlighted, - rawChickenHighlighted, enchantedBear, enchantedBeef, enchantedChicken, enchantedRat; - - Requirement inDungeon, inSanfewRoom; - - QuestStep talkToKaqemeex, goUpToSanfew, talkToSanfew, enterDungeon, enchantMeats, useRatOnCauldron, useBeefOnCauldron, - useBearOnCauldron, useChickenOnCauldron, goUpToSanfewWithMeat, talkToSanfewWithMeat, talkToKaqemeexToFinish; + // Required items + ItemRequirement rawRat; + ItemRequirement rawBear; + ItemRequirement rawBeef; + ItemRequirement rawChicken; - //Zones - Zone dungeon, sanfewRoom; + // Mid-quest item requirements + ItemRequirement rawRatHighlighted; + ItemRequirement rawBearHighlighted; + ItemRequirement rawBeefHighlighted; + ItemRequirement rawChickenHighlighted; + ItemRequirement enchantedBear; + ItemRequirement enchantedBeef; + ItemRequirement enchantedChicken; + ItemRequirement enchantedRat; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); + // Zones + Zone dungeon; + Zone cauldronRoom; + Zone sanfewRoom; - steps.put(0, talkToKaqemeex); + // Miscellaneous requirements + ZoneRequirement inDungeon; + ZoneRequirement inCauldronRoom; + ZoneRequirement inSanfewRoom; - ConditionalStep goTalkToSanfew = new ConditionalStep(this, goUpToSanfew); - goTalkToSanfew.addStep(inSanfewRoom, talkToSanfew); - steps.put(1, goTalkToSanfew); + // Steps + NpcStep talkToKaqemeex; + ObjectStep goUpToSanfew; + NpcStep talkToSanfew; + ObjectStep enterDungeon; + ObjectStep enterCauldronRoom; + ObjectStep enchantMeats; + ObjectStep useRatOnCauldron; + ObjectStep useBeefOnCauldron; + ObjectStep useBearOnCauldron; + ObjectStep useChickenOnCauldron; + ObjectStep goUpToSanfewWithMeat; + NpcStep talkToSanfewWithMeat; + NpcStep talkToKaqemeexToFinish; - ConditionalStep prepareMeats = new ConditionalStep(this, enterDungeon); - prepareMeats.addStep(new Conditions(inSanfewRoom, enchantedRat, enchantedBear, enchantedBeef, enchantedChicken), talkToSanfewWithMeat); - prepareMeats.addStep(new Conditions(enchantedRat, enchantedBear, enchantedBeef, enchantedChicken), goUpToSanfewWithMeat); - prepareMeats.addStep(new Conditions(inDungeon, enchantedRat, enchantedBear, enchantedBeef), useChickenOnCauldron); - prepareMeats.addStep(new Conditions(inDungeon, enchantedRat, enchantedBear), useBeefOnCauldron); - prepareMeats.addStep(new Conditions(inDungeon, enchantedRat), useBearOnCauldron); - prepareMeats.addStep(inDungeon, useRatOnCauldron); - steps.put(2, prepareMeats); + ObjectStep climbDownToEnterDungeon; - steps.put(3, talkToKaqemeexToFinish); - - return steps; + @Override + protected void setupZones() + { + sanfewRoom = new Zone(new WorldPoint(2893, 3423, 1), new WorldPoint(2903, 3433, 1)); + dungeon = new Zone(new WorldPoint(2816, 9668, 0), new WorldPoint(2973, 9855, 0)); + cauldronRoom = new Zone(new WorldPoint(2889, 9825, 0), new WorldPoint(2898, 9839, 0)); } @Override protected void setupRequirements() { rawRat = new ItemRequirement("Raw rat meat", ItemID.RAW_RAT_MEAT); + rawRat.setTooltip("Can be acquired from a giant rat slightly north of the Varrock south-east mine"); rawRat.addAlternates(ItemID.ENCHANTED_RAT_MEAT); rawBear = new ItemRequirement("Raw bear meat", ItemID.RAW_BEAR_MEAT); + rawBear.setTooltip("Can be acquired from a bear south-east of Varrock"); rawBear.addAlternates(ItemID.ENCHANTED_BEAR_MEAT); rawBeef = new ItemRequirement("Raw beef", ItemID.RAW_BEEF); + rawBeef.setTooltip("Can be acquired from a farm north of Lumbridge"); rawBeef.addAlternates(ItemID.ENCHANTED_BEEF); rawChicken = new ItemRequirement("Raw chicken", ItemID.RAW_CHICKEN); + rawChicken.setTooltip("Can be acquired from a farm north of Lumbridge"); rawChicken.addAlternates(ItemID.ENCHANTED_CHICKEN); - rawRatHighlighted = new ItemRequirement("Raw rat meat", ItemID.RAW_RAT_MEAT); - rawRatHighlighted.setHighlightInInventory(true); - rawBearHighlighted = new ItemRequirement("Raw bear meat", ItemID.RAW_BEAR_MEAT); - rawBearHighlighted.setHighlightInInventory(true); - rawBeefHighlighted = new ItemRequirement("Raw beef", ItemID.RAW_BEEF); - rawBeefHighlighted.setHighlightInInventory(true); - rawChickenHighlighted = new ItemRequirement("Raw chicken", ItemID.RAW_CHICKEN); - rawChickenHighlighted.setHighlightInInventory(true); + rawRatHighlighted = rawRat.highlighted(); + rawBearHighlighted = rawBear.highlighted(); + rawBeefHighlighted = rawBeef.highlighted(); + rawChickenHighlighted = rawChicken.highlighted(); enchantedBear = new ItemRequirement("Enchanted bear", ItemID.ENCHANTED_BEAR_MEAT); enchantedBeef = new ItemRequirement("Enchanted beef", ItemID.ENCHANTED_BEEF); enchantedChicken = new ItemRequirement("Enchanted chicken", ItemID.ENCHANTED_CHICKEN); enchantedRat = new ItemRequirement("Enchanted rat", ItemID.ENCHANTED_RAT_MEAT); - } - @Override - protected void setupZones() - { - sanfewRoom = new Zone(new WorldPoint(2893, 3423, 1), new WorldPoint(2903, 3433, 1)); - dungeon = new Zone(new WorldPoint(2816, 9668, 0), new WorldPoint(2973, 9855, 0)); - } - - public void setupConditions() - { inSanfewRoom = new ZoneRequirement(sanfewRoom); inDungeon = new ZoneRequirement(dungeon); + inCauldronRoom = new ZoneRequirement(cauldronRoom); } public void setupSteps() { - talkToKaqemeex = new NpcStep(this, NpcID.KAQEMEEX, new WorldPoint(2925, 3486, 0), "Talk to Kaqemeex in the Druid Circle in Taverley."); - talkToKaqemeex.addDialogSteps("I'm in search of a quest.", "Okay, I will try and help."); + talkToKaqemeex = new NpcStep(this, NpcID.KAQEMEEX, new WorldPoint(2925, 3486, 0), "Talk to Kaqemeex in the Druids' Circle in Taverley."); + talkToKaqemeex.addDialogStep("I'm in search of a quest."); + talkToKaqemeex.addDialogStep("Yes."); goUpToSanfew = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2899, 3429, 0), "Talk to Sanfew upstairs in the Taverley herblore store."); talkToSanfew = new NpcStep(this, NpcID.SANFEW, new WorldPoint(2899, 3429, 1), "Talk to Sanfew upstairs in the Taverley herblore store."); talkToSanfew.addDialogStep("I've been sent to help purify the Varrock stone circle."); talkToSanfew.addSubSteps(goUpToSanfew); enterDungeon = new ObjectStep(this, ObjectID.LADDER_OUTSIDE_TO_UNDERGROUND, new WorldPoint(2884, 3397, 0), - "Enter Taverley Dungeon south of Taverley.", rawBear, rawBeef, rawChicken, rawRat); + "Enter Taverley Dungeon south of Taverley.", rawRat, rawBear, rawBeef, rawChicken); enterDungeon.addDialogStep("Ok, I'll do that then."); + climbDownToEnterDungeon = new ObjectStep(this, ObjectID.SPIRALSTAIRSTOP, new WorldPoint(2898, 3428, 1), "Enter Taverley Dungeon south of Taverley.", rawRat, rawBear, rawBeef, rawChicken); + enterDungeon.addSubSteps(climbDownToEnterDungeon); + + enterCauldronRoom = new ObjectStep(this, ObjectID.CAULDRONDOOR_L, new WorldPoint(2889, 9830, 0), + "Spam-click the Prison door to enter the room with the cauldron in Taverley dungeon. Spam-clicking lets you skip the fight with the suits of armour standing nearby.", rawRat, rawBear, rawBeef, rawChicken); + enterCauldronRoom.addAlternateObjects(ObjectID.CAULDRONDOOR); + useRatOnCauldron = new ObjectStep(this, ObjectID.CAULDRON_OF_THUNDER, new WorldPoint(2893, 9831, 0), - "Use the rat meat on the cauldron. To enter the room, spam-click the gate to get in.", rawRatHighlighted); + "Use the rat meat on the cauldron in Taverley dungeon.", rawRatHighlighted); useRatOnCauldron.addIcon(ItemID.RAW_RAT_MEAT); useBeefOnCauldron = new ObjectStep(this, ObjectID.CAULDRON_OF_THUNDER, new WorldPoint(2893, 9831, 0), - "Use the beef meat on the cauldron. To enter the room, spam-click the gate to get in.", rawBeefHighlighted); + "Use the beef meat on the cauldron in Taverley dungeon.", rawBeefHighlighted); useBeefOnCauldron.addIcon(ItemID.RAW_BEEF); useBearOnCauldron = new ObjectStep(this, ObjectID.CAULDRON_OF_THUNDER, new WorldPoint(2893, 9831, 0), - "Use the bear meat on the cauldron. To enter the room, spam-click the gate to get in.", rawBearHighlighted); + "Use the bear meat on the cauldron in Taverley dungeon.", rawBearHighlighted); useBearOnCauldron.addIcon(ItemID.RAW_BEAR_MEAT); useChickenOnCauldron = new ObjectStep(this, ObjectID.CAULDRON_OF_THUNDER, new WorldPoint(2893, 9831, 0), - "Use the chicken meat on the cauldron. To enter the room, spam-click the gate to get in.", rawChickenHighlighted); + "Use the chicken meat on the cauldron in Taverley dungeon.", rawChickenHighlighted); useChickenOnCauldron.addIcon(ItemID.RAW_CHICKEN); enchantMeats = new ObjectStep(this, ObjectID.CAULDRON_OF_THUNDER, new WorldPoint(2893, 9831, 0), - "Use the four meats on the cauldron. To enter the room, spam-click the gate to get in."); + "Use the four meats on the cauldron in Taverley dungeon."); enchantMeats.addSubSteps(useRatOnCauldron, useChickenOnCauldron, useBeefOnCauldron, useBearOnCauldron); goUpToSanfewWithMeat = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2899, 3429, 0), - "Bring the enchanted meats to Sanfew upstairs in the Taverley herblore store.", enchantedBear, enchantedBeef, enchantedChicken, enchantedRat); + "Bring the enchanted meats to Sanfew upstairs in the Taverley herblore store.", enchantedRat, enchantedBear, enchantedBeef, enchantedChicken); talkToSanfewWithMeat = new NpcStep(this, NpcID.SANFEW, new WorldPoint(2899, 3429, 1), - "Bring the enchanted meats to Sanfew upstairs in the Taverley herblore store.", enchantedBear, enchantedBeef, enchantedChicken, enchantedRat); + "Bring the enchanted meats to Sanfew upstairs in the Taverley herblore store.", enchantedRat, enchantedBear, enchantedBeef, enchantedChicken); talkToSanfewWithMeat.addSubSteps(goUpToSanfewWithMeat); - talkToKaqemeexToFinish = new NpcStep(this, NpcID.KAQEMEEX, new WorldPoint(2925, 3486, 0), "Return to Kaqemeex in the Druid Circle to finish the quest."); + talkToKaqemeexToFinish = new NpcStep(this, NpcID.KAQEMEEX, new WorldPoint(2925, 3486, 0), "Return to Kaqemeex in the Druids' Circle to finish the quest."); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToKaqemeex); + + var goTalkToSanfew = new ConditionalStep(this, goUpToSanfew); + goTalkToSanfew.addStep(inSanfewRoom, talkToSanfew); + steps.put(1, goTalkToSanfew); + + var prepareMeats = new ConditionalStep(this, enterDungeon); + prepareMeats.addStep(and(inSanfewRoom, enchantedRat, enchantedBear, enchantedBeef, enchantedChicken), talkToSanfewWithMeat); + prepareMeats.addStep(and(enchantedRat, enchantedBear, enchantedBeef, enchantedChicken), goUpToSanfewWithMeat); + prepareMeats.addStep(and(inCauldronRoom, enchantedRat, enchantedBear, enchantedBeef), useChickenOnCauldron); + prepareMeats.addStep(and(inCauldronRoom, enchantedRat, enchantedBear), useBeefOnCauldron); + prepareMeats.addStep(and(inCauldronRoom, enchantedRat), useBearOnCauldron); + prepareMeats.addStep(inCauldronRoom, useRatOnCauldron); + prepareMeats.addStep(inDungeon, enterCauldronRoom); + prepareMeats.addStep(inSanfewRoom, climbDownToEnterDungeon); + steps.put(2, prepareMeats); + + steps.put(3, talkToKaqemeexToFinish); + + return steps; } @Override public List getItemRequirements() { - return Arrays.asList(rawBear, rawBeef, rawChicken, rawRat); + return List.of( + rawRat, + rawBear, + rawBeef, + rawChicken + ); } @Override @@ -179,24 +232,39 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.HERBLORE, 250)); + return List.of( + new ExperienceReward(Skill.HERBLORE, 250) + ); } @Override public List getUnlockRewards() { - return Collections.singletonList(new UnlockReward("Access to the Herblore Skill")); + return List.of( + new UnlockReward("Access to the Herblore Skill") + ); } - @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Helping the druids", - Arrays.asList(talkToKaqemeex, talkToSanfew, enterDungeon, enchantMeats, talkToSanfewWithMeat, talkToKaqemeexToFinish), - rawBear, rawBeef, rawChicken, rawRat)); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Helping the druids", List.of( + talkToKaqemeex, + talkToSanfew, + enterDungeon, + enterCauldronRoom, + enchantMeats, + talkToSanfewWithMeat, + talkToKaqemeexToFinish + ), List.of( + rawRat, + rawBear, + rawBeef, + rawChicken + ))); - return allSteps; + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dwarfcannon/DwarfCannon.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dwarfcannon/DwarfCannon.java index c376a56f05b..7e6ee12102a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dwarfcannon/DwarfCannon.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/dwarfcannon/DwarfCannon.java @@ -1,12 +1,37 @@ +/* + * Copyright (c) 2020, Zoinkwiz + * Copyright (c) 2025, pajlada + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.dwarfcannon; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetPresenceRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; @@ -15,84 +40,101 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; public class DwarfCannon extends BasicQuestHelper { - //Items Recommended - ItemRequirement staminas, teleToAsg, teleToKand; - - //Items Required - ItemRequirement hammer, railing, dwarfRemains, toolkit, cannonballMould, nulodionsNotes; - - Requirement upTower1, upTower2, inCave, bar1, bar2, bar3, bar4, bar5, bar6, nearLawgof, springFixed, safetyFixed, cannonFixed; - - QuestStep talkToCaptainLawgof, talkToCaptainLawgof2, gotoTower, goToTower2, talkToCaptainLawgof3, gotoCave, inspectRailings1, inspectRailings2, - inspectRailings3, inspectRailings4, inspectRailings5, inspectRailings6, getRemainsStep, downTower, downTower2, searchCrates, - talkToCaptainLawgof4, useToolkit, talkToCaptainLawgof5, talkToNulodion, talkToCaptainLawgof6; - - //Zones - Zone cave, tower1, tower2, lawgofArea; + // Required items + ItemRequirement hammer; + + // Recommended items + ItemRequirement staminas; + ItemRequirement teleToAsg; + ItemRequirement teleToKand; + + // Zones + Zone cave; + Zone tower1; + Zone tower2; + + // Miscellaneous requirements + ItemRequirement railing; + ItemRequirement dwarfRemains; + ItemRequirement toolkit; + ItemRequirement cannonballMould; + ItemRequirement nulodionsNotes; + + ZoneRequirement upTower1; + ZoneRequirement upTower2; + ZoneRequirement inCave; + VarbitRequirement bar1; + VarbitRequirement bar2; + VarbitRequirement bar3; + VarbitRequirement bar4; + VarbitRequirement bar5; + VarbitRequirement bar6; + Conditions allBarsFixed; + + WidgetPresenceRequirement isPuzzleOpen; + VarbitRequirement toothedToolSelected; + VarbitRequirement pliersSelected; + VarbitRequirement hookSelected; + VarbitRequirement springFixed; + VarbitRequirement safetyFixed; + + // Steps + NpcStep talkToCaptainLawgof; + + NpcStep getRailings; + ObjectStep inspectRailings1; + ObjectStep inspectRailings2; + ObjectStep inspectRailings3; + ObjectStep inspectRailings4; + ObjectStep inspectRailings5; + ObjectStep inspectRailings6; + ConditionalStep cInspectRailings; + NpcStep talkToCaptainLawgof2; + + ObjectStep gotoTower; + ObjectStep goToTower2; + NpcStep talkToCaptainLawgof3; + ObjectStep getRemainsStep; + ObjectStep downTower; + ObjectStep downTower2; + + ObjectStep gotoCave; + ObjectStep searchCrates; + ObjectStep exitCave; + NpcStep talkToCaptainLawgof4; + + PuzzleWrapperStep pwFixMulticannon; + NpcStep talkToCaptainLawgof5; + + NpcStep talkToNulodion; + NpcStep talkToCaptainLawgof6; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - //Start - steps.put(0, talkToCaptainLawgof); - - //Repair Bars - ConditionalStep fixedRailings = new ConditionalStep(this, inspectRailings1); - fixedRailings.addStep(new Conditions(bar6), talkToCaptainLawgof2); - fixedRailings.addStep(new Conditions(hammer, railing, bar5), inspectRailings6); - fixedRailings.addStep(new Conditions(hammer, railing, bar4), inspectRailings5); - fixedRailings.addStep(new Conditions(hammer, railing, bar3), inspectRailings4); - fixedRailings.addStep(new Conditions(hammer, railing, bar2), inspectRailings3); - fixedRailings.addStep(new Conditions(hammer, railing, bar1), inspectRailings2); - - steps.put(1, fixedRailings); - - //Go to tower, get remains, come back - ConditionalStep getRemains = new ConditionalStep(this, gotoTower); - getRemains.addStep(new Conditions(dwarfRemains, nearLawgof), talkToCaptainLawgof3); - getRemains.addStep(new Conditions(dwarfRemains, upTower1), downTower2); - getRemains.addStep(new Conditions(dwarfRemains, upTower2), downTower); - getRemains.addStep(upTower2, getRemainsStep); - getRemains.addStep(upTower1, goToTower2); - steps.put(2, getRemains); - steps.put(3, getRemains); - - //Go to the cave, find Lollk, return and fix cannon - ConditionalStep findLollk = new ConditionalStep(this, gotoCave); - findLollk.addStep(inCave, searchCrates); - steps.put(4, findLollk); - steps.put(5, findLollk); - - steps.put(6, talkToCaptainLawgof4); - - steps.put(7, useToolkit); - steps.put(8, talkToCaptainLawgof5); - - //Ammo mould and back - ConditionalStep captainLawgofFinal = new ConditionalStep(this, talkToNulodion); - captainLawgofFinal.addStep(new Conditions(nulodionsNotes, cannonballMould), talkToCaptainLawgof6); - steps.put(9, captainLawgofFinal); - steps.put(10, captainLawgofFinal); - - return steps; + cave = new Zone(new WorldPoint(2557, 9790, 0), new WorldPoint(2624, 9859, 0)); + tower1 = new Zone(new WorldPoint(2568, 3439, 1), new WorldPoint(2572, 3445, 1)); + tower2 = new Zone(new WorldPoint(2566, 3445, 2), new WorldPoint(2572, 3441, 2)); } @Override protected void setupRequirements() { + hammer = new ItemRequirement("Hammer", ItemCollections.HAMMER).isNotConsumed().canBeObtainedDuringQuest(); + hammer.setTooltip("Can be found in the small building east of Captain Lawgof."); + staminas = new ItemRequirement("Stamina Potions", ItemCollections.STAMINA_POTIONS); teleToAsg = new ItemRequirement("Teleport to Falador, Amulet of Glory, or Combat Bracelet", ItemID.POH_TABLET_FALADORTELEPORT); @@ -103,65 +145,64 @@ protected void setupRequirements() teleToKand.addAlternates(ItemCollections.SKILLS_NECKLACES); teleToKand.addAlternates(ItemID.POH_TABLET_ARDOUGNETELEPORT); - hammer = new ItemRequirement("Hammer", ItemCollections.HAMMER).isNotConsumed(); railing = new ItemRequirement("Railing", ItemID.MCANNONRAILING1_OBJ); railing.setTooltip("You can get more from Captain Lawgof"); toolkit = new ItemRequirement("Toolkit", ItemID.MCANNONTOOLKIT); toolkit.setHighlightInInventory(true); dwarfRemains = new ItemRequirement("Dwarf Remains", ItemID.MCANNONREMAINS); - cannonballMould = new ItemRequirement("Cannonball Mould", ItemID.AMMO_MOULD); - nulodionsNotes = new ItemRequirement("Nulodion's Notes", ItemID.NULODIONS_NOTES); - } + cannonballMould = new ItemRequirement("Ammo mould", ItemID.AMMO_MOULD); + nulodionsNotes = new ItemRequirement("Nulodion's notes", ItemID.NULODIONS_NOTES); + + bar1 = new VarbitRequirement(VarbitID.MCANNON_RAILING1_FIXED, 1); + bar2 = new VarbitRequirement(VarbitID.MCANNON_RAILING2_FIXED, 1); + bar3 = new VarbitRequirement(VarbitID.MCANNON_RAILING3_FIXED, 1); + bar4 = new VarbitRequirement(VarbitID.MCANNON_RAILING4_FIXED, 1); + bar5 = new VarbitRequirement(VarbitID.MCANNON_RAILING5_FIXED, 1); + bar6 = new VarbitRequirement(VarbitID.MCANNON_RAILING6_FIXED, 1); + + allBarsFixed = and(bar1, bar2, bar3, bar4, bar5, bar6); + + isPuzzleOpen = new WidgetPresenceRequirement(InterfaceID.McannonInterface.ROOT_RECT0); + + toothedToolSelected = new VarbitRequirement(VarbitID.MCANNONMULTI_TOOL1, 1); + pliersSelected = new VarbitRequirement(VarbitID.MCANNONMULTI_TOOL2, 1); + hookSelected = new VarbitRequirement(VarbitID.MCANNONMULTI_TOOL3, 1); + + springFixed = new VarbitRequirement(VarbitID.MCANNON_SPRING_SET, 1); + safetyFixed = new VarbitRequirement(VarbitID.MCANNON_SAFETY_ON, 1); - public void setupConditions() - { - //Varbits - bar1 = new VarbitRequirement(2240, 1); - bar2 = new VarbitRequirement(2241, 1); - bar3 = new VarbitRequirement(2242, 1); - bar4 = new VarbitRequirement(2243, 1); - bar5 = new VarbitRequirement(2244, 1); - bar6 = new VarbitRequirement(2245, 1); - //All Complete varbit 2246 - - springFixed = new VarbitRequirement(2239, 1); - safetyFixed = new VarbitRequirement(2238, 1); - cannonFixed = new VarbitRequirement(2235, 1); - - //Zones upTower1 = new ZoneRequirement(tower1); upTower2 = new ZoneRequirement(tower2); inCave = new ZoneRequirement(cave); - nearLawgof = new ZoneRequirement(lawgofArea); - - } - - @Override - protected void setupZones() - { - cave = new Zone(new WorldPoint(2557, 9790, 0), new WorldPoint(2624, 9859, 0)); - tower1 = new Zone(new WorldPoint(2568, 3439, 1), new WorldPoint(2572, 3445, 1)); - tower2 = new Zone(new WorldPoint(2566, 3445, 2), new WorldPoint(2572, 3441, 2)); - lawgofArea = new Zone(new WorldPoint(2551, 3477, 0), new WorldPoint(2595, 3434, 0)); } public void setupSteps() { talkToCaptainLawgof = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Talk to Captain Lawgof near the Coal Truck Mining Site (north of Fishing Guild, West of McGrubor's Wood)."); - talkToCaptainLawgof.addDialogStep("Sure, I'd be honoured to join."); - - //Fix the 6 bent railings, these railings don't have different IDs from the normal railings - inspectRailings1 = new ObjectStep(this, ObjectID.MCANNON_RAILING1_MULTILOC, new WorldPoint(2555, 3479, 0), "Inspect the 6 damaged railings around the camp to fix them.", hammer, railing); - inspectRailings2 = new ObjectStep(this, ObjectID.MCANNON_RAILING2_MULTILOC, new WorldPoint(2557, 3468, 0), "Inspect the railings to fix them.", hammer, railing); - inspectRailings3 = new ObjectStep(this, ObjectID.MCANNON_RAILING3_MULTILOC, new WorldPoint(2559, 3458, 0), "Inspect the railings to fix them.", hammer, railing); - inspectRailings4 = new ObjectStep(this, ObjectID.MCANNON_RAILING4_MULTILOC, new WorldPoint(2563, 3457, 0), "Inspect the railings to fix them.", hammer, railing); - inspectRailings5 = new ObjectStep(this, ObjectID.MCANNON_RAILING5_MULTILOC, new WorldPoint(2573, 3457, 0), "Inspect the railings to fix them.", hammer, railing); - inspectRailings6 = new ObjectStep(this, ObjectID.MCANNON_RAILING6_MULTILOC, new WorldPoint(2577, 3457, 0), "Inspect the railings to fix them.", hammer, railing); - inspectRailings1.addSubSteps(inspectRailings2, inspectRailings3, inspectRailings4, inspectRailings5, inspectRailings6); + talkToCaptainLawgof.addDialogStep("Yes."); + + // Fix the 6 bent railings, these railings don't have different IDs from the normal railings + getRailings = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Talk to Captain Lawgof to get more railings.", hammer, railing); + + inspectRailings1 = new ObjectStep(this, ObjectID.MCANNON_RAILING1_MULTILOC, new WorldPoint(2555, 3479, 0), "", hammer, railing); + inspectRailings2 = new ObjectStep(this, ObjectID.MCANNON_RAILING2_MULTILOC, new WorldPoint(2557, 3468, 0), "", hammer, railing); + inspectRailings3 = new ObjectStep(this, ObjectID.MCANNON_RAILING3_MULTILOC, new WorldPoint(2559, 3458, 0), "", hammer, railing); + inspectRailings4 = new ObjectStep(this, ObjectID.MCANNON_RAILING4_MULTILOC, new WorldPoint(2563, 3457, 0), "", hammer, railing); + inspectRailings5 = new ObjectStep(this, ObjectID.MCANNON_RAILING5_MULTILOC, new WorldPoint(2573, 3457, 0), "", hammer, railing); + inspectRailings6 = new ObjectStep(this, ObjectID.MCANNON_RAILING6_MULTILOC, new WorldPoint(2577, 3457, 0), "", hammer, railing); + + cInspectRailings = new ConditionalStep(this, getRailings, "Inspect the six damaged railings around the camp to fix them."); + cInspectRailings.addStep(and(railing, not(bar1)), inspectRailings1); + cInspectRailings.addStep(and(railing, not(bar2)), inspectRailings2); + cInspectRailings.addStep(and(railing, not(bar3)), inspectRailings3); + cInspectRailings.addStep(and(railing, not(bar4)), inspectRailings4); + cInspectRailings.addStep(and(railing, not(bar5)), inspectRailings5); + cInspectRailings.addStep(and(railing, not(bar6)), inspectRailings6); //Get dwarf remains - talkToCaptainLawgof2 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Talk to Captain Lawgof again. Make sure to complete the entire dialogue."); - gotoTower = new ObjectStep(this, ObjectID.LADDER, new WorldPoint(2570, 3441, 0), "Go to the top floor of the tower south of Captain Lawgof and get the remains there."); + talkToCaptainLawgof2 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Talk to Captain Lawgof after repairing the damaged railings."); + + gotoTower = new ObjectStep(this, ObjectID.LADDER, new WorldPoint(2570, 3441, 0), "Go to the top floor of the tower, south of Captain Lawgof, and get the remains there."); goToTower2 = new ObjectStep(this, ObjectID.MCANNONLADDER, new WorldPoint(2570, 3443, 1), "Go up the second ladder."); getRemainsStep = new ObjectStep(this, ObjectID.MCANNONREMAINS_MULTILOC, new WorldPoint(2567, 3444, 2), "Get the dwarf remains at the top of the tower."); @@ -172,35 +213,110 @@ public void setupSteps() talkToCaptainLawgof3 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Return the remains to Captain Lawgof."); talkToCaptainLawgof3.addSubSteps(downTower, downTower2); - //Cave - gotoCave = new ObjectStep(this, ObjectID.MCANNONCAVE, new WorldPoint(2624, 3393, 0), "Go to the cave entrance east of the Fishing Guild door."); + // Find Lollk in the goblin cave + gotoCave = new ObjectStep(this, ObjectID.MCANNONCAVE, new WorldPoint(2622, 3392, 0), "Enter the goblin cave, east of the Fishing Guild entrance."); searchCrates = new ObjectStep(this, ObjectID.MCANNONCRATEBOY, new WorldPoint(2571, 9850, 0), "Search the crates in the north west corner to find Lollk."); + exitCave = new ObjectStep(this, ObjectID.MCANMUDPILE, new WorldPoint(2621, 9796, 0), "Exit the goblin cave and return to Captain Lawgof."); talkToCaptainLawgof4 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Return to Captain Lawgof."); talkToCaptainLawgof4.addDialogStep("Okay, I'll see what I can do."); + talkToCaptainLawgof4.addSubSteps(exitCave); + + // Fix cannon + var actuallyUseToolkit = new ObjectStep(this, ObjectID.MCANNON_CANNON_MULTILOC, new WorldPoint(2563, 3462, 0), "", toolkit.highlighted()); + actuallyUseToolkit.addIcon(ItemID.MCANNONTOOLKIT); + + var clickHook = new WidgetStep(this, "Click the hook and use it on the spring.", InterfaceID.McannonInterface.MCANNON_TOOL3); + var clickSpring = new WidgetStep(this, "Click the hook and use it on the spring.", InterfaceID.McannonInterface.MCANNON_SPRING); + + var clickPliers = new WidgetStep(this, "Click the pliers and use it on the safety switch at the bottom.", InterfaceID.McannonInterface.MCANNON_TOOL2); + var clickSafety = new WidgetStep(this, "Click the pliers and use it on the safety switch at the bottom.", InterfaceID.McannonInterface.MCANNON_SAFETY); + + var clickToothedTool = new WidgetStep(this, "Click the toothed tool and use it on the gear at the bottom.", InterfaceID.McannonInterface.MCANNON_TOOL1); + var clickGear = new WidgetStep(this, "Click the toothed tool and use it on the gear at the bottom.", InterfaceID.McannonInterface.MCANNON_GEAR); - //Fix cannon - // TODO: Update this to highlight widgets as you progress, indicating what tool to use on what - useToolkit = new PuzzleWrapperStep(this, - new ObjectStep(this, ObjectID.MCANNON_CANNON_MULTILOC, new WorldPoint(2563, 3462, 0), - "Use the toolkit on the broken multicannon. Use the right tool on the spring, the middle tool on the Safety switch, and the left tool on the gear."), - new ObjectStep(this, ObjectID.MCANNON_CANNON_MULTILOC, new WorldPoint(2563, 3462, 0), "Use the toolkit on the broken multicannon.")); - useToolkit.addIcon(ItemID.MCANNONTOOLKIT); - talkToCaptainLawgof5 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Talk to Captain Lawgof (There will be a short pause in dialogue. Both need to be completed.)."); + var fixCannon = new ConditionalStep(this, actuallyUseToolkit, "Use the toolkit on the broken multicannon, then use the highlighted tool on the highlighted part to fix it."); + fixCannon.addStep(and(isPuzzleOpen, safetyFixed, springFixed, toothedToolSelected), clickGear); + fixCannon.addStep(and(isPuzzleOpen, safetyFixed, springFixed), clickToothedTool); + fixCannon.addStep(and(isPuzzleOpen, not(safetyFixed), pliersSelected), clickSafety); + fixCannon.addStep(and(isPuzzleOpen, not(springFixed), hookSelected), clickSpring); + fixCannon.addStep(and(isPuzzleOpen, not(safetyFixed)), clickPliers); + fixCannon.addStep(and(isPuzzleOpen, not(springFixed)), clickHook); + + pwFixMulticannon = fixCannon.puzzleWrapStepWithDefaultText("Use the toolkit on the broken multicannon."); + pwFixMulticannon.addIcon(ItemID.MCANNONTOOLKIT); + talkToCaptainLawgof5 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Talk to Captain Lawgof after repairing the multicannon."); talkToCaptainLawgof5.addDialogStep("Okay then, just for you!"); - //Cannonball mould - talkToNulodion = new NpcStep(this, NpcID.NULODION, new WorldPoint(3012, 3453, 0), "Go talk to Nulodion at the Dwarven Black Guard camp (north-east of Falador, South of Ice Mountain)."); - talkToCaptainLawgof6 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Finally, return to Captain Lawgof with the ammo mould and Nulodion's Notes.", nulodionsNotes, cannonballMould); + // Get notes & mould from Nulodion + talkToNulodion = new NpcStep(this, NpcID.NULODION, new WorldPoint(3012, 3453, 0), "Talk to Nulodion at the Dwarven Black Guard camp, south of Ice Mountain."); + talkToCaptainLawgof6 = new NpcStep(this, NpcID.LAWGOF2, new WorldPoint(2567, 3460, 0), "Return to Captain Lawgof with the ammo mould and Nulodion's Notes.", nulodionsNotes, cannonballMould); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + // Start + steps.put(0, talkToCaptainLawgof); + + // Repair damaged railings + var fixRailings = new ConditionalStep(this, cInspectRailings); + fixRailings.addStep(allBarsFixed, talkToCaptainLawgof2); + fixRailings.addStep(not(railing), getRailings); + steps.put(1, fixRailings); + + // Go to tower, get remains, come back + var getRemains = new ConditionalStep(this, gotoTower); + getRemains.addStep(and(dwarfRemains, upTower1), downTower2); + getRemains.addStep(and(dwarfRemains, upTower2), downTower); + getRemains.addStep(dwarfRemains, talkToCaptainLawgof3); + getRemains.addStep(upTower2, getRemainsStep); + getRemains.addStep(upTower1, goToTower2); + steps.put(2, getRemains); + steps.put(3, getRemains); + + //Go to the cave, find Lollk, return and fix cannon + var findLollk = new ConditionalStep(this, gotoCave); + findLollk.addStep(inCave, searchCrates); + steps.put(4, findLollk); + steps.put(5, findLollk); + + var step6 = new ConditionalStep(this, talkToCaptainLawgof4); + step6.addStep(inCave, exitCave); + steps.put(6, step6); + + steps.put(7, pwFixMulticannon); + steps.put(8, talkToCaptainLawgof5); + + // Ammo mould and back + var captainLawgofFinal = new ConditionalStep(this, talkToNulodion); + captainLawgofFinal.addStep(and(nulodionsNotes, cannonballMould), talkToCaptainLawgof6); + steps.put(9, captainLawgofFinal); + steps.put(10, captainLawgofFinal); + + return steps; + } + + @Override + public List getItemRequirements() + { + return List.of( + hammer + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(staminas); - reqs.add(teleToAsg); - reqs.add(teleToKand); - return reqs; + return List.of( + staminas, + teleToAsg, + teleToKand + ); } @Override @@ -212,25 +328,52 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.CRAFTING, 750)); + return List.of( + new ExperienceReward(Skill.CRAFTING, 750) + ); } @Override public List getUnlockRewards() { - return Arrays.asList( - new UnlockReward("Ability to purchase and use the Dwarf Multicannon."), - new UnlockReward("Ability to make cannonballs.")); + return List.of( + new UnlockReward("Ability to purchase and use the Dwarf Multicannon."), + new UnlockReward("Ability to make cannonballs.") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting off", Collections.singletonList(talkToCaptainLawgof))); - allSteps.add(new PanelDetails("Repair and Retrieval", Arrays.asList(inspectRailings1, talkToCaptainLawgof2, gotoTower, talkToCaptainLawgof3))); - allSteps.add(new PanelDetails("Find Lollk and Fix Cannon", Arrays.asList(gotoCave, searchCrates, talkToCaptainLawgof4, useToolkit, talkToCaptainLawgof5))); - allSteps.add(new PanelDetails("Get Ammo Mould", Arrays.asList(talkToNulodion, talkToCaptainLawgof6))); - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToCaptainLawgof + ))); + + sections.add(new PanelDetails("Repair and Retrieval", List.of( + getRailings, + cInspectRailings, + talkToCaptainLawgof2, + gotoTower, + talkToCaptainLawgof3 + ), List.of( + hammer + ))); + + sections.add(new PanelDetails("Finding the lad", List.of( + gotoCave, + searchCrates, + talkToCaptainLawgof4, + pwFixMulticannon, + talkToCaptainLawgof5 + ))); + + sections.add(new PanelDetails("Get Ammo Mould", List.of( + talkToNulodion, + talkToCaptainLawgof6 + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eadgarsruse/EadgarsRuse.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eadgarsruse/EadgarsRuse.java index 01cba1f2947..368da68aa6b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eadgarsruse/EadgarsRuse.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eadgarsruse/EadgarsRuse.java @@ -50,6 +50,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -337,7 +338,7 @@ public void setupConditions() onMountainPath = new ZoneRequirement(mountainPath1, mountainPath2, mountainPath3, mountainPath4, mountainPath5); inTrollArea1 = new ZoneRequirement(trollArea1); inPrison = new ZoneRequirement(prison); - freedEadgar = new VarbitRequirement(0, 1); + freedEadgar = new VarbitRequirement(VarbitID.TROLL_FREED_EADGAR, 1); hasCellKey2 = cellKey2; inStrongholdFloor1 = new ZoneRequirement(strongholdFloor1); inStrongholdFloor2 = new ZoneRequirement(strongholdFloor2); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eaglespeak/EaglesPeak.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eaglespeak/EaglesPeak.java index c2468155580..943ca9da5f7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eaglespeak/EaglesPeak.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/eaglespeak/EaglesPeak.java @@ -46,6 +46,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -223,34 +224,34 @@ public void setupConditions() bronzeRoomPedestalUp = new ObjectCondition(ObjectID.EAGLEPEAK_NET_TRAP_ACTIVE); bronzeRoomPedestalLowered = new ObjectCondition(ObjectID.EAGLEPEAK_DUNGEON_PEDESTAL_PUZZLE3); inMainCavern = new ZoneRequirement(inMainCave); - spokenToNickolaus = new VarbitRequirement(3110, 3); - spokenOnceToAsyff = new VarbitRequirement(3110, 4); - spokenTwiceToAsyff = new VarbitRequirement(3110, 5); - winch1NotDone = new VarbitRequirement(3101, 0); - winch2NotDone = new VarbitRequirement(3102, 0); - winch3NotDone = new VarbitRequirement(3103, 0); - winch4NotDone = new VarbitRequirement(3104, 0); - hasSolvedBronze = new VarbitRequirement(3105, 0); - hasInspectedSilverPedestal = new VarbitRequirement(3099, 1); - hasInspectedRocks1 = new VarbitRequirement(3099, 2); - hasInspectedRocks2 = new VarbitRequirement(3099, 3); - hasInspectedOpening = new VarbitRequirement(3099, 4); - threatenedKebbit = new VarbitRequirement(3099, 5); + spokenToNickolaus = new VarbitRequirement(VarbitID.EAGLEPEAK_NICKOLAUS_CHAT, 3); + spokenOnceToAsyff = new VarbitRequirement(VarbitID.EAGLEPEAK_NICKOLAUS_CHAT, 4); + spokenTwiceToAsyff = new VarbitRequirement(VarbitID.EAGLEPEAK_NICKOLAUS_CHAT, 5); + winch1NotDone = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE3_WINCH1, 0); + winch2NotDone = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE3_WINCH2, 0); + winch3NotDone = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE3_WINCH3, 0); + winch4NotDone = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE3_WINCH4, 0); + hasSolvedBronze = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE3_NETTRAP, 0); + hasInspectedSilverPedestal = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE2_TRACKING, 1); + hasInspectedRocks1 = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE2_TRACKING, 2); + hasInspectedRocks2 = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE2_TRACKING, 3); + hasInspectedOpening = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE2_TRACKING, 4); + threatenedKebbit = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE2_TRACKING, 5); inSilverRoom = new ZoneRequirement(inSilverRoomZone); inGoldRoom = new ZoneRequirement(inGoldRoomZone1, inGoldRoomZone2); - lever1OriginalPosition = new VarbitRequirement(3092, 0); - lever1Pulled = new VarbitRequirement(3092, 1); - lever2Pulled = new VarbitRequirement(3093, 1); - lever3Pulled = new VarbitRequirement(3090, 1); - lever4Pulled = new VarbitRequirement(3091, 1); - bird1Moved = new VarbitRequirement(3098, 1); - bird2Moved = new VarbitRequirement(3097, 1); - bird3Moved = new VarbitRequirement(3095, 1); - bird4Moved = new VarbitRequirement(3094, 1); - bird5Moved = new VarbitRequirement(3096, 1); - hasInsertedBronzeFeather = new VarbitRequirement(3108, 1); - hasInsertedSilverFeather = new VarbitRequirement(3099, 6); - hasInsertedGoldFeather = new VarbitRequirement(3107, 1); + lever1OriginalPosition = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_GATE3, 0); + lever1Pulled = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_GATE3, 1); + lever2Pulled = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_GATE4, 1); + lever3Pulled = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_GATE1, 1); + lever4Pulled = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_GATE2, 1); + bird1Moved = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_MECHBIRD5, 1); + bird2Moved = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_MECHBIRD4, 1); + bird3Moved = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_MECHBIRD2, 1); + bird4Moved = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_MECHBIRD1, 1); + bird5Moved = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE1_MECHBIRD3, 1); + hasInsertedBronzeFeather = new VarbitRequirement(VarbitID.EAGLEPEAK_EAGLEDOOR_FEATHER3, 1); + hasInsertedSilverFeather = new VarbitRequirement(VarbitID.EAGLEPEAK_PUZZLE2_TRACKING, 6); + hasInsertedGoldFeather = new VarbitRequirement(VarbitID.EAGLEPEAK_EAGLEDOOR_FEATHER1, 1); silverFeatherNearby = new ItemOnTileRequirement(silverFeather); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopi/ElementalWorkshopI.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopi/ElementalWorkshopI.java index 755bc53bafe..8f0b2679b20 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopi/ElementalWorkshopI.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopi/ElementalWorkshopI.java @@ -49,10 +49,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.Arrays; @@ -221,19 +218,19 @@ public void setupConditions() inStairwell = new ZoneRequirement(stairwell); inWorkshop = new ZoneRequirement(workshop); - hasSlashedBook = new VarbitRequirement(2057, 1); + hasSlashedBook = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_KEY, 1); hasReadBook = new VarplayerRequirement(VarPlayerID.ELEMENTAL_WORKSHOP_BITS, true, 1); enteredWall = new VarplayerRequirement(VarPlayerID.ELEMENTAL_WORKSHOP_BITS, true, 15); - foundLeather = new VarbitRequirement(2066, 1); - turnedValve1 = new VarbitRequirement(2059, 1); - turnedValve2 = new VarbitRequirement(2058, 1); - solvedWater = new VarbitRequirement(2060, 1); + foundLeather = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_LEATHER, 1); + turnedValve1 = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_GATE2, 1); + turnedValve2 = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_GATE1, 1); + solvedWater = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_SWITCH, 1); hasLeatherOrSearched = new Conditions(LogicType.OR, foundLeather, leather); - solvedAir = new VarbitRequirement(2063, 1); - fixedBellow = new VarbitRequirement(2061, 1); + solvedAir = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_BELLOWS_SWITCH, 1); + fixedBellow = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_BELLOWS, 1); - solvedFire = new VarbitRequirement(2062, 1); + solvedFire = new VarbitRequirement(VarbitID.ELEMENTAL_WORKSHOP_FIRE, 1); elementalOreNearby = new ItemOnTileRequirement(elementalOre); earthNearby = new NpcCondition(NpcID.ELEM1_QIP_EARTH_ELEMENTAL_ROCK_VERSION); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopii/ElementalWorkshopII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopii/ElementalWorkshopII.java index 3ac4bc5e576..fb8073b2e44 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopii/ElementalWorkshopII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/elementalworkshopii/ElementalWorkshopII.java @@ -324,41 +324,41 @@ public void setupConditions() inPipePuzzle = new WidgetModelRequirement(262, 37, 18794); sortedPipes = new Conditions( new Conditions(LogicType.OR, - new VarbitRequirement(2646, 5), - new VarbitRequirement(2647, 5), - new VarbitRequirement(2648, 5) + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_1_STATE, 5), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_2_STATE, 5), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_3_STATE, 5) ), new Conditions(LogicType.OR, - new VarbitRequirement(2646, 6), - new VarbitRequirement(2647, 6), - new VarbitRequirement(2648, 6) + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_1_STATE, 6), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_2_STATE, 6), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_3_STATE, 6) ), new Conditions(LogicType.OR, - new VarbitRequirement(2646, 13), - new VarbitRequirement(2647, 13), - new VarbitRequirement(2648, 13) + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_1_STATE, 13), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_2_STATE, 13), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_EARTH_PIPE_3_STATE, 13) ) ); - repairedPipe = new VarbitRequirement(2650, 1); + repairedPipe = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_STATE, 1); hasSmallCog = new Conditions(LogicType.OR, smallCog, - new VarbitRequirement(2655, 1), - new VarbitRequirement(2656, 1), - new VarbitRequirement(2657, 1) + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG1, 1), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG2, 1), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG3, 1) ); hasMediumCog = new Conditions(LogicType.OR, mediumCog, - new VarbitRequirement(2655, 2), - new VarbitRequirement(2656, 2), - new VarbitRequirement(2657, 2) + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG1, 2), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG2, 2), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG3, 2) ); hasLargeCog = new Conditions(LogicType.OR, largeCog, - new VarbitRequirement(2655, 3), - new VarbitRequirement(2656, 3), - new VarbitRequirement(2657, 3) + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG1, 3), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG2, 3), + new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG3, 3) ); hasPipe = new Conditions(LogicType.OR, repairedPipe, @@ -367,9 +367,9 @@ public void setupConditions() hasCogsAndPipe = new Conditions(hasSmallCog, hasMediumCog, hasLargeCog, hasPipe); - smallCogPlaced = new VarbitRequirement(2655, 1); - mediumCogPlaced = new VarbitRequirement(2656, 2); - largeCogPlaced = new VarbitRequirement(2657, 3); + smallCogPlaced = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG1, 1); + mediumCogPlaced = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG2, 2); + largeCogPlaced = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_COG3, 3); // This potentially relates to varbit 2664 // Small cog in crate 18614 @@ -377,41 +377,41 @@ public void setupConditions() // Medium cog in crate 18616 // Pipe in crate 18617 - placedBar = new VarbitRequirement(2643, 1); - barHotOnJig = new VarbitRequirement(2643, 2); - flatHotBarOnJig = new VarbitRequirement(2643, 3); - coolFlatBarOnJig = new VarbitRequirement(2643, 4); - airCoolFlatBarOnJig = new VarbitRequirement(2643, 5); - craneLowered = new VarbitRequirement(2645, 1); - craneRaised = new VarbitRequirement(2645, 0); - craneHoldingBar = new VarbitRequirement(2644, 2); - craneAboveLava = new VarbitRequirement(2645, 2); - craneInLava = new VarbitRequirement(2645, 3); - barOutsideLava = new VarbitRequirement(2642, 0); - barUnderPress = new VarbitRequirement(2642, 1); - barOutsideTank = new VarbitRequirement(2642, 2); - barInTunnel = new VarbitRequirement(2642, 3); - craneHoldingHotBar = new VarbitRequirement(2644, 3); - - tankClosed = new VarbitRequirement(2653, 0); - tankOpen = new VarbitRequirement(2653, 1); - grabberOut = new VarbitRequirement(2653, 2); - grabberInWithHotFlatBarDoorOpen = new VarbitRequirement(2653, 4); - grabberInWithHotFlatBarDoorClosed = new VarbitRequirement(2653, 3); - grabberOutWithHotFlatBarDoorOpen = new VarbitRequirement(2653, 5); - grabberInWithCoolFlatBarDoorClosed = new VarbitRequirement(2653, 6); - grabberInWithCoolFlatBarDoorOpened = new VarbitRequirement(2653, 7); - grabberOutWithCoolFlatBar = new VarbitRequirement(2653, 8); - waterInOpen = new VarbitRequirement(2651, 1); - waterInClosed = new VarbitRequirement(2651, 0); - waterOutClosed = new VarbitRequirement(2652, 0); - waterOutOpen = new VarbitRequirement(2652, 1); - waterInTank = new VarbitRequirement(2654, 1); - fanOff = new VarbitRequirement(2660, 0); - fanOn = new VarbitRequirement(2660, 1); - - primedBarPlaced = new VarbitRequirement(2662, 1); - mindBarPlaced = new VarbitRequirement(2662, 2); + placedBar = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_STATE, 1); + barHotOnJig = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_STATE, 2); + flatHotBarOnJig = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_STATE, 3); + coolFlatBarOnJig = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_STATE, 4); + airCoolFlatBarOnJig = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_STATE, 5); + craneLowered = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_FIRE_POS, 1); + craneRaised = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_FIRE_POS, 0); + craneHoldingBar = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_FIRE_STATE, 2); + craneAboveLava = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_FIRE_POS, 2); + craneInLava = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_FIRE_POS, 3); + barOutsideLava = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_POS, 0); + barUnderPress = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_POS, 1); + barOutsideTank = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_POS, 2); + barInTunnel = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_JIG_POS, 3); + craneHoldingHotBar = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_FIRE_STATE, 3); + + tankClosed = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 0); + tankOpen = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 1); + grabberOut = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 2); + grabberInWithHotFlatBarDoorOpen = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 4); + grabberInWithHotFlatBarDoorClosed = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 3); + grabberOutWithHotFlatBarDoorOpen = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 5); + grabberInWithCoolFlatBarDoorClosed = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 6); + grabberInWithCoolFlatBarDoorOpened = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 7); + grabberOutWithCoolFlatBar = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_DOOR, 8); + waterInOpen = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_VALVE_1, 1); + waterInClosed = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_VALVE_1, 0); + waterOutClosed = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_VALVE_2, 0); + waterOutOpen = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_VALVE_2, 1); + waterInTank = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_WATER_LEVEL, 1); + fanOff = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_FAN_STATE, 0); + fanOn = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_AIR_FAN_STATE, 1); + + primedBarPlaced = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_MIND_JIG, 1); + mindBarPlaced = new VarbitRequirement(VarbitID.ELEMENTAL_QUEST_2_MIND_JIG, 2); } public void setupSteps() @@ -482,7 +482,7 @@ public void setupSteps() connectPipes = new ConnectPipes(this); getCogsAndPipe = new ObjectStep(this, ObjectID.ELEMENTAL_WORKSHOP_2_BOX_1, - "Search the various marked crates on the catwalk and below for 3 cogs and a pipe.", + "Search the marked crates on the catwalk AND DOWN THE STAIRS for 3 cogs and a pipe.", smallCog, mediumCog, largeCog, pipe); ((ObjectStep) getCogsAndPipe).addAlternateObjects(ObjectID.ELEMENTAL_WORKSHOP_2_BOX_2, ObjectID.ELEMENTAL_WORKSHOP_2_BOX_3, ObjectID.ELEMENTAL_WORKSHOP_2_BOX_4, ObjectID.ELEMENTAL_WORKSHOP_2_BOX_5, ObjectID.ELEMENTAL_WORKSHOP_2_BOX_6, ObjectID.ELEMENTAL_WORKSHOP_2_BOX_7, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enakhraslament/EnakhrasLament.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enakhraslament/EnakhrasLament.java index e637dc28686..b1a55691093 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enakhraslament/EnakhrasLament.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enakhraslament/EnakhrasLament.java @@ -51,7 +51,10 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class EnakhrasLament extends BasicQuestHelper { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/BalloonFlightStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/BalloonFlightStep.java index f2cf4255912..a5186881d73 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/BalloonFlightStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/BalloonFlightStep.java @@ -35,6 +35,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -92,9 +93,9 @@ protected void updateSteps() return; } - int section = client.getVarbitValue(2884); - int xPos = client.getVarbitValue(2882); - int yPos = client.getVarbitValue(2883); + int section = client.getVarbitValue(VarbitID.ZEP_IF_CURRENT_MAP); + int xPos = client.getVarbitValue(VarbitID.ZEP_IF_SCREEN_DIST); + int yPos = client.getVarbitValue(VarbitID.ZEP_IF_BALLOON_HEIGHT); if (sections.get(section) == null) return; // If we've gone to next section before updating the pos, return diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/EnlightenedJourney.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/EnlightenedJourney.java index fd0ac32ee90..823408f9057 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/EnlightenedJourney.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/EnlightenedJourney.java @@ -47,6 +47,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -153,7 +154,7 @@ public void setupConditions() onEntrana = new ZoneRequirement(entrana); hasSandbags = new Conditions(LogicType.OR, - new VarbitRequirement(2875, 1), + new VarbitRequirement(VarbitID.ZEP_SANDBAGS, 1), sandbag8); flying = new WidgetTextRequirement(471, 1, "Balloon Controls"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/GiveAugusteItems.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/GiveAugusteItems.java index f62af3cafd1..b73e49cb8ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/GiveAugusteItems.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/GiveAugusteItems.java @@ -33,6 +33,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; public class GiveAugusteItems extends NpcStep @@ -54,11 +55,11 @@ public GiveAugusteItems(QuestHelper questHelper) super(questHelper, NpcID.ZEP_PICCARD, new WorldPoint(2809, 3354, 0), "Give Auguste the sandbags, silk, dyes, and bowl.", sandbag8, silk10, redDye, yellowDye, bowl); - givenRedDye = new VarbitRequirement(2873, 1); - givenYellowDye = new VarbitRequirement(2874, 1); // 2879 = 1 as well, maybe both dyes done - givenSandbags = new VarbitRequirement(2875, 1); - givenSilk = new VarbitRequirement(2876, 1); - givenBowl = new VarbitRequirement(2877, 1); + givenRedDye = new VarbitRequirement(VarbitID.ZEP_RDYE, 1); + givenYellowDye = new VarbitRequirement(VarbitID.ZEP_YDYE, 1); // 2879 = 1 as well, maybe both dyes done + givenSandbags = new VarbitRequirement(VarbitID.ZEP_SANDBAGS, 1); + givenSilk = new VarbitRequirement(VarbitID.ZEP_SILK, 1); + givenBowl = new VarbitRequirement(VarbitID.ZEP_LOGS, 1); } @Subscribe diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/TaverleyBalloonFlight.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/TaverleyBalloonFlight.java index 3206b100304..a6b404b9432 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/TaverleyBalloonFlight.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/enlightenedjourney/TaverleyBalloonFlight.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.WidgetStep; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.Arrays; @@ -153,9 +154,9 @@ public void onVarbitChanged(VarbitChanged varbitChanged) protected void updateSteps() { - int section = client.getVarbitValue(2884) - 1; - int xPos = client.getVarbitValue(2882); - int yPos = client.getVarbitValue(2883); + int section = client.getVarbitValue(VarbitID.ZEP_IF_CURRENT_MAP) - 1; + int xPos = client.getVarbitValue(VarbitID.ZEP_IF_SCREEN_DIST); + int yPos = client.getVarbitValue(VarbitID.ZEP_IF_BALLOON_HEIGHT); // If we've gone to next section before updating the pos, return if (sections.get(section).size() <= xPos + 1) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/entertheabyss/EnterTheAbyss.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/entertheabyss/EnterTheAbyss.java index 43054a7ac47..43057442c17 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/entertheabyss/EnterTheAbyss.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/entertheabyss/EnterTheAbyss.java @@ -49,6 +49,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -118,11 +119,11 @@ public void setupConditions() { inWizardBasement = new ZoneRequirement(wizardBasement); - teleportedFromWizardsTower = new VarbitRequirement(2314, 1); - teleportedFromVarrock = new VarbitRequirement(2315, 1); - teleportedFromArdougne = new VarbitRequirement(2316, 1); - teleportedFromDistentor = new VarbitRequirement(2317, 1); - teleportedFromGnome = new VarbitRequirement(2318, 1); + teleportedFromWizardsTower = new VarbitRequirement(VarbitID.RCU_ESSENCESPOT_WIZARDSTOWER, 1); + teleportedFromVarrock = new VarbitRequirement(VarbitID.RCU_ESSENCESPOT_AUBURY, 1); + teleportedFromArdougne = new VarbitRequirement(VarbitID.RCU_ESSENCESPOT_CROMPERTY, 1); + teleportedFromDistentor = new VarbitRequirement(VarbitID.RCU_ESSENCESPOT_BRIMSTAIL, 1); + teleportedFromGnome = new VarbitRequirement(VarbitID.RCU_ESSENCESPOT_WIZARDSGUILD, 1); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ernestthechicken/ErnestTheChicken.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ernestthechicken/ErnestTheChicken.java index ecc5eb571c8..abcaa16ffe1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ernestthechicken/ErnestTheChicken.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ernestthechicken/ErnestTheChicken.java @@ -43,6 +43,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -158,18 +159,18 @@ public void setupConditions() inGroundFloor = new ZoneRequirement(manorGround1, secretRoom, manorGround3); inSecretRoom = new ZoneRequirement(secretRoom); killedFish = new ChatMessageRequirement("... then die and float to the surface."); - isLeverADown = new VarbitRequirement(1788, 1); - isLeverBDown = new VarbitRequirement(1789, 1); - isLeverCDown = new VarbitRequirement(1790, 1); - isLeverDDown = new VarbitRequirement(1791, 1); - isLeverEDown = new VarbitRequirement(1792, 1); - isLeverFDown = new VarbitRequirement(1793, 1); - isLeverAUp = new VarbitRequirement(1788, 0); - isLeverBUp = new VarbitRequirement(1789, 0); - isLeverCUp = new VarbitRequirement(1790, 0); - isLeverDUp = new VarbitRequirement(1791, 0); - isLeverEUp = new VarbitRequirement(1792, 0); - isLeverFUp = new VarbitRequirement(1793, 0); + isLeverADown = new VarbitRequirement(VarbitID.ERNESTLEVER_A, 1); + isLeverBDown = new VarbitRequirement(VarbitID.ERNESTLEVER_B, 1); + isLeverCDown = new VarbitRequirement(VarbitID.ERNESTLEVER_C, 1); + isLeverDDown = new VarbitRequirement(VarbitID.ERNESTLEVER_D, 1); + isLeverEDown = new VarbitRequirement(VarbitID.ERNESTLEVER_E, 1); + isLeverFDown = new VarbitRequirement(VarbitID.ERNESTLEVER_F, 1); + isLeverAUp = new VarbitRequirement(VarbitID.ERNESTLEVER_A, 0); + isLeverBUp = new VarbitRequirement(VarbitID.ERNESTLEVER_B, 0); + isLeverCUp = new VarbitRequirement(VarbitID.ERNESTLEVER_C, 0); + isLeverDUp = new VarbitRequirement(VarbitID.ERNESTLEVER_D, 0); + isLeverEUp = new VarbitRequirement(VarbitID.ERNESTLEVER_E, 0); + isLeverFUp = new VarbitRequirement(VarbitID.ERNESTLEVER_F, 0); inBasement = new ZoneRequirement(basement); inRoomCD = new ZoneRequirement(roomCD); inEmptyRoom = new ZoneRequirement(emptyRoom); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ethicallyacquiredantiquities/EthicallyAcquiredAntiquities.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ethicallyacquiredantiquities/EthicallyAcquiredAntiquities.java index e89d0f48bad..ca96a61aa29 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ethicallyacquiredantiquities/EthicallyAcquiredAntiquities.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ethicallyacquiredantiquities/EthicallyAcquiredAntiquities.java @@ -90,7 +90,7 @@ public Map loadSteps() steps.put(8, talkToRegulus); steps.put(10, talkToCrewmember); ConditionalStep goRepairSail = new ConditionalStep(this, talkToArtima); - goRepairSail.addStep(fixedSail.alsoCheckBank(questBank), returnToCrewmember); + goRepairSail.addStep(fixedSail.alsoCheckBank(), returnToCrewmember); steps.put(12, goRepairSail); steps.put(14, returnToCrewmember); steps.put(16, talkToTraderStan); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fairytaleii/FairytaleII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fairytaleii/FairytaleII.java index ae99053d107..e582ddf6ba3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fairytaleii/FairytaleII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fairytaleii/FairytaleII.java @@ -53,6 +53,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -104,7 +105,7 @@ public Map loadSteps() goInvestigate.addStep(new Conditions(hasInvestigatedCertificate, hasReadSign, talkedToGodfather), goToHideoutSurface); goInvestigate.addStep(new Conditions(inZanaris, hasInvestigatedCertificate, hasReadSign), talkToGodfather); goInvestigate.addStep(new Conditions(inZanaris, hasInvestigatedCertificate), readSign); - goInvestigate.addStep(new Conditions(inZanaris, fairyCertificate.alsoCheckBank(questBank)), studyCertificate); + goInvestigate.addStep(new Conditions(inZanaris, fairyCertificate.alsoCheckBank()), studyCertificate); goInvestigate.addStep(inZanaris, takeCertificate); steps.put(20, goInvestigate); steps.put(30, goInvestigate); @@ -112,9 +113,9 @@ public Map loadSteps() steps.put(45, goInvestigate); ConditionalStep goGetSecateurs = new ConditionalStep(this, goToZanarisToPickpocket); - goGetSecateurs.addStep(new Conditions(inHideout, queensSecateurs.alsoCheckBank(questBank)), giveSecateursToNuff); - goGetSecateurs.addStep(new Conditions(inZanaris, queensSecateurs.alsoCheckBank(questBank)), goToHideoutWithSec); - goGetSecateurs.addStep(queensSecateurs.alsoCheckBank(questBank), goToHideoutSurfaceWithSec); + goGetSecateurs.addStep(new Conditions(inHideout, queensSecateurs.alsoCheckBank()), giveSecateursToNuff); + goGetSecateurs.addStep(new Conditions(inZanaris, queensSecateurs.alsoCheckBank()), goToHideoutWithSec); + goGetSecateurs.addStep(queensSecateurs.alsoCheckBank(), goToHideoutSurfaceWithSec); goGetSecateurs.addStep(inHideout, returnToZanarisFromBase); goGetSecateurs.addStep(inZanaris, pickpocketGodfather); steps.put(50, goGetSecateurs); @@ -126,14 +127,14 @@ public Map loadSteps() steps.put(65, goTalkNuffAfterSec); ConditionalStep goMakePotion = new ConditionalStep(this, goToCkp); - goMakePotion.addStep(new Conditions(addedClawCorrectly, magicEssence.alsoCheckBank(questBank), inHideout), + goMakePotion.addStep(new Conditions(addedClawCorrectly, magicEssence.alsoCheckBank(), inHideout), usePotionOnQueen); - goMakePotion.addStep(new Conditions(addedClawCorrectly, magicEssence.alsoCheckBank(questBank)), goToHideout2); - goMakePotion.addStep(new Conditions(addedFlowerCorrectly, gorakClawPowder.alsoCheckBank(questBank), - magicEssenceUnf.alsoCheckBank(questBank)), usePowderOnPotion); - goMakePotion.addStep(new Conditions(addedFlowerCorrectly, gorakClaw.alsoCheckBank(questBank), - magicEssenceUnf.alsoCheckBank(questBank)), usePestleOnClaw); - goMakePotion.addStep(new Conditions(gorakClaw.alsoCheckBank(questBank), starFlower.alsoCheckBank(questBank)), + goMakePotion.addStep(new Conditions(addedClawCorrectly, magicEssence.alsoCheckBank()), goToHideout2); + goMakePotion.addStep(new Conditions(addedFlowerCorrectly, gorakClawPowder.alsoCheckBank(), + magicEssenceUnf.alsoCheckBank()), usePowderOnPotion); + goMakePotion.addStep(new Conditions(addedFlowerCorrectly, gorakClaw.alsoCheckBank(), + magicEssenceUnf.alsoCheckBank()), usePestleOnClaw); + goMakePotion.addStep(new Conditions(gorakClaw.alsoCheckBank(), starFlower.alsoCheckBank()), useStarFlowerOnVial); goMakePotion.addStep(new Conditions(clawNearby, starflowerOrUnfCorrectlyMade), pickupGorakClaw); goMakePotion.addStep(new Conditions(inGorakPlane, starflowerOrUnfCorrectlyMade), killGorak); @@ -214,9 +215,9 @@ public void setupConditions() // 2328 0->1 // 2329 0->2 - hasReadSign = new VarbitRequirement(2338, 4); + hasReadSign = new VarbitRequirement(VarbitID.FAIRY2_SIGN_READ, 4); - hasInvestigatedCertificate = new VarbitRequirement(2336, 1); + hasInvestigatedCertificate = new VarbitRequirement(VarbitID.FAIRY2_CERTIFICUTE_EXAMINED, 1); talkedToGodfather = new VarbitRequirement(QuestVarbits.QUEST_FAIRYTALE_II_CURE_A_QUEEN.getId(), 40, Operation.GREATER_EQUAL); addedFlowerCorrectly = new VarbitRequirement(QuestVarbits.QUEST_FAIRYTALE_II_CURE_A_QUEEN.getId(), 72, Operation.GREATER_EQUAL); @@ -225,7 +226,7 @@ public void setupConditions() // 2334? starflowerNearby = new NpcCondition(NpcID.FAIRY2_STARFLOWER_FULLGROWN); - pickedStarFlower = new VarbitRequirement(2330, 1); + pickedStarFlower = new VarbitRequirement(VarbitID.FAIRYRING_COSMIC_PLANE, 1); clawNearby = new ItemOnTileRequirement(gorakClaw); // 2327 1->2 when searched for certificate @@ -235,8 +236,8 @@ public void setupConditions() // Killed Gorak, 2382=1 starflowerOrUnfCorrectlyMade = new Conditions(LogicType.OR, - starFlower.alsoCheckBank(questBank), - new Conditions(addedFlowerCorrectly, magicEssenceUnf.alsoCheckBank(questBank)) + starFlower.alsoCheckBank(), + new Conditions(addedFlowerCorrectly, magicEssenceUnf.alsoCheckBank()) ); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/familycrest/FamilyCrest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/familycrest/FamilyCrest.java index e6d17691a1c..931bf7feb3e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/familycrest/FamilyCrest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/familycrest/FamilyCrest.java @@ -95,11 +95,11 @@ public Map loadSteps() steps.put(6, goTalkToBoot); ConditionalStep getGold = new ConditionalStep(this, enterWitchavenDungeon); - getGold.addStep(new Conditions(perfectNecklace.alsoCheckBank(questBank), perfectRing.alsoCheckBank(questBank)), returnToMan); - getGold.addStep(perfectNecklace.alsoCheckBank(questBank), makeRing); - getGold.addStep(new Conditions(gold.alsoCheckBank(questBank), goldBar.alsoCheckBank(questBank)), smeltGold); - getGold.addStep(goldBar.alsoCheckBank(questBank), makeNecklace); - getGold.addStep(gold2.alsoCheckBank(questBank), smeltGold); + getGold.addStep(new Conditions(perfectNecklace.alsoCheckBank(), perfectRing.alsoCheckBank()), returnToMan); + getGold.addStep(perfectNecklace.alsoCheckBank(), makeRing); + getGold.addStep(new Conditions(gold.alsoCheckBank(), goldBar.alsoCheckBank()), smeltGold); + getGold.addStep(goldBar.alsoCheckBank(), makeNecklace); + getGold.addStep(gold2.alsoCheckBank(), smeltGold); getGold.addStep(new Conditions(northRoomUp, southRoomDown), mineGold); getGold.addStep(new Conditions(northRoomUp, northWallUp), pullSouthRoomLever2); getGold.addStep(new Conditions(northRoomUp, northWallDown), pullNorthLever3); @@ -122,8 +122,8 @@ public Map loadSteps() steps.put(9, goGiveAntipoisonToJohnathon); ConditionalStep goKillChronizon = new ConditionalStep(this, goDownToChronizon); - goKillChronizon.addStep(crest.alsoCheckBank(questBank), returnCrest); - goKillChronizon.addStep(crestPiece3.alsoCheckBank(questBank), repairCrest); + goKillChronizon.addStep(crest.alsoCheckBank(), returnCrest); + goKillChronizon.addStep(crestPiece3.alsoCheckBank(), repairCrest); goKillChronizon.addStep(crest3Nearby, pickUpCrest3); goKillChronizon.addStep(inEdgevilleDungeon, killChronizon); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fightarena/FightArena.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fightarena/FightArena.java index 407447983d4..8d6552c90a6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fightarena/FightArena.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fightarena/FightArena.java @@ -29,7 +29,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; @@ -48,172 +47,221 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class FightArena extends BasicQuestHelper { - //Items Required - ItemRequirement coins, khazardHelmet, khazardPlatebody, khazardHelmetEquipped, khazardPlatebodyEquipped, khaliBrew, cellKeys; + // Required items + ItemRequirement coins; - //Items Recommended + // Recommended items ItemRequirement combatGear; - Requirement hasKhazardArmour, inArena, inArenaWithOgre, inArenaWithScorpion, inArenaWithBouncer, inCell; - - QuestStep startQuest, searchChest, talkToGuard, buyKhaliBrew, giveKhaliBrew, getCellKeys, openCell, talkToSammy, killOgre, - talkToKhazard, talkToHengrad, talkToSammyForScorpion, killScorpion, talkToSammyForBouncer, killBouncer, leaveArena, endQuest; - - //Zones - Zone arena1, cell; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - - Map steps = new HashMap<>(); - steps.put(0, startQuest); - steps.put(1, searchChest); - - ConditionalStep talkToGuardSteps = new ConditionalStep(this, searchChest); - talkToGuardSteps.addStep(hasKhazardArmour, talkToGuard); - steps.put(2, talkToGuardSteps); - - ConditionalStep giveKhaliBrewSteps = new ConditionalStep(this, searchChest); - giveKhaliBrewSteps.addStep(new Conditions(hasKhazardArmour, khaliBrew), giveKhaliBrew); - giveKhaliBrewSteps.addStep(new Conditions(hasKhazardArmour), buyKhaliBrew); - steps.put(3, giveKhaliBrewSteps); + // Zones + Zone arena1; + Zone cell; - ConditionalStep openCellSteps = new ConditionalStep(this, searchChest); - // You don't need Khazard armour to open the cell, but unless zones are added for the prison, keep the armour - // requirement in case you leave the prison and lose the armour - openCellSteps.addStep(new Conditions(hasKhazardArmour, cellKeys), openCell); - openCellSteps.addStep(new Conditions(hasKhazardArmour), getCellKeys); - steps.put(4, openCellSteps); - steps.put(5, openCellSteps); + // Miscellaneous requirements + ItemRequirement khazardHelmet; + ItemRequirement khazardPlatebody; + ItemRequirement khazardHelmetEquipped; + ItemRequirement khazardPlatebodyEquipped; + ItemRequirement khaliBrew; + ItemRequirement cellKeys; - ConditionalStep killOgreSteps = new ConditionalStep(this, talkToSammy); - killOgreSteps.addStep(new Conditions(inArenaWithOgre), killOgre); - steps.put(6, killOgreSteps); + Requirement hasKhazardArmour; + Requirement inArena; + Requirement inArenaWithOgre; + Requirement inArenaWithScorpion; + Requirement inArenaWithBouncer; + Requirement inCell; - steps.put(7, talkToKhazard); // Step not actually seen, 6->8 when kill Ogre - steps.put(8, talkToKhazard); + // Steps + NpcStep startQuest; + ObjectStep searchChest; + NpcStep talkToGuard; + NpcStep buyKhaliBrew; + NpcStep giveKhaliBrew; + NpcStep getCellKeys; + ObjectStep openCell; + NpcStep talkToSammy; + NpcStep killOgre; + NpcStep talkToKhazard; + NpcStep talkToHengrad; + NpcStep talkToSammyForScorpion; + NpcStep killScorpion; + NpcStep talkToSammyForBouncer; + NpcStep killBouncer; + ObjectStep leaveArena; + NpcStep endQuest; - ConditionalStep inPrisonAndKillScorpionSteps = new ConditionalStep(this, talkToSammyForScorpion); - inPrisonAndKillScorpionSteps.addStep(inCell, talkToHengrad); - inPrisonAndKillScorpionSteps.addStep(new Conditions(inArenaWithScorpion), killScorpion); - steps.put(9, inPrisonAndKillScorpionSteps); - ConditionalStep killBouncerSteps = new ConditionalStep(this, talkToSammyForBouncer); - killBouncerSteps.addStep(new Conditions(inArenaWithBouncer), killBouncer); - steps.put(10, killBouncerSteps); - - ConditionalStep endQuestSteps = new ConditionalStep(this, endQuest); - endQuestSteps.addStep(inArena, leaveArena); - steps.put(11, endQuestSteps); - steps.put(12, endQuestSteps); - steps.put(13, endQuestSteps); - steps.put(14, endQuestSteps); - - return steps; + @Override + protected void setupZones() + { + arena1 = new Zone(new WorldPoint(2583, 3152, 0), new WorldPoint(2606, 3170, 0)); + cell = new Zone(new WorldPoint(2597, 3142, 0), new WorldPoint(2601, 3144, 0)); } @Override protected void setupRequirements() { + inCell = new ZoneRequirement(cell); + inArena = new ZoneRequirement(arena1); + inArenaWithOgre = and(inArena, new NpcCondition(NpcID.ARENA_OGRE, arena1)); + inArenaWithScorpion = and(inArena, new NpcCondition(NpcID.ARENA_SCORPION, arena1)); + inArenaWithBouncer = and(inArena, new NpcCondition(NpcID.ARENA_BOUNCER, arena1)); + coins = new ItemRequirement("Coins", ItemCollections.COINS, 5); + + combatGear = new ItemRequirement("Combat equipment and food (magic/ranged if you want to safe spot)", -1, -1).isNotConsumed(); + combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); + khazardHelmet = new ItemRequirement("Khazard helmet", ItemID.KHAZARD_HELMET); khazardPlatebody = new ItemRequirement("Khazard armour", ItemID.KHAZARD_PLATEMAIL); - khazardHelmetEquipped = new ItemRequirement("Khazard helmet", ItemID.KHAZARD_HELMET, 1, true); - khazardPlatebodyEquipped = new ItemRequirement("Khazard armour", ItemID.KHAZARD_PLATEMAIL, 1, true); + khazardHelmetEquipped = khazardHelmet.equipped(); + khazardPlatebodyEquipped = khazardPlatebody.equipped(); khaliBrew = new ItemRequirement("Khali brew", ItemID.KHALI_BREW); cellKeys = new ItemRequirement("Khazard cell keys", ItemID.KHAZARD_CELLKEYS); cellKeys.setHighlightInInventory(true); - combatGear = new ItemRequirement("Combat equipment and food (magic/ranged if you want to safe spot)", -1, -1).isNotConsumed(); - combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); - } - - @Override - protected void setupZones() - { - arena1 = new Zone(new WorldPoint(2583, 3152, 0), new WorldPoint(2606, 3170, 0)); - cell = new Zone(new WorldPoint(2597, 3142, 0), new WorldPoint(2601, 3144, 0)); - } - public void setupConditions() - { hasKhazardArmour = new ItemRequirements(khazardHelmet, khazardPlatebody); - inCell = new ZoneRequirement(cell); - inArena = new ZoneRequirement(arena1); - inArenaWithOgre = new Conditions(inArena, new NpcCondition(NpcID.ARENA_OGRE, arena1)); - inArenaWithScorpion = new Conditions(inArena, new NpcCondition(NpcID.ARENA_SCORPION, arena1)); - inArenaWithBouncer = new Conditions(inArena, new NpcCondition(NpcID.ARENA_BOUNCER, arena1)); } public void setupSteps() { - startQuest = new NpcStep(this, NpcID.LADY_SERVIL_VIS, new WorldPoint(2565, 3199, 0), - "Talk to Lady Servil, west-southwest of the Monastery south of Ardougne."); - startQuest.addDialogStep(2, "Can I help you?"); + startQuest = new NpcStep(this, NpcID.LADY_SERVIL_VIS, new WorldPoint(2565, 3199, 0), "Talk to Lady Servil, west-southwest of the Monastery south of Ardougne."); + startQuest.addDialogStep("Yes."); + searchChest = new ObjectStep(this, ObjectID.ARENA_GUARD_CHEST_SHUT, new WorldPoint(2613, 3189, 0), "Search the chest to the east for some Khazard armour."); - ((ObjectStep) searchChest).addAlternateObjects(ObjectID.ARENA_GUARD_CHEST_OPEN); - talkToGuard = new NpcStep(this, NpcID.ARENA_GUARD2, new WorldPoint(2615, 3143, 0), - "Equip Khazard armour, talk to the Khazard Guard in the southeast of the prison.", khazardHelmetEquipped, khazardPlatebodyEquipped); - buyKhaliBrew = new NpcStep(this, NpcID.KHAZARD_BARMAN, new WorldPoint(2567, 3140, 0), - "Buy Khali brew for 5 coins from the nearby bar to the west.", coins); - buyKhaliBrew.addDialogStep(2, "I'd like a Khali brew please."); - giveKhaliBrew = new NpcStep(this, NpcID.ARENA_GUARD2, new WorldPoint(2615, 3143, 0), - "Take the brew back to the Khazard Guard.", khazardHelmetEquipped, khazardPlatebodyEquipped, khaliBrew); + searchChest.addAlternateObjects(ObjectID.ARENA_GUARD_CHEST_OPEN); + + talkToGuard = new NpcStep(this, NpcID.ARENA_GUARD2, new WorldPoint(2615, 3143, 0), "Equip Khazard armour, talk to the Khazard Guard in the southeast of the prison.", khazardHelmetEquipped, khazardPlatebodyEquipped); + + buyKhaliBrew = new NpcStep(this, NpcID.KHAZARD_BARMAN, new WorldPoint(2567, 3140, 0), "Buy Khali brew from the nearby bar to the west for 5 coins.", coins); + buyKhaliBrew.addDialogStep("I'd like a Khali Brew please."); + + giveKhaliBrew = new NpcStep(this, NpcID.ARENA_GUARD2, new WorldPoint(2615, 3143, 0), "Take the brew back to the Khazard Guard.", khazardHelmetEquipped, khazardPlatebodyEquipped, khaliBrew); + getCellKeys = new NpcStep(this, NpcID.ARENA_GUARD2, new WorldPoint(2615, 3143, 0), "Get another set of keys from the Khazard Guard", khazardHelmetEquipped, khazardPlatebodyEquipped); openCell = new ObjectStep(this, ObjectID.ARENA_JEREMYDOOR, new WorldPoint(2617, 3167, 0), "Get ready to fight the monsters (all safespottable), starting with Khazard Ogre (level 63). Use the keys on Sammy's cell door to free him.", combatGear, cellKeys); openCell.addIcon(ItemID.KHAZARD_CELLKEYS); talkToSammy = new NpcStep(this, NpcID.SAMMY_SERVIL_VIS_NOOP, new WorldPoint(2602, 3153, 0), "Talk to Sammy, then fight the ogre."); - killOgre = new NpcStep(this, NpcID.ARENA_OGRE, new WorldPoint(2601, 3163, 0), - "Kill the Ogre. You can lure it behind a skeleton to safespot it.", combatGear); + + killOgre = new NpcStep(this, NpcID.ARENA_OGRE, new WorldPoint(2601, 3163, 0), "Kill the Ogre. You can lure it behind a skeleton to safespot it.", combatGear); killOgre.addSubSteps(talkToSammy); + killOgre.addSafeSpots(new WorldPoint(2598, 3162, 0)); + talkToKhazard = new NpcStep(this, NpcID.SHADOW_MAJ_KHAZARD, new WorldPoint(2605, 3153, 0), "Talk to General Khazard."); talkToHengrad = new NpcStep(this, NpcID.HENGRAD, new WorldPoint(2599, 3143, 0), "Talk to Hengrad."); talkToHengrad.addSubSteps(talkToKhazard); + talkToSammyForScorpion = new NpcStep(this, NpcID.SAMMY_SERVIL_VIS_NOOP, new WorldPoint(2602, 3153, 0), "Talk to Sammy, then fight the scorpion."); + killScorpion = new NpcStep(this, NpcID.ARENA_SCORPION, new WorldPoint(2601, 3163, 0), "Kill the Scorpion. You can lure it behind a skeleton to safespot it.", combatGear); + killScorpion.addSafeSpots(new WorldPoint(2598, 3162, 0)); killScorpion.addSubSteps(talkToSammyForScorpion); + talkToSammyForBouncer = new NpcStep(this, NpcID.SAMMY_SERVIL_VIS_NOOP, new WorldPoint(2602, 3153, 0), "Talk to Sammy, then fight Bouncer."); - killBouncer = new NpcStep(this, NpcID.ARENA_BOUNCER, new WorldPoint(2601, 3163, 0), - "Kill Bouncer. You can lure it behind a skeleton to safespot it. Warning: After Bouncer is killed, you will be unable to re-enter the arena.", combatGear); + + killBouncer = new NpcStep(this, NpcID.ARENA_BOUNCER, new WorldPoint(2601, 3163, 0), "Kill Bouncer. You can lure it behind a skeleton to safespot it. Warning: After Bouncer is killed, you will be unable to re-enter the arena.", combatGear); + killBouncer.addSafeSpots(new WorldPoint(2598, 3162, 0)); killBouncer.addSubSteps(talkToSammyForBouncer); - leaveArena = new ObjectStep(this, ObjectID.FIGHTARENA_DOOR2, new WorldPoint(2606, 3152, 0), - "Exit the arena (can ignore General Khazard). Warning: You will be unable to re-enter the arena."); + + leaveArena = new ObjectStep(this, ObjectID.FIGHTARENA_DOOR2, new WorldPoint(2606, 3152, 0), "Exit the arena (can ignore General Khazard). Warning: You will be unable to re-enter the arena."); + leaveArena.addDialogStep("Yes."); + endQuest = new NpcStep(this, NpcID.LADY_SERVIL_VIS, new WorldPoint(2565, 3199, 0), "Go back to Lady Servil to end the quest."); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + Map steps = new HashMap<>(); + steps.put(0, startQuest); + steps.put(1, searchChest); + + var talkToGuardSteps = new ConditionalStep(this, searchChest); + talkToGuardSteps.addStep(hasKhazardArmour, talkToGuard); + steps.put(2, talkToGuardSteps); + + var giveKhaliBrewSteps = new ConditionalStep(this, searchChest); + giveKhaliBrewSteps.addStep(and(hasKhazardArmour, khaliBrew), giveKhaliBrew); + giveKhaliBrewSteps.addStep(hasKhazardArmour, buyKhaliBrew); + steps.put(3, giveKhaliBrewSteps); + + var openCellSteps = new ConditionalStep(this, searchChest); + // You don't need Khazard armour to open the cell, but unless zones are added for the prison, keep the armour + // requirement in case you leave the prison and lose the armour + openCellSteps.addStep(and(hasKhazardArmour, cellKeys), openCell); + openCellSteps.addStep(hasKhazardArmour, getCellKeys); + steps.put(4, openCellSteps); + steps.put(5, openCellSteps); + + var killOgreSteps = new ConditionalStep(this, talkToSammy); + killOgreSteps.addStep(inArenaWithOgre, killOgre); + steps.put(6, killOgreSteps); + + steps.put(7, talkToKhazard); // Step not actually seen, 6->8 when kill Ogre + steps.put(8, talkToKhazard); + + var inPrisonAndKillScorpionSteps = new ConditionalStep(this, talkToSammyForScorpion); + inPrisonAndKillScorpionSteps.addStep(inCell, talkToHengrad); + inPrisonAndKillScorpionSteps.addStep(inArenaWithScorpion, killScorpion); + steps.put(9, inPrisonAndKillScorpionSteps); + + var killBouncerSteps = new ConditionalStep(this, talkToSammyForBouncer); + killBouncerSteps.addStep(inArenaWithBouncer, killBouncer); + steps.put(10, killBouncerSteps); + + var endQuestSteps = new ConditionalStep(this, endQuest); + endQuestSteps.addStep(inArena, leaveArena); + steps.put(11, endQuestSteps); + steps.put(12, endQuestSteps); + steps.put(13, endQuestSteps); + steps.put(14, endQuestSteps); + + return steps; + } + @Override public List getItemRequirements() { - return Collections.singletonList(coins); + return List.of( + coins + ); } @Override public List getItemRecommended() { - return Collections.singletonList(combatGear); + return List.of( + combatGear + ); } @Override public List getCombatRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add("Khazard Scorpion (level 44) (safespottable)"); - reqs.add("Khazard Ogre (level 63) (safespottable)"); - reqs.add("Bouncer (level 137) (safespottable)"); - reqs.add("General Khazard (level 142) (safespottable) (optional)"); - return reqs; + return List.of( + "Khazard Scorpion (level 44) (safespottable)", + "Khazard Ogre (level 63) (safespottable)", + "Bouncer (level 137) (safespottable)", + "General Khazard (level 142) (safespottable) (optional)" + ); } @Override @@ -225,26 +273,52 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Arrays.asList( - new ExperienceReward(Skill.ATTACK, 12175), - new ExperienceReward(Skill.THIEVING, 2175)); + return List.of( + new ExperienceReward(Skill.ATTACK, 12175), + new ExperienceReward(Skill.THIEVING, 2175) + ); } @Override public List getItemRewards() { - return Arrays.asList( - new ItemReward("Coins", ItemID.COINS, 1000), - new ItemReward("Khazard Armor", ItemID.KHAZARD_PLATEMAIL, 1)); + return List.of( + new ItemReward("Coins", ItemID.COINS, 1000), + new ItemReward("Khazard Armor", ItemID.KHAZARD_PLATEMAIL, 1) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Start quest", Arrays.asList(startQuest, searchChest, talkToGuard, buyKhaliBrew, giveKhaliBrew), coins)); - allSteps.add(new PanelDetails("Fight!", Arrays.asList(getCellKeys, openCell, killOgre, talkToHengrad, killScorpion, killBouncer), combatGear)); - allSteps.add(new PanelDetails("Finish quest", Arrays.asList(leaveArena, endQuest))); - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Start quest", List.of( + startQuest, + searchChest, + talkToGuard, + buyKhaliBrew, + giveKhaliBrew + ), List.of( + coins + ))); + + sections.add(new PanelDetails("Fight!", List.of( + getCellKeys, + openCell, + killOgre, + talkToHengrad, + killScorpion, + killBouncer + ), List.of( + combatGear + ))); + + sections.add(new PanelDetails("Finish quest", List.of( + leaveArena, + endQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fishingcontest/FishingContest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fishingcontest/FishingContest.java index 3e1d4c0bf5a..1b47c2b9814 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fishingcontest/FishingContest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/fishingcontest/FishingContest.java @@ -37,7 +37,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -55,6 +54,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -213,9 +213,9 @@ public void setupConditions() notInWoods = new Conditions(LogicType.NOR, inWoods); // 2051 0->1 also set for garlic in pipe - hasPutGarlicInPipe = new VarbitRequirement(2054, 1); - needsGarlic = and(LogicHelper.nor(hasPutGarlicInPipe), new ItemRequirements(LogicType.NOR, "", garlic)); - hasEverything = new Conditions(LogicHelper.nor(needsGarlic), redVineWorm, fishingRod); + hasPutGarlicInPipe = new VarbitRequirement(VarbitID.FISHINGCOMPO_STRANGER, 1); + needsGarlic = and(nor(hasPutGarlicInPipe), new ItemRequirements(LogicType.NOR, "", garlic)); + hasEverything = new Conditions(nor(needsGarlic), redVineWorm, fishingRod); enteredContestArea = new Conditions(hasEverything, onContestGrounds); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/forgettabletale/ForgettableTale.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/forgettabletale/ForgettableTale.java index d70a69b1d04..3c6629d3029 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/forgettabletale/ForgettableTale.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/forgettabletale/ForgettableTale.java @@ -420,11 +420,11 @@ public void setupConditions() // Part way through veldeban dialog, told about drunken dwarf: // 824 = 1 - givenBeerToDrunkenDwarf = new VarbitRequirement(838, 1); - rowdyDwarfMadeRequest = new VarbitRequirement(829, 1); - gotRowdySeed = new VarbitRequirement(826, 1); - gotGaussSeed = new VarbitRequirement(827, 1); - gotKhorvakSeed = new VarbitRequirement(828, 1); + givenBeerToDrunkenDwarf = new VarbitRequirement(VarbitID.FORGET_BEER_GIVEN, 1); + rowdyDwarfMadeRequest = new VarbitRequirement(VarbitID.FORGET_SEED2_TOLD, 1); + gotRowdySeed = new VarbitRequirement(VarbitID.FORGET_SEED2_GIVEN, 1); + gotGaussSeed = new VarbitRequirement(VarbitID.FORGET_SEED3_GIVEN, 1); + gotKhorvakSeed = new VarbitRequirement(VarbitID.FORGET_SEED4_GIVEN, 1); // 830 = 1, talked a bit to gauss // 831 = 1, asked about seed from khorvak @@ -440,13 +440,13 @@ public void setupConditions() keldaBrewed = new VarbitRequirement(VarbitID.BREWING_VAT_VARBIT_1, 71, Operation.GREATER_EQUAL); keldaInBarrel = new VarbitRequirement(VarbitID.BREWING_BARREL_VARBIT_1, 3, Operation.GREATER_EQUAL); - inPurple = new VarbitRequirement(578, 1); // Purple Pewter - inYellow = new VarbitRequirement(578, 2); // Yellow Fortune - inBlue = new VarbitRequirement(578, 3); // Blue Opal - inGreen = new VarbitRequirement(578, 4); // Green Gem - inWhite = new VarbitRequirement(578, 5); // White Chisel - inSilver = new VarbitRequirement(578, 6); // Silver Cog - inBrown = new VarbitRequirement(578, 7); // Brown Engine + inPurple = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 1); // Purple Pewter + inYellow = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 2); // Yellow Fortune + inBlue = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 3); // Blue Opal + inGreen = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 4); // Green Gem + inWhite = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 5); // White Chisel + inSilver = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 6); // Silver Cog + inBrown = new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 7); // Brown Engine handsFree = new NoItemRequirement("No weapon equipped", ItemSlots.WEAPON); shieldFree = new NoItemRequirement("No shield equipped", ItemSlots.SHIELD); @@ -456,76 +456,76 @@ public void setupConditions() // 863 = 1, Searched box // - searchedBox1 = new VarbitRequirement(863, 1); + searchedBox1 = new VarbitRequirement(VarbitID.FORGET_START_EMPTIED, 1); // 862, 861 are number of green/yellow inPuzzle = new WidgetTextRequirement(248, 53, "Ok"); - donePuzzle1P1 = new VarbitRequirement(842, 2); - donePuzzle1P2 = new VarbitRequirement(844, 1); - searchedPuzzle1Box = new VarbitRequirement(864, 1); + donePuzzle1P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 2); + donePuzzle1P2 = new VarbitRequirement(VarbitID.FORGET_IF3, 1); + searchedPuzzle1Box = new VarbitRequirement(VarbitID.FORGET_BOX1_EMPTIED, 1); // Puzzle 2 - donePuzzle2P1 = new VarbitRequirement(842, 1); - donePuzzle2P2 = new VarbitRequirement(843, 2); - donePuzzle2P3 = new VarbitRequirement(846, 1); - searchedPuzzle258Box = new VarbitRequirement(865, 1); + donePuzzle2P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 1); + donePuzzle2P2 = new VarbitRequirement(VarbitID.FORGET_IF2, 2); + donePuzzle2P3 = new VarbitRequirement(VarbitID.FORGET_IF5, 1); + searchedPuzzle258Box = new VarbitRequirement(VarbitID.FORGET_BOX2_EMPTIED, 1); // Puzzle 3 - donePuzzle3P1 = new VarbitRequirement(842, 2); - donePuzzle3P2 = new VarbitRequirement(844, 2); - donePuzzle3P3 = new VarbitRequirement(847, 1); - donePuzzle3P4 = new VarbitRequirement(848, 1); + donePuzzle3P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 2); + donePuzzle3P2 = new VarbitRequirement(VarbitID.FORGET_IF3, 2); + donePuzzle3P3 = new VarbitRequirement(VarbitID.FORGET_IF6, 1); + donePuzzle3P4 = new VarbitRequirement(VarbitID.FORGET_IF7, 1); // Puzzle 4 inRoom2PuzzleWidget = new WidgetTextRequirement(244, 73, "Ok"); - donePuzzle4P1 = new VarbitRequirement(842, 1); - donePuzzle4P2 = new VarbitRequirement(843, 2); - donePuzzle4P3 = new VarbitRequirement(846, 2); - searchedPuzzle147Box = new VarbitRequirement(864, 1); + donePuzzle4P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 1); + donePuzzle4P2 = new VarbitRequirement(VarbitID.FORGET_IF2, 2); + donePuzzle4P3 = new VarbitRequirement(VarbitID.FORGET_IF5, 2); + searchedPuzzle147Box = new VarbitRequirement(VarbitID.FORGET_BOX1_EMPTIED, 1); // Puzzle 5 - donePuzzle5P1 = new VarbitRequirement(842, 2); - donePuzzle5P2 = new VarbitRequirement(844, 2); - donePuzzle5P3 = new VarbitRequirement(847, 1); - donePuzzle5P4 = new VarbitRequirement(852, 1); + donePuzzle5P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 2); + donePuzzle5P2 = new VarbitRequirement(VarbitID.FORGET_IF3, 2); + donePuzzle5P3 = new VarbitRequirement(VarbitID.FORGET_IF6, 1); + donePuzzle5P4 = new VarbitRequirement(VarbitID.FORGET_IF11, 1); inPuzzle5Room = new ZoneRequirement(puzzle5Room); // Puzzle 6 - donePuzzle6P1 = new VarbitRequirement(842, 1); - donePuzzle6P2 = new VarbitRequirement(843, 1); - donePuzzle6P3 = new VarbitRequirement(845, 2); - donePuzzle6P4 = new VarbitRequirement(851, 1); - donePuzzle6P5 = new VarbitRequirement(853, 2); + donePuzzle6P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 1); + donePuzzle6P2 = new VarbitRequirement(VarbitID.FORGET_IF2, 1); + donePuzzle6P3 = new VarbitRequirement(VarbitID.FORGET_IF4, 2); + donePuzzle6P4 = new VarbitRequirement(VarbitID.FORGET_IF10, 1); + donePuzzle6P5 = new VarbitRequirement(VarbitID.FORGET_IF12, 2); inLibrary = new ZoneRequirement(library); - readBook = new VarbitRequirement(833, 1); - readCrate1 = new VarbitRequirement(834, 1); - readCrate2 = new VarbitRequirement(835, 1); + readBook = new VarbitRequirement(VarbitID.FORGET_ROOM2_BOOKCASE, 1); + readCrate1 = new VarbitRequirement(VarbitID.FORGET_ROOM2_PAPER1, 1); + readCrate2 = new VarbitRequirement(VarbitID.FORGET_ROOM2_PAPER2, 1); // Puzzle 7 inRoom3PuzzleWidget = new WidgetTextRequirement(247, 108, "Ok"); - donePuzzle7P1 = new VarbitRequirement(842, 1); - donePuzzle7P2 = new VarbitRequirement(843, 1); - donePuzzle7P3 = new VarbitRequirement(845, 2); - donePuzzle7P4 = new VarbitRequirement(847, 2); + donePuzzle7P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 1); + donePuzzle7P2 = new VarbitRequirement(VarbitID.FORGET_IF2, 1); + donePuzzle7P3 = new VarbitRequirement(VarbitID.FORGET_IF4, 2); + donePuzzle7P4 = new VarbitRequirement(VarbitID.FORGET_IF6, 2); // Puzzle 8 - donePuzzle8P1 = new VarbitRequirement(842, 2); - donePuzzle8P2 = new VarbitRequirement(844, 2); - donePuzzle8P3 = new VarbitRequirement(846, 2); - donePuzzle8P4 = new VarbitRequirement(848, 1); - donePuzzle8P5 = new VarbitRequirement(850, 1); - donePuzzle8P6 = new VarbitRequirement(853, 1); + donePuzzle8P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 2); + donePuzzle8P2 = new VarbitRequirement(VarbitID.FORGET_IF3, 2); + donePuzzle8P3 = new VarbitRequirement(VarbitID.FORGET_IF5, 2); + donePuzzle8P4 = new VarbitRequirement(VarbitID.FORGET_IF7, 1); + donePuzzle8P5 = new VarbitRequirement(VarbitID.FORGET_IF9, 1); + donePuzzle8P6 = new VarbitRequirement(VarbitID.FORGET_IF12, 1); // Puzzle 9 - donePuzzle9P1 = new VarbitRequirement(842, 1); - donePuzzle9P2 = new VarbitRequirement(843, 1); - donePuzzle9P3 = new VarbitRequirement(845, 2); - donePuzzle9P4 = new VarbitRequirement(847, 1); - donePuzzle9P5 = new VarbitRequirement(849, 2); - donePuzzle9P6 = new VarbitRequirement(852, 1); - donePuzzle9P7 = new VarbitRequirement(855, 2); - donePuzzle9P8 = new VarbitRequirement(858, 2); + donePuzzle9P1 = new VarbitRequirement(VarbitID.FORGET_IF1, 1); + donePuzzle9P2 = new VarbitRequirement(VarbitID.FORGET_IF2, 1); + donePuzzle9P3 = new VarbitRequirement(VarbitID.FORGET_IF4, 2); + donePuzzle9P4 = new VarbitRequirement(VarbitID.FORGET_IF6, 1); + donePuzzle9P5 = new VarbitRequirement(VarbitID.FORGET_IF8, 2); + donePuzzle9P6 = new VarbitRequirement(VarbitID.FORGET_IF11, 1); + donePuzzle9P7 = new VarbitRequirement(VarbitID.FORGET_IF14, 2); + donePuzzle9P8 = new VarbitRequirement(VarbitID.FORGET_IF17, 2); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gardenoftranquility/GardenOfTranquillity.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gardenoftranquility/GardenOfTranquillity.java index 7ffb5f1422c..8a33e111406 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gardenoftranquility/GardenOfTranquillity.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gardenoftranquility/GardenOfTranquillity.java @@ -286,27 +286,27 @@ protected void setupRequirements() public void setupConditions() { - talkedToElstan = new VarbitRequirement(967, 1); + talkedToElstan = new VarbitRequirement(VarbitID.GARDEN_ELSTAN_VARBIT, 1); plantedMarigold = new VarbitRequirement(VarbitID.GARDEN_ELSTAN_VARBIT, 2, Operation.GREATER_EQUAL); - harvestedMarigold = new VarbitRequirement(967, 3); - givenMarigold = new VarbitRequirement(967, 4); + harvestedMarigold = new VarbitRequirement(VarbitID.GARDEN_ELSTAN_VARBIT, 3); + givenMarigold = new VarbitRequirement(VarbitID.GARDEN_ELSTAN_VARBIT, 4); - talkedToLyra = new VarbitRequirement(968, 1); + talkedToLyra = new VarbitRequirement(VarbitID.GARDEN_LYRA_VARBIT, 1); plantedOnions = new Conditions(LogicType.OR, - new VarbitRequirement(969, 1), // West patch - new VarbitRequirement(970, 1)); // East patch + new VarbitRequirement(VarbitID.GARDEN_PATCH_7_VARBIT, 1), // West patch + new VarbitRequirement(VarbitID.GARDEN_PATCH_8_VARBIT, 1)); // East patch // Planted onion, 4771 3->13 onionsGrown = new VarbitRequirement(VarbitID.GARDEN_LYRA_VARBIT, 2, Operation.GREATER_EQUAL); - talkedToLyraAgain = new VarbitRequirement(968, 3); - talkedToKragen = new VarbitRequirement(971, 1); + talkedToLyraAgain = new VarbitRequirement(VarbitID.GARDEN_LYRA_VARBIT, 3); + talkedToKragen = new VarbitRequirement(VarbitID.GARDEN_KRAGEN_VARBIT, 1); plantedCabbages = new Conditions(LogicType.OR, - new VarbitRequirement(974, 1), // North patch - new VarbitRequirement(975, 1)); // South patch + new VarbitRequirement(VarbitID.GARDEN_PATCH_5_VARBIT, 1), // North patch + new VarbitRequirement(VarbitID.GARDEN_PATCH_6_VARBIT, 1)); // South patch cabbagesGrown = new VarbitRequirement(VarbitID.GARDEN_KRAGEN_VARBIT, 2, Operation.GREATER_EQUAL); - talkedToKragenAgain = new VarbitRequirement(971, 3); + talkedToKragenAgain = new VarbitRequirement(VarbitID.GARDEN_KRAGEN_VARBIT, 3); - talkedToDantaera = new VarbitRequirement(976, 1); - cutShoot = new VarbitRequirement(976, 2); + talkedToDantaera = new VarbitRequirement(VarbitID.GARDEN_DANTAERA_VARBIT, 1); + cutShoot = new VarbitRequirement(VarbitID.GARDEN_DANTAERA_VARBIT, 2); hasPlantedShoot = new Conditions(whiteTreePot); hasWateredShoot = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.GARDEN_WHITE_TREE_VARBIT, 4, Operation.GREATER_EQUAL), @@ -314,12 +314,12 @@ public void setupConditions() whitetreeSapling); talkedToAlthric = new VarbitRequirement(VarbitID.GARDEN_ALTHRIC_VARBIT, 1, Operation.GREATER_EQUAL); - ringInWell = new VarbitRequirement(966, 1); + ringInWell = new VarbitRequirement(VarbitID.GARDEN_RING_IN_WELL_VARBIT, 1); canPickRoses = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.GARDEN_ALTHRIC_VARBIT, 2, Operation.GREATER_EQUAL), ringInWell ); - ringNotInWell = new VarbitRequirement(966, 0); + ringNotInWell = new VarbitRequirement(VarbitID.GARDEN_RING_IN_WELL_VARBIT, 0); hasRedRoseSeed = new Conditions(LogicType.OR, redRoseSeed, @@ -335,17 +335,17 @@ public void setupConditions() ); hasRoseSeeds = new Conditions(hasRedRoseSeed, hasWhiteRoseSeed, hasPinkRoseSeed); - talkedToBernald = new VarbitRequirement(988, 1); - usedCureOnVines = new VarbitRequirement(988, 2); - talkedToAlain = new VarbitRequirement(988, 3); - curedVine = new VarbitRequirement(988, 4); + talkedToBernald = new VarbitRequirement(VarbitID.GARDEN_BERNALD_VARBIT, 1); + usedCureOnVines = new VarbitRequirement(VarbitID.GARDEN_BERNALD_VARBIT, 2); + talkedToAlain = new VarbitRequirement(VarbitID.GARDEN_BERNALD_VARBIT, 3); + curedVine = new VarbitRequirement(VarbitID.GARDEN_BERNALD_VARBIT, 4); hasShards = runeShards; hasDust = runeDust; hasEnhancedCure = magicPlantCure; - gotVineSeeds = new VarbitRequirement(988, 5); + gotVineSeeds = new VarbitRequirement(VarbitID.GARDEN_BERNALD_VARBIT, 5); - notAddedCompost1 = new VarbitRequirement(984, 0); - notAddedCompost2 = new VarbitRequirement(986, 0); + notAddedCompost1 = new VarbitRequirement(VarbitID.GARDEN_ORCHIDS_PINK_VARBIT, 0); + notAddedCompost2 = new VarbitRequirement(VarbitID.GARDEN_ORCHIDS_YELLOW_VARBIT, 0); notPlantedDelphinium = new VarbitRequirement(VarbitID.GARDEN_DELPHINIUMS_VARBIT, 3, Operation.LESS_EQUAL); notPlantedYellowOrchid = new VarbitRequirement(VarbitID.GARDEN_ORCHIDS_YELLOW_VARBIT, 1, Operation.LESS_EQUAL); notPlantedPinkOrchid = new VarbitRequirement(VarbitID.GARDEN_ORCHIDS_PINK_VARBIT, 1, Operation.LESS_EQUAL); @@ -363,11 +363,11 @@ public void setupConditions() trolley, new NpcCondition(NpcID.GARDEN_TROLLEY_SARADOMIN)); - lumbridgeStatueOnTrolley = new VarbitRequirement(965, 2); - faladorStatueOnTrolley = new VarbitRequirement(965, 1); + lumbridgeStatueOnTrolley = new VarbitRequirement(VarbitID.GARDEN_TROLLEY_VARBIT, 2); + faladorStatueOnTrolley = new VarbitRequirement(VarbitID.GARDEN_TROLLEY_VARBIT, 1); - placedLumbridgeStatue = new VarbitRequirement(964, 2); - placedFaladorStatue = new VarbitRequirement(963, 2); + placedLumbridgeStatue = new VarbitRequirement(VarbitID.GARDEN_KING_STATUE_VARBIT, 2); + placedFaladorStatue = new VarbitRequirement(VarbitID.GARDEN_SARADOMIN_STATUE_VARBIT, 2); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gertrudescat/GertrudesCat.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gertrudescat/GertrudesCat.java index d7d7657e7d1..25d3ace8fa4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gertrudescat/GertrudesCat.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/gertrudescat/GertrudesCat.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Patyfatycake + * Copyright (c) 2025, pajlada * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,11 +28,9 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; +import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirements; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; @@ -45,208 +44,190 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class GertrudesCat extends BasicQuestHelper { - //Items Required - ItemRequirement bucketOfMilk, coins, seasonedSardine, sardine, doogleLeaves, milkHighlighted, - seasonedSardineHighlighted, kittenHighlighted; + // Required items + ItemRequirement bucketOfMilk; + ItemRequirement coins; + ItemRequirement sardineHighlighted; - ItemRequirement lumberyardTeleport, varrockTeleport; + // Miscellaneous requirements + ItemRequirement seasonedSardine; + ItemRequirement doogleLeaves; + ItemRequirement doogleLeavesHighlighted; + ItemRequirement bucketOfMilkHighlighted; + ItemRequirement seasonedSardineHighlighted; + ItemRequirement kitten; + ItemRequirement kittenHighlighted; - QuestStep talkToGertrude, talkToChildren, gertrudesCat, gertrudesCat2, searchNearbyCrates, - giveKittenToFluffy, finishQuest; + ZoneRequirement isUpstairsLumberyard; - QuestStep pickupDoogle, makeSeasonedSardine; + QuestRequirement hasGivenFluffsMilkAndSardine; - ConditionalStep giveMilkToCatSteps, giveSardineToCat; + ItemRequirement lumberyardTeleport; + ItemRequirement varrockTeleport; - Requirement isUpstairsLumberyard, hasFluffsKitten; + // Steps + NpcStep talkToGertrude; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); + DetailedQuestStep pickupDoogle; + DetailedQuestStep makeSeasonedSardine; + NpcStep talkToChildren; - return getSteps(); - } + ObjectStep climbLadder; + QuestStep gertrudesCat; + ConditionalStep cGiveMilkToCat; - private Map getSteps() - { - Map steps = new HashMap<>(); + ObjectStep climbLadder2; + NpcStep gertrudesCat2; + ConditionalStep cGiveSardineToCat; - steps.put(0, talkToGertrude = getTalkToGertrude()); + ObjectStep climbDownLadderStep; + ObjectStep climbUpLadderStep; + NpcStep searchNearbyCrates; + NpcStep giveKittenToFluffy; - talkToChildren = getTalkToChildren(); + NpcStep finishQuest; - ConditionalStep conditionalTalkToChildren = new ConditionalStep(this, pickupDoogle); - conditionalTalkToChildren.addStep(new ItemRequirements(LogicType.AND, "", sardine, doogleLeaves), makeSeasonedSardine); - conditionalTalkToChildren.addStep(seasonedSardine, talkToChildren); - steps.put(1, conditionalTalkToChildren); + @Override + protected void setupZones() + { + Zone zone = new Zone(new WorldPoint(3306, 3507, 12), new WorldPoint(3312, 3513, 1)); - steps.put(2, giveMilkToCatSteps = getGiveMilkToCat()); - steps.put(3, giveSardineToCat = getFeedCat()); - steps.put(4, findFluffsKitten()); - steps.put(5, finishQuest = returnToGertrude()); - return steps; + isUpstairsLumberyard = new ZoneRequirement(zone); } - private NpcStep returnToGertrude() + @Override + protected void setupRequirements() { - return new NpcStep(this, NpcID.GERTRUDE_QUEST, - new WorldPoint(3148, 3413, 0), "Return to Gertrude to complete the quest."); - } + hasGivenFluffsMilkAndSardine = new QuestRequirement(QuestHelperQuest.GERTRUDES_CAT, 4); - private QuestStep findFluffsKitten() - { - //Need to find to ways to hide arrow - searchNearbyCrates = new NpcStep(this, NpcID.KITTENS_MEW, new WorldPoint(3306, 3505, 0), - "Search for a kitten in the crates in the Lumberyard.", true); - ((NpcStep)(searchNearbyCrates)).setHideWorldArrow(true); - ObjectStep climbDownLadderStep = goDownLadderStep(); - ObjectStep climbUpLadderStep = getClimbLadder(); - ArrayList fluffsKittenRequirement = new ArrayList<>(); - fluffsKittenRequirement.add(new ItemRequirement("Fluffs' Kitten", ItemID.GERTRUDEKITTENS)); - climbUpLadderStep.addItemRequirements(fluffsKittenRequirement); - Conditions hasFluffsKittenUpstairs = new Conditions(hasFluffsKitten, isUpstairsLumberyard); - - kittenHighlighted = new ItemRequirement("Fluffs' Kitten", ItemID.GERTRUDEKITTENS); - kittenHighlighted.setHighlightInInventory(true); - - giveKittenToFluffy = getGertrudesCat(kittenHighlighted); - giveKittenToFluffy.setText("Return the kitten to Gertrude's cat."); - giveKittenToFluffy.addIcon(ItemID.GERTRUDEKITTENS); + bucketOfMilk = new ItemRequirement("Bucket of milk", ItemID.BUCKET_MILK).hideConditioned(hasGivenFluffsMilkAndSardine); + bucketOfMilkHighlighted = bucketOfMilk.highlighted(); - ConditionalStep conditionalKitten = new ConditionalStep(this, searchNearbyCrates); - conditionalKitten.addStep(hasFluffsKittenUpstairs, giveKittenToFluffy); - conditionalKitten.addStep(hasFluffsKitten, climbUpLadderStep); - conditionalKitten.addStep(isUpstairsLumberyard, climbDownLadderStep); + coins = new ItemRequirement("Coins", ItemCollections.COINS, 100); - searchNearbyCrates.addSubSteps(climbDownLadderStep); - giveKittenToFluffy.addSubSteps(climbUpLadderStep); + sardineHighlighted = new ItemRequirement("Raw Sardine", ItemID.RAW_SARDINE).highlighted().hideConditioned(hasGivenFluffsMilkAndSardine); - return conditionalKitten; - } + seasonedSardine = new ItemRequirement("Seasoned Sardine", ItemID.SEASONED_SARDINE).hideConditioned(hasGivenFluffsMilkAndSardine); + seasonedSardine.setTooltip("Can be created by using a sardine on Doogle leaves(South of Gertrudes House)"); + seasonedSardineHighlighted = seasonedSardine.highlighted(); - private ObjectStep goDownLadderStep() - { - return new ObjectStep(this, ObjectID.FAI_VARROCK_LADDERTOP, new WorldPoint(3310, 3509, 1), - "Climb down ladder in the Lumberyard."); + doogleLeaves = new ItemRequirement("Doogle Leaves", ItemID.DOOGLELEAVES); + doogleLeavesHighlighted = doogleLeaves.highlighted(); + + kitten = new ItemRequirement("Fluffs' Kitten", ItemID.GERTRUDEKITTENS); + kittenHighlighted = kitten.highlighted(); + + // Teleport recommendations + lumberyardTeleport = new ItemRequirement("Lumberyard teleport", ItemID.TELEPORTSCROLL_LUMBERYARD); + varrockTeleport = new ItemRequirement("Varrock teleports", ItemID.POH_TABLET_VARROCKTELEPORT, 2); } - private ConditionalStep getFeedCat() + public void setupSteps() { - gertrudesCat2 = getGertrudesCat(seasonedSardineHighlighted); - gertrudesCat2.addIcon(ItemID.SEASONED_SARDINE); - - ObjectStep climbLadder = new ObjectStep(this, ObjectID.FAI_VARROCK_LADDER, - new WorldPoint(3310, 3509, 0), "Climb up the ladder in the Lumberyard.", seasonedSardine); + talkToGertrude = new NpcStep(this, NpcID.GERTRUDE_QUEST, new WorldPoint(3148, 3413, 0), "Talk to Gertrude west of Varrock to start the quest."); + talkToGertrude.addDialogStep("Yes."); - ConditionalStep lumberyard = new ConditionalStep(this, climbLadder, "Use a seasoned sardine on Gertrude's cat upstairs in the Lumberyard north east of Varrock."); - lumberyard.addStep(isUpstairsLumberyard, gertrudesCat2); - gertrudesCat2.addSubSteps(climbLadder); + pickupDoogle = new DetailedQuestStep(this, "Pickup some Doogle Leaves south of Gertrude's house.", doogleLeaves, sardineHighlighted); + makeSeasonedSardine = new DetailedQuestStep(this, "Use your Doogle Leaves on the Sardine.", doogleLeavesHighlighted, sardineHighlighted); - return lumberyard; - } + talkToChildren = new NpcStep(this, NpcID.SHILOP, new WorldPoint(3222, 3435, 0), "Talk to Shilop or Wilough in the Varrock Square.", true, seasonedSardine, coins); + talkToChildren.addAlternateNpcs(NpcID.WILOUGH); + talkToChildren.addDialogSteps("What will make you tell me?", "Okay then, I'll pay."); - private ConditionalStep getGiveMilkToCat() - { - gertrudesCat = getGertrudesCat(milkHighlighted); + gertrudesCat = new NpcStep(this, NpcID.GERTRUDESCAT, new WorldPoint(3308, 3511, 1), "", bucketOfMilkHighlighted); gertrudesCat.addIcon(ItemID.BUCKET_MILK); - ObjectStep climbLadder = getClimbLadder(bucketOfMilk); + climbLadder = new ObjectStep(this, ObjectID.FAI_VARROCK_LADDER, new WorldPoint(3310, 3509, 0), "Climb up the ladder in the Lumberyard.", bucketOfMilk); - ConditionalStep giveMilkToCat = new ConditionalStep(this, climbLadder, "Use a bucket of milk on Gertrude's cat upstairs in the Lumberyard north east of Varrock.", seasonedSardine); - giveMilkToCat.addStep(isUpstairsLumberyard, gertrudesCat); + cGiveMilkToCat = new ConditionalStep(this, climbLadder, "Use a bucket of milk on Gertrude's cat upstairs in the Lumberyard north east of Varrock.", seasonedSardine); + cGiveMilkToCat.addStep(isUpstairsLumberyard, gertrudesCat); - return giveMilkToCat; - } + gertrudesCat2 = new NpcStep(this, NpcID.GERTRUDESCAT, new WorldPoint(3308, 3511, 1), "", seasonedSardineHighlighted); + gertrudesCat2.addIcon(ItemID.SEASONED_SARDINE); - private NpcStep getGertrudesCat(ItemRequirement... requirement) - { - return new NpcStep(this, NpcID.GERTRUDESCAT, - new WorldPoint(3308, 3511, 1), "", requirement); - } + climbLadder2 = new ObjectStep(this, ObjectID.FAI_VARROCK_LADDER, + new WorldPoint(3310, 3509, 0), "Climb up the ladder in the Lumberyard.", seasonedSardine); - private QuestStep getTalkToChildren() - { - pickupDoogle = new DetailedQuestStep(this, "Pickup some Doogle Leaves south of Gertrude's house.", new ItemRequirement("Doogle Leaves", ItemID.DOOGLELEAVES), sardine); - makeSeasonedSardine = new DetailedQuestStep(this, "Use your Doogle Leaves on the Sardine.", sardine, doogleLeaves); + cGiveSardineToCat = new ConditionalStep(this, climbLadder2, "Use a seasoned sardine on Gertrude's cat upstairs in the Lumberyard north east of Varrock."); + cGiveSardineToCat.addStep(isUpstairsLumberyard, gertrudesCat2); - NpcStep talkToChildren = new NpcStep(this, NpcID.SHILOP, - new WorldPoint(3222, 3435, 0), "Talk to Shilop or Wilough in the Varrock Square.", true, - seasonedSardine, coins); - talkToChildren.addAlternateNpcs(NpcID.WILOUGH); - talkToChildren.addDialogSteps("What will make you tell me?", "Okay then, I'll pay."); + //Need to find to ways to hide arrow + searchNearbyCrates = new NpcStep(this, NpcID.KITTENS_MEW, new WorldPoint(3306, 3505, 0), + "Search different crates downstairs in the Lumberyard until you find the kitten.", true, bucketOfMilk); + searchNearbyCrates.setHideWorldArrow(true); + climbDownLadderStep = new ObjectStep(this, ObjectID.FAI_VARROCK_LADDERTOP, new WorldPoint(3310, 3509, 1), "Climb down ladder in the Lumberyard."); + climbUpLadderStep = new ObjectStep(this, ObjectID.FAI_VARROCK_LADDER, new WorldPoint(3310, 3509, 0), "Climb up the ladder in the Lumberyard.", kitten); - return talkToChildren; - } - private QuestStep getTalkToGertrude() - { - NpcStep talkToGertrude = new NpcStep(this, NpcID.GERTRUDE_QUEST, - new WorldPoint(3148, 3413, 0), "Talk to Gertrude."); - talkToGertrude.addDialogStep("Yes."); - return talkToGertrude; + giveKittenToFluffy = new NpcStep(this, NpcID.GERTRUDESCAT, + new WorldPoint(3308, 3511, 1), "", kittenHighlighted); + giveKittenToFluffy.setText("Return the kitten to Gertrude's cat."); + giveKittenToFluffy.addIcon(ItemID.GERTRUDEKITTENS); + + + searchNearbyCrates.addSubSteps(climbDownLadderStep); + giveKittenToFluffy.addSubSteps(climbUpLadderStep); + + finishQuest = new NpcStep(this, NpcID.GERTRUDE_QUEST, + new WorldPoint(3148, 3413, 0), "Return to Gertrude west of Varrock to complete the quest."); } @Override - protected void setupRequirements() + public Map loadSteps() { - bucketOfMilk = new ItemRequirement("Bucket of milk", ItemID.BUCKET_MILK); - milkHighlighted = new ItemRequirement("Bucket of milk", ItemID.BUCKET_MILK); - milkHighlighted.setHighlightInInventory(true); - - coins = new ItemRequirement("Coins", ItemCollections.COINS, 100); + initializeRequirements(); + setupSteps(); - seasonedSardine = new ItemRequirement("Seasoned Sardine", ItemID.SEASONED_SARDINE); - seasonedSardine.setTooltip("Can be created by using a sardine on Doogle leaves(South of Gertrudes House)"); + var steps = new HashMap(); - seasonedSardineHighlighted = new ItemRequirement("Seasoned Sardine", ItemID.SEASONED_SARDINE); - seasonedSardineHighlighted.setTooltip("Can be created by using a sardine on Doogle leaves(South of Gertrudes House)"); - seasonedSardineHighlighted.setHighlightInInventory(true); + steps.put(0, talkToGertrude); - sardine = new ItemRequirement("Raw Sardine", ItemID.RAW_SARDINE); - sardine.setHighlightInInventory(true); - doogleLeaves = new ItemRequirement("Doogle Leaves", ItemID.DOOGLELEAVES); - doogleLeaves.setHighlightInInventory(true); + var cTalkToChildren = new ConditionalStep(this, pickupDoogle); + cTalkToChildren.addStep(and(sardineHighlighted, doogleLeaves), makeSeasonedSardine); + cTalkToChildren.addStep(seasonedSardine, talkToChildren); + steps.put(1, cTalkToChildren); - // Recommended items - lumberyardTeleport = new ItemRequirement("Lumberyard teleport", ItemID.TELEPORTSCROLL_LUMBERYARD); - varrockTeleport = new ItemRequirement("Varrock teleports", ItemID.POH_TABLET_VARROCKTELEPORT, 2); - } + steps.put(2, cGiveMilkToCat); - @Override - protected void setupZones() - { - Zone zone = new Zone(new WorldPoint(3306, 3507, 12), new WorldPoint(3312, 3513, 1)); + steps.put(3, cGiveSardineToCat); - isUpstairsLumberyard = new ZoneRequirement(zone); - } + var cFindFluffsKitten = new ConditionalStep(this, searchNearbyCrates); + cFindFluffsKitten.addStep(and(kitten, isUpstairsLumberyard), giveKittenToFluffy); + cFindFluffsKitten.addStep(kitten, climbUpLadderStep); + cFindFluffsKitten.addStep(isUpstairsLumberyard, climbDownLadderStep); + steps.put(4, cFindFluffsKitten); - private void setupConditions() - { - hasFluffsKitten = new ItemRequirements(new ItemRequirement("Fluffs' kitten", ItemID.GERTRUDEKITTENS)); - } + steps.put(5, finishQuest); - private ObjectStep getClimbLadder(ItemRequirement... itemRequirements) - { - return new ObjectStep(this, ObjectID.FAI_VARROCK_LADDER, - new WorldPoint(3310, 3509, 0), "Climb up the ladder in the Lumberyard.", itemRequirements); + return steps; } @Override public List getItemRequirements() { - return Arrays.asList(bucketOfMilk, coins, sardine); + return List.of( + bucketOfMilk, + coins, + sardineHighlighted + ); } @Override public List getItemRecommended() { - return Arrays.asList(varrockTeleport, lumberyardTeleport); + return List.of( + varrockTeleport, + lumberyardTeleport + ); } @Override @@ -258,42 +239,58 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.COOKING, 1525)); + return List.of( + new ExperienceReward(Skill.COOKING, 1525) + ); } @Override public List getItemRewards() { - return Arrays.asList( - new ItemReward("A pet Kitten", ItemID.KITTENOBJECT, 1), - new ItemReward("Chocolate Cake", ItemID.CHOCOLATE_CAKE, 1), - new ItemReward("Stew", ItemID.STEW, 1)); + return List.of( + new ItemReward("A pet Kitten", ItemID.KITTENOBJECT, 1), + new ItemReward("Chocolate Cake", ItemID.CHOCOLATE_CAKE, 1), + new ItemReward("Stew", ItemID.STEW, 1) + ); } @Override public List getUnlockRewards() { - return Collections.singletonList(new UnlockReward("Ability to raise kittens.")); + return List.of( + new UnlockReward("Ability to raise kittens.") + ); } @Override public List getPanels() { - List steps = new ArrayList<>(); - - PanelDetails startingPanel = new PanelDetails("Starting out", - Arrays.asList(talkToGertrude, pickupDoogle, makeSeasonedSardine, talkToChildren), - sardine, coins); - steps.add(startingPanel); - - PanelDetails lumberYardPanel = new PanelDetails("The secret playground (Lumber Yard)", - Arrays.asList(giveMilkToCatSteps, giveSardineToCat, searchNearbyCrates, giveKittenToFluffy), - seasonedSardine, bucketOfMilk); - steps.add(lumberYardPanel); - - PanelDetails finishQuestPanel = new PanelDetails("Finish the quest", - Collections.singletonList(finishQuest)); - steps.add(finishQuestPanel); - return steps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting out", List.of( + talkToGertrude, + pickupDoogle, + makeSeasonedSardine, + talkToChildren + ), List.of( + sardineHighlighted, + coins + ))); + + sections.add(new PanelDetails("The secret playground (Lumber Yard)", List.of( + cGiveMilkToCat, + cGiveSardineToCat, + searchNearbyCrates, + giveKittenToFluffy + ), List.of( + seasonedSardine, + bucketOfMilk + ))); + + sections.add(new PanelDetails("Finish the quest", List.of( + finishQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ghostsahoy/GhostsAhoy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ghostsahoy/GhostsAhoy.java index 81433db8a94..5c0b5d5716c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ghostsahoy/GhostsAhoy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ghostsahoy/GhostsAhoy.java @@ -61,7 +61,7 @@ public class GhostsAhoy extends BasicQuestHelper { //Required Items - ItemRequirement ghostspeak, coins400, milk, silk, dyes, spade, oakLongbow, knife, needle, thread, bucketOfSlime, nettleTea, ectoToken2, ectoToken4, chestKey, + ItemRequirement ghostspeak, coins400, milk, silk, dyes, spade, oakLongbow, knife, needle, thread, needleThread, costumeNeedle, needleThreadOrCostumeNeedle, bucketOfSlime, nettleTea, ectoToken2, ectoToken4, chestKey, nettleTeaHighlighted, milkHighlighted, milkyTea, cup, cupWithMilkyTea, cupWithTea, modelShip, repairedShip, ectoToken12, ectoToken27, charos, map, signedOakBow, ectoToken10, ectoToken25, ectoSheets, bedsheet, petition, boneKey, boneKeyHighlighted, robes, book, manual, mapPiece1, mapPiece2, mapPiece3, silkHighlighted, ectoTokensCharos, ectoTokensNoCharos, ectoSheetsEquipped, enchantedGhostspeakEquipped; @@ -228,6 +228,10 @@ protected void setupRequirements() knife = new ItemRequirement("Knife", ItemID.KNIFE).isNotConsumed(); needle = new ItemRequirement("Needle", ItemID.NEEDLE).isNotConsumed(); thread = new ItemRequirement("Thread", ItemID.THREAD); + needleThread = new ItemRequirements(needle, thread); + costumeNeedle = new ItemRequirement("Costume needle", ItemID.COSTUMENEEDLE); + needleThreadOrCostumeNeedle = new ItemRequirements(LogicType.OR, "Needle/Thread or Costume needle", needleThread, costumeNeedle); + needleThreadOrCostumeNeedle.setDisplayMatchedItemName(true); bucketOfSlime = new ItemRequirement("Bucket of slime", ItemID.BUCKET_ECTOPLASM); bucketOfSlime.setTooltip("You can buy one from the Charter Ship crew"); bucketOfSlime.setHighlightInInventory(true); @@ -285,30 +289,30 @@ public void setupConditions() onRocks = new ZoneRequirement(rocks); onDragontooth = new ZoneRequirement(dragontooth); - hasCupOfMilkyTea = cupWithMilkyTea.alsoCheckBank(questBank); - hasCupOfTea = cupWithTea.alsoCheckBank(questBank); - hasMap = map.alsoCheckBank(questBank); - hasPiece1 = mapPiece1.alsoCheckBank(questBank); - hasPiece2 = mapPiece2.alsoCheckBank(questBank); - hasPiece3 = mapPiece3.alsoCheckBank(questBank); - hasModelShip = modelShip.alsoCheckBank(questBank); - hasRepairedShip = repairedShip.alsoCheckBank(questBank); - hasCup = cup.alsoCheckBank(questBank); - hasBook = new Conditions(LogicType.OR, new VarbitRequirement(208, 1), book.alsoCheckBank(questBank)); - hasManual = new Conditions(LogicType.OR, new VarbitRequirement(206, 1), new VarbitRequirement(212, 8)); - hasSheet = bedsheet.alsoCheckBank(questBank); - hasEctoSheet = ectoSheets.alsoCheckBank(questBank); - hasMysticalRobes = new Conditions(LogicType.OR, new VarbitRequirement(207, 1), robes.alsoCheckBank(questBank)); - hasSignedOakBow = signedOakBow.alsoCheckBank(questBank); - hasPetition = petition.alsoCheckBank(questBank); + hasCupOfMilkyTea = cupWithMilkyTea.alsoCheckBank(); + hasCupOfTea = cupWithTea.alsoCheckBank(); + hasMap = map.alsoCheckBank(); + hasPiece1 = mapPiece1.alsoCheckBank(); + hasPiece2 = mapPiece2.alsoCheckBank(); + hasPiece3 = mapPiece3.alsoCheckBank(); + hasModelShip = modelShip.alsoCheckBank(); + hasRepairedShip = repairedShip.alsoCheckBank(); + hasCup = cup.alsoCheckBank(); + hasBook = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.AHOY_GIVEN_BOOK, 1), book.alsoCheckBank()); + hasManual = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.AHOY_GIVEN_MANUAL, 1), new VarbitRequirement(VarbitID.AHOY_SUBQUEST_BOW, 8)); + hasSheet = bedsheet.alsoCheckBank(); + hasEctoSheet = ectoSheets.alsoCheckBank(); + hasMysticalRobes = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.AHOY_GIVEN_ROBES, 1), robes.alsoCheckBank()); + hasSignedOakBow = signedOakBow.alsoCheckBank(); + hasPetition = petition.alsoCheckBank(); hasSignatures = new VarbitRequirement(VarbitID.AHOY_SIGNATURECOUNTER, 11, Operation.GREATER_EQUAL); givenPetitionToNecro = new VarbitRequirement(VarbitID.AHOY_SIGNATURECOUNTER, 31, Operation.GREATER_EQUAL); hadChestKey = new Conditions(LogicType.OR, chestKey, new VarbitRequirement(VarbitID.AHOY_SUBQUEST_TOYBOAT, 2, Operation.GREATER_EQUAL)); unlockedChest2 = new VarbitRequirement(VarbitID.AHOY_SUBQUEST_TOYBOAT, 3, Operation.GREATER_EQUAL); - doorUnlocked = new VarbitRequirement(213, 1); + doorUnlocked = new VarbitRequirement(VarbitID.AHOY_TEMPLEDOOR_UNLOCKED, 1); lobsterNearby = new NpcCondition(NpcID.GIANT_LOBSTER); - killedLobster = new VarbitRequirement(215, 1); + killedLobster = new VarbitRequirement(VarbitID.AHOY_KILLED_LOBSTER, 1); boneKeyNearby = new ItemOnTileRequirement(boneKey); hasBoneKey = new Conditions(LogicType.OR, boneKey, doorUnlocked); @@ -423,11 +427,11 @@ public List getItemRequirements() { if (canUseCharos) { - return Arrays.asList(ghostspeak, charos, ectoTokensCharos, coins400, nettleTea, milk, silk, knife, needle, thread, dyes, spade, oakLongbow, bucketOfSlime); + return Arrays.asList(ghostspeak, charos, ectoTokensCharos, coins400, nettleTea, milk, silk, knife, needleThreadOrCostumeNeedle, dyes, spade, oakLongbow, bucketOfSlime); } else { - return Arrays.asList(ghostspeak, ectoTokensNoCharos, coins400, nettleTea, milk, silk, knife, needle, thread, dyes, spade, oakLongbow, bucketOfSlime); + return Arrays.asList(ghostspeak, ectoTokensNoCharos, coins400, nettleTea, milk, silk, knife, needleThreadOrCostumeNeedle, dyes, spade, oakLongbow, bucketOfSlime); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/goblindiplomacy/GoblinDiplomacy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/goblindiplomacy/GoblinDiplomacy.java index ff7ec363007..899c5a3926e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/goblindiplomacy/GoblinDiplomacy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/goblindiplomacy/GoblinDiplomacy.java @@ -42,6 +42,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -127,9 +128,9 @@ protected void setupRequirements() public void setupConditions() { isUpstairs = new ZoneRequirement(upstairs); - hasUpstairsArmour = new VarbitRequirement(2381, 1); - hasWestArmour = new VarbitRequirement(2380, 1); - hasNorthArmour = new VarbitRequirement(2379, 1); + hasUpstairsArmour = new VarbitRequirement(VarbitID.GOBDIP_CRATE3_SEARCHED, 1); + hasWestArmour = new VarbitRequirement(VarbitID.GOBDIP_CRATE2_SEARCHED, 1); + hasNorthArmour = new VarbitRequirement(VarbitID.GOBDIP_CRATE1_SEARCHED, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/grimtales/GrimTales.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/grimtales/GrimTales.java index de73799fdce..4a337966ef7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/grimtales/GrimTales.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/grimtales/GrimTales.java @@ -87,7 +87,7 @@ public Map loadSteps() steps.put(4, talkToSylas); ConditionalStep getHelmet = new ConditionalStep(this, climbWall); - getHelmet.addStep(rupertsHelmet.alsoCheckBank(questBank), giveHelmetToSylas); + getHelmet.addStep(rupertsHelmet.alsoCheckBank(), giveHelmetToSylas); getHelmet.addStep(releasedRupert, talkToRupertAfterAmulet); getHelmet.addStep(new Conditions(givenPendant), talkMizAfterPendant); getHelmet.addStep(new Conditions(hasMiazrqasPendant), givePendant); @@ -226,8 +226,8 @@ public void setupConditions() inTowerBase = new ZoneRequirement(towerBase); inTowerUpstairs = new ZoneRequirement(towerUpstairs); - grimgnashAsleep = new VarbitRequirement(3717, 1); - givenFeather = new VarbitRequirement(3719, 1); + grimgnashAsleep = new VarbitRequirement(VarbitID.GRIM_GRIFFIN_ASLEEP, 1); + givenFeather = new VarbitRequirement(VarbitID.GRIM_GIVEN_FEATHER, 1); talkedToDrainOnce = new VarbitRequirement(VarbitID.GRIM_DWARFQUEST, 5, Operation.GREATER_EQUAL); beardDropped = new VarbitRequirement(VarbitID.GRIM_DWARFQUEST, 10, Operation.GREATER_EQUAL); @@ -235,17 +235,17 @@ public void setupConditions() talkedToMiazrqa = new VarbitRequirement(VarbitID.GRIM_DWARFQUEST, 20, Operation.GREATER_EQUAL); inPianoWidget = new WidgetModelRequirement(535, 1, 25890); - pressed1 = new VarbitRequirement(3697, 1); - pressed2 = new VarbitRequirement(3697, 2); - pressed3 = new VarbitRequirement(3697, 3); - pressed4 = new VarbitRequirement(3697, 4); - pressed5 = new VarbitRequirement(3697, 5); - pressed6 = new VarbitRequirement(3697, 6); - pressed7 = new VarbitRequirement(3697, 7); - pressed8 = new VarbitRequirement(3697, 8); + pressed1 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 1); + pressed2 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 2); + pressed3 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 3); + pressed4 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 4); + pressed5 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 5); + pressed6 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 6); + pressed7 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 7); + pressed8 = new VarbitRequirement(VarbitID.GRIM_PIANOTRACK, 8); - unlockedPiano = new VarbitRequirement(3698, 1); - searchedPiano = new VarbitRequirement(3716, 1); + unlockedPiano = new VarbitRequirement(VarbitID.GRIM_PIANO_USED, 1); + searchedPiano = new VarbitRequirement(VarbitID.GRIM_HEAD_FOUND, 1); inMouseRoom1 = new ZoneRequirement(mouseRoom1); inMouseRoom2 = new ZoneRequirement(mouseRoom2); @@ -257,19 +257,19 @@ public void setupConditions() inWrongMouse1 = new ZoneRequirement(wrongMouse1); inWrongMouse2 = new ZoneRequirement(wrongMouse2); - hasMiazrqasPendant = new VarbitRequirement(3721, 1); + hasMiazrqasPendant = new VarbitRequirement(VarbitID.GRIM_HAVE_PENDANT, 1); - givenPendant = new VarbitRequirement(3694, 25); + givenPendant = new VarbitRequirement(VarbitID.GRIM_DWARFQUEST, 25); - releasedRupert = new VarbitRequirement(3701, 1); + releasedRupert = new VarbitRequirement(VarbitID.GRIM_DWARF_VIS, 1); - plantedSeed = new VarbitRequirement(3714, 1); - wateredSeed = new VarbitRequirement(3714, 2); + plantedSeed = new VarbitRequirement(VarbitID.GRIM_STALK_STATE, 1); + wateredSeed = new VarbitRequirement(VarbitID.GRIM_STALK_STATE, 2); onCloud = new ZoneRequirement(cloud); - killedGlod = new VarbitRequirement(3715, 1); + killedGlod = new VarbitRequirement(VarbitID.GRIM_GIANT_DEAD, 1); - usedPotion = new VarbitRequirement(3714, 3); + usedPotion = new VarbitRequirement(VarbitID.GRIM_STALK_STATE, 3); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hauntedmine/HauntedMine.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hauntedmine/HauntedMine.java index be544306a41..d945cd5e5c6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hauntedmine/HauntedMine.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hauntedmine/HauntedMine.java @@ -49,10 +49,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.*; @@ -223,7 +220,7 @@ protected void setupZones() public void setupConditions() { - askedAboutKey = new VarbitRequirement(2397, 1); + askedAboutKey = new VarbitRequirement(VarbitID.HAUNTEDMINE_HEARDABOUTKEY, 1); inLevel1North = new ZoneRequirement(level1North); inLevel1South = new ZoneRequirement(level1South); inLevel2South = new ZoneRequirement(level2South); @@ -240,22 +237,22 @@ public void setupConditions() inCrystalEntrance = new ZoneRequirement(crystalEntrance); inCrystalOrCrystalEntranceRoom = new ZoneRequirement(crystalRoom1, crystalRoom2, crystalRoom3, crystalEntrance); - valveOpened = new VarbitRequirement(2393, 1); - valveOpen = new VarbitRequirement(2394, 1); + valveOpened = new VarbitRequirement(VarbitID.HAUNTEDMINE_LIFTPOWEREDONCE, 1); + valveOpen = new VarbitRequirement(VarbitID.HAUNTEDMINE_LIFTPOWEREDNOW, 1); hasKeyOrOpenedValve = new Conditions(LogicType.OR, zealotsKey, valveOpened); - leverAWrong = new VarbitRequirement(2385, 0); - leverBWrong = new VarbitRequirement(2386, 0); - leverCWrong = new VarbitRequirement(2387, 1); - leverDWrong = new VarbitRequirement(2388, 1); - leverEWrong = new VarbitRequirement(2389, 0); - leverFWrong = new VarbitRequirement(2390, 0); - leverGWrong = new VarbitRequirement(2391, 1); - leverHWrong = new VarbitRequirement(2392, 1); - - fungusInCart = new VarbitRequirement(2395, 1); - fungusOnOtherSide = new VarbitRequirement(2396, 1); + leverAWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_B, 0); + leverBWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_A, 0); + leverCWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_C, 1); + leverDWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_D, 1); + leverEWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_E, 0); + leverFWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_I, 0); + leverGWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_J, 1); + leverHWrong = new VarbitRequirement(VarbitID.HAUNTEDMINE_LEVER_K, 1); + + fungusInCart = new VarbitRequirement(VarbitID.HAUNTEDMINE_BEGINCART_FUNGUS, 1); + fungusOnOtherSide = new VarbitRequirement(VarbitID.HAUNTEDMINE_ENDCART_FUNGUS, 1); daythNearby = new NpcHintArrowRequirement(NpcID.HAUNTEDMINE_BOSS_GHOST, NpcID.HAUNTEDMINE_BOSS_GHOST_FADED); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelCult.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelCult.java index 33cdab65993..73dd07c3175 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelCult.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelCult.java @@ -29,10 +29,8 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestVarPlayer; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -46,141 +44,123 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class HazeelCult extends BasicQuestHelper { - //Items Recommended + // Recommended items ItemRequirement ardougneCloak; - ItemRequirement hazeelScroll, poison, carnilleanArmour, key, hazeelMark; - - Requirement inCultEntrance, inCultRoom, inManorBasement, inManorF1, inManorF2, canSearchChest, - talkedToCerilAfterPoison, armourNearby, sidedWithCeril, receivedMark, onStep7, givenAlomoneScroll, - givenArmour, hadArmour, butlerArrested; - - QuestStep talkToCeril, enterCave, talkToClivet, leaveCaveForValves; - - // Hazeel side - QuestStep getPoison, leaveCaveWithPoison, enterKitchen, usePoisonOnRange, leaveKitchen, talkToCerilAfterPoison, - enterCaveAfterPoison, talkToClivetAfterPoison, boardRaftAfterPoison, talkToAlomone, returnOnRaftAfterAlomone, leaveCaveAfterAlomone, - enterKitchenAfterButler, searchCrateForKey, leaveKitchenWithKey, goToF1WithKey, - climbLadderWithKey, searchChestForScroll, goF2ToF1WithScroll, goF1ToF0WithScroll, enterCaveWithScroll, - boardRaftWithScroll, giveAlomoneScroll; - - // Ceril side - QuestStep enterCaveAfterValvesForCeril, boardRaftToKill, talkToAlomoneToKill, killAlomone, retrieveArmourFromChest, returnOnRaftAfterKilling, - leaveCaveAfterKilling, talkToJonesAfterKilling, talkToCerilAfterKilling, goUpToCupboard, - searchCupboardForEvidence, talkToCerilToFinish; - - HazeelValves valveStepsCeril, valveStepsHazeel; - - //Zones - Zone cultEntrance, cultRoom, manorBasement, manorF1, manorF2; - - ConditionalStep cerilSteps, hazeel4GoPoisonSteps; + // Zones + Zone cultEntrance; + Zone cultRoom; + Zone manorBasement; + Zone manorF1; + Zone manorF2; + Zone manorF2LadderRoom; + + // Miscellaneous requirements + ItemRequirement hazeelScroll; + ItemRequirement poison; + ItemRequirement carnilleanArmour; + ItemRequirement key; + ItemRequirement hazeelMark; + + ZoneRequirement inCultEntrance; + ZoneRequirement inCultRoom; + ZoneRequirement inManorBasement; + ZoneRequirement inManorF1; + ZoneRequirement inManorF2; + ZoneRequirement inManorF2LadderRoom; VarbitRequirement alomoneAttackable; + VarbitRequirement givenAlomoneScroll; + VarbitRequirement givenArmour; + VarbitRequirement canSearchChest; + VarbitRequirement sidedWithCeril; + VarbitRequirement receivedMark; + VarbitRequirement talkedToCerilAfterPoison; + VarbitRequirement butlerArrested; + ItemOnTileRequirement armourNearby; + VarplayerRequirement onStep7; + Requirement hadArmour; + + // Steps + NpcStep talkToCeril; + ObjectStep enterCave; + NpcStep talkToClivet; + + // Ceril side steps + ObjectStep leaveCaveForValves; + HazeelValves valveStepsCeril; + ObjectStep enterCaveAfterValvesForCeril; + ObjectStep boardRaftToKill; + NpcStep talkToAlomoneToKill; + NpcStep killAlomone; + ObjectStep retrieveArmourFromChest; + ObjectStep returnOnRaftAfterKilling; + ObjectStep leaveCaveAfterKilling; + NpcStep talkToJonesAfterKilling; + NpcStep talkToCerilAfterKilling; + ObjectStep goUpToCupboard; + ObjectStep searchCupboardForEvidence; + NpcStep talkToCerilToFinish; + + // Hazeel side steps + NpcStep getPoison; + ObjectStep leaveCaveWithPoison; + ObjectStep enterKitchen; + ObjectStep usePoisonOnRange; + ObjectStep leaveKitchen; + NpcStep talkToCerilAfterPoison; + HazeelValves valveStepsHazeel; + ObjectStep enterCaveAfterPoison; + NpcStep talkToClivetAfterPoison; + ObjectStep boardRaftAfterPoison; + NpcStep talkToAlomone; + ObjectStep returnOnRaftAfterAlomone; + ObjectStep leaveCaveAfterAlomone; + ObjectStep enterKitchenAfterButler; + ObjectStep searchCrateForKey; + ObjectStep leaveKitchenWithKey; + ObjectStep goToF1WithKey; + ObjectStep knockOnWall; + ObjectStep climbLadderWithKey; + ObjectStep searchChestForScroll; + ObjectStep goF2ToF1WithScroll; + ObjectStep knockOnWallToExit; + ObjectStep goF1ToF0WithScroll; + ObjectStep enterCaveWithScroll; + ObjectStep boardRaftWithScroll; + NpcStep giveAlomoneScroll; @Override - public Map loadSteps() + protected void setupZones() { - // TODO: Should the valves section implement the PuzzleWrapper? - initializeRequirements(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToCeril); - - // Got poison first time, 14782 0->1 - // Have poison currently (10670 0->1, back to 0 if you talk to Clivet without poison) - // Is also for recieved the mark? - - ConditionalStep goTalkToClivet = new ConditionalStep(this, enterCave); - goTalkToClivet.addStep(inCultEntrance, talkToClivet); - steps.put(2, goTalkToClivet); - steps.put(3, goTalkToClivet); - - // Help Hazeel - hazeel4GoPoisonSteps = new ConditionalStep(this, enterKitchen); - // 14779 0->1 when used poison on range - hazeel4GoPoisonSteps.addStep(inManorBasement, usePoisonOnRange); - hazeel4GoPoisonSteps.addStep(inCultEntrance, leaveCaveWithPoison); - - // TODO: Verify if this is needed - ConditionalStep goTalkAfterPoison = new ConditionalStep(this, talkToCerilAfterPoison); - goTalkAfterPoison.addStep(inManorBasement, leaveKitchen); - - ConditionalStep goTalkToClivetAfterPoison = new ConditionalStep(this, goTalkAfterPoison); - // Probably don't actually need the mark but nice to ensure the player gets it - goTalkToClivetAfterPoison.addStep(new Conditions(inCultRoom, hazeelMark.alsoCheckBank(questBank)), talkToAlomone); - goTalkToClivetAfterPoison.addStep(new Conditions(inCultEntrance, valveStepsHazeel.solved, - hazeelMark.alsoCheckBank(questBank)), boardRaftAfterPoison); - goTalkToClivetAfterPoison.addStep(new Conditions(inCultEntrance, valveStepsHazeel.solved), talkToClivetAfterPoison); - goTalkToClivetAfterPoison.addStep(valveStepsHazeel.solved, enterCaveAfterPoison); - goTalkToClivetAfterPoison.addStep(talkedToCerilAfterPoison, valveStepsHazeel); - - Conditions hadScroll = new Conditions(LogicType.OR, hazeelScroll.alsoCheckBank(questBank), givenAlomoneScroll); - ConditionalStep goGetScroll = new ConditionalStep(this, enterKitchenAfterButler); - goGetScroll.addStep(new Conditions(inCultRoom, hadScroll), giveAlomoneScroll); - goGetScroll.addStep(new Conditions(inCultEntrance, hadScroll), boardRaftWithScroll); - goGetScroll.addStep(new Conditions(inManorF1, hadScroll), goF1ToF0WithScroll); - goGetScroll.addStep(new Conditions(inManorF2, hadScroll), goF2ToF1WithScroll); - goGetScroll.addStep(new Conditions(hadScroll), enterCaveWithScroll); - goGetScroll.addStep(new Conditions(inManorF2, key), searchChestForScroll); - goGetScroll.addStep(new Conditions(inManorF1, key), climbLadderWithKey); - goGetScroll.addStep(new Conditions(inManorBasement, key), leaveKitchenWithKey); - goGetScroll.addStep(new Conditions(key), goToF1WithKey); - goGetScroll.addStep(inManorBasement, searchCrateForKey); - goGetScroll.addStep(inCultEntrance, leaveCaveAfterAlomone); - goGetScroll.addStep(inCultRoom, returnOnRaftAfterAlomone); - - // Ceril side - cerilSteps = new ConditionalStep(this, valveStepsCeril); - cerilSteps.addStep(new Conditions(onStep7, butlerArrested), talkToCerilToFinish); - cerilSteps.addStep(new Conditions(onStep7, inManorF1), searchCupboardForEvidence); - cerilSteps.addStep(onStep7, goUpToCupboard); - cerilSteps.addStep(new Conditions(inCultEntrance, hadArmour), leaveCaveAfterKilling); - cerilSteps.addStep(new Conditions(inCultRoom, hadArmour), returnOnRaftAfterKilling); - cerilSteps.addStep(hadArmour, talkToCerilAfterKilling); - cerilSteps.addStep(new Conditions(inCultRoom, canSearchChest), retrieveArmourFromChest); - cerilSteps.addStep(new Conditions(inCultRoom, alomoneAttackable), killAlomone); - cerilSteps.addStep(new Conditions(inCultRoom), talkToAlomoneToKill); - cerilSteps.addStep(new Conditions(inCultEntrance, valveStepsCeril.solved), boardRaftToKill); - cerilSteps.addStep(valveStepsCeril.solved, enterCaveAfterValvesForCeril); - cerilSteps.addStep(inCultEntrance, leaveCaveForValves); - - // TODO: 14782 0->1 may occur to represent Hazeel - - // Told to make poison, 223 3->4 - // Sided with Ceril: - // 10670 1->0 occurs, - // 14769 0->1 and 223 3->4 - ConditionalStep step4 = new ConditionalStep(this, enterCave); - step4.addStep(sidedWithCeril, cerilSteps); - step4.addStep(poison, hazeel4GoPoisonSteps); - step4.addStep(inCultEntrance, getPoison); - steps.put(4, step4); - - // Assuming this can only be reached in Hazeel side, but may be wrong - steps.put(5, goTalkToClivetAfterPoison); - - ConditionalStep step6And7 = new ConditionalStep(this, goGetScroll); - step6And7.addStep(sidedWithCeril, cerilSteps); - steps.put(6, step6And7); - steps.put(7, step6And7); - - return steps; + cultEntrance = new Zone(new WorldPoint(2565, 9679, 0), new WorldPoint(2571, 9685, 0)); + cultRoom = new Zone(new WorldPoint(2600, 9666, 0), new WorldPoint(2615, 9693, 0)); + manorBasement = new Zone(new WorldPoint(2535, 9692, 0), new WorldPoint(2550, 9703, 0)); + manorF1 = new Zone(new WorldPoint(2564, 3267, 1), new WorldPoint(2576, 3275, 1)); + manorF2 = new Zone(new WorldPoint(2564, 3267, 2), new WorldPoint(2576, 3275, 2)); + manorF2LadderRoom = new Zone(new WorldPoint(2573, 3271, 1), new WorldPoint(2571, 3271, 1)); } @Override protected void setupRequirements() { - givenAlomoneScroll = new VarbitRequirement(14780, 1); - givenArmour = new VarbitRequirement(14772, 1); + givenAlomoneScroll = new VarbitRequirement(VarbitID.HAZEELCULT_GIVEN_SCROLL, 1); + givenArmour = new VarbitRequirement(VarbitID.HAZEELCULT_GIVEN_ARMOUR, 1); + alomoneAttackable = new VarbitRequirement(VarbitID.HAZEELCULT_ALOMONE_VIS, 1); + canSearchChest = new VarbitRequirement(VarbitID.HAZEELCULT_ALOMONE_VIS, 2); + sidedWithCeril = new VarbitRequirement(VarbitID.HAZEELCULT_CLIVET_LOCATION, 1); + receivedMark = new VarbitRequirement(VarbitID.HAZEELCULT_GIVEN_AMULET, 1); + talkedToCerilAfterPoison = new VarbitRequirement(VarbitID.HAZEELCULT_POISON_SUCCESS, 1); + butlerArrested = new VarbitRequirement(VarbitID.HAZEELCULT_JONES_CUTSCENE, 1); ardougneCloak = new ItemRequirement("Ardougne cloak for Monastery teleport", ItemID.ARDY_CAPE_EASY).isNotConsumed(); ardougneCloak.addAlternates(ItemID.ARDY_CAPE_MEDIUM, ItemID.ARDY_CAPE_HARD, ItemID.ARDY_CAPE_ELITE); @@ -197,28 +177,21 @@ protected void setupRequirements() inManorBasement = new ZoneRequirement(manorBasement); inManorF1 = new ZoneRequirement(manorF1); inManorF2 = new ZoneRequirement(manorF2); - - alomoneAttackable = new VarbitRequirement(14770, 1); - canSearchChest = new VarbitRequirement(14770, 2); + inManorF2LadderRoom = new ZoneRequirement(manorF2LadderRoom); // Got armour, 14778 0->1 - hadArmour = or(givenArmour, carnilleanArmour.alsoCheckBank(questBank)); + hadArmour = or(givenArmour, carnilleanArmour.alsoCheckBank()); - talkedToCerilAfterPoison = new VarbitRequirement(14775, 1); // Talking to Ceril // 3679 -1 -> 71 armourNearby = new ItemOnTileRequirement(carnilleanArmour); - sidedWithCeril = new VarbitRequirement(14769, 1); - // Mark also could be 14776 - receivedMark = new VarbitRequirement(14777, 1); // 14779 1->2, asked to go talk to the butler onStep7 = new VarplayerRequirement(QuestVarPlayer.QUEST_HAZEEL_CULT.getId(), 7); // Butler found out // 14773 1 // 14774 1 - butlerArrested = new VarbitRequirement(14773, 1); /* Ceril var changes */ // Sided with Ceril @@ -235,34 +208,23 @@ protected void setupRequirements() // 14770 1->2 } - @Override - protected void setupZones() - { - cultEntrance = new Zone(new WorldPoint(2565, 9679, 0), new WorldPoint(2571, 9685, 0)); - cultRoom = new Zone(new WorldPoint(2600, 9666, 0), new WorldPoint(2615, 9693, 0)); - manorF1 = new Zone(new WorldPoint(2564, 3267, 1), new WorldPoint(2576, 3275, 1)); - manorF2 = new Zone(new WorldPoint(2564, 3267, 2), new WorldPoint(2576, 3275, 2)); - manorBasement = new Zone(new WorldPoint(2535, 9692, 0), new WorldPoint(2550, 9703, 0)); - } - public void setupSteps() { talkToCeril = new NpcStep(this, NpcID.SIR_CERIL_CARNILLEAN_VIS, new WorldPoint(2569, 3275, 0), "Talk to Ceril Carnillean in the south west of East Ardougne."); talkToCeril.addDialogSteps("What's wrong?", "Yes."); + enterCave = new ObjectStep(this, ObjectID.HAZEELCULTCAVE, new WorldPoint(2587, 3235, 0), - "Enter the cave south east of the Clock Tower."); + "Enter the cave south east of the Clock Tower entrance."); talkToClivet = new NpcStep(this, NpcID.CLIVET_HAZEEL_CULTIST_VIS, new WorldPoint(2569, 9682, 0), "Talk to Clivet. You can choose to either side with him or with the Carnilleans."); - talkToClivet.addDialogSteps("Alright, I've made my decision.", "I have no more questions.", "What do you mean?"); + talkToClivet.addDialogSteps("Alright, I've made my decision.", "Actually, I have no questions.", "I have no more questions.", "What do you mean?"); talkToClivet.addDialogChange("I won't help you.", "I won't help you. (side with Ceril)"); talkToClivet.addDialogChange("Alright, how do I do it?", "Alright, how do I do it? (side with Hazeel)"); talkToClivet.addDialogChange("I'll help you.", "I'll help you. (side with Hazeel)"); leaveCaveForValves = new ObjectStep(this, ObjectID.HAZEELCULTSTAIRS, new WorldPoint(2571, 9684, 0), "Go back to the surface."); - valveStepsHazeel = new HazeelValves(this); - valveStepsCeril = new HazeelValves(this); valveStepsCeril.addSubSteps(leaveCaveForValves); @@ -281,6 +243,8 @@ public void setupSteps() talkToCerilAfterPoison = new NpcStep(this, NpcID.SIR_CERIL_CARNILLEAN_VIS, new WorldPoint(2569, 3275, 0), "Talk to Ceril Carnillean to confirm the results of the poison."); + valveStepsHazeel = new HazeelValves(this); + enterCaveAfterPoison = new ObjectStep(this, ObjectID.HAZEELCULTCAVE, new WorldPoint(2587, 3235, 0), "Return to Clivet in the cave south of East Ardougne."); talkToClivetAfterPoison = new NpcStep(this, NpcID.CLIVET_HAZEEL_CULTIST_VIS, new WorldPoint(2569, 9682, 0), @@ -305,14 +269,23 @@ public void setupSteps() "Go back upstairs from the kitchen.", key); goToF1WithKey = new ObjectStep(this, ObjectID.CARNILLEAN_STAIRS, new WorldPoint(2569, 3269, 0), "Go upstairs in the house.", key); + + knockOnWall = new ObjectStep(this, ObjectID.CARNILLEANBOOKCASE_KNOCK, new WorldPoint(2572, 3270, 1), "Knock the wall to enter the hidden room."); + knockOnWall.addDialogStep("Yes."); + climbLadderWithKey = new ObjectStep(this, ObjectID.LADDER, new WorldPoint(2573, 3271, 1), "Knock the wall to enter the hidden room, then climb up the ladder.", key); climbLadderWithKey.addDialogStep("Yes."); + climbLadderWithKey.addSubSteps(knockOnWall); + searchChestForScroll = new ObjectStep(this, ObjectID.CARNILLEANSHUTCHEST, new WorldPoint(2571, 3269, 2), "Open the chest.", key.highlighted()); searchChestForScroll.addIcon(ItemID.CARNILLEANCHESTKEY); goF2ToF1WithScroll = new ObjectStep(this, ObjectID.LADDERTOP, new WorldPoint(2573, 3271, 2), "Return to Alomone with the scroll.", hazeelScroll); + + knockOnWallToExit = new ObjectStep(this, ObjectID.CARNILLEANBOOKCASE_KNOCK, new WorldPoint(2572, 3270, 1), "Return to Alomone with the scroll.", hazeelScroll); + goF1ToF0WithScroll = new ObjectStep(this, ObjectID.CARNILLEAN_STAIRSTOP, new WorldPoint(2569, 3269, 1), "Return to Alomone with the scroll.", hazeelScroll); enterCaveWithScroll = new ObjectStep(this, ObjectID.HAZEELCULTCAVE, new WorldPoint(2587, 3235, 0), @@ -320,9 +293,10 @@ public void setupSteps() boardRaftWithScroll = new ObjectStep(this, ObjectID.HAZEELSEWERRAFT, new WorldPoint(2568, 9679, 0), "Return to Alomone with the scroll. If the raft doesn't go to Alomone, repeat the prior valve steps first.", hazeelScroll); + giveAlomoneScroll = new NpcStep(this, NpcID.ALOMONE_HAZEEL_CULTIST_1OP, new WorldPoint(2607, 9673, 0), "Return to Alomone with the scroll.", hazeelScroll); - giveAlomoneScroll.addSubSteps(goF2ToF1WithScroll, goF1ToF0WithScroll, enterCaveWithScroll, boardRaftWithScroll); + giveAlomoneScroll.addSubSteps(goF2ToF1WithScroll, knockOnWallToExit, goF1ToF0WithScroll, enterCaveWithScroll, boardRaftWithScroll); // Ceril side enterCaveAfterValvesForCeril = new ObjectStep(this, ObjectID.HAZEELCULTCAVE, new WorldPoint(2587, 3235, 0), @@ -357,23 +331,122 @@ public void setupSteps() "Go upstairs in the house."); searchCupboardForEvidence = new ObjectStep(this, ObjectID.HAZEELCBSHUT, new WorldPoint(2574, 3267, 1), "Search the cupboard in the east room."); - ((ObjectStep) searchCupboardForEvidence).addAlternateObjects(ObjectID.HAZEELCBOPEN); + searchCupboardForEvidence.addAlternateObjects(ObjectID.HAZEELCBOPEN); searchCupboardForEvidence.addSubSteps(goUpToCupboard); talkToCerilToFinish = new NpcStep(this, NpcID.SIR_CERIL_CARNILLEAN_VIS, new WorldPoint(2569, 3275, 0), "Talk to Ceril to finish the quest."); } + @Override + public Map loadSteps() + { + // TODO: Should the valves section implement the PuzzleWrapper? + initializeRequirements(); + setupSteps(); + Map steps = new HashMap<>(); + + steps.put(0, talkToCeril); + + // Got poison first time, 14782 0->1 + // Have poison currently (10670 0->1, back to 0 if you talk to Clivet without poison) + // Is also for recieved the mark? + + var goTalkToClivet = new ConditionalStep(this, enterCave); + goTalkToClivet.addStep(inCultEntrance, talkToClivet); + steps.put(2, goTalkToClivet); + steps.put(3, goTalkToClivet); + + // Help Hazeel + var hazeel4GoPoisonSteps = new ConditionalStep(this, enterKitchen); + // 14779 0->1 when used poison on range + hazeel4GoPoisonSteps.addStep(inManorBasement, usePoisonOnRange); + hazeel4GoPoisonSteps.addStep(inCultEntrance, leaveCaveWithPoison); + + // TODO: Verify if this is needed + var goTalkAfterPoison = new ConditionalStep(this, talkToCerilAfterPoison); + goTalkAfterPoison.addStep(inManorBasement, leaveKitchen); + + var goTalkToClivetAfterPoison = new ConditionalStep(this, goTalkAfterPoison); + // Probably don't actually need the mark but nice to ensure the player gets it + goTalkToClivetAfterPoison.addStep(and(inCultRoom, hazeelMark.alsoCheckBank()), talkToAlomone); + goTalkToClivetAfterPoison.addStep(and(inCultEntrance, valveStepsHazeel.solved, hazeelMark.alsoCheckBank()), boardRaftAfterPoison); + goTalkToClivetAfterPoison.addStep(and(inCultEntrance, valveStepsHazeel.solved), talkToClivetAfterPoison); + goTalkToClivetAfterPoison.addStep(valveStepsHazeel.solved, enterCaveAfterPoison); + goTalkToClivetAfterPoison.addStep(talkedToCerilAfterPoison, valveStepsHazeel); + + var hadScroll = or(hazeelScroll.alsoCheckBank(), givenAlomoneScroll); + var hazeelSteps = new ConditionalStep(this, enterKitchenAfterButler); + hazeelSteps.addStep(and(inCultRoom, hadScroll), giveAlomoneScroll); + hazeelSteps.addStep(and(inCultEntrance, hadScroll), boardRaftWithScroll); + hazeelSteps.addStep(and(inManorF1, hadScroll, inManorF2LadderRoom), knockOnWallToExit); + hazeelSteps.addStep(and(inManorF1, hadScroll), goF1ToF0WithScroll); + hazeelSteps.addStep(and(inManorF2, hadScroll), goF2ToF1WithScroll); + hazeelSteps.addStep(hadScroll, enterCaveWithScroll); + hazeelSteps.addStep(and(inManorF2, key), searchChestForScroll); + hazeelSteps.addStep(and(inManorF1, key, inManorF2LadderRoom), climbLadderWithKey); + hazeelSteps.addStep(and(inManorF1, key), knockOnWall); + hazeelSteps.addStep(and(inManorBasement, key), leaveKitchenWithKey); + hazeelSteps.addStep(key, goToF1WithKey); + hazeelSteps.addStep(inManorBasement, searchCrateForKey); + hazeelSteps.addStep(inCultEntrance, leaveCaveAfterAlomone); + hazeelSteps.addStep(inCultRoom, returnOnRaftAfterAlomone); + + // Ceril side + var cerilSteps = new ConditionalStep(this, valveStepsCeril); + cerilSteps.addStep(and(onStep7, butlerArrested), talkToCerilToFinish); + cerilSteps.addStep(and(onStep7, inManorF1), searchCupboardForEvidence); + cerilSteps.addStep(onStep7, goUpToCupboard); + cerilSteps.addStep(and(inCultEntrance, hadArmour), leaveCaveAfterKilling); + cerilSteps.addStep(and(inCultRoom, hadArmour), returnOnRaftAfterKilling); + cerilSteps.addStep(hadArmour, talkToCerilAfterKilling); + cerilSteps.addStep(and(inCultRoom, canSearchChest), retrieveArmourFromChest); + cerilSteps.addStep(and(inCultRoom, alomoneAttackable), killAlomone); + cerilSteps.addStep(and(inCultRoom), talkToAlomoneToKill); + cerilSteps.addStep(and(inCultEntrance, valveStepsCeril.solved), boardRaftToKill); + cerilSteps.addStep(valveStepsCeril.solved, enterCaveAfterValvesForCeril); + cerilSteps.addStep(inCultEntrance, leaveCaveForValves); + + // TODO: 14782 0->1 may occur to represent Hazeel + + // Told to make poison, 223 3->4 + // Sided with Ceril: + // 10670 1->0 occurs, + // 14769 0->1 and 223 3->4 + var step4 = new ConditionalStep(this, enterCave); + step4.addStep(sidedWithCeril, cerilSteps); + step4.addStep(poison, hazeel4GoPoisonSteps); + step4.addStep(inCultEntrance, getPoison); + steps.put(4, step4); + + // Assuming this can only be reached in Hazeel side, but may be wrong + steps.put(5, goTalkToClivetAfterPoison); + + var step6 = new ConditionalStep(this, hazeelSteps); + step6.addStep(sidedWithCeril, cerilSteps); + steps.put(6, step6); + + var step7 = new ConditionalStep(this, hazeelSteps); + step7.addStep(sidedWithCeril, cerilSteps); + steps.put(7, step7); + + return steps; + } + @Override public List getItemRecommended() { - return Collections.singletonList(ardougneCloak); + return List.of( + ardougneCloak + ); } @Override public List getCombatRequirements() { - return Collections.singletonList("Alomone (level 13) if taking Ceril's side"); + return List.of( + "Alomone (level 13) if taking Ceril's side" + ); } @Override @@ -385,13 +458,15 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.THIEVING, 1500)); + return List.of( + new ExperienceReward(Skill.THIEVING, 1500) + ); } @Override public List getItemRewards() { - return Arrays.asList( + return List.of( new ItemReward("(2,005 if siding with Ceril) Coins", ItemID.COINS, 2000), new ItemReward("Hazeel's mark (if you sided with Hazeel)", ItemID.MARK_OF_HAZEEL), new ItemReward("Carnillean armour (if you sided with Ceril)", ItemID.CARNILLEAN_ARMOUR) @@ -401,31 +476,39 @@ public List getItemRewards() @Override public List getNotes() { - return Collections.singletonList("If you sided with Hazeel and are being guided to help Ceril, just click the" + - " box in the Ceril sidebar header to switch to Hazeel"); + return List.of( + "If you sided with Hazeel and are being guided to help Ceril, just click the box in the Ceril sidebar header to switch to Hazeel" + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting off", Arrays.asList(talkToCeril, enterCave, talkToClivet))); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToCeril, + enterCave, + talkToClivet + ))); - List cerilStepsSidebar = new ArrayList<>(Collections.singletonList(leaveCaveForValves)); + var cerilStepsSidebar = new ArrayList(Collections.singletonList(leaveCaveForValves)); cerilStepsSidebar.addAll(valveStepsCeril.getDisplaySteps()); cerilStepsSidebar.addAll(Arrays.asList(enterCaveAfterValvesForCeril, boardRaftToKill, talkToAlomoneToKill, killAlomone, retrieveArmourFromChest, talkToCerilAfterKilling, talkToJonesAfterKilling, searchCupboardForEvidence, talkToCerilToFinish)); PanelDetails cerilPanel = new PanelDetails("Siding with Ceril", cerilStepsSidebar); - allSteps.add(cerilPanel); + // TODO: add locking step to make it lockable? + sections.add(cerilPanel); - List hazeelSteps = new ArrayList<>(Arrays.asList(getPoison, leaveCaveWithPoison, enterKitchen, + var hazeelSteps = new ArrayList(Arrays.asList(getPoison, leaveCaveWithPoison, enterKitchen, usePoisonOnRange, leaveKitchen, talkToCerilAfterPoison)); hazeelSteps.addAll(valveStepsHazeel.getDisplaySteps()); hazeelSteps.addAll(Arrays.asList(talkToClivetAfterPoison, boardRaftAfterPoison, talkToAlomone, searchCrateForKey, leaveKitchenWithKey, goToF1WithKey, climbLadderWithKey, searchChestForScroll, giveAlomoneScroll)); - allSteps.add(new PanelDetails("Siding with Hazeel", hazeelSteps)); + // TODO: add locking step to make it lockable? + sections.add(new PanelDetails("Siding with Hazeel", hazeelSteps)); - return allSteps; + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelValves.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelValves.java index 455283ae789..0d4f349edb6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelValves.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/hazeelcult/HazeelValves.java @@ -241,6 +241,7 @@ protected void setupSteps() turnValve1 = new ObjectStep(getQuestHelper(), ObjectID.SEWERVALVE1, new WorldPoint(2562, 3247, 0), "Turn the valve west of the Clocktower to the right."); turnValve1.addDialogStep("Turn it to the right."); + turnValve1.addSubSteps(catchState); turnValve2 = new ObjectStep(getQuestHelper(), ObjectID.SEWERVALVE2, new WorldPoint(2572, 3263, 0), "Turn the valve next to the Carnillean home to the right."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/heroesquest/HeroesQuest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/heroesquest/HeroesQuest.java index 6cbf9736fd4..a8a70fd1175 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/heroesquest/HeroesQuest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/heroesquest/HeroesQuest.java @@ -296,7 +296,7 @@ public void setupConditions() gottenPapers = new VarplayerRequirement(VarPlayerID.HEROQUEST, 9, Operation.GREATER_EQUAL); enteredMansion = new VarplayerRequirement(VarPlayerID.HEROQUEST, 10, Operation.GREATER_EQUAL); talkedToGrip = new VarplayerRequirement(VarPlayerID.HEROQUEST, 11, Operation.GREATER_EQUAL); - unlockedCandlestickBlackArm = new VarplayerRequirement(188, 12); + unlockedCandlestickBlackArm = new VarplayerRequirement(VarPlayerID.HEROQUEST, 12); finishedBlackArm = new VarplayerRequirement(VarPlayerID.HEROQUEST, 13, Operation.GREATER_EQUAL); talkedToStraven = new VarplayerRequirement(VarPlayerID.HEROQUEST, 2, Operation.GREATER_EQUAL); talkedToAlfonse = new VarplayerRequirement(VarPlayerID.HEROQUEST, 3, Operation.GREATER_EQUAL); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/holygrail/HolyGrail.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/holygrail/HolyGrail.java index b6c5a4ae5a3..e31e9b165c6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/holygrail/HolyGrail.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/holygrail/HolyGrail.java @@ -32,11 +32,12 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; +import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ObjectCondition; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.DialogRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; @@ -50,126 +51,129 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; public class HolyGrail extends BasicQuestHelper { - //Items Recommended - ItemRequirement antipoison, combatGear, food, threeCamelotTele, ardyTele, faladorTele, sixtyCoins, draynorTele; - - //Items Required - ItemRequirement excalibur, holyTableNapkin, twoMagicWhistles, highlightMagicWhistle1, goldFeather, grailBell, highlightGrailBell, emptyInvSpot, oneMagicWhistle, highlightMagicWhistle2, grail; - - Requirement inCamelot, inCamelotUpstairs, inMerlinRoom, merlinNearby, onEntrana, inDraynorFrontManor, inDraynorManorBottomFloor, inDraynorManorSecondFloor, - inDraynorManorTopFloor, inMagicWhistleRoom, inTeleportLocation, titanNearby, inFisherKingRealmAfterTitan, talkedToFisherman, - inGrailBellRingLocation, inFisherKingCastle1BottomFloor, inFisherKingCastle1SecondFloor, inFisherKingRealm, inFisherKingCastle2BottomFloor, - inFisherKingCastle2SecondFloor, inFisherKingCastle2ThirdFloor; - - DetailedQuestStep talkToKingArthur1, talkToMerlin, goUpStairsCamelot, openMerlinDoor, goToEntrana, talkToHighPriest, talkToGalahad, goToDraynorManor, enterDraynorManor, goUpStairsDraynor1, - goUpStairsDraynor2, openWhistleDoor, takeWhistles, goGetExcalibur, goToTeleportLocation1, blowWhistle1, attackTitan, talkToFisherman, pickupBell, ringBell, goUpStairsBrokenCastle, talkToFisherKing, goToCamelot, - talkToKingArthur2, openSack, goToTeleportLocation2, blowWhistle2, openFisherKingCastleDoor, goUpNewCastleStairs, goUpNewCastleLadder, takeGrail, talkToKingArthur3; + // Required items + ItemRequirement excalibur; + + // Recommended items + ItemRequirement antipoison; + ItemRequirement combatGear; + ItemRequirement food; + ItemRequirement threeCamelotTele; + ItemRequirement ardyTele; + ItemRequirement faladorTele; + ItemRequirement sixtyCoins; + ItemRequirement thirtyCoins; + ItemRequirement draynorTele; + + // Mid-quest item requirements + ItemRequirement holyTableNapkin; + ItemRequirement twoMagicWhistles; + ItemRequirement highlightMagicWhistle1; + ItemRequirement goldFeather; + ItemRequirement grailBell; + ItemRequirement highlightGrailBell; + ItemRequirement emptyInvSpot; + ItemRequirement oneMagicWhistle; + ItemRequirement highlightMagicWhistle2; + ItemRequirement grail; + + // Zones + Zone camelotGround; + Zone camelotUpstairsZone1; + Zone camelotUpstairsZone2; + Zone merlinRoom; + Zone entranaBoat; + Zone entranaIsland; + Zone draynorManorFront; + Zone draynorManorBottomFloor; + Zone draynorManorSecondFloor; + Zone draynorManorTopFloor; + Zone magicWhistleRoom; + Zone teleportLocation; + Zone fisherKingRealmAfterTitan1; + Zone fisherKingRealmAfterTitan2; + Zone fisherKingRealmAfterTitan3; + Zone grailBellRingLocation; + Zone fisherKingRealmCastle1BottomFloor; + Zone fisherKingRealmCastle1SecondFloor; + Zone fisherKingRealm; + Zone fisherKingRealmCastle2BottomFloor; + Zone fisherKingRealmCastle2SecondFloor; + Zone fisherKingRealmCastle2ThirdFloor; + + // Miscellaneous requirements + ZoneRequirement inCamelot; + ZoneRequirement inCamelotUpstairs; + ZoneRequirement inMerlinRoom; + NpcCondition merlinNearby; + ZoneRequirement onEntrana; + ZoneRequirement inDraynorFrontManor; + ZoneRequirement inDraynorManorBottomFloor; + ZoneRequirement inDraynorManorSecondFloor; + ZoneRequirement inDraynorManorTopFloor; + ZoneRequirement inMagicWhistleRoom; + ZoneRequirement inTeleportLocation; + NpcCondition titanNearby; + ZoneRequirement inFisherKingRealmAfterTitan; + Conditions talkedToFisherman; + ItemOnTileRequirement bellInRightPosition; + ZoneRequirement inGrailBellRingLocation; + ZoneRequirement inFisherKingCastle1BottomFloor; + ZoneRequirement inFisherKingCastle1SecondFloor; + ZoneRequirement inFisherKingRealm; + ZoneRequirement inFisherKingCastle2BottomFloor; + ZoneRequirement inFisherKingCastle2SecondFloor; + ZoneRequirement inFisherKingCastle2ThirdFloor; + Conditions fisherKingCastleOuterDoorOpen; + + // Steps + NpcStep startQuest; + + ObjectStep goUpStairsCamelot; + ObjectStep openMerlinDoor; + NpcStep talkToMerlin; + + NpcStep goToEntrana; + NpcStep talkToHighPriest; + NpcStep talkToGalahad; + DetailedQuestStep goToDraynorManor; + ObjectStep enterDraynorManor; + ObjectStep goUpStairsDraynor1; + ObjectStep goUpStairsDraynor2; + ObjectStep openWhistleDoor; + DetailedQuestStep takeWhistles; + ItemStep goGetExcalibur; + DetailedQuestStep goToTeleportLocation1; + ItemStep blowWhistle1; + NpcStep attackTitan; + NpcStep talkToFisherman; + DetailedQuestStep pickupBell; + DetailedQuestStep ringBell; + DetailedQuestStep ringBellHighlighted; + ObjectStep goUpStairsBrokenCastle; + NpcStep talkToFisherKing; + DetailedQuestStep goToCamelot; + NpcStep talkToKingArthur2; + ObjectStep openSack; + DetailedQuestStep goToTeleportLocation2; + ItemStep blowWhistle2; + ObjectStep openFisherKingCastleDoor; + ObjectStep goUpNewCastleStairs; + ObjectStep goUpNewCastleLadder; + DetailedQuestStep takeGrail; + NpcStep finishQuest; ConditionalStep findFisherKing; - //Zones - Zone camelotGround, camelotUpstairsZone1, camelotUpstairsZone2, merlinRoom, entranaBoat, entranaIsland, draynorManorFront, draynorManorBottomFloor, draynorManorSecondFloor, - draynorManorTopFloor, magicWhistleRoom, teleportLocation, fisherKingRealmAfterTitan1, fisherKingRealmAfterTitan2, fisherKingRealmAfterTitan3, grailBellRingLocation, - fisherKingRealmCastle1BottomFloor, fisherKingRealmCastle1SecondFloor, fisherKingRealm, fisherKingRealmCastle2BottomFloor, fisherKingRealmCastle2SecondFloor, fisherKingRealmCastle2ThirdFloor; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToKingArthur1); - - ConditionalStep findingMerlin = new ConditionalStep(this, goUpStairsCamelot); - findingMerlin.addStep(new Conditions(inMerlinRoom, merlinNearby), talkToMerlin); - findingMerlin.addStep(inCamelotUpstairs, openMerlinDoor); - - steps.put(2, findingMerlin); - - ConditionalStep findHighPriest = new ConditionalStep(this, goToEntrana); - findHighPriest.addStep(onEntrana, talkToHighPriest); - - steps.put(3, findHighPriest); - - findFisherKing = new ConditionalStep(this, talkToGalahad); - findFisherKing.addStep(inFisherKingCastle1SecondFloor, talkToFisherKing); - findFisherKing.addStep(inFisherKingCastle1BottomFloor, goUpStairsBrokenCastle); - findFisherKing.addStep(new Conditions(grailBell, inFisherKingRealmAfterTitan), ringBell); - findFisherKing.addStep(talkedToFisherman, pickupBell); - findFisherKing.addStep(inFisherKingRealmAfterTitan, talkToFisherman); - findFisherKing.addStep(new Conditions(excalibur, titanNearby), attackTitan); - findFisherKing.addStep(new Conditions(twoMagicWhistles, inTeleportLocation, excalibur), blowWhistle1); - findFisherKing.addStep(new Conditions(twoMagicWhistles, excalibur), goToTeleportLocation1); - findFisherKing.addStep(twoMagicWhistles, goGetExcalibur); - findFisherKing.addStep(and(inMagicWhistleRoom, holyTableNapkin), takeWhistles); - findFisherKing.addStep(and(holyTableNapkin, inDraynorManorTopFloor), openWhistleDoor); - findFisherKing.addStep(and(holyTableNapkin, inDraynorManorSecondFloor), goUpStairsDraynor2); - findFisherKing.addStep(and(holyTableNapkin, inDraynorManorBottomFloor), goUpStairsDraynor1); - findFisherKing.addStep(and(holyTableNapkin, inDraynorFrontManor), enterDraynorManor); - findFisherKing.addStep(holyTableNapkin, goToDraynorManor); - findFisherKing.setLockingCondition(twoMagicWhistles); - - steps.put(4, findFisherKing); - steps.put(7, findFisherKing); - - ConditionalStep findPercival = new ConditionalStep(this, talkToKingArthur2); - findPercival.addStep(goldFeather, openSack); - - steps.put(8, findPercival); - - ConditionalStep finishQuest = new ConditionalStep(this, goToTeleportLocation2); - finishQuest.addStep(grail, talkToKingArthur3); - finishQuest.addStep(inFisherKingCastle2ThirdFloor, takeGrail); - finishQuest.addStep(inFisherKingCastle2SecondFloor, goUpNewCastleLadder); - finishQuest.addStep(inFisherKingCastle2BottomFloor, goUpNewCastleStairs); - finishQuest.addStep(inFisherKingRealm, openFisherKingCastleDoor); - finishQuest.addStep(inTeleportLocation, blowWhistle2); - - steps.put(9, finishQuest); - - return steps; - } - - @Override - protected void setupRequirements() - { - excalibur = new ItemRequirement("Excalibur", ItemID.EXCALIBUR).isNotConsumed(); - holyTableNapkin = new ItemRequirement("Holy Table Napkin", ItemID.HOLY_TABLE_NAPKIN); - twoMagicWhistles = new ItemRequirement("Magic Whistles", ItemID.MAGIC_WHISTLE, 2); - threeCamelotTele = new ItemRequirement("Camelot Teleports", ItemID.POH_TABLET_CAMELOTTELEPORT, 3); - draynorTele = new ItemRequirement("Draynor Teleport Tablet", ItemID.TELETAB_DRAYNOR, 1); - draynorTele.addAlternates(ItemCollections.AMULET_OF_GLORIES); - ardyTele = new ItemRequirement("Ardougne Teleport", ItemID.POH_TABLET_ARDOUGNETELEPORT); - faladorTele = new ItemRequirement("Falador Teleport", ItemID.POH_TABLET_FALADORTELEPORT); - sixtyCoins = new ItemRequirement("Coins", ItemCollections.COINS, 60); - antipoison = new ItemRequirement("Antipoison", ItemID._4DOSEANTIPOISON); - food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); - combatGear = new ItemRequirement("A weapon and armour (melee recommended)", -1, -1).isNotConsumed(); - combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); - emptyInvSpot = new ItemRequirement("Empty Inventory Spot", -1, 1); - goldFeather = new ItemRequirement("Magic gold feather", ItemID.MAGIC_GOLDEN_FEATHER); - grailBell = new ItemRequirement("Grail Bell", ItemID.GRAIL_BELL); - oneMagicWhistle = new ItemRequirement("Magic Whistle", ItemID.MAGIC_WHISTLE); - grail = new ItemRequirement("Holy Grail", ItemID.HOLY_GRAIL); - - highlightMagicWhistle1 = new ItemRequirement("Magic Whistle", ItemID.MAGIC_WHISTLE, 2); - highlightMagicWhistle1.setHighlightInInventory(true); - - highlightMagicWhistle2 = new ItemRequirement("Magic Whistle", ItemID.MAGIC_WHISTLE); - highlightMagicWhistle2.setHighlightInInventory(true); - - highlightGrailBell = new ItemRequirement("Grail Bell", ItemID.GRAIL_BELL); - highlightGrailBell.setHighlightInInventory(true); - } - @Override protected void setupZones() { @@ -197,17 +201,37 @@ protected void setupZones() fisherKingRealmCastle2ThirdFloor = new Zone(new WorldPoint(2651, 4686, 2), new WorldPoint(2647, 4682, 2)); } - public void setupConditions() + @Override + protected void setupRequirements() { + excalibur = new ItemRequirement("Excalibur", ItemID.EXCALIBUR).isNotConsumed(); + holyTableNapkin = new ItemRequirement("Holy Table Napkin", ItemID.HOLY_TABLE_NAPKIN); + twoMagicWhistles = new ItemRequirement("Magic Whistles", ItemID.MAGIC_WHISTLE, 2); + threeCamelotTele = new ItemRequirement("Camelot Teleports", ItemID.POH_TABLET_CAMELOTTELEPORT, 3); + draynorTele = new ItemRequirement("Draynor Teleport Tablet", ItemID.TELETAB_DRAYNOR, 1); + draynorTele.addAlternates(ItemCollections.AMULET_OF_GLORIES); + ardyTele = new ItemRequirement("Ardougne Teleport", ItemID.POH_TABLET_ARDOUGNETELEPORT); + faladorTele = new ItemRequirement("Falador Teleport", ItemID.POH_TABLET_FALADORTELEPORT); + sixtyCoins = new ItemRequirement("Coins", ItemCollections.COINS, 60); + sixtyCoins.appendToTooltip("For travel from Ardougne to Brimhaven twice"); + thirtyCoins = new ItemRequirement("Coins", ItemCollections.COINS, 30); + thirtyCoins.appendToTooltip("For travel from Ardougne to Brimhaven"); + antipoison = new ItemRequirement("Antipoison", ItemCollections.ANTIPOISONS); + antipoison.setTooltip("If you're below Combat level 41, the poisonous scorpions on Karamja are aggressive"); + food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); + combatGear = new ItemRequirement("A weapon and armour (melee recommended)", -1, -1).isNotConsumed(); + combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); + emptyInvSpot = new ItemRequirement("Empty Inventory Spot", -1, 1); + goldFeather = new ItemRequirement("Magic gold feather", ItemID.MAGIC_GOLDEN_FEATHER); + grailBell = new ItemRequirement("Grail Bell", ItemID.GRAIL_BELL); + oneMagicWhistle = new ItemRequirement("Magic Whistle", ItemID.MAGIC_WHISTLE); + grail = new ItemRequirement("Holy Grail", ItemID.HOLY_GRAIL); + inCamelot = new ZoneRequirement(camelotGround); - inCamelotUpstairs = new Conditions(LogicType.OR, - new ZoneRequirement(camelotUpstairsZone1), - new ZoneRequirement(camelotUpstairsZone2)); + inCamelotUpstairs = new ZoneRequirement(camelotUpstairsZone1, camelotUpstairsZone2); inMerlinRoom = new ZoneRequirement(merlinRoom); merlinNearby = new NpcCondition(NpcID.MERLIN2); - onEntrana = new Conditions(LogicType.OR, - new ZoneRequirement(entranaBoat), - new ZoneRequirement(entranaIsland)); + onEntrana = new ZoneRequirement(entranaBoat, entranaIsland); inDraynorFrontManor = new ZoneRequirement(draynorManorFront); inDraynorManorBottomFloor = new ZoneRequirement(draynorManorBottomFloor); inDraynorManorSecondFloor = new ZoneRequirement(draynorManorSecondFloor); @@ -215,10 +239,7 @@ public void setupConditions() inMagicWhistleRoom = new ZoneRequirement(magicWhistleRoom); inTeleportLocation = new ZoneRequirement(teleportLocation); titanNearby = new NpcCondition(NpcID.BLACK_KNIGHT_TITAN); - inFisherKingRealmAfterTitan = new Conditions(LogicType.OR, - new ZoneRequirement(fisherKingRealmAfterTitan1), - new ZoneRequirement(fisherKingRealmAfterTitan2), - new ZoneRequirement(fisherKingRealmAfterTitan3)); + inFisherKingRealmAfterTitan = new ZoneRequirement(fisherKingRealmAfterTitan1, fisherKingRealmAfterTitan2, fisherKingRealmAfterTitan3); talkedToFisherman = new Conditions(true, new DialogRequirement("You must be blind then. There's ALWAYS bells there when I go to the castle.")); inGrailBellRingLocation = new ZoneRequirement(grailBellRingLocation); inFisherKingCastle1BottomFloor = new ZoneRequirement(fisherKingRealmCastle1BottomFloor); @@ -227,21 +248,36 @@ public void setupConditions() inFisherKingCastle2BottomFloor = new ZoneRequirement(fisherKingRealmCastle2BottomFloor); inFisherKingCastle2SecondFloor = new ZoneRequirement(fisherKingRealmCastle2SecondFloor); inFisherKingCastle2ThirdFloor = new ZoneRequirement(fisherKingRealmCastle2ThirdFloor); + + highlightMagicWhistle1 = new ItemRequirement("Magic Whistle", ItemID.MAGIC_WHISTLE, 2); + highlightMagicWhistle1.setHighlightInInventory(true); + + highlightMagicWhistle2 = new ItemRequirement("Magic Whistle", ItemID.MAGIC_WHISTLE); + highlightMagicWhistle2.setHighlightInInventory(true); + + highlightGrailBell = new ItemRequirement("Grail Bell", ItemID.GRAIL_BELL); + highlightGrailBell.setHighlightInInventory(true); + + bellInRightPosition = new ItemOnTileRequirement(ItemID.GRAIL_BELL, new WorldPoint(2762, 4694, 0)); + + fisherKingCastleOuterDoorOpen = not(new ObjectCondition(ObjectID.CASTLEDOUBLEDOORR, new WorldPoint(2634, 4693, 0))); } public void setupSteps() { - WorldPoint kingArthurWorldPoint = new WorldPoint(2763, 3513, 0); - talkToKingArthur1 = new NpcStep(this, NpcID.KING_ARTHUR, kingArthurWorldPoint, "Talk to King Arthur in Camelot Castle to start."); - talkToKingArthur1.addDialogStep("Tell me of this quest."); - talkToKingArthur1.addDialogStep("I'd enjoy trying that."); - goUpStairsCamelot = new ObjectStep(this, ObjectID.KR_CAM_WOODENSTAIRS, new WorldPoint(2751, 3511, 0), "Go upstairs to talk to Merlin."); - openMerlinDoor = new ObjectStep(this, ObjectID.MERLINWORKSHOP, "Open the door to go to Merlin's room."); - talkToMerlin = new NpcStep(this, NpcID.MERLIN2, new WorldPoint(2763, 3513, 1), "Talk to Merlin"); - talkToMerlin.addDialogStep("Where can I find Sir Galahad?"); - - goToEntrana = new NpcStep(this, NpcID.SHIPMONK1_C, new WorldPoint(3048, 3235, 0), "Talk to a monk of Entrana. Bank all combat gear.", true); - talkToHighPriest = new NpcStep(this, NpcID.HIGH_PRIEST_OF_ENTRANA, new WorldPoint(2851, 3348, 0), "Talk to the High Priest."); + var kingArthurWorldPoint = new WorldPoint(2763, 3513, 0); + + startQuest = new NpcStep(this, NpcID.KING_ARTHUR, kingArthurWorldPoint, "Talk to King Arthur in Camelot Castle to start the quest."); + startQuest.addDialogStep("Tell me of this quest."); + startQuest.addDialogStep("Yes."); + + goUpStairsCamelot = new ObjectStep(this, ObjectID.KR_CAM_WOODENSTAIRS, new WorldPoint(2751, 3511, 0), "Go upstairs and talk to Merlin."); + openMerlinDoor = new ObjectStep(this, ObjectID.MERLINWORKSHOP, "Go upstairs and talk to Merlin."); + talkToMerlin = new NpcStep(this, NpcID.MERLIN2, new WorldPoint(2763, 3513, 1), "Go upstairs and talk to Merlin."); + talkToMerlin.addSubSteps(goUpStairsCamelot, openMerlinDoor); + + goToEntrana = new NpcStep(this, NpcID.SHIPMONK1_C, new WorldPoint(3048, 3235, 0), "Head to Port Sarim and talk to a monk of Entrana for passage to Entrana. Bank all combat gear.", true); + talkToHighPriest = new NpcStep(this, NpcID.HIGH_PRIEST_OF_ENTRANA, new WorldPoint(2851, 3348, 0), "Talk to the High Priest on Entrana."); talkToHighPriest.addDialogSteps("Ask about the Holy Grail Quest", "Ok, I will go searching."); talkToGalahad = new NpcStep(this, NpcID.BROTHER_GALAHAD, new WorldPoint(2612, 3475, 0), "Talk to Galahad in his house west of McGrubor's Woods."); @@ -258,64 +294,145 @@ public void setupSteps() goGetExcalibur = new ItemStep(this, "Go retrieve Excalibur from your bank. If you do not own Excalibur, you can retrieve it from the Lady of the Lake in Taverley for 500 coins.", twoMagicWhistles, excalibur); WorldPoint teleportLocationPoint = new WorldPoint(2742, 3236, 0); goToTeleportLocation1 = new DetailedQuestStep(this, teleportLocationPoint, "Go to the tower on Karamja near gold mine west of Brimhaven.", twoMagicWhistles, excalibur); + goToTeleportLocation1.addDialogStep("I'd like to go to Brimhaven."); + goToTeleportLocation1.addRecommended(thirtyCoins); + goToTeleportLocation1.addRecommended(antipoison); + goToTeleportLocation1.addSubSteps(goGetExcalibur); blowWhistle1 = new ItemStep(this, "Blow the whistle once you are underneath of the tower.", highlightMagicWhistle1, excalibur); attackTitan = new NpcStep(this, NpcID.BLACK_KNIGHT_TITAN, "Kill the Black Knight Titan with Excalibur. Melee is recommended as it has high Ranged and Magic defence. (You only need to deal the killing blow with excalibur!)", twoMagicWhistles, excalibur); talkToFisherman = new NpcStep(this, NpcID.GRAIL_FISHERMAN, new WorldPoint(2798, 4706, 0), "Talk to the fisherman by the river. After talking to him walk West to the castle."); talkToFisherman.addDialogStep("Any idea how to get into the castle?"); - pickupBell = new DetailedQuestStep(this, new WorldPoint(2762, 4694, 0), "Pickup the bell outside of the castle."); - ringBell = new DetailedQuestStep(this, new WorldPoint(2762, 4694, 0), "Ring the grail bell directly north of the broken castle wall (Where you picked up the bell)", highlightGrailBell); + pickupBell = new ItemStep(this, new WorldPoint(2762, 4694, 0), "Pickup the grail bell outside of the castle. If it's not there, return to the fisherman and finish the conversation.", grailBell); + pickupBell.addDialogStep("Any idea how to get into the castle?"); + ringBell = new DetailedQuestStep(this, new WorldPoint(2762, 4694, 0), "Ring the grail bell while standing directly north of the broken castle wall (Where you picked up the bell)", grailBell); ringBell.addIcon(ItemID.GRAIL_BELL); + ringBellHighlighted = new DetailedQuestStep(this, new WorldPoint(2762, 4694, 0), "Ring the grail bell while standing directly north of the broken castle wall (Where you picked up the bell)", highlightGrailBell); + ringBellHighlighted.addIcon(ItemID.GRAIL_BELL); + ringBell.addSubSteps(ringBellHighlighted); goUpStairsBrokenCastle = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2762, 4681, 0), "Go up the stairs inside of the castle."); talkToFisherKing = new NpcStep(this, NpcID.FISHER_KING, "Talk to The Fisher King."); talkToFisherKing.addDialogStep("You don't look too well."); + findFisherKing = new ConditionalStep(this, talkToGalahad); + findFisherKing.addStep(inFisherKingCastle1SecondFloor, talkToFisherKing); + findFisherKing.addStep(inFisherKingCastle1BottomFloor, goUpStairsBrokenCastle); + findFisherKing.addStep(and(grailBell, inGrailBellRingLocation), ringBellHighlighted); + findFisherKing.addStep(and(grailBell, inFisherKingRealmAfterTitan), ringBell); + findFisherKing.addStep(or(talkedToFisherman, bellInRightPosition), pickupBell); + findFisherKing.addStep(inFisherKingRealmAfterTitan, talkToFisherman); + findFisherKing.addStep(and(excalibur, titanNearby), attackTitan); + findFisherKing.addStep(and(twoMagicWhistles, inTeleportLocation, excalibur), blowWhistle1); + findFisherKing.addStep(and(twoMagicWhistles, excalibur), goToTeleportLocation1); + findFisherKing.addStep(twoMagicWhistles, goGetExcalibur); + findFisherKing.addStep(and(inMagicWhistleRoom, holyTableNapkin), takeWhistles); + findFisherKing.addStep(and(holyTableNapkin, inDraynorManorTopFloor), openWhistleDoor); + findFisherKing.addStep(and(holyTableNapkin, inDraynorManorSecondFloor), goUpStairsDraynor2); + findFisherKing.addStep(and(holyTableNapkin, inDraynorManorBottomFloor), goUpStairsDraynor1); + findFisherKing.addStep(and(holyTableNapkin, inDraynorFrontManor), enterDraynorManor); + findFisherKing.addStep(holyTableNapkin, goToDraynorManor); + findFisherKing.setLockingCondition(twoMagicWhistles); + goToCamelot = new DetailedQuestStep(this, new WorldPoint(2758, 3486, 0), "Go back to Camelot."); talkToKingArthur2 = new NpcStep(this, NpcID.KING_ARTHUR, kingArthurWorldPoint, "Return to Camelot and talk to King Arthur.", emptyInvSpot); - openSack = new ObjectStep(this, ObjectID.PERCY_SACKS, new WorldPoint(2962, 3506, 0), "Travel to the Goblin Village North of Falador. Right click and open the sacks.", twoMagicWhistles); + openSack = new ObjectStep(this, ObjectID.PERCY_SACKS, new WorldPoint(2962, 3506, 0), "Travel to the Goblin Village, north of Falador. Right click and open the sacks.", twoMagicWhistles); openSack.addDialogStep("Come with me, I shall make you a king."); goToTeleportLocation2 = new DetailedQuestStep(this, teleportLocationPoint, "Go to the tower on Karamja near gold mine west of Brimhaven.", oneMagicWhistle, goldFeather); - blowWhistle2 = new ItemStep(this, "Blow the whistle once you are underneath of the tower.", highlightMagicWhistle2, goldFeather); + goToTeleportLocation2.addDialogStep("I'd like to go to Brimhaven."); + goToTeleportLocation2.addRecommended(thirtyCoins); + goToTeleportLocation2.addRecommended(antipoison); + blowWhistle2 = new ItemStep(this, "Blow the whistle once you are underneath of the tower.", highlightMagicWhistle2); - openFisherKingCastleDoor = new ObjectStep(this, ObjectID.CASTLEDOUBLEDOORR, "Open the door to the castle and enter.", goldFeather); - goUpNewCastleStairs = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2649, 4684, 0), "Go up the stairs to the east.", goldFeather); - goUpNewCastleLadder = new ObjectStep(this, ObjectID.LADDER, "Climb the ladder on the second floor.", goldFeather); - takeGrail = new DetailedQuestStep(this, new WorldPoint(2649, 4684, 2), "Pickup the Grail.", goldFeather); + openFisherKingCastleDoor = new ObjectStep(this, ObjectID.CASTLEDOUBLEDOORR, "Open the door to the castle and enter."); + goUpNewCastleStairs = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(2649, 4684, 0), "Go up the stairs to the east."); + goUpNewCastleLadder = new ObjectStep(this, ObjectID.LADDER, "Climb the ladder on the second floor."); + takeGrail = new ItemStep(this, new WorldPoint(2649, 4684, 2), "Pickup the Holy grail.", grail); - talkToKingArthur3 = new NpcStep(this, NpcID.KING_ARTHUR, kingArthurWorldPoint, "Return to Camelot and talk to King Arthur", grail); + finishQuest = new NpcStep(this, NpcID.KING_ARTHUR, kingArthurWorldPoint, "Return to Camelot and talk to King Arthur", grail); } @Override - public List getCombatRequirements() + public Map loadSteps() { - ArrayList reqs = new ArrayList<>(); - reqs.add("Black Knight Titan (level 120)"); - return reqs; + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, startQuest); + + var findingMerlin = new ConditionalStep(this, goUpStairsCamelot); + findingMerlin.addStep(and(inMerlinRoom, merlinNearby), talkToMerlin); + findingMerlin.addStep(inCamelotUpstairs, openMerlinDoor); + + steps.put(2, findingMerlin); + + var findHighPriest = new ConditionalStep(this, goToEntrana); + findHighPriest.addStep(onEntrana, talkToHighPriest); + + steps.put(3, findHighPriest); + + steps.put(4, findFisherKing); + steps.put(7, findFisherKing); + + var findPercival = new ConditionalStep(this, talkToKingArthur2); + findPercival.addStep(goldFeather, openSack); + + steps.put(8, findPercival); + + var finishQuest = new ConditionalStep(this, goToTeleportLocation2); + finishQuest.addStep(grail, this.finishQuest); + finishQuest.addStep(inFisherKingCastle2ThirdFloor, takeGrail); + finishQuest.addStep(inFisherKingCastle2SecondFloor, goUpNewCastleLadder); + finishQuest.addStep(or(inFisherKingCastle2BottomFloor, fisherKingCastleOuterDoorOpen), goUpNewCastleStairs); + finishQuest.addStep(inFisherKingRealm, openFisherKingCastleDoor); + finishQuest.addStep(inTeleportLocation, blowWhistle2); + + steps.put(9, finishQuest); + + return steps; + } + + @Override + public List getGeneralRequirements() + { + return List.of( + new QuestRequirement(QuestHelperQuest.MERLINS_CRYSTAL, QuestState.FINISHED), + new SkillRequirement(Skill.ATTACK, 20) + ); } @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(excalibur); - return reqs; + return List.of( + excalibur + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(threeCamelotTele); - reqs.add(ardyTele.quantity(2)); - reqs.add(draynorTele); - reqs.add(faladorTele); - reqs.add(sixtyCoins); - reqs.add(antipoison); - reqs.add(food); - reqs.add(combatGear); - return reqs; + return List.of( + threeCamelotTele, + ardyTele.quantity(2), + draynorTele, + faladorTele, + sixtyCoins, + antipoison, + food, + combatGear + ); + } + + @Override + public List getCombatRequirements() + { + return List.of( + "Black Knight Titan (level 120)" + ); } @Override @@ -327,40 +444,95 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Arrays.asList( - new ExperienceReward(Skill.PRAYER, 11000), - new ExperienceReward(Skill.DEFENCE, 15300)); + return List.of( + new ExperienceReward(Skill.PRAYER, 11000), + new ExperienceReward(Skill.DEFENCE, 15300) + ); } @Override public List getUnlockRewards() { - return Arrays.asList( - new UnlockReward("Access to the Fisher Realm."), - new UnlockReward("Ability to put King Arthur picture on the wall in the POH.")); + return List.of( + new UnlockReward("Access to the Fisher Realm."), + new UnlockReward("Ability to put King Arthur picture on the wall in the POH.") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting Off", Arrays.asList(talkToKingArthur1, goUpStairsCamelot, openMerlinDoor, talkToMerlin))); - allSteps.add(new PanelDetails("Getting the Napkin", Arrays.asList(goToEntrana, talkToHighPriest, talkToGalahad))); - allSteps.add(new PanelDetails("Getting the Magic Whistles", Arrays.asList(goToDraynorManor, enterDraynorManor, goUpStairsDraynor1, goUpStairsDraynor2, openWhistleDoor, takeWhistles), Collections.singletonList(holyTableNapkin), Collections.singletonList(draynorTele))); - allSteps.add(new PanelDetails("Fisher King Realm Pt.1", Arrays.asList(goToTeleportLocation1, blowWhistle1, attackTitan, talkToFisherman, pickupBell, ringBell, goUpStairsBrokenCastle, talkToFisherKing), twoMagicWhistles, excalibur)); - allSteps.add(new PanelDetails("Finding Percival", Arrays.asList(talkToKingArthur2, openSack), emptyInvSpot, twoMagicWhistles)); - allSteps.add(new PanelDetails("Fisher King Realm Pt.2", Arrays.asList(goToTeleportLocation2, blowWhistle2, openFisherKingCastleDoor, goUpNewCastleStairs, goUpNewCastleLadder, takeGrail), oneMagicWhistle, goldFeather)); - allSteps.add(new PanelDetails("Finishing Up", Collections.singletonList(talkToKingArthur3), grail)); - - return allSteps; - } - - @Override - public List getGeneralRequirements() - { - ArrayList req = new ArrayList<>(); - req.add(new QuestRequirement(QuestHelperQuest.MERLINS_CRYSTAL, QuestState.FINISHED)); - req.add(new SkillRequirement(Skill.ATTACK, 20)); - return req; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + startQuest, + talkToMerlin + ))); + + sections.add(new PanelDetails("Getting the Napkin", List.of( + goToEntrana, + talkToHighPriest, + talkToGalahad + ))); + + sections.add(new PanelDetails("Getting the Magic Whistles", List.of( + goToDraynorManor, + enterDraynorManor, + goUpStairsDraynor1, + goUpStairsDraynor2, + openWhistleDoor, + takeWhistles + ), List.of( + holyTableNapkin + ), List.of( + draynorTele + ))); + + sections.add(new PanelDetails("Fisher King Realm Pt.1", List.of( + goToTeleportLocation1, + blowWhistle1, + attackTitan, + talkToFisherman, + pickupBell, + ringBell, + goUpStairsBrokenCastle, + talkToFisherKing + ), List.of( + twoMagicWhistles, + excalibur + ), List.of( + thirtyCoins, + antipoison + ))); + + sections.add(new PanelDetails("Finding Percival", List.of( + talkToKingArthur2, + openSack + ), List.of( + emptyInvSpot, + twoMagicWhistles + ))); + + sections.add(new PanelDetails("Fisher King Realm Pt.2", List.of( + goToTeleportLocation2, + blowWhistle2, + openFisherKingCastleDoor, + goUpNewCastleStairs, + goUpNewCastleLadder, + takeGrail + ), List.of( + oneMagicWhistle + ), List.of( + thirtyCoins, + antipoison + ))); + + sections.add(new PanelDetails("Finishing up", List.of( + finishQuest + ), List.of( + grail + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/horrorfromthedeep/HorrorFromTheDeep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/horrorfromthedeep/HorrorFromTheDeep.java index 6e4e9b78283..2fd61bd18db 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/horrorfromthedeep/HorrorFromTheDeep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/horrorfromthedeep/HorrorFromTheDeep.java @@ -54,6 +54,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -188,22 +189,22 @@ public void setupConditions() inBasement = new ZoneRequirement(basement); inDagCave = new ZoneRequirement(dagCave); - repairedBridge1 = new VarbitRequirement(36, 1); - repairedBridge2 = new VarbitRequirement(37, 1); - gotKey = new VarbitRequirement(38, 1); + repairedBridge1 = new VarbitRequirement(VarbitID.HORRORBRIDGELEFT, 1); + repairedBridge2 = new VarbitRequirement(VarbitID.HORRORBRIDGERIGHT, 1); + gotKey = new VarbitRequirement(VarbitID.HORRORAGILITYKEY, 1); - usedTar = new VarbitRequirement(46, 1); - usedTinderbox = new VarbitRequirement(48, 1); - usedGlass = new VarbitRequirement(47, 1); + usedTar = new VarbitRequirement(VarbitID.HORRORTAR, 1); + usedTinderbox = new VarbitRequirement(VarbitID.HORRORLIGHT, 1); + usedGlass = new VarbitRequirement(VarbitID.HORRORGLASS, 1); - notUsedAirRune = new Conditions(LogicType.NOR, new VarbitRequirement(43, 1)); - notUsedWaterRune = new Conditions(LogicType.NOR, new VarbitRequirement(41, 1)); - notUsedEarthRune = new Conditions(LogicType.NOR, new VarbitRequirement(42, 1)); - notUsedFireRune = new Conditions(LogicType.NOR, new VarbitRequirement(40, 1)); - notUsedSword = new Conditions(LogicType.NOR, new VarbitRequirement(44, 1)); - notUsedArrow = new Conditions(LogicType.NOR, new VarbitRequirement(45, 1)); + notUsedAirRune = new Conditions(LogicType.NOR, new VarbitRequirement(VarbitID.HORRORAIR, 1)); + notUsedWaterRune = new Conditions(LogicType.NOR, new VarbitRequirement(VarbitID.HORRORWATER, 1)); + notUsedEarthRune = new Conditions(LogicType.NOR, new VarbitRequirement(VarbitID.HORROREARTH, 1)); + notUsedFireRune = new Conditions(LogicType.NOR, new VarbitRequirement(VarbitID.HORRORFIRE, 1)); + notUsedSword = new Conditions(LogicType.NOR, new VarbitRequirement(VarbitID.HORRORSWORD, 1)); + notUsedArrow = new Conditions(LogicType.NOR, new VarbitRequirement(VarbitID.HORRORARROW, 1)); - doorUnlocked = new VarbitRequirement(35, 1); + doorUnlocked = new VarbitRequirement(VarbitID.HORRORDOOR, 1); dagannothNearby = new NpcHintArrowRequirement(NpcID.HORROR_DAGANNOTH_JR4); motherNearby = new NpcHintArrowRequirement(NpcID.HORROR_DAGGANOTH_AIRA, NpcID.HORROR_DAGGANOTH_AIRB, NpcID.HORROR_DAGGANOTH_AIRC, NpcID.HORROR_DAGGANOTH_AIR, NpcID.HORROR_DAGGANOTH_WATER, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/DoorPuzzleStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/DoorPuzzleStep.java index 1584be58e07..dbd7fa79a2b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/DoorPuzzleStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/DoorPuzzleStep.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -89,10 +90,9 @@ public void onGameTick(GameTick event) private void updateSolvedPositionState() { - int START_VARBIT_ID = 420; for (int i = 0; i < 20; i++) { - currentState[i] = (1 + client.getVarbitValue(START_VARBIT_ID + i)) % 2; + currentState[i] = (1 + client.getVarbitValue(VarbitID.ICS_TILE1 + i)) % 2; } if (Arrays.equals(currentState, lastState)) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/IcthlarinsLittleHelper.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/IcthlarinsLittleHelper.java index c94483d0fbc..28a7d5e2312 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/IcthlarinsLittleHelper.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/icthlarinslittlehelper/IcthlarinsLittleHelper.java @@ -255,27 +255,27 @@ protected void setupRequirements() public void setupConditions() { puzzleOpen = new WidgetModelRequirement(147, 3, 6474); - givenToken = new VarbitRequirement(450, 1); + givenToken = new VarbitRequirement(VarbitID.ICS_GIVENSPHINXSTATUE, 1); - hasHetJar = new VarbitRequirement(397, 1); - hasCrondisJar = new VarbitRequirement(397, 4); + hasHetJar = new VarbitRequirement(VarbitID.ICS_LITTLE_JAR_MULTI, 1); + hasCrondisJar = new VarbitRequirement(VarbitID.ICS_LITTLE_JAR_MULTI, 4); // TODO: Verify varbit values for apmeken/scarabas - hasApmekenJar = new VarbitRequirement(397, 3); - hasScarabasJar = new VarbitRequirement(397, 2); + hasApmekenJar = new VarbitRequirement(VarbitID.ICS_LITTLE_JAR_MULTI, 3); + hasScarabasJar = new VarbitRequirement(VarbitID.ICS_LITTLE_JAR_MULTI, 2); killedGuardian = new VarbitRequirement(VarbitID.ICS_LITTLE_VAR, 11, Operation.GREATER_EQUAL); // picked up het, 404 = 1 // picked up apmeken, 405 = 1 - talkedToEmbalmer = new VarbitRequirement(399, 1); + talkedToEmbalmer = new VarbitRequirement(VarbitID.ICS_METEMBALMER, 1); - givenSalt = new VarbitRequirement(401, 1); - givenSap = new VarbitRequirement(402, 1); - givenLinen = new VarbitRequirement(403, 1); - givenEmbalmerAllItems = new VarbitRequirement(400, 7); + givenSalt = new VarbitRequirement(VarbitID.ICS_GOTSALT, 1); + givenSap = new VarbitRequirement(VarbitID.ICS_GOTSAP, 1); + givenLinen = new VarbitRequirement(VarbitID.ICS_GOTLINEN, 1); + givenEmbalmerAllItems = new VarbitRequirement(VarbitID.ICS_LITTLE_EMBALMER_MULTI, 7); - talkedToCarpenter = new VarbitRequirement(412, 1); - givenCarpenterLogs = new VarbitRequirement(398, 1); + talkedToCarpenter = new VarbitRequirement(VarbitID.ICS_METCARPENTER, 1); + givenCarpenterLogs = new VarbitRequirement(VarbitID.ICS_LITTLE_CARPENTER_MULTI, 1); possessedPriestNearby = new NpcCondition(NpcID.ICS_LITTLE_POSSESSEDPRIEST); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/impcatcher/ImpCatcher.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/impcatcher/ImpCatcher.java index cab9996122d..e7673923e48 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/impcatcher/ImpCatcher.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/impcatcher/ImpCatcher.java @@ -40,43 +40,43 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class ImpCatcher extends BasicQuestHelper { - //Items Required - ItemRequirement blackBead, whiteBead, redBead, yellowBead; - - QuestStep moveToTower, climbTower, turnInQuest, collectBeads; - - Zone towerSecond, towerThird; - - ZoneRequirement inTowerSecond, inTowerThird; + // Required items + ItemRequirement blackBead; + ItemRequirement whiteBead; + ItemRequirement redBead; + ItemRequirement yellowBead; + + // Zones + Zone towerSecond; + Zone towerThird; + + // Miscellaneus requirements + ZoneRequirement inTowerSecond; + ZoneRequirement inTowerThird; + + // Steps + QuestStep moveToTower; + QuestStep climbUpF1; + QuestStep turnInQuest; + QuestStep collectBeads; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupSteps(); - - Map steps = new HashMap<>(); - - ConditionalStep doQuest = new ConditionalStep(this, collectBeads); - doQuest.addStep(new Conditions(blackBead,whiteBead,redBead,yellowBead, inTowerThird), turnInQuest); - doQuest.addStep(new Conditions(blackBead,whiteBead,redBead,yellowBead, inTowerSecond), climbTower); - doQuest.addStep(new Conditions(blackBead,whiteBead,redBead,yellowBead), moveToTower); - - steps.put(0, doQuest); - - steps.put(1, doQuest); - - return steps; + towerSecond = new Zone(new WorldPoint(3089, 3176, 1), new WorldPoint(3126, 3146, 1)); + towerThird = new Zone(new WorldPoint(3089, 3176, 2), new WorldPoint(3126, 3146, 2)); } - - @Override - protected void setupRequirements() { + protected void setupRequirements() + { blackBead = new ItemRequirement("Black bead", ItemID.BLACK_BEAD); whiteBead = new ItemRequirement("White bead", ItemID.WHITE_BEAD); redBead = new ItemRequirement("Red bead", ItemID.RED_BEAD); @@ -86,13 +86,16 @@ protected void setupRequirements() { inTowerThird = new ZoneRequirement(towerThird); } - public void setupSteps(){ + public void setupSteps() + { collectBeads = new DetailedQuestStep(this, "Collect one of each bead. You can kill imps for these beads, or buy them on the Grand Exchange.", blackBead, whiteBead, redBead, yellowBead); moveToTower = new ObjectStep(this, ObjectID.FAI_WIZTOWER_SPIRALSTAIRS, new WorldPoint(3103, 3159, 0), "Head to the Wizards' Tower and climb up the staircase with the required beads.", blackBead, whiteBead, redBead, yellowBead); - climbTower = new ObjectStep(this, ObjectID.FAI_WIZTOWER_SPIRALSTAIRS_MIDDLE, new WorldPoint(3103, 3159, 1), - "Climb the staircase again.", blackBead, whiteBead, redBead, yellowBead); + climbUpF1 = new ObjectStep(this, ObjectID.FAI_WIZTOWER_SPIRALSTAIRS_MIDDLE, new WorldPoint(3103, 3159, 1), + "Head to the Wizards' Tower and climb up the staircase with the required beads.", blackBead, whiteBead, redBead, yellowBead); + climbUpF1.addDialogStep("Up"); + moveToTower.addSubSteps(climbUpF1); turnInQuest = new NpcStep(this, NpcID.WIZARD_MIZGOG_QUEST, new WorldPoint(3103, 3163, 2), "Talk to Wizard Mizgog with the required beads to finish the quest.", blackBead, whiteBead, redBead, yellowBead); @@ -100,30 +103,34 @@ public void setupSteps(){ } @Override - protected void setupZones(){ - towerSecond = new Zone(new WorldPoint(3089, 3176, 1), new WorldPoint(3126, 3146, 1)); - towerThird = new Zone(new WorldPoint(3089, 3176, 2), new WorldPoint(3126, 3146, 2)); - } - - @Override - public List getItemRequirements() + public Map loadSteps() { - ArrayList reqs = new ArrayList<>(); - reqs.add(blackBead); - reqs.add(whiteBead); - reqs.add(redBead); - reqs.add(yellowBead); + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + var doQuest = new ConditionalStep(this, collectBeads); + doQuest.addStep(new Conditions(blackBead, whiteBead, redBead, yellowBead, inTowerThird), turnInQuest); + doQuest.addStep(new Conditions(blackBead, whiteBead, redBead, yellowBead, inTowerSecond), climbUpF1); + doQuest.addStep(new Conditions(blackBead, whiteBead, redBead, yellowBead), moveToTower); - return reqs; + steps.put(0, doQuest); + + steps.put(1, doQuest); + + return steps; } @Override - public List getPanels() + public List getItemRequirements() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Bring Mizgog his beads", Arrays.asList(collectBeads, moveToTower, climbTower, turnInQuest), - blackBead, whiteBead, redBead, yellowBead)); - return allSteps; + return List.of( + blackBead, + whiteBead, + redBead, + yellowBead + ); } @Override @@ -135,18 +142,43 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.MAGIC, 875)); + return List.of( + new ExperienceReward(Skill.MAGIC, 875) + ); } @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("An Amulet of Accuracy", ItemID.AMULET_OF_ACCURACY, 1)); + return List.of( + new ItemReward("An Amulet of Accuracy", ItemID.AMULET_OF_ACCURACY, 1) + ); } @Override public List getCombatRequirements() { - return Collections.singletonList("Imps (level 2) if you plan on collecting the beads yourself"); + return List.of( + "Imps (level 2) if you plan on collecting the beads yourself" + ); + } + + @Override + public List getPanels() + { + var steps = new ArrayList(); + + steps.add(new PanelDetails("Bring Mizgog his beads", List.of( + collectBeads, + moveToTower, + turnInQuest + ), List.of( + blackBead, + whiteBead, + redBead, + yellowBead + ))); + + return steps; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/FillBurghCrate.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/FillBurghCrate.java index f97298e4eb5..f672d0ff405 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/FillBurghCrate.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/FillBurghCrate.java @@ -30,6 +30,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -66,9 +67,9 @@ public void onGameTick(GameTick event) protected void updateSteps() { - int numBronzeAxeNeeded = 10 - client.getVarbitValue(1991); - int numSnailOrMackerelNeeded = 10 - client.getVarbitValue(1992); - int numTinderboxNeeded = 3 - client.getVarbitValue(1993); + int numBronzeAxeNeeded = 10 - client.getVarbitValue(VarbitID.BURGH_AXES_CRATE); + int numSnailOrMackerelNeeded = 10 - client.getVarbitValue(VarbitID.BURGH_FOOD_CRATE); + int numTinderboxNeeded = 3 - client.getVarbitValue(VarbitID.BURGH_TINDERBOX_CRATE); tinderbox3.setQuantity(numTinderboxNeeded); bronzeAxe10.setQuantity(numBronzeAxeNeeded); @@ -77,7 +78,7 @@ protected void updateSteps() if (!decidedOnSnailOrMackerel && QuestHelperQuest.IN_AID_OF_THE_MYREQUE.getVar(client) >= 165) { decidedOnSnailOrMackerel = true; - if (client.getVarbitValue(1976) == 1) + if (client.getVarbitValue(VarbitID.BURGH_FOOD_TYPE) == 1) { this.setText("Fill the crate with 3 tinderboxes, 10 bronze axes, and 10 raw mackerel."); rawSnailsOrMackerel.setDisplayItemId(ItemID.RAW_MACKEREL); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/InAidOfTheMyreque.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/InAidOfTheMyreque.java index 20760887288..b1ceddc008a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/InAidOfTheMyreque.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/inaidofthemyreque/InAidOfTheMyreque.java @@ -364,24 +364,24 @@ public void setupConditions() // 1979, Cornelius is banker - filledCrate = new VarbitRequirement(1994, 938); - addedCoal = new VarbitRequirement(1980, 2); - litFurnace = new VarbitRequirement(1980, 3); + filledCrate = new VarbitRequirement(VarbitID.BURGH_CRATE_OVERSEER, 938); + addedCoal = new VarbitRequirement(VarbitID.BURGH_FURNACE_FIX, 2); + litFurnace = new VarbitRequirement(VarbitID.BURGH_FURNACE_FIX, 3); - talkedToGadderanks = new VarbitRequirement(1995, 1); - talkedToJuvinates = new VarbitRequirement(1997, 1); - talkedToWiskit = new VarbitRequirement(1996, 1); + talkedToGadderanks = new VarbitRequirement(VarbitID.GADDERANKS_BLOOD_TITHE_CHAT, 1); + talkedToJuvinates = new VarbitRequirement(VarbitID.JUVE_BLOOD_TITHE_CHAT, 1); + talkedToWiskit = new VarbitRequirement(VarbitID.VILLAGER_BLOOD_TITHE_CHAT, 1); - defeatedGadderanks = new VarbitRequirement(1999, 3); + defeatedGadderanks = new VarbitRequirement(VarbitID.JUVINATE_DEATHS, 3); veliafReturnedToBase = new VarbitRequirement(VarbitID.BLOOD_TITHE_VISIBLE, 3, Operation.GREATER_EQUAL); // 2001 = 1, travelling with ivan // 2003 = 1, Ivan has silver sickle // 2005 0-10 for food - libraryOpen = new VarbitRequirement(1982, 1); + libraryOpen = new VarbitRequirement(VarbitID.BURGH_TEMPLE_TRAPDOOR, 1); - boardsRemoved = new VarbitRequirement(1983, 1); + boardsRemoved = new VarbitRequirement(VarbitID.IVANDIS_TOMB_BOARDS, 1); // 1981 1->2 when talked to Gadderanks diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/FeedingAimeri.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/FeedingAimeri.java index 98e560392b8..1c0266a0171 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/FeedingAimeri.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/FeedingAimeri.java @@ -32,6 +32,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; public class FeedingAimeri extends NpcStep @@ -54,7 +55,7 @@ public void onGameTick(GameTick event) protected void updateSteps() { - int numFoodUsed = client.getVarbitValue(8393); + int numFoodUsed = client.getVarbitValue(VarbitID.HOSDUN_AIMERI_STATUS); food5Highlighted.setQuantity(5 - numFoodUsed); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/InSearchOfKnowledge.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/InSearchOfKnowledge.java index d5fc9a58828..6ac52a1dbd7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/InSearchOfKnowledge.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofknowledge/InSearchOfKnowledge.java @@ -43,6 +43,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -138,11 +139,11 @@ protected void setupZones() public void setupConditions() { inDungeon = new ZoneRequirement(dungeon); - fedAimeri = new VarbitRequirement(8393, 5); + fedAimeri = new VarbitRequirement(VarbitID.HOSDUN_AIMERI_STATUS, 5); - givenSunTome = new VarbitRequirement(8405, 1); - givenMoonTome = new VarbitRequirement(8404, 1); - givenTempleTome = new VarbitRequirement(8406, 1); + givenSunTome = new VarbitRequirement(VarbitID.HOSDUN_SUN_TOME_RETURNED, 1); + givenMoonTome = new VarbitRequirement(VarbitID.HOSDUN_MOON_TOME_RETURNED, 1); + givenTempleTome = new VarbitRequirement(VarbitID.HOSDUN_TEMPLE_TOME_RETURNED, 1); hadTempleTome = new Conditions(true, LogicType.OR, templeTome, @@ -154,9 +155,9 @@ public void setupConditions() sunTome, givenSunTome); - repairedSun = new VarbitRequirement(8399, 4); - repairedMoon = new VarbitRequirement(8400, 4); - repairedTemple = new VarbitRequirement(8401, 4); + repairedSun = new VarbitRequirement(VarbitID.HOSDUN_SUN_PAGES, 4); + repairedMoon = new VarbitRequirement(VarbitID.HOSDUN_MOON_PAGES, 4); + repairedTemple = new VarbitRequirement(VarbitID.HOSDUN_TEMPLE_PAGES, 4); repairedTomes = new Conditions(repairedSun, repairedMoon, repairedTemple); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofthemyreque/InSearchOfTheMyreque.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofthemyreque/InSearchOfTheMyreque.java index d6d3bcade99..2c90f767d9b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofthemyreque/InSearchOfTheMyreque.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/insearchofthemyreque/InSearchOfTheMyreque.java @@ -214,9 +214,9 @@ protected void setupZones() public void setupConditions() { hasEnoughPouch = druidPouch5; - repairedBridge1 = new VarbitRequirement(176, 1); - repairedBridge2 = new VarbitRequirement(177, 1); - repairedBridge3 = new VarbitRequirement(178, 1); + repairedBridge1 = new VarbitRequirement(VarbitID.BRIDGERUNG1, 1); + repairedBridge2 = new VarbitRequirement(VarbitID.BRIDGERUNG2, 1); + repairedBridge3 = new VarbitRequirement(VarbitID.BRIDGERUNG3, 1); onBridge = new ZoneRequirement(bridge); onEntranceIsland = new ZoneRequirement(entranceIsland); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/KingsRansom.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/KingsRansom.java index 765e159a5f7..a6431c945b8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/KingsRansom.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/KingsRansom.java @@ -49,6 +49,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -253,9 +254,9 @@ protected void setupZones() public void setupConditions() { - hasForm = new Conditions(LogicType.OR, addressForm, new VarbitRequirement(3890, 1)); - hasScrapPaper = new Conditions(LogicType.OR, scrapPaper, new VarbitRequirement(3891, 1)); - hasBlackHelm = new Conditions(LogicType.OR, blackHelm, new VarbitRequirement(3892, 1)); + hasForm = new Conditions(LogicType.OR, addressForm, new VarbitRequirement(VarbitID.KR_CLUE_FORM, 1)); + hasScrapPaper = new Conditions(LogicType.OR, scrapPaper, new VarbitRequirement(VarbitID.KR_CLUE_NOTE, 1)); + hasBlackHelm = new Conditions(LogicType.OR, blackHelm, new VarbitRequirement(VarbitID.KR_CLUE_ARMOUR, 1)); inUpstairsManor = new ZoneRequirement(upstairsManor); inDownstairsManor = new ZoneRequirement(downstairsManor, downstairsManor2); inTrialRoom = new ZoneRequirement(trialRoom); @@ -267,14 +268,14 @@ public void setupConditions() inSecretRoom = new ZoneRequirement(secretRoomFloor0); inFortressEntrance = new ZoneRequirement(mainEntrance1, mainEntrance2, mainEntrance3, mainEntrance4); - handlerInRoom = new VarbitRequirement(3907, 2); - butlerInRoom = new VarbitRequirement(3907, 3); - maidInRoom = new VarbitRequirement(3907, 5); + handlerInRoom = new VarbitRequirement(VarbitID.KR_COURT_WITNESS, 2); + butlerInRoom = new VarbitRequirement(VarbitID.KR_COURT_WITNESS, 3); + maidInRoom = new VarbitRequirement(VarbitID.KR_COURT_WITNESS, 5); - askedAboutThread = new VarbitRequirement(3900, 1); - askedAboutPoison = new VarbitRequirement(3912, 1); - askedAboutDagger = new VarbitRequirement(3913, 1); - askedAboutNight = new VarbitRequirement(3915, 1); + askedAboutThread = new VarbitRequirement(VarbitID.KR_COURT_THREAD, 1); + askedAboutPoison = new VarbitRequirement(VarbitID.KR_COURT_DOG_PROOF, 1); + askedAboutDagger = new VarbitRequirement(VarbitID.KR_COURT_BUTL_PROOF, 1); + askedAboutNight = new VarbitRequirement(VarbitID.KR_COURT_MAID_PROOF, 1); inPuzzle = new WidgetModelRequirement(588, 1, 27214); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/LockpickPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/LockpickPuzzle.java index db29cd8ff5f..43d813205ac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/LockpickPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/kingsransom/LockpickPuzzle.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -36,10 +37,19 @@ public class LockpickPuzzle extends QuestStep { - int[] TUMBLER_ANSWERS = new int[]{3894, 3895, 3896, 3897}; + int[] TUMBLER_ANSWERS = new int[]{ + VarbitID.KR_TUMB1_ANS, + VarbitID.KR_TUMB2_ANS, + VarbitID.KR_TUMB3_ANS, + VarbitID.KR_TUMB4_ANS + }; int[] TUMBLER_WIDGETS = new int[]{20, 21, 22, 23}; - int[] TUMBLER_CURRENT = new int[]{3901, 3902, 3903, 3904}; - int CURRENT_TUMBLER = 3905; + int[] TUMBLER_CURRENT = new int[]{ + VarbitID.KR_TUMB1_CURR_POS, + VarbitID.KR_TUMB2_CURR_POS, + VarbitID.KR_TUMB3_CURR_POS, + VarbitID.KR_TUMB4_CURR_POS + }; int UP_WIDGET = 12; int DOWN_WIDGET = 13; int TRY_LOCK = 14; @@ -105,7 +115,7 @@ private void updateSolvedPositionState() private void updateWidget(int widgetID, int currentVal, int answer) { - int currentTumbler = client.getVarbitValue(CURRENT_TUMBLER); + int currentTumbler = client.getVarbitValue(VarbitID.KR_TUMB_CURRENT); if (currentTumbler != widgetID + 1) { highlightChildID = TUMBLER_WIDGETS[widgetID]; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/landofthegoblins/LandOfTheGoblins.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/landofthegoblins/LandOfTheGoblins.java index 524b783390e..593527e1125 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/landofthegoblins/LandOfTheGoblins.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/landofthegoblins/LandOfTheGoblins.java @@ -52,6 +52,7 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.client.plugins.microbot.questhelper.steps.choice.DialogChoiceStep; import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; @@ -134,7 +135,7 @@ public Map loadSteps() becomeGoblin.addStep(new Conditions(inFrontOfGuardsWithGoblinPotion, blackMushroom), makeBlackDye); becomeGoblin.addStep(inFrontOfGuardsWithGoblinPotion, pickBlackMushrooms); becomeGoblin.addStep(inGoblinCaveWithGoblinPotion, goToGuards); - becomeGoblin.addStep(goblinPotion.alsoCheckBank(questBank), goBackToGoblinCave); + becomeGoblin.addStep(goblinPotion.alsoCheckBank(), goBackToGoblinCave); becomeGoblin.addStep(pharmakosBerryHighlight, mixGoblinPotion); steps.put(16, becomeGoblin); @@ -333,13 +334,13 @@ protected void setupRequirements() inGoblinCaveWithZanik = new Conditions(LogicType.AND, inGoblinCave, zanikFollowing); unlockedDoor = new VarbitRequirement(QuestHelperQuest.LAND_OF_THE_GOBLINS.getId(), 36, Operation.GREATER_EQUAL); - saragorgakKey = new ItemRequirement("Saragorgak key", ItemID.LOTG_KEY_WHITE).alsoCheckBank(questBank); - yurkolgokhKey = new ItemRequirement("Yurkolgokh key", ItemID.LOTG_KEY_YELLOW).alsoCheckBank(questBank); - ekeleshuunKey = new ItemRequirement("Ekeleshuun key", ItemID.LOTG_KEY_BLUE).alsoCheckBank(questBank); - nargoshuunKey = new ItemRequirement("Narogoshuun key", ItemID.LOTG_KEY_ORANGE).alsoCheckBank(questBank); - horogothgarKey = new ItemRequirement("Horogothgar key", ItemID.LOTG_KEY_PURPLE).alsoCheckBank(questBank); + saragorgakKey = new ItemRequirement("Saragorgak key", ItemID.LOTG_KEY_WHITE).alsoCheckBank(); + yurkolgokhKey = new ItemRequirement("Yurkolgokh key", ItemID.LOTG_KEY_YELLOW).alsoCheckBank(); + ekeleshuunKey = new ItemRequirement("Ekeleshuun key", ItemID.LOTG_KEY_BLUE).alsoCheckBank(); + nargoshuunKey = new ItemRequirement("Narogoshuun key", ItemID.LOTG_KEY_ORANGE).alsoCheckBank(); + horogothgarKey = new ItemRequirement("Horogothgar key", ItemID.LOTG_KEY_PURPLE).alsoCheckBank(); - huzamogaarbKey = new ItemRequirement("Huzamogaarb key", ItemID.LOTG_KEY_BLACK).alsoCheckBank(questBank); + huzamogaarbKey = new ItemRequirement("Huzamogaarb key", ItemID.LOTG_KEY_BLACK).alsoCheckBank(); // ItemRequirements lightSource = new ItemRequirement("Light source", ItemCollections.LIGHT_SOURCES); @@ -384,11 +385,11 @@ protected void setupRequirements() pharmakosBerryHighlight.setHighlightInInventory(true); toadflaxUnfHighlight = new ItemRequirement("Toadflax potion (unf)", ItemID.TOADFLAXVIAL); toadflaxUnfHighlight.setHighlightInInventory(true); - goblinPotion = new ItemRequirement("Goblin potion", Arrays.asList(ItemID.LOTG_1DOSEGOBLIN, ItemID.LOTG_2DOSEGOBLIN, ItemID.LOTG_3DOSEGOBLIN)); + goblinPotion = new ItemRequirement("Goblin potion", Arrays.asList(ItemID.LOTG_1DOSEGOBLIN, ItemID.LOTG_2DOSEGOBLIN, ItemID.LOTG_3DOSEGOBLIN, ItemID.LOTG_4DOSEGOBLIN)); goblinPotion.setTooltip("You can make another with a toadflax potion (unf) and some pharmakos berries from the bush outside the Makeover Mage's house"); inGoblinCaveWithGoblinPotion = new Conditions(LogicType.AND, inGoblinCave, goblinPotion); inFrontOfGuardsWithGoblinPotion = new Conditions(LogicType.AND, new ZoneRequirement(guardArea), goblinPotion); - goblinPotionHighlight = new ItemRequirement("Goblin potion", Arrays.asList(ItemID.LOTG_1DOSEGOBLIN, ItemID.LOTG_2DOSEGOBLIN, ItemID.LOTG_3DOSEGOBLIN)); + goblinPotionHighlight = new ItemRequirement("Goblin potion", Arrays.asList(ItemID.LOTG_1DOSEGOBLIN, ItemID.LOTG_2DOSEGOBLIN, ItemID.LOTG_3DOSEGOBLIN, ItemID.LOTG_4DOSEGOBLIN)); goblinPotionHighlight.setHighlightInInventory(true); goblinSelectionActive = new WidgetPresenceRequirement(InterfaceID.LotgMakeover.CONFIRM); hasBlackMushroomsOrDye = new Conditions(LogicType.OR, blackMushroom, blackDye); @@ -506,12 +507,15 @@ public void setupSteps() talkToZanikInCell = new NpcStep(this, NpcID.LOTG_ZANIK, new WorldPoint(3751, 4343, 0), "Talk to Zanik in the cell.", dorgeshKaanSphere); leaveNorthEastRoom = new NpcStep(this, NpcID.LOTG_GOBLIN_GUARD_BLACK, new WorldPoint(3753, 4329, 0), "Pass by the guard to leave the northeastern room."); talkToPriestInTemple = new NpcStep(this, NpcID.LOTG_GOBLIN_HIGH_PRIEST, new WorldPoint(3744, 4328, 0), "Talk to High Priest Bighead. When prompted, answer in this order: True, False, False."); - talkToPriestInTemple.addDialogConsideringLastLineCondition("True or false: Those who do not believe in Big High War God, whether they goblins or other races, must die.", - "True."); - talkToPriestInTemple.addDialogConsideringLastLineCondition("Second question. True or false: Big High War God chose goblins to be his race because goblins mighty warriors.", - "False."); - talkToPriestInTemple.addDialogConsideringLastLineCondition("Third question. True or false: Goblin leaders should be good at planning in order to win battles.", - "False."); + var q1 = new DialogChoiceStep(config, "True."); + q1.setExpectedPreviousLine("True or false: Those who do not believe in Big High War God, whether they goblins or other races, must die."); + talkToPriestInTemple.addDialogStep(q1); + var q2 = new DialogChoiceStep(config, "False."); + q2.setExpectedPreviousLine("Second question. True or false: Big High War God chose goblins to be his race because goblins mighty warriors."); + talkToPriestInTemple.addDialogStep(q2); + var q3 = new DialogChoiceStep(config, "False."); + q3.setExpectedPreviousLine("Third question. True or false: Goblin leaders should be good at planning in order to win battles."); + talkToPriestInTemple.addDialogStep(q3); talkToPriestInTemple.addDialogStep("Yes."); talkToPriestInTemple.addDialogStep("I understand Big High War God."); talkToPriestInTemple.addDialogStep("Big High War God commands it."); @@ -547,7 +551,7 @@ public void setupSteps() talkToAggieWithFish = new NpcStep(this, NpcID.AGGIE, new WorldPoint(3086, 3258, 0), "Bring the whitefish and black goblin mail to Aggie.", coins, hemensterWhitefish, blackGoblinMail); ((NpcStep) talkToAggieWithFish).addAlternateNpcs(NpcID.AGGIE_1OP); ((NpcStep) talkToAggieWithFish).addTeleport(draynorTeleport.quantity(1).named("Amulet of glory (Draynor Village [3])")); - talkToAggieWithFish.addDialogSteps("Draynor Village", "Can you make dyes for me please?", "Could you remove the dye from this goblin mail?"); + talkToAggieWithFish.addDialogSteps("Draynor Village", "Can you make dyes for me, please?", "Could you remove the dye from this goblin mail?"); goToTempleWithDyes = new ObjectStep(this, ObjectID.MCANNONCAVE, new WorldPoint(2624, 3393, 0), "", whiteGoblinMail, goblinPotion, huzamogaarbKey, yellowDye, blueDye, orangeDye, purpleDye, noEquippedItems, combatGear); ((ObjectStep) goToTempleWithDyes).addTeleport(skillsNecklace.quantity(1).named("Skills necklace (Fishing Guild [1])")); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/legendsquest/LegendsQuest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/legendsquest/LegendsQuest.java index 29bd4cbfdc5..8bfca9074e2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/legendsquest/LegendsQuest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/legendsquest/LegendsQuest.java @@ -208,22 +208,22 @@ public Map loadSteps() gemPuzzle.addStep(new Conditions(sapphirePlaced, diamondPlaced, rubyPlaced), useTopaz); gemPuzzle.addStep(new Conditions(sapphirePlaced, diamondPlaced), useRuby); gemPuzzle.addStep(new Conditions(sapphirePlaced), useDiamond); - gemPuzzle.setLockingCondition(bindingBook.alsoCheckBank(questBank)); + gemPuzzle.setLockingCondition(bindingBook.alsoCheckBank()); gemPuzzle.setBlocker(true); blessBowl = new ConditionalStep(this, makeBowl); - blessBowl.addStep(new Conditions(inKharazi, goldBowlBlessed.alsoCheckBank(questBank), reed), useReedOnPool); - blessBowl.addStep(new Conditions(inKharazi, goldBowlBlessed.alsoCheckBank(questBank)), useMacheteOnReeds); - blessBowl.addStep(new Conditions(inKharazi, goldBowl.alsoCheckBank(questBank), gujuoNearby), talkToGujuoWithBowl); - blessBowl.addStep(new Conditions(inKharazi, goldBowl.alsoCheckBank(questBank)), spinBullToBless); - blessBowl.addStep(goldBowl.alsoCheckBank(questBank), enterJungleWithBowl); + blessBowl.addStep(new Conditions(inKharazi, goldBowlBlessed.alsoCheckBank(), reed), useReedOnPool); + blessBowl.addStep(new Conditions(inKharazi, goldBowlBlessed.alsoCheckBank()), useMacheteOnReeds); + blessBowl.addStep(new Conditions(inKharazi, goldBowl.alsoCheckBank(), gujuoNearby), talkToGujuoWithBowl); + blessBowl.addStep(new Conditions(inKharazi, goldBowl.alsoCheckBank()), spinBullToBless); + blessBowl.addStep(goldBowl.alsoCheckBank(), enterJungleWithBowl); ConditionalStep solvingCaves = new ConditionalStep(this, enterJungleWithRoarer); solvingCaves.addStep(new Conditions(inFire, nezNearby), fightNezikchenedInFire); - solvingCaves.addStep(new Conditions(inFire, bindingBook.alsoCheckBank(questBank)), useBindingBookOnUngadulu); - solvingCaves.addStep(new Conditions(inCaves, bindingBook.alsoCheckBank(questBank), goldBowlFull), useBowlOnFireWall); - solvingCaves.addStep(new Conditions(bindingBook.alsoCheckBank(questBank), goldBowlFull), enterMossyRockWithBowl); - solvingCaves.addStep(bindingBook.alsoCheckBank(questBank), blessBowl); + solvingCaves.addStep(new Conditions(inFire, bindingBook.alsoCheckBank()), useBindingBookOnUngadulu); + solvingCaves.addStep(new Conditions(inCaves, bindingBook.alsoCheckBank(), goldBowlFull), useBowlOnFireWall); + solvingCaves.addStep(new Conditions(bindingBook.alsoCheckBank(), goldBowlFull), enterMossyRockWithBowl); + solvingCaves.addStep(bindingBook.alsoCheckBank(), blessBowl); solvingCaves.addStep(inCaveRoom5, gemPuzzle); solvingCaves.addStep(hadSketch, runePuzzle); solvingCaves.addStep(new Conditions(inKharazi, gujuoNearby), talkToGujuoAgain); @@ -264,7 +264,7 @@ public Map loadSteps() reachingTheDeeperCaves.addStep(inCaveRoom2, enterGate1ToSource); reachingTheDeeperCaves.addStep(new Conditions(inCaveRoom1, braveryPotion), enterBookcaseToSource); reachingTheDeeperCaves.addStep(new Conditions(inKharazi, braveryPotion), enterMossyRockToSource); - reachingTheDeeperCaves.addStep(braveryPotion.alsoCheckBank(questBank), enterJungleToGoToSource); + reachingTheDeeperCaves.addStep(braveryPotion.alsoCheckBank(), enterJungleToGoToSource); reachingTheDeeperCaves.addStep(snakeMixture, addArdrigalToSnake); reachingTheDeeperCaves.addStep(ardrigalMixture, addSnake); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/BringLunarItems.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/BringLunarItems.java index 98e6720e33f..82c65aafe3c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/BringLunarItems.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/BringLunarItems.java @@ -9,6 +9,7 @@ import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; public class BringLunarItems extends NpcStep { @@ -41,14 +42,14 @@ public void setupConditions() sealOfPassage = new ItemRequirement("Seal of passage", ItemID.LUNAR_SEAL_OF_PASSAGE); sealOfPassage.setTooltip("You can get another from Brundt"); - handedInHelm = new VarbitRequirement(2436, 1); - handedInCape = new VarbitRequirement(2437, 1); - handedInAmulet = new VarbitRequirement(2438, 1); - handedInTorso = new VarbitRequirement(2439, 1); - handedInGloves = new VarbitRequirement(2441, 1); - handedInBoots = new VarbitRequirement(2440, 1); - handedInLegs = new VarbitRequirement(2442, 1); - handedInRing = new VarbitRequirement(2443, 1); + handedInHelm = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_HELM, 1); + handedInCape = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_CAPE, 1); + handedInAmulet = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_AMULET, 1); + handedInTorso = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_TORSO, 1); + handedInGloves = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_BOOTS, 1); + handedInBoots = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_GLOVES, 1); + handedInLegs = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_TROUSERS, 1); + handedInRing = new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_RING, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/LunarDiplomacy.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/LunarDiplomacy.java index ac4bbbcb561..e32115ed2b0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/LunarDiplomacy.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/LunarDiplomacy.java @@ -498,31 +498,31 @@ public void setupConditions() inFightArena = new ZoneRequirement(fightArena); - revealedPillar = new VarbitRequirement(2431, 2); - revealedCannon = new VarbitRequirement(2432, 2); - revealedCrate = new VarbitRequirement(2433, 2); - revealedChart = new VarbitRequirement(2434, 2); - revealedChest = new VarbitRequirement(2435, 2); + revealedPillar = new VarbitRequirement(VarbitID.LUNAR_QUEST_SYMBOLPRES1, 2); + revealedCannon = new VarbitRequirement(VarbitID.LUNAR_QUEST_SYMBOLPRES2, 2); + revealedCrate = new VarbitRequirement(VarbitID.LUNAR_QUEST_SYMBOLPRES3, 2); + revealedChart = new VarbitRequirement(VarbitID.LUNAR_QUEST_SYMBOLPRES4, 2); + revealedChest = new VarbitRequirement(VarbitID.LUNAR_QUEST_SYMBOLPRES5, 2); toothNearby = new ItemOnTileRequirement(suqahTooth); - talkedToSelene = new VarbitRequirement(2445, 1); - talkedToMeteora = new VarbitRequirement(2446, 1); - talkedToRimae = new VarbitRequirement(2447, 1); + talkedToSelene = new VarbitRequirement(VarbitID.LUNAR_MONK_RING_INTRO, 1); + talkedToMeteora = new VarbitRequirement(VarbitID.LUNAR_MONK_AMULET_INTRO, 1); + talkedToRimae = new VarbitRequirement(VarbitID.LUNAR_MONK_TANCLOTHES_INTRO, 1); tiaraNearby = new ItemOnTileRequirement(tiara); - hadHelm = new Conditions(LogicType.OR, helm.alsoCheckBank(questBank), new VarbitRequirement(2436, 1)); - hadCape = new Conditions(LogicType.OR, cape.alsoCheckBank(questBank), new VarbitRequirement(2437, 1)); - hadAmulet = new Conditions(LogicType.OR, amulet.alsoCheckBank(questBank), new VarbitRequirement(2438, 1)); - hadTorso = new Conditions(LogicType.OR, torso.alsoCheckBank(questBank), new VarbitRequirement(2439, 1)); - hadGloves = new Conditions(LogicType.OR, gloves.alsoCheckBank(questBank), new VarbitRequirement(2441, 1)); - hadBoots = new Conditions(LogicType.OR, boots.alsoCheckBank(questBank), new VarbitRequirement(2440, 1)); - hadLegs = new Conditions(LogicType.OR, legs.alsoCheckBank(questBank), new VarbitRequirement(2442, 1)); - hadRing = new Conditions(LogicType.OR, ring.alsoCheckBank(questBank), new VarbitRequirement(2443, 1)); + hadHelm = new Conditions(LogicType.OR, helm.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_HELM, 1)); + hadCape = new Conditions(LogicType.OR, cape.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_CAPE, 1)); + hadAmulet = new Conditions(LogicType.OR, amulet.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_AMULET, 1)); + hadTorso = new Conditions(LogicType.OR, torso.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_TORSO, 1)); + hadGloves = new Conditions(LogicType.OR, gloves.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_BOOTS, 1)); + hadBoots = new Conditions(LogicType.OR, boots.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_GLOVES, 1)); + hadLegs = new Conditions(LogicType.OR, legs.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_TROUSERS, 1)); + hadRing = new Conditions(LogicType.OR, ring.alsoCheckBank(), new VarbitRequirement(VarbitID.LUNAR_PT2_ONEIRO_GIVEN_RING, 1)); hadClothes = new Conditions(hadBoots, hadTorso, hadGloves, hadLegs); - litBrazier = new VarbitRequirement(2430, 1); + litBrazier = new VarbitRequirement(VarbitID.LUNAR_BRAZIER_LIT, 1); inCentreOfDream = new ZoneRequirement(centreOfDream); inChanceDream = new ZoneRequirement(chanceDream); @@ -532,12 +532,12 @@ public void setupConditions() inRaceDream = new ZoneRequirement(raceDream); inMimicDream = new ZoneRequirement(mimicDream); - doingTreeChallenge = new VarbitRequirement(3184, 1); - startedRaceChallenge = new VarbitRequirement(2424, 1); + doingTreeChallenge = new VarbitRequirement(VarbitID.LUNAR_TREE_PLAYING, 1); + startedRaceChallenge = new VarbitRequirement(VarbitID.LUNAR_SKILL_INTRO, 1); - startedNumberChallenge = new VarbitRequirement(2416, 1); + startedNumberChallenge = new VarbitRequirement(VarbitID.LUNAR_NUM_INTRO, 1); - needToTalkAtMiddle = new VarbitRequirement(2429, 1); + needToTalkAtMiddle = new VarbitRequirement(VarbitID.LUNAR_SPOKEN_CENTRE, 1); finishedMimic = new VarbitRequirement(VarbitID.LUNAR_EMOTE_PROG, 5, Operation.GREATER_EQUAL); finishedNumbers = new VarbitRequirement(VarbitID.LUNAR_NUM_PROG, 6, Operation.GREATER_EQUAL); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MemoryChallenge.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MemoryChallenge.java index ec2d58d6302..e892a8ac91b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MemoryChallenge.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MemoryChallenge.java @@ -26,10 +26,11 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.ArrayList; @@ -70,7 +71,7 @@ public void onVarbitChanged(VarbitChanged varbitChanged) @Subscribe public void onGameTick(GameTick event) { - if (wps.size() == 0) + if (wps.isEmpty()) { return; } @@ -81,7 +82,7 @@ public void onGameTick(GameTick event) } // If start of path, check first point in legit path - if (currentPath.size() == 0) + if (currentPath.isEmpty()) { checkNextTile(0); return; @@ -104,15 +105,11 @@ public void onGameTick(GameTick event) public void checkNextTile(int wpsPos) { - WorldPoint instanceWp = QuestPerspective.getInstanceWorldPointFromReal(client, wps.get(wpsPos)); - if (instanceWp == null) - { - return; - } - + var definedPoint = DefinedPoint.of(wps.get(wpsPos)); // If on same tiles as wpsPos if (client.getLocalPlayer() != null && - client.getLocalPlayer().getWorldLocation().distanceTo(instanceWp) == 0) + definedPoint != null && + definedPoint.distanceTo(client, client.getLocalPlayer().getLocalLocation()) == 0) { currentPath.add(wps.get(wpsPos)); lastPos = wpsPos; @@ -122,10 +119,10 @@ public void checkNextTile(int wpsPos) private void setupPaths() { - int current1 = client.getVarbitValue(2412); - int current2 = client.getVarbitValue(2413); - int current3 = client.getVarbitValue(2414); - int current4 = client.getVarbitValue(2415); + int current1 = client.getVarbitValue(VarbitID.LUNAR_FLOOR_COL_A); + int current2 = client.getVarbitValue(VarbitID.LUNAR_FLOOR_COL_B); + int current3 = client.getVarbitValue(VarbitID.LUNAR_FLOOR_COL_C); + int current4 = client.getVarbitValue(VarbitID.LUNAR_FLOOR_COL_D); if (current1 == column1 && current2 == column2 && diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MimicChallenge.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MimicChallenge.java index 2229a4f0237..c6545aa5e50 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MimicChallenge.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/MimicChallenge.java @@ -30,6 +30,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import java.util.Arrays; import java.util.Collection; @@ -65,13 +66,13 @@ public void onVarbitChanged(VarbitChanged varbitChanged) @Override protected void updateSteps() { - if (client.getVarbitValue(2419) == 0) + if (client.getVarbitValue(VarbitID.LUNAR_EMOTE_CANMIMIC) == 0) { startUpStep(talk); return; } - switch (client.getVarbitValue(2420)) + switch (client.getVarbitValue(VarbitID.LUNAR_EMOTE_LOC)) { case 1: startUpStep(cry); @@ -96,7 +97,7 @@ protected void updateSteps() public void chooseStepBasedOnIfTalked(QuestStep emoteStep) { - if (client.getVarbitValue(2419) == 1) + if (client.getVarbitValue(VarbitID.LUNAR_EMOTE_CANMIMIC) == 1) { startUpStep(emoteStep); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/NumberChallenge.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/NumberChallenge.java index f03a56be50c..68750355f85 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/NumberChallenge.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/lunardiplomacy/NumberChallenge.java @@ -8,6 +8,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.Arrays; import java.util.Collection; @@ -60,7 +61,7 @@ public void onVarbitChanged(VarbitChanged varbitChanged) @Override protected void updateSteps() { - switch (client.getVarbitValue(2417)) + switch (client.getVarbitValue(VarbitID.LUNAR_NUM_CURSEQ)) { case 0: setupStepFromState(press7, press9); @@ -114,7 +115,7 @@ protected void updateSteps() private void setupStepFromState(QuestStep choice1, QuestStep choice2) { - if (client.getVarbitValue(2421) == 0) + if (client.getVarbitValue(VarbitID.LUNAR_PT3_NUM_SEQ_N) == 0) { startUpStep(choice1); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makingfriendswithmyarm/MakingFriendsWithMyArm.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makingfriendswithmyarm/MakingFriendsWithMyArm.java index 54df5d1c38d..27ec86a5990 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makingfriendswithmyarm/MakingFriendsWithMyArm.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makingfriendswithmyarm/MakingFriendsWithMyArm.java @@ -400,7 +400,7 @@ public void setupConditions() // 2098 200 -> 205 (SWAN SONG???) when WOM dies - pickedUpWom = new VarbitRequirement(6536, 0); + pickedUpWom = new VarbitRequirement(VarbitID.MY2ARM_CLIENT_COFFIN, 0); oddMushroomDied = new VarbitRequirement(VarbitID.MY2ARM_STATUS, 150, Operation.GREATER_EQUAL); defeatedBoss1 = new VarbitRequirement(VarbitID.MY2ARM_STATUS, 160, Operation.GREATER_EQUAL); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makinghistory/MakingHistory.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makinghistory/MakingHistory.java index a1296cd9ee8..2cb99b031cd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makinghistory/MakingHistory.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/makinghistory/MakingHistory.java @@ -183,18 +183,18 @@ protected void setupZones() public void setupConditions() { - talkedtoBlanin = new Conditions(LogicType.OR, new VarbitRequirement(1385, 1), new VarbitRequirement(1385, 2)); + talkedtoBlanin = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.MAKINGHISTORY_WARR_PROG, 1), new VarbitRequirement(VarbitID.MAKINGHISTORY_WARR_PROG, 2)); talkedToDron = new VarbitRequirement(VarbitID.MAKINGHISTORY_WARR_PROG, 3, Operation.GREATER_EQUAL); - talkedToDroalak = new Conditions(LogicType.OR, new VarbitRequirement(1386, 2), new VarbitRequirement(1386, 1)); - talkedToMelina = new Conditions(LogicType.OR, new VarbitRequirement(1386, 4), new VarbitRequirement(1386, 3)); - gotScroll = new VarbitRequirement(1386, 5); - handedInScroll = new VarbitRequirement(1386, 6); + talkedToDroalak = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.MAKINGHISTORY_GHOST_PROG, 2), new VarbitRequirement(VarbitID.MAKINGHISTORY_GHOST_PROG, 1)); + talkedToMelina = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.MAKINGHISTORY_GHOST_PROG, 4), new VarbitRequirement(VarbitID.MAKINGHISTORY_GHOST_PROG, 3)); + gotScroll = new VarbitRequirement(VarbitID.MAKINGHISTORY_GHOST_PROG, 5); + handedInScroll = new VarbitRequirement(VarbitID.MAKINGHISTORY_GHOST_PROG, 6); inCastle = new ZoneRequirement(castle); gotKey = new VarbitRequirement(VarbitID.MAKINGHISTORY_TRADER_PROG, 1, Operation.GREATER_EQUAL); gotChest = new VarbitRequirement(VarbitID.MAKINGHISTORY_TRADER_PROG, 2, Operation.GREATER_EQUAL); - handedInJournal = new VarbitRequirement(1384, 4); + handedInJournal = new VarbitRequirement(VarbitID.MAKINGHISTORY_TRADER_PROG, 4); handedInEverything = new Conditions(handedInJournal, handedInScroll, talkedToDron); finishedFrem = talkedToDron; finishedGhost = new Conditions(LogicType.OR, handedInScroll, gotScroll); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/meatandgreet/MeatAndGreet.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/meatandgreet/MeatAndGreet.java index 8b5b172095a..f0a540c7b98 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/meatandgreet/MeatAndGreet.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/meatandgreet/MeatAndGreet.java @@ -218,7 +218,7 @@ public void setupSteps() // enterWolfDenAndKillTheDireWolfAlpha killDireWolfAlpha = new NpcStep(this, NpcID.MAG_DIREWOLF, "Kill the Dire Wolf Alpha. Use Protect from Melee to avoid most damage. His pups deal ranged damage.", combatGear, food); // killed wolf: 11184 2->3 - var needToKillWolf = new VarbitRequirement(11184, 2); + var needToKillWolf = new VarbitRequirement(VarbitID.MAG_MEAT, 2); var exitWolfDen = new ObjectStep(this, ObjectID.DIREWOLF_CAVE_EXIT_INSTANCE, new WorldPoint(1488, 9502, 1), "Exit the wolf den, then head back to Alba in the farmhouse west of Civitas illa Fortis."); // 13092 0->100 // 13093 0->100 @@ -226,7 +226,7 @@ public void setupSteps() // 13095 0->100 returnToAlba = new NpcStep(this, NpcID.MAG_ALBA, new WorldPoint(1587, 3126, 0), "Return to Alba in the farmhouse west of Civitas illa Fortis to tell them about the Dire Wolf Alpha's demise."); returnToAlba.addSubSteps(exitWolfDen); - var needToReturnToAlba = new VarbitRequirement(11184, 3); + var needToReturnToAlba = new VarbitRequirement(VarbitID.MAG_MEAT, 3); // 11184 3->4 after returning to alba solveSupplyChainIssues = new ConditionalStep(this, returnToAlba); solveSupplyChainIssues.addStep(pinPadOpen, enterCodeWrapper); @@ -309,9 +309,9 @@ public void setupSteps() "Adjust number of spice portions to:" ); var meatCorrect = new VarbitRequirement(VarbitID.MAG_PORTIONS_MEAT, 4, Operation.EQUAL); - var saladCorrect = new VarbitRequirement(11186, 2); - var spiceCorrect = new VarbitRequirement(11187, 1); - var sauceCorrect = new VarbitRequirement(11188, 3); + var saladCorrect = new VarbitRequirement(VarbitID.MAG_PORTIONS_SALAD, 2); + var spiceCorrect = new VarbitRequirement(VarbitID.MAG_PORTIONS_SPICE, 1); + var sauceCorrect = new VarbitRequirement(VarbitID.MAG_PORTIONS_SAUCE, 3); var recipeStep = new ConditionalStep(this, adjustRecipe, "Configure the kebab recipe with Emelio."); // 11189 0->1 = received test kebab var giveExperimentalKebabToRenata = new NpcStep(this, NpcID.MAG_RENATA_VIS, new WorldPoint(1750, 3072, 0), "Talk to Renata to have them test your test kebab.", experimentalKebab); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/merlinscrystal/MerlinsCrystal.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/merlinscrystal/MerlinsCrystal.java index ad4e5579fde..44595dcca7b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/merlinscrystal/MerlinsCrystal.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/merlinscrystal/MerlinsCrystal.java @@ -27,7 +27,6 @@ import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankSlotIcons; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ObjectCondition; @@ -45,94 +44,122 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; public class MerlinsCrystal extends BasicQuestHelper { - //Items Required - ItemRequirement bread, tinderbox, bucketOfWax, batBones, combatGear, bucket, repellent, blackCandle, - litBlackCandle, excalibur, batBonesOptional, bucketOfWaxOptional, equippedExcalibur; - - //Items Recommended - ItemRequirement varrockTeleport, camelotTeleport, twoFaladorTeleports; - - Requirement inFaye, inFayeGround, inFaye1, inFaye2, inCamelot1, inCamelot2, morganNearby, clearedHive, - hasAnyBlackCandle, beggarNearby, talkedToLady, hasReadSpell, inCamelot, inStar, thrantaxNearby, inCamelotTower1, inCamelotTower2; - - QuestStep startQuest, talkToGawain, goUpstairsInCamelot, talkToLancelot, goBackDownStairsCamelot, hideInArheinCrate, goToFirstFloor, goToSecondFloor, - attackMordred, talkToMorgan, goToCatherbyAfterFortress, optionalGetRepellent, optionalGetBucket, optionalUseRepellent, talkToCandleMaker, talkToLadyOfLake, - enterSarimShopAndTalk, talkToBeggar, goReadMagicWords, returnToCamelot, returnToCamelotLit, goStandInStar, lightCandle, dropBatBones, sayWords, - goUpLadder1Camelot, goUpLadder2Camelot, smashCrystal, goDownLadder1Camelot, goDownLadder2Camelot, finishQuest; - - ConditionalStep getBlackCandle, getExcalibur; - - //Zones - Zone fayeGround, faye1, faye2, camelotGround1, camelotGround2, camelotGround3, camelot1, camelot2, star, camelotTower1, camelotTower2; + // Required items + ItemRequirement bread; + ItemRequirement tinderbox; + ItemRequirement bucketOfWax; + ItemRequirement batBones; + ItemRequirement combatGear; + + // Recommended items + ItemRequirement varrockTeleport; + ItemRequirement camelotTeleport; + ItemRequirement twoFaladorTeleports; + + // Mid-quest item requirements + ItemRequirement bucket; + ItemRequirement repellent; + ItemRequirement blackCandle; + ItemRequirement litBlackCandle; + ItemRequirement anyBlackCandle; + ItemRequirement excalibur; + ItemRequirement excaliburEquipped; + + // Zones + Zone fayeGround; + Zone faye1; + Zone faye2; + Zone camelotGround1; + Zone camelotGround2; + Zone camelotGround3; + Zone camelot1; + Zone camelot2; + Zone star; + Zone camelotTower1; + Zone camelotTower2; + + // Miscellaneous requirements + ZoneRequirement inFaye; + ZoneRequirement inFayeGround; + ZoneRequirement inFaye1; + ZoneRequirement inFaye2; + ZoneRequirement inCamelot1; + ZoneRequirement inCamelot2; + ZoneRequirement inCamelot; + ZoneRequirement inStar; + ZoneRequirement inCamelotTower1; + ZoneRequirement inCamelotTower2; + + NpcCondition morganNearby; + ObjectCondition clearedHive; + NpcCondition beggarNearby; + Conditions talkedToLady; + Conditions hasReadSpell; + NpcCondition thrantaxNearby; + + // Steps + NpcStep startQuest; + NpcStep talkToGawain; + ObjectStep goUpstairsInCamelot; + NpcStep talkToLancelot; + ObjectStep goBackDownStairsCamelot; + ObjectStep hideInArheinCrate; + ObjectStep goToFirstFloor; + ObjectStep goToSecondFloor; + NpcStep attackMordred; + DetailedQuestStep talkToMorgan; + DetailedQuestStep goToCatherbyAfterFortress; + DetailedQuestStep optionalGetRepellent; + ItemStep optionalGetBucket; + ObjectStep optionalUseRepellent; + NpcStep talkToCandleMaker; + NpcStep talkToLadyOfLake; + ObjectStep enterSarimShopAndTalk; + NpcStep talkToBeggar; + ObjectStep goReadMagicWords; + ObjectStep returnToCamelot; + DetailedQuestStep goStandInStar; + DetailedQuestStep lightCandle; + DetailedQuestStep dropBatBones; + DetailedQuestStep sayWords; + ObjectStep goUpLadder1Camelot; + ObjectStep goUpLadder2Camelot; + ObjectStep smashCrystal; + ObjectStep goDownLadder1Camelot; + ObjectStep goDownLadder2Camelot; + NpcStep finishQuest; + + ConditionalStep cGetBatBones; + ConditionalStep getBlackCandle; + ConditionalStep getExcalibur; + NpcStep getBatBones; + ObjectStep climbDownFaye2; + ObjectStep climbDownFaye1; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, startQuest); - steps.put(1, talkToGawain); - - ConditionalStep findLancelot = new ConditionalStep(this, goUpstairsInCamelot); - findLancelot.addStep(inCamelot1, talkToLancelot); - - steps.put(2, findLancelot); - - ConditionalStep discoverHowToFreeMerlin = new ConditionalStep(this, hideInArheinCrate); - discoverHowToFreeMerlin.addStep(new Conditions(inFaye2, morganNearby), talkToMorgan); - discoverHowToFreeMerlin.addStep(inFaye2, attackMordred); - discoverHowToFreeMerlin.addStep(inFaye1, goToSecondFloor); - discoverHowToFreeMerlin.addStep(inFayeGround, goToFirstFloor); - discoverHowToFreeMerlin.addStep(inCamelot1, goBackDownStairsCamelot); - - steps.put(3, discoverHowToFreeMerlin); - - getBlackCandle = new ConditionalStep(this, optionalGetRepellent); - getBlackCandle.addStep(inFaye, goToCatherbyAfterFortress); - getBlackCandle.addStep(bucketOfWax, talkToCandleMaker); - getBlackCandle.addStep(new Conditions(repellent, bucket), optionalUseRepellent); - getBlackCandle.addStep(repellent, optionalGetBucket); - getBlackCandle.setLockingCondition(hasAnyBlackCandle); - - getExcalibur = new ConditionalStep(this, talkToLadyOfLake); - getExcalibur.addStep(beggarNearby, talkToBeggar); - getExcalibur.addStep(talkedToLady, enterSarimShopAndTalk); - getExcalibur.setLockingCondition(excalibur); - - ConditionalStep performSpell = new ConditionalStep(this, returnToCamelot); - performSpell.addStep(thrantaxNearby, sayWords); - performSpell.addStep(new Conditions(inStar, litBlackCandle), dropBatBones); - performSpell.addStep(inStar, lightCandle); - performSpell.addStep(inCamelot, goStandInStar); - performSpell.addStep(litBlackCandle, returnToCamelotLit); - - ConditionalStep completeAllTasks = new ConditionalStep(this, getBlackCandle); - completeAllTasks.addStep(new Conditions(hasAnyBlackCandle, excalibur, hasReadSpell), performSpell); - completeAllTasks.addStep(new Conditions(hasAnyBlackCandle, excalibur), goReadMagicWords); - completeAllTasks.addStep(hasAnyBlackCandle, getExcalibur); - - steps.put(4, completeAllTasks); - - ConditionalStep goFreeMerlin = new ConditionalStep(this, goUpLadder1Camelot); - goFreeMerlin.addStep(inCamelotTower2, smashCrystal); - goFreeMerlin.addStep(inCamelotTower1, goUpLadder2Camelot); - - steps.put(5, goFreeMerlin); - - ConditionalStep goTellArthur = new ConditionalStep(this, finishQuest); - goTellArthur.addStep(inCamelotTower1, goDownLadder1Camelot); - goTellArthur.addStep(inCamelotTower2, goDownLadder2Camelot); - - steps.put(6, goTellArthur); - - return steps; + fayeGround = new Zone(new WorldPoint(2764, 3395, 0), new WorldPoint(2781, 3410, 0)); + faye1 = new Zone(new WorldPoint(2764, 3395, 1), new WorldPoint(2781, 3410, 1)); + faye2 = new Zone(new WorldPoint(2764, 3395, 2), new WorldPoint(2781, 3410, 2)); + camelot1 = new Zone(new WorldPoint(2744, 3483, 1), new WorldPoint(2769, 3517, 1)); + camelot2 = new Zone(new WorldPoint(2744, 3483, 2), new WorldPoint(2769, 3517, 2)); + camelotGround1 = new Zone(new WorldPoint(2744, 3483, 0), new WorldPoint(2774, 3517, 0)); + camelotGround2 = new Zone(new WorldPoint(2775, 3511, 0), new WorldPoint(2783, 3517, 0)); + camelotGround3 = new Zone(new WorldPoint(2774, 3505, 0), new WorldPoint(2776, 3511, 0)); + star = new Zone(new WorldPoint(2780, 3515, 0), new WorldPoint(2780, 3515, 0)); + camelotTower1 = new Zone(new WorldPoint(2765, 3490, 1), new WorldPoint(2770, 3495, 1)); + camelotTower2 = new Zone(new WorldPoint(2765, 3490, 2), new WorldPoint(2770, 3494, 2)); } @Override @@ -140,43 +167,23 @@ protected void setupRequirements() { bread = new ItemRequirement("Bread", ItemID.BREAD); tinderbox = new ItemRequirement("Tinderbox", ItemID.TINDERBOX).isNotConsumed(); - bucketOfWaxOptional = new ItemRequirement("Bucket of wax", ItemID.BUCKET_WAX); - bucketOfWaxOptional.canBeObtainedDuringQuest(); - bucketOfWax = new ItemRequirement("Bucket of wax", ItemID.BUCKET_WAX); - batBones = new ItemRequirement("Bat bones", ItemID.BAT_BONES); - batBonesOptional = new ItemRequirement("Bat bones", ItemID.BAT_BONES); - batBonesOptional.canBeObtainedDuringQuest(); + bucketOfWax = new ItemRequirement("Bucket of wax", ItemID.BUCKET_WAX).canBeObtainedDuringQuest(); + batBones = new ItemRequirement("Bat bones", ItemID.BAT_BONES).canBeObtainedDuringQuest(); + combatGear = new ItemRequirement("Combat gear + food for Sir Mordred (level 39)", -1, -1).isNotConsumed(); + combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); + varrockTeleport = new ItemRequirement("Teleport to Varrock", ItemID.POH_TABLET_VARROCKTELEPORT); camelotTeleport = new ItemRequirement("Teleport to Camelot", ItemID.POH_TABLET_CAMELOTTELEPORT); twoFaladorTeleports = new ItemRequirement("Teleports to Falador", ItemID.POH_TABLET_FALADORTELEPORT, 2); - combatGear = new ItemRequirement("Combat gear + food for Sir Mordred (level 39)", -1, -1).isNotConsumed(); - combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); + bucket = new ItemRequirement("Bucket", ItemID.BUCKET_EMPTY); repellent = new ItemRequirement("Insect repellent", ItemID.INSECT_REPELLENT).isNotConsumed(); blackCandle = new ItemRequirement("Black candle", ItemID.UNLIT_BLACK_CANDLE); litBlackCandle = new ItemRequirement("Lit black candle", ItemID.LIT_BLACK_CANDLE); + anyBlackCandle = new ItemRequirement("Black candle", List.of(ItemID.UNLIT_BLACK_CANDLE, ItemID.LIT_BLACK_CANDLE)); excalibur = new ItemRequirement("Excalibur", ItemID.EXCALIBUR).isNotConsumed(); - equippedExcalibur = excalibur.equipped(); - } - - @Override - protected void setupZones() - { - fayeGround = new Zone(new WorldPoint(2764, 3395, 0), new WorldPoint(2781, 3410, 0)); - faye1 = new Zone(new WorldPoint(2764, 3395, 1), new WorldPoint(2781, 3410, 1)); - faye2 = new Zone(new WorldPoint(2764, 3395, 2), new WorldPoint(2781, 3410, 2)); - camelot1 = new Zone(new WorldPoint(2744, 3483, 1), new WorldPoint(2769, 3517, 1)); - camelot2 = new Zone(new WorldPoint(2744, 3483, 2), new WorldPoint(2769, 3517, 2)); - camelotGround1 = new Zone(new WorldPoint(2744, 3483, 0), new WorldPoint(2774, 3517, 0)); - camelotGround2 = new Zone(new WorldPoint(2775, 3511, 0), new WorldPoint(2783, 3517, 0)); - camelotGround3 = new Zone(new WorldPoint(2774, 3505, 0), new WorldPoint(2776, 3511, 0)); - star = new Zone(new WorldPoint(2780, 3515, 0), new WorldPoint(2780, 3515, 0)); - camelotTower1 = new Zone(new WorldPoint(2765, 3490, 1), new WorldPoint(2770, 3495, 1)); - camelotTower2 = new Zone(new WorldPoint(2765, 3490, 2), new WorldPoint(2770, 3494, 2)); - } + excaliburEquipped = excalibur.equipped().highlighted(); - public void setupConditions() - { inFaye = new ZoneRequirement(faye1, fayeGround, faye2); inFayeGround = new ZoneRequirement(fayeGround); inFaye1 = new ZoneRequirement(faye1); @@ -184,16 +191,16 @@ public void setupConditions() inCamelot = new ZoneRequirement(camelotGround1, camelotGround2, camelotGround3); inCamelot1 = new ZoneRequirement(camelot1); inCamelot2 = new ZoneRequirement(camelot2); + inStar = new ZoneRequirement(star); + inCamelotTower1 = new ZoneRequirement(camelotTower1); + inCamelotTower2 = new ZoneRequirement(camelotTower2); + morganNearby = new NpcCondition(NpcID.MORGAN_LE_FAYE); clearedHive = new ObjectCondition(ObjectID.BEEHIVE); - hasAnyBlackCandle = new Conditions(LogicType.OR, blackCandle, litBlackCandle); beggarNearby = new NpcCondition(NpcID.LAKE_BEGGAR); talkedToLady = new Conditions(true, new DialogRequirement(questHelperPlugin.getPlayerStateManager().getPlayerName(), "Ok. That seems easy enough.", false)); - hasReadSpell = new Conditions(true, LogicType.AND, new WidgetTextRequirement(229, 1, "You find a small inscription")); - inStar = new ZoneRequirement(star); + hasReadSpell = new Conditions(true, LogicType.AND, WidgetTextRequirement.messageBox("You find a small inscription")); thrantaxNearby = new NpcCondition(NpcID.THRANTAX); - inCamelotTower1 = new ZoneRequirement(camelotTower1); - inCamelotTower2 = new ZoneRequirement(camelotTower2); } public void setupSteps() @@ -225,30 +232,38 @@ public void setupSteps() talkToMorgan.addDialogStep("Tell me how to untrap Merlin and I might."); talkToMorgan.addDialogStep("Ok I will do all that."); - goToCatherbyAfterFortress = new DetailedQuestStep(this, "Return to Catherby. If you still need bat bones, you can kill one of the bats just outside the fortress."); + getBatBones = new NpcStep(this, NpcID.BAT, new WorldPoint(2757, 3401, 0), "Kill a Giant bat outside Keep Le Faye for some bat bones.", true, batBones); + climbDownFaye2 = new ObjectStep(this, ObjectID.STAIRSTOP, new WorldPoint(2769, 3399, 2), "Climb down from Keep Le Faye and step through the front door, then kill a Giant bat for some bat bones."); + climbDownFaye1 = new ObjectStep(this, ObjectID.STAIRSTOP, new WorldPoint(2769, 3405, 1), "Climb down from Keep Le Faye and step through the front door, then kill a Giant bat for some bat bones."); + climbDownFaye2.addSubSteps(climbDownFaye1); + + goToCatherbyAfterFortress = new DetailedQuestStep(this, "Return to Catherby."); optionalGetRepellent = new DetailedQuestStep(this, new WorldPoint(2807, 3450, 0), "If you still need wax, go grab the insect repellent in a house in north Catherby. Otherwise, get your wax out.", repellent); - optionalGetBucket = new DetailedQuestStep(this, new WorldPoint(2766, 3441, 0), "Go grab the bucket in the bee field west of Catherby.", bucket); + optionalGetBucket = new ItemStep(this, new WorldPoint(2766, 3441, 0), "Go grab the bucket in the bee field west of Catherby.", bucket); optionalUseRepellent = new ObjectStep(this, ObjectID.MERLIN_BEEHIVE, new WorldPoint(2762, 3443, 0), "Use the insect repellent on a bee hive, then try to take some wax.", bucket, repellent.highlighted()); talkToCandleMaker = new NpcStep(this, NpcID.CANDLE_MAKER, new WorldPoint(2797, 3440, 0), "Talk to the Candle Maker in Catherby twice until he gives you a black candle.", bucketOfWax); talkToCandleMaker.addDialogStep("Have you got any black candles?"); talkToLadyOfLake = new NpcStep(this, NpcID.LADYOFTHELAKE, new WorldPoint(2924, 3404, 0), "Talk to the Lady of the Lake in Taverley."); + talkToLadyOfLake.addTeleport(twoFaladorTeleports.quantity(1)); talkToLadyOfLake.addDialogStep("I seek the sword Excalibur."); talkToLadyOfLake.setLockingCondition(talkedToLady); enterSarimShopAndTalk = new ObjectStep(this, ObjectID.JEWELLERSDOOR, new WorldPoint(3016, 3246, 0), "Attempt to enter the jewelery store in Port Sarim.", bread); enterSarimShopAndTalk.addDialogStep("Yes certainly."); - talkToBeggar = new ObjectStep(this, ObjectID.JEWELLERSDOOR, new WorldPoint(3016, 3246, 0), "Talk to the beggar who appears and give him some bread.", bread); + enterSarimShopAndTalk.addDialogStep("Yes, here you go."); + talkToBeggar = new NpcStep(this, NpcID.LAKE_BEGGAR, new WorldPoint(3016, 3247, 0), "Talk to the beggar who appears and give him some bread.", bread); talkToBeggar.addDialogStep("Yes certainly."); + talkToBeggar.addDialogStep("Yes, here you go."); goReadMagicWords = new ObjectStep(this, ObjectID.THRANTAXALTAR, new WorldPoint(3260, 3381, 0), "Check the altar in the Zamorak Temple in south east Varrock. If you've already learnt the spell, just mark this step complete in the Quest Helper sidebar."); + goReadMagicWords.addTeleport(varrockTeleport); goReadMagicWords.setLockingCondition(hasReadSpell); - returnToCamelot = new ObjectStep(this, ObjectID.KR_CAMELOT_METALGATECLOSEDR, new WorldPoint(2758, 3482, 0), "Return to Camelot", excalibur, blackCandle, batBones, tinderbox); - returnToCamelotLit = new ObjectStep(this, ObjectID.KR_CAMELOT_METALGATECLOSEDR, new WorldPoint(2758, 3482, 0), "Return to Camelot", excalibur, litBlackCandle, batBones); + returnToCamelot = new ObjectStep(this, ObjectID.KR_CAMELOT_METALGATECLOSEDR, new WorldPoint(2758, 3482, 0), "Enter the gates towards Camelot Castle.", excalibur, anyBlackCandle, batBones, tinderbox); - goStandInStar = new DetailedQuestStep(this, new WorldPoint(2780, 3515, 0), "Go stand in the star symbol north east of Camelot Castle."); + goStandInStar = new DetailedQuestStep(this, new WorldPoint(2780, 3515, 0), "Go stand in the star symbol north east of Camelot Castle.", excalibur, anyBlackCandle, batBones, tinderbox); goStandInStar.addDialogStep("Snarthon Candtrick Termanto"); lightCandle = new DetailedQuestStep(this, "Light the Black candle with your tinderbox.", blackCandle.highlighted(), tinderbox.highlighted()); @@ -257,10 +272,10 @@ public void setupSteps() sayWords = new DetailedQuestStep(this, "Say the spell 'Snarthon Candtrick Termanto'. Be careful not to click the wrong option or you'll have to get another Black Candle.", excalibur); sayWords.addDialogStep("Snarthon Candtrick Termanto"); - goUpLadder1Camelot = new ObjectStep(this, ObjectID.KR_CAM_LADDER, new WorldPoint(2769, 3493, 0), "Go up the ladder in the south east of Camelot castle.", equippedExcalibur); - goUpLadder2Camelot = new ObjectStep(this, ObjectID.KR_CAM_LADDER, new WorldPoint(2767, 3491, 1), "Go up the next ladder.", equippedExcalibur); + goUpLadder1Camelot = new ObjectStep(this, ObjectID.KR_CAM_LADDER, new WorldPoint(2769, 3493, 0), "Go up the ladder in the south east of Camelot castle.", excaliburEquipped); + goUpLadder2Camelot = new ObjectStep(this, ObjectID.KR_CAM_LADDER, new WorldPoint(2767, 3491, 1), "Go up the next ladder.", excaliburEquipped); - smashCrystal = new ObjectStep(this, ObjectID.MERLINS_CRYSTAL, new WorldPoint(2768, 3494, 2), "Smash the Giant Crystal with Excalibur equipped.", equippedExcalibur); + smashCrystal = new ObjectStep(this, ObjectID.MERLINS_CRYSTAL, new WorldPoint(2768, 3494, 2), "Smash the Giant Crystal with Excalibur equipped.", excaliburEquipped); goDownLadder1Camelot = new ObjectStep(this, ObjectID.KR_CAM_LADDERTOP, new WorldPoint(2769, 3493, 1), "Tell King Arthur you've freed Merlin."); goDownLadder2Camelot = new ObjectStep(this, ObjectID.KR_CAM_LADDERTOP, new WorldPoint(2767, 3491, 2), "Tell King Arthur you've freed Merlin."); @@ -270,33 +285,104 @@ public void setupSteps() } @Override - public List getCombatRequirements() + public Map loadSteps() { - ArrayList reqs = new ArrayList<>(); - reqs.add("Sir Mordred (level 39)"); - return reqs; + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, startQuest); + steps.put(1, talkToGawain); + + var findLancelot = new ConditionalStep(this, goUpstairsInCamelot); + findLancelot.addStep(inCamelot1, talkToLancelot); + + steps.put(2, findLancelot); + + var discoverHowToFreeMerlin = new ConditionalStep(this, hideInArheinCrate); + discoverHowToFreeMerlin.addStep(and(inFaye2, morganNearby), talkToMorgan); + discoverHowToFreeMerlin.addStep(inFaye2, attackMordred); + discoverHowToFreeMerlin.addStep(inFaye1, goToSecondFloor); + discoverHowToFreeMerlin.addStep(inFayeGround, goToFirstFloor); + discoverHowToFreeMerlin.addStep(inCamelot1, goBackDownStairsCamelot); + + steps.put(3, discoverHowToFreeMerlin); + + cGetBatBones = new ConditionalStep(this, getBatBones); + cGetBatBones.addStep(inFaye2, climbDownFaye2); + cGetBatBones.addStep(inFaye1, climbDownFaye1); + cGetBatBones.setLockingCondition(batBones); + + getBlackCandle = new ConditionalStep(this, optionalGetRepellent); + getBlackCandle.addStep(inFaye, goToCatherbyAfterFortress); + getBlackCandle.addStep(bucketOfWax, talkToCandleMaker); + getBlackCandle.addStep(and(repellent, bucket), optionalUseRepellent); + getBlackCandle.addStep(repellent, optionalGetBucket); + getBlackCandle.setLockingCondition(anyBlackCandle); + + getExcalibur = new ConditionalStep(this, talkToLadyOfLake); + getExcalibur.addStep(beggarNearby, talkToBeggar); + getExcalibur.addStep(talkedToLady, enterSarimShopAndTalk); + getExcalibur.setLockingCondition(excalibur); + + var performSpell = new ConditionalStep(this, returnToCamelot); + performSpell.addStep(thrantaxNearby, sayWords); + performSpell.addStep(and(inStar, litBlackCandle), dropBatBones); + performSpell.addStep(inStar, lightCandle); + performSpell.addStep(inCamelot, goStandInStar); + + var completeAllTasks = new ConditionalStep(this, getBlackCandle); + completeAllTasks.addStep(not(batBones), cGetBatBones); + completeAllTasks.addStep(and(anyBlackCandle, excalibur, hasReadSpell), performSpell); + completeAllTasks.addStep(and(anyBlackCandle, excalibur), goReadMagicWords); + completeAllTasks.addStep(anyBlackCandle, getExcalibur); + + steps.put(4, completeAllTasks); + + var goFreeMerlin = new ConditionalStep(this, goUpLadder1Camelot); + goFreeMerlin.addStep(inCamelotTower2, smashCrystal); + goFreeMerlin.addStep(inCamelotTower1, goUpLadder2Camelot); + + steps.put(5, goFreeMerlin); + + var goTellArthur = new ConditionalStep(this, finishQuest); + goTellArthur.addStep(inCamelotTower1, goDownLadder1Camelot); + goTellArthur.addStep(inCamelotTower2, goDownLadder2Camelot); + + steps.put(6, goTellArthur); + + return steps; } @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(combatGear); - reqs.add(bread); - reqs.add(tinderbox); - reqs.add(bucketOfWaxOptional); - reqs.add(batBonesOptional); - return reqs; + return List.of( + combatGear, + bread, + tinderbox, + bucketOfWax, + batBones + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(varrockTeleport); - reqs.add(camelotTeleport); - reqs.add(twoFaladorTeleports); - return reqs; + return List.of( + varrockTeleport, + camelotTeleport, + twoFaladorTeleports + ); + } + + @Override + public List getCombatRequirements() + { + return List.of( + "Sir Mordred (level 39)" + ); } @Override @@ -308,43 +394,94 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Excalibur", ItemID.EXCALIBUR, 1)); + return List.of( + new ItemReward("Excalibur", ItemID.EXCALIBUR, 1) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting off", Arrays.asList(startQuest, talkToGawain, goUpstairsInCamelot, talkToLancelot))); - allSteps.add(new PanelDetails("Infiltrate the fortress", Arrays.asList(hideInArheinCrate, goToFirstFloor, goToSecondFloor, attackMordred, talkToMorgan), combatGear)); - PanelDetails getBlackCandlePanel = new PanelDetails("Get a Black Candle", - Arrays.asList(goToCatherbyAfterFortress, optionalGetRepellent, optionalGetBucket, optionalUseRepellent, talkToCandleMaker)); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + startQuest, + talkToGawain, + goUpstairsInCamelot, + talkToLancelot + ))); + + sections.add(new PanelDetails("Infiltrate the fortress", List.of( + hideInArheinCrate, + goToFirstFloor, + goToSecondFloor, + attackMordred, + talkToMorgan + ), List.of( + combatGear + ))); + + var getBatBonesPanel = new PanelDetails("Get bat bones", List.of( + climbDownFaye2, + getBatBones + )); + getBatBonesPanel.setLockingStep(cGetBatBones); + getBatBonesPanel.setVars(4); + + sections.add(getBatBonesPanel); + + var getBlackCandlePanel = new PanelDetails("Get a Black Candle", List.of( + goToCatherbyAfterFortress, + optionalGetRepellent, + optionalGetBucket, + optionalUseRepellent, + talkToCandleMaker + )); getBlackCandlePanel.setLockingStep(getBlackCandle); getBlackCandlePanel.setVars(4); - allSteps.add(getBlackCandlePanel); + sections.add(getBlackCandlePanel); - PanelDetails getExcaliburPanel = new PanelDetails("Get Excalibur", - Arrays.asList(talkToLadyOfLake, enterSarimShopAndTalk, talkToBeggar), bread); + var getExcaliburPanel = new PanelDetails("Get Excalibur", List.of( + talkToLadyOfLake, + enterSarimShopAndTalk, + talkToBeggar + ), List.of( + bread + )); getExcaliburPanel.setLockingStep(getExcalibur); getExcaliburPanel.setVars(4); - allSteps.add(getExcaliburPanel); + sections.add(getExcaliburPanel); - PanelDetails readMagicWordsPanel = new PanelDetails("Learn magic words", - Collections.singletonList(goReadMagicWords)); + var readMagicWordsPanel = new PanelDetails("Learn magic words", List.of( + goReadMagicWords + )); readMagicWordsPanel.setLockingStep(goReadMagicWords); readMagicWordsPanel.setVars(4); - allSteps.add(readMagicWordsPanel); - - PanelDetails performMagicPanel = new PanelDetails("Perform the spell", - Arrays.asList(returnToCamelot, goStandInStar, lightCandle, dropBatBones, sayWords), blackCandle, batBones, excalibur, tinderbox); - - allSteps.add(performMagicPanel); - - allSteps.add(new PanelDetails("Free Merlin", Arrays.asList(goUpLadder1Camelot, goUpLadder2Camelot, smashCrystal, finishQuest))); - - return allSteps; + sections.add(readMagicWordsPanel); + + sections.add(new PanelDetails("Perform the spell", List.of( + returnToCamelot, + goStandInStar, + lightCandle, + dropBatBones, + sayWords + ), List.of( + anyBlackCandle, + batBones, + excalibur, + tinderbox + ))); + + sections.add(new PanelDetails("Free Merlin", List.of( + goUpLadder1Camelot, + goUpLadder2Camelot, + smashCrystal, + finishQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java index 7735e135ae5..c1481e5898e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/misthalinmystery/MisthalinMystery.java @@ -29,7 +29,6 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetTextRequirement; @@ -38,24 +37,17 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.PuzzleWrapperStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.WidgetStep; +import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.*; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import net.runelite.api.Skill; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.InterfaceID; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarbitID; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class MisthalinMystery extends BasicQuestHelper { @@ -190,11 +182,11 @@ protected void setupRequirements() playedAnyKey = new VarbitRequirement(VarbitID.MISTMYST_PIANO_ATTEMPTS, 1, Operation.GREATER_EQUAL); inPianoWidget = new WidgetTextRequirement(554, 20, "C"); inGemWidget = new WidgetTextRequirement(555, 1, 1, "Gemstone switch panel"); - selectedSaphire = and(new VarbitRequirement(4051, 1), new VarbitRequirement(4050, 1)); - selectedDiamond = and(new VarbitRequirement(4052, 1), new VarbitRequirement(4050, 2)); - selectedZenyte = and(new VarbitRequirement(4053, 1), new VarbitRequirement(4050, 3)); - selectedEmerald = and(new VarbitRequirement(4054, 1), new VarbitRequirement(4050, 4)); - selectedOnyx = and(new VarbitRequirement(4055, 1), new VarbitRequirement(4050, 5)); + selectedSaphire = and(new VarbitRequirement(VarbitID.MISTMYST_SAPPHIRE_SWITCHED, 1), new VarbitRequirement(VarbitID.MISTMYST_SWITCH_ATTEMPTS, 1)); + selectedDiamond = and(new VarbitRequirement(VarbitID.MISTMYST_DIAMOND_SWITCHED, 1), new VarbitRequirement(VarbitID.MISTMYST_SWITCH_ATTEMPTS, 2)); + selectedZenyte = and(new VarbitRequirement(VarbitID.MISTMYST_ZENYTE_SWITCHED, 1), new VarbitRequirement(VarbitID.MISTMYST_SWITCH_ATTEMPTS, 3)); + selectedEmerald = and(new VarbitRequirement(VarbitID.MISTMYST_EMERALD_SWITCHED, 1), new VarbitRequirement(VarbitID.MISTMYST_SWITCH_ATTEMPTS, 4)); + selectedOnyx = and(new VarbitRequirement(VarbitID.MISTMYST_ONYX_SWITCHED, 1), new VarbitRequirement(VarbitID.MISTMYST_SWITCH_ATTEMPTS, 5)); selectAnyGem = new VarbitRequirement(VarbitID.MISTMYST_SWITCH_ATTEMPTS, 1, Operation.GREATER_EQUAL); bucket = new ItemRequirement("Bucket", ItemID.BUCKET_EMPTY); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessi/MonkeyMadnessI.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessi/MonkeyMadnessI.java index e1f41e132dd..0eab1b12193 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessi/MonkeyMadnessI.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessi/MonkeyMadnessI.java @@ -52,7 +52,6 @@ import net.runelite.client.plugins.microbot.questhelper.util.QHObjectID; import net.runelite.api.Prayer; import net.runelite.api.QuestState; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.*; @@ -171,13 +170,13 @@ public Map loadSteps() makeAmulet.addStep(inHangar, talkToWaydarForAmuletMake); makeAmulet.addStep(inFloor1, talkToDaeroForAmuletMake); makeAmulet.addStep(inZooknockDungeon, leaveToPrepareForAmulet); - makeAmulet.setLockingCondition(amulet.alsoCheckBank(questBank)); + makeAmulet.setLockingCondition(amulet.alsoCheckBank()); getTalisman = new ConditionalStep(this, talkToMonkeyChild); getTalisman.addStep(inTempleDungeon, leaveTempleDungeon); getTalisman.setLockingCondition(hasTalisman); - ItemRequirement talismans4 = anyTalisman.quantity(4).alsoCheckBank(questBank); + ItemRequirement talismans4 = anyTalisman.quantity(4).alsoCheckBank(); getBones = new ConditionalStep(this, talkToChildFor4Talismans); getBones.addStep(and(talismans4, ninjaBones, gorillaBones, inTempleDungeon), killZombie); getBones.addStep(and(talismans4, ninjaBones, gorillaBones), goDownToZombie); @@ -196,14 +195,14 @@ public Map loadSteps() makeKaramjanGreeGree.addStep(inTempleDungeon, leaveToPrepareForTalismanRun); makeKaramjanGreeGree.addStep(inMouldRoom, leaveToPrepareForTalismanRun); makeKaramjanGreeGree.addStep(onApeAtollNorth, leaveToPrepareForTalismanRun); - makeKaramjanGreeGree.setLockingCondition(karamjanGreegree.alsoCheckBank(questBank)); + makeKaramjanGreeGree.setLockingCondition(karamjanGreegree.alsoCheckBank()); ConditionalStep infiltratingTheMonkeys = new ConditionalStep(this, getAmuletParts); - infiltratingTheMonkeys.addStep(new Conditions(talkedToGarkor, talismans4, zombieBones.alsoCheckBank(questBank), - gorillaBones.alsoCheckBank(questBank), - ninjaBones.alsoCheckBank(questBank)), makeKaramjanGreeGree); - infiltratingTheMonkeys.addStep(and(talkedToGarkor, amulet.alsoCheckBank(questBank), talisman.alsoCheckBank(questBank)), getBones); - infiltratingTheMonkeys.addStep(new Conditions(talkedToGarkor, amulet.alsoCheckBank(questBank)), getTalisman); + infiltratingTheMonkeys.addStep(new Conditions(talkedToGarkor, talismans4, zombieBones.alsoCheckBank(), + gorillaBones.alsoCheckBank(), + ninjaBones.alsoCheckBank()), makeKaramjanGreeGree); + infiltratingTheMonkeys.addStep(and(talkedToGarkor, amulet.alsoCheckBank(), talisman.alsoCheckBank()), getBones); + infiltratingTheMonkeys.addStep(new Conditions(talkedToGarkor, amulet.alsoCheckBank()), getTalisman); infiltratingTheMonkeys.addStep(new Conditions(talkedToGarkor, hadEnchantedBar), makeAmulet); infiltratingTheMonkeys.addStep(new Conditions(talkedToGarkor, hadDenturesAndMould), makeBar); @@ -420,9 +419,9 @@ public void setupConditions() inThroneRoom = new ZoneRequirement(throne1, throne2, throne3, throne4); inJungleDemonRoom = new ZoneRequirement(jungleDemonRoom); - talkedToCaranock = new VarbitRequirement(122, 3); + talkedToCaranock = new VarbitRequirement(VarbitID.MM_CARANOCK, 3); - reportedBackToNarnode = new VarbitRequirement(121, 7); + reportedBackToNarnode = new VarbitRequirement(VarbitID.MM_NARNODE, 7); talkedToDaero = new VarbitRequirement(VarbitID.MM_DAERO, 1, Operation.GREATER_EQUAL); @@ -581,11 +580,11 @@ public void setupSteps() searchForDentures = new ObjectStep(this, ObjectID.MM_DENTURE_CRATE, new WorldPoint(2767, 2769, 0), "DO NOT WALK ON THE LIGHT FLOOR. Search the stacked crates for monkey dentures."); - searchForDentures.addTileMarker(new WorldPoint(2767, 2768, 0), SpriteID.PLAYER_KILLER_SKULL); - searchForDentures.addTileMarker(new WorldPoint(2766, 2768, 0), SpriteID.PLAYER_KILLER_SKULL); - searchForDentures.addTileMarker(new WorldPoint(2767, 2767, 0), SpriteID.PLAYER_KILLER_SKULL); - searchForDentures.addTileMarker(new WorldPoint(2766, 2767, 0), SpriteID.PLAYER_KILLER_SKULL); - searchForDentures.addTileMarker(new WorldPoint(2766, 2769, 0), SpriteID.PLAYER_KILLER_SKULL); + searchForDentures.addTileMarker(new WorldPoint(2767, 2768, 0), SpriteID.HEADICONS_PK); + searchForDentures.addTileMarker(new WorldPoint(2766, 2768, 0), SpriteID.HEADICONS_PK); + searchForDentures.addTileMarker(new WorldPoint(2767, 2767, 0), SpriteID.HEADICONS_PK); + searchForDentures.addTileMarker(new WorldPoint(2766, 2767, 0), SpriteID.HEADICONS_PK); + searchForDentures.addTileMarker(new WorldPoint(2766, 2769, 0), SpriteID.HEADICONS_PK); searchForDentures.addTileMarkers(new WorldPoint(2768, 2769, 0)); searchForDentures.addDialogStep("Yes"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/AgilityDungeonSteps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/AgilityDungeonSteps.java index 0ecc7da4833..d748245ef5c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/AgilityDungeonSteps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/AgilityDungeonSteps.java @@ -39,13 +39,10 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Player; import net.runelite.api.Prayer; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameTick; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; import net.runelite.client.eventbus.Subscribe; import java.util.*; @@ -129,7 +126,7 @@ public void setupConditions() inKrukRoom = new ZoneRequirement(krukRoom); hasBronzeKey = bronzeKey; - openedShortcut = new VarbitRequirement(5029, 1); + openedShortcut = new VarbitRequirement(VarbitID.MM2_MAZE_RETURN, 1); path1SouthIsWrongChat = new ChatMessageRequirement( new ZoneRequirement(new Zone(new WorldPoint(2512, 9141, 1), new WorldPoint(2515, 9135, 1))), @@ -273,8 +270,8 @@ public void setupSteps() fightKruk = new NpcStep(getQuestHelper(), NpcID.MM2_KRUK_COMBAT, new WorldPoint(2535, 9213, 1), "Kill Kruk. He can be flinched on a corner in the room by keeping him on a north east tile to you."); - fightKruk.addTileMarker(new WorldPoint(2528, 9220, 1), SpriteID.RS2_SWORD_POINTED_LEFT); - fightKruk.addTileMarker(new WorldPoint(2529, 9221, 1), SpriteID.EQUIPMENT_SLOT_SHIELD); + fightKruk.addTileMarker(new WorldPoint(2528, 9220, 1), SpriteID.Sworddecor.LEFT); + fightKruk.addTileMarker(new WorldPoint(2529, 9221, 1), SpriteID.Wornicons.SHIELD); } private void updateSection1Route() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MM2Sabotage.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MM2Sabotage.java index d25a4acf734..5e3d4b5a8a5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MM2Sabotage.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MM2Sabotage.java @@ -36,11 +36,12 @@ import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.SpriteID; +import net.runelite.api.gameval.VarbitID; import java.util.Arrays; import java.util.List; @@ -144,14 +145,14 @@ public void setupConditions() // 10->14 // 14->46 // 46->62 - placedSatchel1 = new VarbitRequirement(5044, 1); - placedSatchel2 = new VarbitRequirement(5042, 1); - placedSatchel3 = new VarbitRequirement(5043, 1); - placedSatchel4 = new VarbitRequirement(5046, 1); - placedSatchel5 = new VarbitRequirement(5045, 1); - placedSatchel6 = new VarbitRequirement(5041, 1); + placedSatchel1 = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGET_4, 1); + placedSatchel2 = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGET_2, 1); + placedSatchel3 = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGET_3, 1); + placedSatchel4 = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGET_6, 1); + placedSatchel5 = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGET_5, 1); + placedSatchel6 = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGET_1, 1); - placedAllSatchels = new VarbitRequirement(5047, 63); + placedAllSatchels = new VarbitRequirement(VarbitID.MM2_PLATFORM_TARGETS, 63); } public void setupSteps() @@ -260,8 +261,8 @@ public void setupSteps() ); // Exclamation mark - placeSatchel3.addTileMarker(new WorldPoint(2069, 5413, 2), SpriteID.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); - placeSatchel3.addTileMarker(new WorldPoint(2069, 5421, 2), SpriteID.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); + placeSatchel3.addTileMarker(new WorldPoint(2069, 5413, 2), SpriteID.HeadiconsPkInterface.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); + placeSatchel3.addTileMarker(new WorldPoint(2069, 5421, 2), SpriteID.HeadiconsPkInterface.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); placeSatchel3.setHideMinimapLines(true); placeSatchel3.setLinePoints(pathToSatchel3); @@ -276,8 +277,8 @@ public void setupSteps() new WorldPoint(2066, 5431, 2), new WorldPoint(2072, 5431, 2) ); - goUpToSatchel4.addTileMarker(new WorldPoint(2069, 5421, 2), SpriteID.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); - goUpToSatchel4.addTileMarker(new WorldPoint(2066, 5413, 2), SpriteID.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); + goUpToSatchel4.addTileMarker(new WorldPoint(2069, 5421, 2), SpriteID.HeadiconsPkInterface.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); + goUpToSatchel4.addTileMarker(new WorldPoint(2066, 5413, 2), SpriteID.HeadiconsPkInterface.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); goUpToSatchel4.setHideMinimapLines(true); placeSatchel4 = new ObjectStep(getQuestHelper(), ObjectID.MM2_TARGET_F, new WorldPoint(2096, 5393, 3), "Place a satchel on the gas cylinder to the south.", filledSatchel1Highlighted); @@ -300,7 +301,7 @@ public void setupSteps() new WorldPoint(2085, 5409, 3), new WorldPoint(2067, 5407, 3) ); - placeSatchel5.addTileMarker(new WorldPoint(2069, 5413, 3), SpriteID.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); + placeSatchel5.addTileMarker(new WorldPoint(2069, 5413, 3), SpriteID.HeadiconsPkInterface.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); placeSatchel5.setHideMinimapLines(true); placeSatchel5.addIcon(ItemID.MM2_EXPLOSIVES_SATCHEL_FULL); goF2ToF1ForSatchel6 = new ObjectStep(getQuestHelper(), ObjectID.MM2_SHIPYARD_LADDER_TOP, new WorldPoint(2098, 5407, 3), "Go back to the bottom floor.", filledSatchel1); @@ -313,7 +314,7 @@ public void setupSteps() new WorldPoint(2085, 5409, 3), new WorldPoint(2067, 5407, 3) ); - goF2ToF1ForSatchel6.addTileMarker(new WorldPoint(2066, 5413, 3), SpriteID.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); + goF2ToF1ForSatchel6.addTileMarker(new WorldPoint(2066, 5413, 3), SpriteID.HeadiconsPkInterface.BOUNTY_HUNTER_TARGET_WEALTH_1_VERY_LOW); goF1ToF0ForSatchel6 = new ObjectStep(getQuestHelper(), ObjectID.MM2_SHIPYARD_LADDER_TOP, new WorldPoint(2098, 5408, 2), "Go back to the bottom floor.", filledSatchel1); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MonkeyMadnessII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MonkeyMadnessII.java index f8fe2b7f8ec..c392a31ecf8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MonkeyMadnessII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monkeymadnessii/MonkeyMadnessII.java @@ -354,7 +354,7 @@ public void setupConditions() foundHandkerchief = new Conditions(LogicType.OR, new VarbitRequirement(VarbitID.MM2_FOUND_HANDKERCHIEF, 2, Operation.GREATER_EQUAL), handkerchief); talkedToAnita = new VarbitRequirement(VarbitID.MM2_ANTIAS_CLUE, 1, Operation.GREATER_EQUAL); openedCupboard = new Conditions(true, LogicType.OR, new WidgetTextRequirement(229, 1, "You turn the statue and hear a clicking sound in the room."), new ChatMessageRequirement("You have already activated the statue.")); - foundNote = new VarbitRequirement(5028, 1); + foundNote = new VarbitRequirement(VarbitID.MM2_FOUND_NOTE, 1); hasBrush = new Conditions(LogicType.OR, grapeBrush, brush); // Read note: @@ -369,15 +369,15 @@ public void setupConditions() kob2Nearby = new NpcCondition(NpcID.MM2_GENERAL_KOB_COMBAT); keef2Nearby = new NpcCondition(NpcID.MM2_CHIEFTAN_KEEF_COMBAT); - defeatedKob = new VarbitRequirement(5035, 1); - defeatedKeef = new VarbitRequirement(5034, 1); + defeatedKob = new VarbitRequirement(VarbitID.MM2_TROLL_DEFEATED, 1); + defeatedKeef = new VarbitRequirement(VarbitID.MM2_OGRE_DEFEATED, 1); // Killed Kruk, 5036 0->2 - smithInLocation1 = new VarbitRequirement(5040, 1); // TODO: Get location - smithInLocation2 = new VarbitRequirement(5040, 2); // TODO: Get location - smithInLocation3 = new VarbitRequirement(5040, 3); // TODO: Get location - smithInLocation4 = new VarbitRequirement(5040, 4); // Smith near rune store + smithInLocation1 = new VarbitRequirement(VarbitID.MM2_LE_SMITH_POS, 1); // TODO: Get location + smithInLocation2 = new VarbitRequirement(VarbitID.MM2_LE_SMITH_POS, 2); // TODO: Get location + smithInLocation3 = new VarbitRequirement(VarbitID.MM2_LE_SMITH_POS, 3); // TODO: Get location + smithInLocation4 = new VarbitRequirement(VarbitID.MM2_LE_SMITH_POS, 4); // Smith near rune store smithNearby = new NpcCondition(NpcID.MM2_LE_SMITH); @@ -395,7 +395,7 @@ public void setupConditions() // 5068 0->1 // 5069 1->2 - killedGorillas = new VarbitRequirement(5068, 3); + killedGorillas = new VarbitRequirement(VarbitID.MM2_BREACH_KC, 3); nieveFollowing = new NpcInteractingRequirement(NpcID.MM2_NIEVE_FOLLOWER); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monksfriend/MonksFriend.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monksfriend/MonksFriend.java index d169ff0390e..adfb1bf8309 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monksfriend/MonksFriend.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/monksfriend/MonksFriend.java @@ -26,8 +26,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -41,109 +39,135 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class MonksFriend extends BasicQuestHelper { - //Items Required - ItemRequirement jugOfWater, log, blanket; + // Required items + ItemRequirement jugOfWater; + ItemRequirement log; - //Items Recommended + // Recommended items ItemRequirement ardougneCloak; - Requirement inDungeon; - - QuestStep talkToOmad, goDownLadder, grabBlanket, goUpLadder, returnToOmadWithBlanket, talkToOmadAgain, talkToCedric, talkToCedricWithJug, - continueTalkingToCedric, talkToCedricWithLog, finishQuest; - - //Zones + // Zones Zone dungeon; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToOmad); - - ConditionalStep getBlanket = new ConditionalStep(this, goDownLadder); - getBlanket.addStep(new Conditions(inDungeon, blanket.alsoCheckBank(questBank)), goUpLadder); - getBlanket.addStep(blanket.alsoCheckBank(questBank), returnToOmadWithBlanket); - getBlanket.addStep(inDungeon, grabBlanket); + // Miscellaneous requirements + ItemRequirement blanket; - steps.put(10, getBlanket); + ZoneRequirement inDungeon; - steps.put(20, talkToOmadAgain); - steps.put(30, talkToCedric); - steps.put(40, talkToCedricWithJug); - steps.put(50, continueTalkingToCedric); - steps.put(60, talkToCedricWithLog); - steps.put(70, finishQuest); + // Steps + NpcStep talkToOmad; + ObjectStep goDownLadder; + DetailedQuestStep grabBlanket; + ObjectStep goUpLadder; + NpcStep returnToOmadWithBlanket; + NpcStep talkToOmadAgain; + NpcStep talkToCedric; + NpcStep talkToCedricWithJug; + NpcStep continueTalkingToCedric; + NpcStep talkToCedricWithLog; + NpcStep finishQuest; - return steps; + @Override + protected void setupZones() + { + dungeon = new Zone(new WorldPoint(2559, 9597, 0), new WorldPoint(2582, 9623, 0)); } @Override protected void setupRequirements() { + inDungeon = new ZoneRequirement(dungeon); + log = new ItemRequirement("Logs", ItemID.LOGS); jugOfWater = new ItemRequirement("Jug of Water", ItemID.JUG_WATER); blanket = new ItemRequirement("Child's blanket", ItemID.CHILDS_BLANKET); ardougneCloak = new ItemRequirement("Ardougne cloak 1 or higher for teleports to the monastery", ItemID.CERT_ARRAVCERTIFICATE).isNotConsumed(); } - @Override - protected void setupZones() - { - dungeon = new Zone(new WorldPoint(2559, 9597, 0), new WorldPoint(2582, 9623, 0)); - } - public void setupConditions() { - inDungeon = new ZoneRequirement(dungeon); } public void setupSteps() { - talkToOmad = new NpcStep(this, NpcID.BROTHER_OMAD, new WorldPoint(2607, 3211, 0), "Talk to Brother Omad in the monastery south of West Ardougne."); + talkToOmad = new NpcStep(this, NpcID.BROTHER_OMAD, new WorldPoint(2607, 3211, 0), "Talk to Brother Omad in the monastery south of East Ardougne."); talkToOmad.addDialogStep("Why can't you sleep, what's wrong?"); - talkToOmad.addDialogStep("Can I help at all?"); + talkToOmad.addDialogStep("Yes."); + goDownLadder = new ObjectStep(this, ObjectID.LADDER_OUTSIDE_TO_UNDERGROUND, new WorldPoint(2561, 3222, 0), "Go down the ladder in a circle of stones west of the monastery."); grabBlanket = new DetailedQuestStep(this, new WorldPoint(2570, 9604, 0), "Pick up the Child's blanket in the room to the south.", blanket); - goUpLadder = new ObjectStep(this, ObjectID.LADDER_FROM_CELLAR, new WorldPoint(2561, 9622, 0), "Go back up the ladder."); - returnToOmadWithBlanket = new NpcStep(this, NpcID.BROTHER_OMAD, new WorldPoint(2607, 3211, 0), "Bring the blanket back to Brother Omad.", blanket); + goUpLadder = new ObjectStep(this, ObjectID.LADDER_FROM_CELLAR, new WorldPoint(2561, 9622, 0), "Go back up the ladder.", blanket); + returnToOmadWithBlanket = new NpcStep(this, NpcID.BROTHER_OMAD, new WorldPoint(2607, 3211, 0), "Bring the blanket back to Brother Omad in the monastery.", blanket); + talkToOmadAgain = new NpcStep(this, NpcID.BROTHER_OMAD, new WorldPoint(2607, 3211, 0), "Talk to Brother Omad again."); talkToOmadAgain.addDialogStep("Is there anything else I can help with?"); talkToOmadAgain.addDialogStep("Who's Brother Cedric?"); talkToOmadAgain.addDialogStep("Where should I look?"); + talkToCedric = new NpcStep(this, NpcID.BROTHER_CEDRIC, new WorldPoint(2614, 3258, 0), "Talk to Brother Cedric north of the monastery."); + talkToCedricWithJug = new NpcStep(this, NpcID.BROTHER_CEDRIC, new WorldPoint(2614, 3258, 0), "Talk to Brother Cedric again.", jugOfWater); talkToCedricWithJug.addDialogStep("Yes, I'd be happy to!"); continueTalkingToCedric = new NpcStep(this, NpcID.BROTHER_CEDRIC, new WorldPoint(2614, 3258, 0), "Talk to Brother Cedric again."); continueTalkingToCedric.addDialogStep("Yes, I'd be happy to!"); talkToCedricWithJug.addSubSteps(continueTalkingToCedric); + talkToCedricWithLog = new NpcStep(this, NpcID.BROTHER_CEDRIC, new WorldPoint(2614, 3258, 0), "Talk to Brother Cedric once again with logs.", log); + finishQuest = new NpcStep(this, NpcID.BROTHER_OMAD, new WorldPoint(2607, 3211, 0), "Return to Brother Omad to finish the quest."); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToOmad); + + var getBlanket = new ConditionalStep(this, goDownLadder); + getBlanket.addStep(and(inDungeon, blanket.alsoCheckBank()), goUpLadder); + getBlanket.addStep(blanket.alsoCheckBank(), returnToOmadWithBlanket); + getBlanket.addStep(inDungeon, grabBlanket); + + steps.put(10, getBlanket); + + steps.put(20, talkToOmadAgain); + steps.put(30, talkToCedric); + steps.put(40, talkToCedricWithJug); + steps.put(50, continueTalkingToCedric); + steps.put(60, talkToCedricWithLog); + steps.put(70, finishQuest); + + return steps; + } + @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(jugOfWater); - reqs.add(log); - return reqs; + return List.of( + jugOfWater, + log + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(ardougneCloak); - return reqs; + return List.of( + ardougneCloak + ); } @Override @@ -155,23 +179,46 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.WOODCUTTING, 2000)); + return List.of( + new ExperienceReward(Skill.WOODCUTTING, 2000) + ); } @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Law Runes", ItemID.LAWRUNE, 8)); + return List.of( + new ItemReward("Law Runes", ItemID.LAWRUNE, 8) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting off", Collections.singletonList(talkToOmad), jugOfWater, log)); - allSteps.add(new PanelDetails("Finding the blanket", Arrays.asList(goDownLadder, grabBlanket, goUpLadder, returnToOmadWithBlanket))); - allSteps.add(new PanelDetails("Help Cedric", Arrays.asList(talkToOmadAgain, talkToCedric, talkToCedricWithJug, talkToCedricWithLog, finishQuest))); - - return allSteps; + List sections = new ArrayList<>(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToOmad + ), List.of( + jugOfWater, + log + ))); + + sections.add(new PanelDetails("Finding the blanket", List.of( + goDownLadder, + grabBlanket, + goUpLadder, + returnToOmadWithBlanket + ))); + + sections.add(new PanelDetails("Help Cedric", List.of( + talkToOmadAgain, + talkToCedric, + talkToCedricWithJug, + talkToCedricWithLog, + finishQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mountaindaughter/MountainDaughter.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mountaindaughter/MountainDaughter.java index b2b99ee099c..8656228c9ac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mountaindaughter/MountainDaughter.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mountaindaughter/MountainDaughter.java @@ -43,12 +43,8 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.*; import java.util.*; @@ -104,8 +100,8 @@ public Map loadSteps() helpTheCamp.addStep(new Conditions(givenGuaranteeToSvidi, finishedFood), returnToHamalAboutDiplomacy); // Get fruit - helpTheCamp.addStep(new Conditions(givenGuaranteeToSvidi, whitePearlSeed.alsoCheckBank(questBank)), returnToHamalAboutFood); - helpTheCamp.addStep(new Conditions(givenGuaranteeToSvidi, whitePearl.alsoCheckBank(questBank)), eatFruit); + helpTheCamp.addStep(new Conditions(givenGuaranteeToSvidi, whitePearlSeed.alsoCheckBank()), returnToHamalAboutFood); + helpTheCamp.addStep(new Conditions(givenGuaranteeToSvidi, whitePearl.alsoCheckBank()), eatFruit); helpTheCamp.addStep(givenGuaranteeToSvidi, getFruit); // Fremennik friendship @@ -133,15 +129,15 @@ public Map loadSteps() steps.put(40, killKendalStep); ConditionalStep returnTheCorpse = new ConditionalStep(this, enterCave); - returnTheCorpse.addStep(corpse.alsoCheckBank(questBank), bringCorpseToHamal); + returnTheCorpse.addStep(corpse.alsoCheckBank(), bringCorpseToHamal); returnTheCorpse.addStep(inKendalCave, grabCorpse); steps.put(50, returnTheCorpse); ConditionalStep buryCorpse = new ConditionalStep(this, enterCampOverRocks); buryCorpse.addStep(hasBuried, createCairn); - buryCorpse.addStep(necklace.alsoCheckBank(questBank), buryCorpseOnIsland); - buryCorpse.addStep(muddyRocks5.alsoCheckBank(questBank), speakRagnar); + buryCorpse.addStep(necklace.alsoCheckBank(), buryCorpseOnIsland); + buryCorpse.addStep(muddyRocks5.alsoCheckBank(), speakRagnar); buryCorpse.addStep(inTheCamp, collectRocks); steps.put(60, buryCorpse); @@ -214,23 +210,23 @@ private void loadConditions() onIsland3 = new Conditions(new ZoneRequirement(LAKE_ISLAND_3)); inTheCamp = new Conditions(new ZoneRequirement(CAMP_ZONE_1, CAMP_ZONE_2, CAMP_ZONE_3)); - askedAboutDiplomacy = new Conditions(new VarbitRequirement(262, 10)); - rubbedMudIntoTree = new Conditions(new VarbitRequirement(261, 1)); + askedAboutDiplomacy = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 10)); + rubbedMudIntoTree = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_MUD_VAR, 1)); VarbitRequirement askedAboutFood = new VarbitRequirement(VarbitID.MDAUGHTER_FOOD_VAR, 10, Operation.GREATER_EQUAL); - askedAboutFoodAndDiplomacy = new Conditions(new VarbitRequirement(262, 10), askedAboutFood); - spokenToSvidi = new Conditions(new VarbitRequirement(262, 20), askedAboutFood); - spokenToBrundt = new Conditions(new VarbitRequirement(262, 30), askedAboutFood); - minedRock = new Conditions(new VarbitRequirement(262, 40), askedAboutFood); - gottenGuarantee = new Conditions(new VarbitRequirement(262, 50), askedAboutFood); - givenGuaranteeToSvidi = new Conditions(new VarbitRequirement(262, 60), askedAboutFood); - finishedDiplomacy = new Conditions(new VarbitRequirement(266, 1)); - finishedFood = new VarbitRequirement(263, 20); + askedAboutFoodAndDiplomacy = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 10), askedAboutFood); + spokenToSvidi = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 20), askedAboutFood); + spokenToBrundt = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 30), askedAboutFood); + minedRock = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 40), askedAboutFood); + gottenGuarantee = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 50), askedAboutFood); + givenGuaranteeToSvidi = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_RELATIONS_VAR, 60), askedAboutFood); + finishedDiplomacy = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_HAMAL_RELATIONS_DONE, 1)); + finishedFood = new VarbitRequirement(VarbitID.MDAUGHTER_FOOD_VAR, 20); finishedFoodAndDiplomacy = new Conditions(finishedDiplomacy, finishedFood); inKendalCave = new Conditions(new ZoneRequirement(KENDAL_CAVE)); fightableKendalNearby = new Conditions(new NpcHintArrowRequirement(NpcID.MDAUGHTER_BEARMAN_FIGHTER)); - hasBuried = new Conditions(new VarbitRequirement(273, 1)); + hasBuried = new Conditions(new VarbitRequirement(VarbitID.MDAUGHTER_BURIAL_STATE, 1)); } private void loadQuestSteps() @@ -343,8 +339,8 @@ private void loadQuestSteps() enterCave = new ObjectStep(this, ObjectID.MDAUGHTER_CAVEENTRANCE, new WorldPoint(2809, 3703, 0), "Cut through the trees north east of the lake and enter the cave there. Bring combat gear.", axe); - ((ObjectStep) enterCave).addTileMarker(new WorldPoint(2802, 3703, 0), SpriteID.COMBAT_STYLE_AXE_CHOP); - ((ObjectStep) enterCave).addTileMarker(new WorldPoint(2807, 3703, 0), SpriteID.COMBAT_STYLE_AXE_CHOP); + ((ObjectStep) enterCave).addTileMarker(new WorldPoint(2802, 3703, 0), SpriteID.Combaticons.AXE_CHOP); + ((ObjectStep) enterCave).addTileMarker(new WorldPoint(2807, 3703, 0), SpriteID.Combaticons.AXE_CHOP); talkToKendal = new NpcStep(this, NpcID.MDAUGHTER_BEARMAN, new WorldPoint(2788, 10081, 0), "Speak to the Kendal, then kill him."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendparti/MourningsEndPartI.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendparti/MourningsEndPartI.java index bf182ba05a7..d078424a57c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendparti/MourningsEndPartI.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendparti/MourningsEndPartI.java @@ -114,8 +114,8 @@ public Map loadSteps() enterMournerHQ.addStep(inMournerHQ, enterBasement); ConditionalStep prepareItems = new ConditionalStep(this, getItems); - prepareItems.addStep(new Conditions(hasAllMournerItems, mournerBody.alsoCheckBank(questBank), mournerLegs.alsoCheckBank(questBank)), enterMournerHQ); - prepareItems.addStep(new Conditions(hasAllMournerItems, mournerBody.alsoCheckBank(questBank)), repairTrousersSteps); + prepareItems.addStep(new Conditions(hasAllMournerItems, mournerBody.alsoCheckBank(), mournerLegs.alsoCheckBank()), enterMournerHQ); + prepareItems.addStep(new Conditions(hasAllMournerItems, mournerBody.alsoCheckBank()), repairTrousersSteps); prepareItems.addStep(new Conditions(hasAllMournerItems), cleanTopSteps); steps.put(3, prepareItems); @@ -156,11 +156,11 @@ public Map loadSteps() takeAppleToElena.addStep(new Conditions(twoPoisoned, inMournerHQ), enterMournerBasementAfterPoison); takeAppleToElena.addStep(twoPoisoned, enterMournerBaseAfterPoison); takeAppleToElena.addStep(new Conditions(receivedSieve, poisoned1), usePowderOnFood2); - takeAppleToElena.addStep(new Conditions(receivedSieve, toxicPowder.alsoCheckBank(questBank)), usePowderOnFood1); + takeAppleToElena.addStep(new Conditions(receivedSieve, toxicPowder.alsoCheckBank()), usePowderOnFood1); takeAppleToElena.addStep(new Conditions(receivedSieve, toxicNaphtha), cookNaphtha); takeAppleToElena.addStep(new Conditions(receivedSieve, naphthaAppleMix), useSieveOnBarrel); - takeAppleToElena.addStep(new Conditions(receivedSieve, appleBarrel.alsoCheckBank(questBank), naphtha), useNaphthaOnBarrel); - takeAppleToElena.addStep(new Conditions(receivedSieve, appleBarrel.alsoCheckBank(questBank)), getNaphtha); + takeAppleToElena.addStep(new Conditions(receivedSieve, appleBarrel.alsoCheckBank(), naphtha), useNaphthaOnBarrel); + takeAppleToElena.addStep(new Conditions(receivedSieve, appleBarrel.alsoCheckBank()), getNaphtha); takeAppleToElena.addStep(new Conditions(receivedSieve, barrelOfRottenApples), useApplesOnPress); takeAppleToElena.addStep(new Conditions(receivedSieve, emptyBarrel), useBarrelOnPile); takeAppleToElena.addStep(receivedSieve, pickUpBarrel); @@ -294,16 +294,16 @@ public void setupConditions() releasedGnome = new VarbitRequirement(VarbitID.MOURNING_GNOME, 7, Operation.GREATER_EQUAL); repairedDevice = new VarbitRequirement(VarbitID.MOURNING_GNOME, 9, Operation.GREATER_EQUAL); - learntAboutToads = new VarbitRequirement(9155, 1); - redToadLoaded = new VarbitRequirement(804, 1); - greenToadLoaded = new VarbitRequirement(804, 2); - blueToadLoaded = new VarbitRequirement(804, 3); - yellowToadLoaded = new VarbitRequirement(804, 4); + learntAboutToads = new VarbitRequirement(VarbitID.MOURNING_DYE_CHAT, 1); + redToadLoaded = new VarbitRequirement(VarbitID.MOURNING_GUN_AMMO, 1); + greenToadLoaded = new VarbitRequirement(VarbitID.MOURNING_GUN_AMMO, 2); + blueToadLoaded = new VarbitRequirement(VarbitID.MOURNING_GUN_AMMO, 3); + yellowToadLoaded = new VarbitRequirement(VarbitID.MOURNING_GUN_AMMO, 4); - greenDyed = new VarbitRequirement(803, 1); - redDyed = new VarbitRequirement(801, 1); - yellowDyed = new VarbitRequirement(802, 1); - blueDyed = new VarbitRequirement(800, 1); + greenDyed = new VarbitRequirement(VarbitID.MOURNING_SHEEP_GREEN, 1); + redDyed = new VarbitRequirement(VarbitID.MOURNING_SHEEP_RED, 1); + yellowDyed = new VarbitRequirement(VarbitID.MOURNING_SHEEP_YELLOW, 1); + blueDyed = new VarbitRequirement(VarbitID.MOURNING_SHEEP_BLUE, 1); greenToadGot = new Conditions(LogicType.OR, greenToadLoaded, greenToad, greenDyed); redToadGot = new Conditions(LogicType.OR, redToadLoaded, redToad, redDyed); @@ -315,9 +315,9 @@ public void setupConditions() givenRottenApple = new VarbitRequirement(VarbitID.MOURNING_ELENA, 2, Operation.GREATER_EQUAL); receivedSieve = new VarbitRequirement(VarbitID.MOURNING_ELENA, 4, Operation.GREATER_EQUAL); - poisoned1 = new VarbitRequirement(806, 1); - poisoned2 = new VarbitRequirement(807, 1); - poisoned3 = new VarbitRequirement(808, 1); + poisoned1 = new VarbitRequirement(VarbitID.MOURNING_FOOD_POISON1, 1); + poisoned2 = new VarbitRequirement(VarbitID.MOURNING_FOOD_POISON2, 1); + poisoned3 = new VarbitRequirement(VarbitID.MOURNING_FOOD_POISON3, 1); twoPoisoned = new Conditions(LogicType.OR, new Conditions(poisoned1, poisoned2), new Conditions(poisoned1, poisoned3), new Conditions(poisoned2, poisoned3)); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendpartii/MourningsEndPartII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendpartii/MourningsEndPartII.java index 887f8957fe9..9fe790e908b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendpartii/MourningsEndPartII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/mourningsendpartii/MourningsEndPartII.java @@ -146,7 +146,7 @@ public Map loadSteps() steps.put(5, goTalkToEssyllt); ConditionalStep getCrystal = new ConditionalStep(this, enterMournerHQ); - getCrystal.addStep(blackenedCrystal.alsoCheckBank(questBank), bringCrystalToArianwyn); + getCrystal.addStep(blackenedCrystal.alsoCheckBank(), bringCrystalToArianwyn); getCrystal.addStep(inNorthF2, useChisel); getCrystal.addStep(inTempleStairSquare, goUpFromMiddleToNorth); getCrystal.addStep(inSouthF2, goToMiddleFromSouth); @@ -432,10 +432,10 @@ protected void setupRequirements() blackenedCrystal = new ItemRequirement("Blackened crystal", ItemID.MOURNING_CRYSTAL_SAMPLE); newlyMadeCrystal = new ItemRequirement("Newly made crystal", ItemID.MOURNING_CRYSTAL_NEW_SAMPLE); - newlyMadeCrystal.setTooltip("You can get another from Arianwyn in Llyeta"); + newlyMadeCrystal.setTooltip("You can get another from Arianwyn in Lletya"); newlyMadeCrystalHighlight = new ItemRequirement("Newly made crystal", ItemID.MOURNING_CRYSTAL_NEW_SAMPLE); - newlyMadeCrystalHighlight.setTooltip("You can get another from Arianwyn in Llyeta"); + newlyMadeCrystalHighlight.setTooltip("You can get another from Arianwyn in Lletya"); newlyMadeCrystalHighlight.setHighlightInInventory(true); newlyIfOneTrip = new ItemRequirement("Newly made crystal (if already have death talisman)", ItemID.MOURNING_CRYSTAL_NEW_SAMPLE); @@ -499,24 +499,24 @@ public void setupConditions() inDeathAltar = new ZoneRequirement(deathAltar); - dispenserEmpty = new VarbitRequirement(1106, 0); + dispenserEmpty = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_MIRRORS_RESET_TRAY, 0); // 1108 yellow crystal in dispenser // 1107, blue crystal in dispenser - usedRope = new VarbitRequirement(1328, 1); + usedRope = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_ROPE, 1); - knowToUseCrystal = new VarbitRequirement(1104, 1); + knowToUseCrystal = new VarbitRequirement(VarbitID.MOURNING_ARIANWYN_TOLD, 1); - solvedPuzzle1 = new VarbitRequirement(1113, 1); - solvedPuzzle2 = new VarbitRequirement(1114, 1); - solvedPuzzle3 = new VarbitRequirement(1116, 1); - solvedPuzzle4 = new VarbitRequirement(1115, 1); - solvedPuzzle5 = new VarbitRequirement(1117, 1); + solvedPuzzle1 = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_PARTS_2, 1); + solvedPuzzle2 = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_PARTS_3, 1); + solvedPuzzle3 = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_PARTS_5, 1); + solvedPuzzle4 = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_PARTS_4, 1); + solvedPuzzle5 = new VarbitRequirement(VarbitID.MOURNING_TEMPLE_PARTS_6, 1); - enteredDeathArea = new VarbitRequirement(1330, 1); + enteredDeathArea = new VarbitRequirement(VarbitID.MOURNING_LIGHT_DOOR_1_C_FIRST_TIME, 1); - receivedList = new VarbitRequirement(1327, 1); + receivedList = new VarbitRequirement(VarbitID.MOURNING_DWARF_STARTEDTASK, 1); final int RED = 1; final int YELLOW = 2; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/murdermystery/MurderMystery.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/murdermystery/MurderMystery.java index a0a0766a619..dc9ceec725b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/murdermystery/MurderMystery.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/murdermystery/MurderMystery.java @@ -42,189 +42,251 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.events.VarbitChanged; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.client.eventbus.Subscribe; +import net.runelite.api.gameval.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; public class MurderMystery extends BasicQuestHelper { - //Items Required - ItemRequirement pot, pungentPot, criminalsDaggerAny, criminalsDagger, criminalsDaggerFlour, criminalsThread, criminalsThread1, criminalsThread2, criminalsThread3, - twoFlypaper, potOfFlourHighlighted, flypaper, unknownPrint, silverNecklace, silverBook, silverBookFlour, silverNecklaceFlour, annaPrint, davidPrint, killersPrint, silverNeedle, - silverPot, silverNeedleFlour, silverPotFlour, elizabethPrint, frankPrint, criminalsDaggerHighlighted, criminalsDaggerFlourHighlighted, silverCup, silverCupFlour, silverBottle, - silverBottleFlour, bobPrint, carolPrint; - - RuneliteRequirement heardAboutPoisonSalesman, talkedToPoisonSalesman, hadThread, hadPot, hadKillerPrint; - - Requirement annaGuilty, bobGuilty, carolGuilty, davidGuilty, elizabethGuilty, frankGuilty, hasCriminalSilverItem, isUpstairs, - hasSuspectPrint, hasSilverItemFlour; - - Requirement talkedToAnna, talkedToBob, talkedToCarol, talkedToDavid, talkedToElizabeth, talkedToFrank, talkedToSuspect, pleaseWaitRequirement; - Requirement checkedAnna, checkedBob, checkedCarol, checkedDavid, checkedElizabeth, checkedFrank, checkedSuspect; - + // Required items + ItemRequirement pot; + + // Mid-quest requirements + ItemRequirement pungentPot; + ItemRequirement criminalsDaggerAny; + ItemRequirement criminalsDagger; + ItemRequirement criminalsDaggerFlour; + ItemRequirement criminalsThread; + ItemRequirement criminalsThread1; + ItemRequirement criminalsThread2; + ItemRequirement criminalsThread3; + ItemRequirement twoFlypaper; + ItemRequirement potOfFlourHighlighted; + ItemRequirement flypaper; + ItemRequirement unknownPrint; + ItemRequirement silverNecklace; + ItemRequirement silverBook; + ItemRequirement silverBookFlour; + ItemRequirement silverNecklaceFlour; + ItemRequirement annaPrint; + ItemRequirement davidPrint; + ItemRequirement killersPrint; + ItemRequirement silverNeedle; + ItemRequirement silverPot; + ItemRequirement silverNeedleFlour; + ItemRequirement silverPotFlour; + ItemRequirement elizabethPrint; + ItemRequirement frankPrint; + ItemRequirement criminalsDaggerHighlighted; + ItemRequirement criminalsDaggerFlourHighlighted; + ItemRequirement silverCup; + ItemRequirement silverCupFlour; + ItemRequirement silverBottle; + ItemRequirement silverBottleFlour; + ItemRequirement bobPrint; + ItemRequirement carolPrint; + + // Zones Zone upstairs; - QuestStep talkToGuard, talkToGossip, talkToPoisonSalesman, pickUpDagger, pickUpPungentPot, searchWindowForThread, fillPotWithFlour, useFlourOnDagger, - collectTwoFlypaper, useFlypaperOnDagger, searchAnnasBarrel, searchDavidsBarrel, searchFranksBarrel, searchElizabethsBarrel, - searchBobsBarrel, searchCarolsBarrel, remainingSteps, finishQuest; - - QuestStep useFlourOnNecklace, useFlourOnCup, useFlourOnBottle, useFlourOnBook, useFlourOnNeedle, useFlourOnPot; - QuestStep useFlypaperOnNecklace, useFlypaperOnCup, useFlypaperOnBottle, useFlypaperOnBook, useFlypaperOnNeedle, useFlypaperOnPot; - QuestStep collectFlypaper, fillPotWithFlourForSilver; - QuestStep compareAnna, compareBob, compareCarol, compareDavid, compareElizabeth, compareFrank; - QuestStep talkToAnna, talkToBob, talkToFrank, talkToDavid, talkToCarol, talkToElizabeth; - QuestStep searchAnna, searchBob, searchCarol, searchDavid, searchElizabeth, searchFrank; - - ConditionalStep useFlour, searchBarrel, useFlypaper, comparePrints, talkToSuspect, searchSuspectItem; - DetailedQuestStep useFlourSidebar, searchBarrelSidebar, useFlypaperSidebar, comparePrintsSidebar, talkToSuspectSidebar, searchSuspectItemSidebar; + // Miscellaneous requirements + RuneliteRequirement heardAboutPoisonSalesman; + RuneliteRequirement talkedToPoisonSalesman; + RuneliteRequirement talkedToPoisonSalesman2; + RuneliteRequirement hadThread; + RuneliteRequirement hadPot; + RuneliteRequirement hadKillerPrint; + + VarplayerRequirement annaGuilty; + VarplayerRequirement bobGuilty; + VarplayerRequirement carolGuilty; + VarplayerRequirement davidGuilty; + VarplayerRequirement elizabethGuilty; + VarplayerRequirement frankGuilty; + Conditions hasCriminalSilverItem; + ZoneRequirement isUpstairs; + Requirement hasSuspectPrint; + Requirement hasSilverItemFlour; + + Conditions talkedToAnna; + Conditions talkedToBob; + Conditions talkedToCarol; + Conditions talkedToDavid; + Conditions talkedToElizabeth; + Conditions talkedToFrank; + RuneliteRequirement talkedToSuspect; + WidgetTextRequirement pleaseWaitRequirement; + + Requirement checkedAnna; + Requirement checkedBob; + Requirement checkedCarol; + Requirement checkedDavid; + Requirement checkedElizabeth; + Requirement checkedFrank; + Requirement checkedSuspect; + + // Steps + QuestStep talkToGuard; + QuestStep talkToGossip; + QuestStep talkToPoisonSalesman; + QuestStep talkToPoisonSalesman2; + QuestStep pickUpDagger; + QuestStep pickUpPungentPot; + QuestStep searchWindowForThread; + QuestStep fillPotWithFlour; + QuestStep useFlourOnDagger; + QuestStep collectTwoFlypaper; + QuestStep useFlypaperOnDagger; + QuestStep searchAnnasBarrel; + QuestStep searchDavidsBarrel; + QuestStep searchFranksBarrel; + QuestStep searchElizabethsBarrel; + QuestStep searchBobsBarrel; + QuestStep searchCarolsBarrel; + QuestStep remainingSteps; + QuestStep finishQuest; + + QuestStep useFlourOnNecklace; + QuestStep useFlourOnCup; + QuestStep useFlourOnBottle; + QuestStep useFlourOnBook; + QuestStep useFlourOnNeedle; + QuestStep useFlourOnPot; + + QuestStep useFlypaperOnNecklace; + QuestStep useFlypaperOnCup; + QuestStep useFlypaperOnBottle; + QuestStep useFlypaperOnBook; + QuestStep useFlypaperOnNeedle; + QuestStep useFlypaperOnPot; + + QuestStep collectFlypaper; + QuestStep fillPotWithFlourForSilver; + + QuestStep compareAnna; + QuestStep compareBob; + QuestStep compareCarol; + QuestStep compareDavid; + QuestStep compareElizabeth; + QuestStep compareFrank; + + QuestStep talkToAnna; + QuestStep talkToBob; + QuestStep talkToFrank; + QuestStep talkToDavid; + QuestStep talkToCarol; + QuestStep talkToElizabeth; + + QuestStep searchAnna; + QuestStep searchBob; + QuestStep searchCarol; + QuestStep searchDavid; + QuestStep searchElizabeth; + QuestStep searchFrank; + + ConditionalStep useFlour; + ConditionalStep searchBarrel; + ConditionalStep useFlypaper; + ConditionalStep comparePrints; + ConditionalStep talkToSuspect; + ConditionalStep searchSuspectItem; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupZone(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToGuard); + upstairs = new Zone(new WorldPoint(2727, 3571, 1), new WorldPoint(2752, 3585, 1)); + } - Requirement doesntNeedMoreFlypaper = new Conditions(LogicType.OR, twoFlypaper, new Conditions(flypaper, unknownPrint)); + @Override + protected void setupRequirements() + { + pot = new ItemRequirement("Pot", ItemID.POT_EMPTY); - Conditions hadPotAndThread = new Conditions(hadThread, hadPot); + pungentPot = new ItemRequirement("Pungent pot", ItemID.MURDERPOT2); - ConditionalStep checkingPrintSteps = new ConditionalStep(this, pickUpDagger); - /* compare prints */ - checkingPrintSteps.addStep(new Conditions(unknownPrint, hasSuspectPrint), comparePrints); - checkingPrintSteps.addStep(new Conditions(unknownPrint, hasSilverItemFlour, flypaper), useFlypaper); - checkingPrintSteps.addStep(new Conditions(unknownPrint, hasCriminalSilverItem, flypaper, potOfFlourHighlighted), useFlour); - checkingPrintSteps.addStep(new Conditions(unknownPrint, hasCriminalSilverItem, flypaper), fillPotWithFlourForSilver); - checkingPrintSteps.addStep(new Conditions(unknownPrint, hasCriminalSilverItem), collectFlypaper); - /* Unknown print */ - checkingPrintSteps.addStep(new Conditions(criminalsDaggerFlour, hasCriminalSilverItem), useFlypaperOnDagger); - checkingPrintSteps.addStep(new Conditions(criminalsDaggerAny, hasCriminalSilverItem, potOfFlourHighlighted), useFlourOnDagger); - checkingPrintSteps.addStep(new Conditions(criminalsDaggerAny, doesntNeedMoreFlypaper, hasCriminalSilverItem), fillPotWithFlour); - checkingPrintSteps.addStep(new Conditions(criminalsDaggerAny, doesntNeedMoreFlypaper), searchBarrel); - checkingPrintSteps.addStep(new Conditions(criminalsDaggerAny), collectTwoFlypaper); - - ConditionalStep investigating = new ConditionalStep(this, searchWindowForThread); - investigating.addStep(new Conditions(hadPotAndThread, hadKillerPrint, checkedSuspect), finishQuest); - investigating.addStep(new Conditions(hadPotAndThread, hadKillerPrint, talkedToSuspect), searchSuspectItem); - investigating.addStep(new Conditions(hadPotAndThread, hadKillerPrint, talkedToPoisonSalesman), talkToSuspect); - investigating.addStep(new Conditions(hadPotAndThread, hadKillerPrint, heardAboutPoisonSalesman), talkToPoisonSalesman); - investigating.addStep(new Conditions(hadPotAndThread, hadKillerPrint), talkToGossip); - investigating.addStep(hadPotAndThread, checkingPrintSteps); /* Get dagger print */ - investigating.addStep(hadThread, pickUpPungentPot); + criminalsDaggerAny = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPON); + criminalsDaggerAny.addAlternates(ItemID.MURDERWEAPONDUST, ItemID.MURDERFINGERPRINT); - steps.put(1, investigating); + criminalsDagger = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPON); + criminalsDaggerHighlighted = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPON); + criminalsDaggerHighlighted.setHighlightInInventory(true); - if (client.getVarpValue(195) > 0) updateSuspect(); + criminalsDaggerFlour = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPONDUST); + criminalsDaggerFlourHighlighted = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPONDUST); + criminalsDaggerFlourHighlighted.setHighlightInInventory(true); - return steps; - } + criminalsThread = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADR); + criminalsThread.addAlternates(ItemID.MURDERTHREADG, ItemID.MURDERTHREADB); + criminalsThread1 = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADR); + criminalsThread2 = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADG); + criminalsThread3 = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADB); + twoFlypaper = new ItemRequirement("Flypaper", ItemID.MURDERPAPER, 2); + flypaper = new ItemRequirement("Flypaper", ItemID.MURDERPAPER); + flypaper.setHighlightInInventory(true); + flypaper.setTooltip("You can get more from the sack in the shed on the west of the Sinclair Mansion"); + potOfFlourHighlighted = new ItemRequirement("Pot of flour", ItemID.POT_FLOUR); + potOfFlourHighlighted.setHighlightInInventory(true); + unknownPrint = new ItemRequirement("Unknown print", ItemID.MURDERFINGERPRINT1); - @Subscribe - public void onVarbitChanged(VarbitChanged varbitChanged) - { - if (varbitChanged.getVarpId() != 195) return; + /* Thread 1 item */ + bobPrint = new ItemRequirement("Bob's print", ItemID.MURDERFINGERPRINTB); + carolPrint = new ItemRequirement("Carol's print", ItemID.MURDERFINGERPRINTC); + silverCup = new ItemRequirement("Silver cup", ItemID.MURDERCUP); + silverCupFlour = new ItemRequirement("Silver cup", ItemID.MURDERCUPDUST); + silverBottle = new ItemRequirement("Silver bottle", ItemID.MURDERBOTTLE); + silverBottleFlour = new ItemRequirement("Silver bottle", ItemID.MURDERBOTTLEDUST); - updateSuspect(); - } + /* Thread 2 items */ + annaPrint = new ItemRequirement("Anna's print", ItemID.MURDERFINGERPRINTA); + davidPrint = new ItemRequirement("David's print", ItemID.MURDERFINGERPRINTD); + silverNecklace = new ItemRequirement("Silver necklace", ItemID.MURDERNECKLACE); + silverNecklaceFlour = new ItemRequirement("Silver necklace", ItemID.MURDERNECKLACEDUST); + silverBook = new ItemRequirement("Silver book", ItemID.MURDERBOOK); + silverBookFlour = new ItemRequirement("Silver book", ItemID.MURDERBOOKDUST); - private void updateSuspect() - { - // 5 for me - int suspect = client.getVarpValue(195); - if (suspect == 1) - { - useFlourSidebar.getText().set(0, useFlourOnNecklace.getText().get(0)); - searchBarrelSidebar.getText().set(0, searchAnnasBarrel.getText().get(0)); - useFlypaperSidebar.getText().set(0, useFlypaperOnNecklace.getText().get(0)); - comparePrintsSidebar.getText().set(0, compareAnna.getText().get(0)); - talkToSuspectSidebar.getText().set(0, talkToAnna.getText().get(0)); - searchSuspectItemSidebar.getText().set(0, searchAnna.getText().get(0)); - } - else if (suspect == 2) - { - useFlourSidebar.getText().set(0, useFlourOnCup.getText().get(0)); - searchBarrelSidebar.getText().set(0, searchBobsBarrel.getText().get(0)); - useFlypaperSidebar.getText().set(0, useFlypaperOnCup.getText().get(0)); - comparePrintsSidebar.getText().set(0, compareBob.getText().get(0)); - talkToSuspectSidebar.getText().set(0, talkToBob.getText().get(0)); - searchSuspectItemSidebar.getText().set(0, searchBob.getText().get(0)); - } - else if (suspect == 3) - { - useFlourSidebar.getText().set(0, useFlourOnBottle.getText().get(0)); - searchBarrelSidebar.getText().set(0, searchCarolsBarrel.getText().get(0)); - useFlypaperSidebar.getText().set(0, useFlypaperOnBottle.getText().get(0)); - comparePrintsSidebar.getText().set(0, compareCarol.getText().get(0)); - talkToSuspectSidebar.getText().set(0, talkToCarol.getText().get(0)); - searchSuspectItemSidebar.getText().set(0, searchCarol.getText().get(0)); - } - else if (suspect == 4) - { - useFlourSidebar.getText().set(0, useFlourOnBook.getText().get(0)); - searchBarrelSidebar.getText().set(0, searchDavidsBarrel.getText().get(0)); - useFlypaperSidebar.getText().set(0, useFlypaperOnBook.getText().get(0)); - comparePrintsSidebar.getText().set(0, compareDavid.getText().get(0)); - talkToSuspectSidebar.getText().set(0, talkToDavid.getText().get(0)); - searchSuspectItemSidebar.getText().set(0, searchDavid.getText().get(0)); - } - else if (suspect == 5) - { - useFlourSidebar.getText().set(0, useFlourOnNeedle.getText().get(0)); - searchBarrelSidebar.getText().set(0, searchElizabethsBarrel.getText().get(0)); - useFlypaperSidebar.getText().set(0, useFlypaperOnNeedle.getText().get(0)); - comparePrintsSidebar.getText().set(0, compareElizabeth.getText().get(0)); - talkToSuspectSidebar.getText().set(0, talkToElizabeth.getText().get(0)); - searchSuspectItemSidebar.getText().set(0, searchElizabeth.getText().get(0)); - } - else if (suspect == 6) - { - useFlourSidebar.getText().set(0, useFlourOnPot.getText().get(0)); - searchBarrelSidebar.getText().set(0, searchFranksBarrel.getText().get(0)); - useFlypaperSidebar.getText().set(0, useFlypaperOnPot.getText().get(0)); - comparePrintsSidebar.getText().set(0, compareFrank.getText().get(0)); - talkToSuspectSidebar.getText().set(0, talkToFrank.getText().get(0)); - searchSuspectItemSidebar.getText().set(0, searchFrank.getText().get(0)); - } - } + /* Thread 3 items */ + elizabethPrint = new ItemRequirement("Elizabeth's print", ItemID.MURDERFINGERPRINTE); + frankPrint = new ItemRequirement("Frank's print", ItemID.MURDERFINGERPRINTF); + silverNeedle = new ItemRequirement("Silver needle", ItemID.MURDERNEEDLE); + silverNeedleFlour = new ItemRequirement("Silver needle", ItemID.MURDERNEEDLEDUST); + silverPot = new ItemRequirement("Silver needle", ItemID.MURDERPOT); + silverPotFlour = new ItemRequirement("Silver needle", ItemID.MURDERPOTDUST); - public void setupZone() - { - upstairs = new Zone(new WorldPoint(2727, 3571, 1), new WorldPoint(2752, 3585, 1)); + killersPrint = new ItemRequirement("Killer's print", ItemID.MURDERFINGERPRINT); } public void setupConditions() { isUpstairs = new ZoneRequirement(upstairs); - hadThread = new RuneliteRequirement(getConfigManager(), "murdermysteryhadthread", criminalsThread.alsoCheckBank(questBank)); - hadPot = new RuneliteRequirement(getConfigManager(), "murdermysteryhadpot", pungentPot.alsoCheckBank(questBank)); - heardAboutPoisonSalesman = new RuneliteRequirement(getConfigManager(), "murdermysterytalkedtogossip", - new Conditions(true, new DialogRequirement( "Especially as I heard that the poison salesman in the Seers' village made a big sale to one of the family the other day.")) + hadThread = new RuneliteRequirement(configManager, "murdermysteryhadthread", criminalsThread.alsoCheckBank()); + hadPot = new RuneliteRequirement(configManager, "murdermysteryhadpot", pungentPot.alsoCheckBank()); + heardAboutPoisonSalesman = new RuneliteRequirement(configManager, "murdermysterytalkedtogossip", + new Conditions(true, new DialogRequirement("Especially as I heard that the poison salesman in the Seers' village made a big sale to one of the family the other day.")) ); - talkedToPoisonSalesman = new RuneliteRequirement(getConfigManager(), "murdermysterytalkedtopoisonsalesman", + talkedToPoisonSalesman = new RuneliteRequirement(configManager, "murdermysterytalkedtopoisonsalesman", new Conditions(true, LogicType.OR, - new DialogRequirement(questHelperPlugin.getPlayerStateManager().getPlayerName(), "Uh... no, it's ok.", false), + new DialogRequirement(questHelperPlugin.getPlayerStateManager().getPlayerName(), "Uh... no, it's ok.", false), new DialogRequirement("Anna, Bob, Carol, David, Elizabeth and Frank all bought a bottle! " + - "In fact they bought the last of my supplies!") - )); + "In fact they bought the last of my supplies!") + )); + talkedToPoisonSalesman2 = new RuneliteRequirement(configManager, "murdermysterytalkedtopoisonsalesmanpot", + new Conditions(true, new DialogRequirement("Yes... I suppose that could have happened...")) + ); - annaGuilty = new VarplayerRequirement(195, 1); - bobGuilty = new VarplayerRequirement(195, 2); - carolGuilty = new VarplayerRequirement(195, 3); - davidGuilty = new VarplayerRequirement(195, 4); - elizabethGuilty = new VarplayerRequirement(195, 5); - frankGuilty = new VarplayerRequirement(195, 6); + annaGuilty = new VarplayerRequirement(VarPlayerID.MURDERSUS, 1); + bobGuilty = new VarplayerRequirement(VarPlayerID.MURDERSUS, 2); + carolGuilty = new VarplayerRequirement(VarPlayerID.MURDERSUS, 3); + davidGuilty = new VarplayerRequirement(VarPlayerID.MURDERSUS, 4); + elizabethGuilty = new VarplayerRequirement(VarPlayerID.MURDERSUS, 5); + frankGuilty = new VarplayerRequirement(VarPlayerID.MURDERSUS, 6); - hasCriminalSilverItem = new Conditions( - LogicType.OR, + hasCriminalSilverItem = or( new Conditions(annaGuilty, silverNecklace), new Conditions(bobGuilty, silverCup), new Conditions(carolGuilty, silverBottle), @@ -233,8 +295,7 @@ public void setupConditions() new Conditions(frankGuilty, silverPot) ); - hasSuspectPrint = new Conditions( - LogicType.OR, + hasSuspectPrint = or( new Conditions(annaGuilty, annaPrint), new Conditions(bobGuilty, bobPrint), new Conditions(carolGuilty, carolPrint), @@ -243,18 +304,18 @@ public void setupConditions() new Conditions(frankGuilty, frankPrint) ); - hadKillerPrint = new RuneliteRequirement(getConfigManager(), "murdermysteryhadkillerprint", + hadKillerPrint = new RuneliteRequirement(configManager, "murdermysteryhadkillerprint", new Conditions(killersPrint) ); hasSilverItemFlour = new Conditions( LogicType.OR, - new Conditions(annaGuilty, silverNecklaceFlour), - new Conditions(bobGuilty, silverCupFlour), - new Conditions(carolGuilty, silverBottleFlour), - new Conditions(davidGuilty, silverBookFlour), - new Conditions(elizabethGuilty, silverNeedleFlour), - new Conditions(frankGuilty, silverPotFlour) + and(annaGuilty, silverNecklaceFlour), + and(bobGuilty, silverCupFlour), + and(carolGuilty, silverBottleFlour), + and(davidGuilty, silverBookFlour), + and(elizabethGuilty, silverNeedleFlour), + and(frankGuilty, silverPotFlour) ); // TODO: This currently can't be used as checks are on each tick, but the text change + removal can occur within a tick @@ -284,7 +345,7 @@ public void setupConditions() true, new DialogRequirement("Frank", "clean that family crest", false) ); - talkedToSuspect = new RuneliteRequirement(getConfigManager(), "murdermysterytalkedtosuspect", + talkedToSuspect = new RuneliteRequirement(configManager, "murdermysterytalkedtosuspect", new Conditions( LogicType.OR, new Conditions(annaGuilty, talkedToAnna), @@ -298,29 +359,29 @@ public void setupConditions() checkedAnna = new Conditions( true, - new WidgetTextRequirement(229, 1, "The compost is teeming with maggots.") + new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, "The compost is teeming with maggots.") ); checkedBob = new Conditions( true, - new WidgetTextRequirement(229, 1, "The beehive buzzes with activity.") + new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, "The beehive buzzes with activity.") ); checkedCarol = new Conditions( true, - new WidgetTextRequirement(229, 1, "The drain is totally blocked.") + new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, "The drain is totally blocked.") ); checkedDavid = new Conditions( true, - new WidgetTextRequirement(229, 1, "few hundred spiders ready to hatch.") + new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, "few hundred spiders ready to hatch.") ); checkedElizabeth = new Conditions( true, - new WidgetTextRequirement(229, 1, "The fountain is swarming") + new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, "The fountain is swarming") ); checkedFrank = new Conditions( true, - new WidgetTextRequirement(229, 1, "crest but it is very dirty") + new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, "crest but it is very dirty") ); - checkedSuspect = new RuneliteRequirement(getConfigManager(), "murdermysterydisprovedsuspect", + checkedSuspect = new RuneliteRequirement(configManager, "murdermysterydisprovedsuspect", new Conditions( LogicType.OR, checkedAnna, @@ -334,71 +395,64 @@ public void setupConditions() } @Override - protected void setupRequirements() + public Map loadSteps() { - pot = new ItemRequirement("Pot", ItemID.POT_EMPTY); - pungentPot = new ItemRequirement("Pungent pot", ItemID.MURDERPOT2); + initializeRequirements(); + setupConditions(); + setupSteps(); - criminalsDaggerAny = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPON); - criminalsDaggerAny.addAlternates(ItemID.MURDERWEAPONDUST, ItemID.MURDERFINGERPRINT); + var steps = new HashMap(); - criminalsDagger = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPON); - criminalsDaggerHighlighted = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPON); - criminalsDaggerHighlighted.setHighlightInInventory(true); + steps.put(0, talkToGuard); - criminalsDaggerFlour = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPONDUST); - criminalsDaggerFlourHighlighted = new ItemRequirement("Criminal's dagger", ItemID.MURDERWEAPONDUST); - criminalsDaggerFlourHighlighted.setHighlightInInventory(true); + var doesntNeedMoreFlypaper = new Conditions(LogicType.OR, twoFlypaper, and(flypaper, unknownPrint)); - criminalsThread = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADR); - criminalsThread.addAlternates(ItemID.MURDERTHREADG, ItemID.MURDERTHREADB); - criminalsThread1 = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADR); - criminalsThread2 = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADG); - criminalsThread3 = new ItemRequirement("Criminal's thread", ItemID.MURDERTHREADB); - twoFlypaper = new ItemRequirement("Flypaper", ItemID.MURDERPAPER, 2); - flypaper = new ItemRequirement("Flypaper", ItemID.MURDERPAPER); - flypaper.setHighlightInInventory(true); - flypaper.setTooltip("You can get more from the sack in the shed on the west of the Sinclair Mansion"); - potOfFlourHighlighted = new ItemRequirement("Pot of flour", ItemID.POT_FLOUR); - potOfFlourHighlighted.setHighlightInInventory(true); - unknownPrint = new ItemRequirement("Unknown print", ItemID.MURDERFINGERPRINT1); + var hadPotAndThread = and(hadThread, hadPot); - /* Thread 1 items */ - bobPrint = new ItemRequirement("Bob's print", ItemID.MURDERFINGERPRINTB); - carolPrint = new ItemRequirement("Carol's print", ItemID.MURDERFINGERPRINTC); - silverCup = new ItemRequirement("Silver cup", ItemID.MURDERCUP); - silverCupFlour = new ItemRequirement("Silver cup", ItemID.MURDERCUPDUST); - silverBottle = new ItemRequirement("Silver bottle", ItemID.MURDERBOTTLE); - silverBottleFlour = new ItemRequirement("Silver bottle", ItemID.MURDERBOTTLEDUST); - - /* Thread 2 items */ - annaPrint = new ItemRequirement("Anna's print", ItemID.MURDERFINGERPRINTA); - davidPrint = new ItemRequirement("David's print", ItemID.MURDERFINGERPRINTD); - silverNecklace = new ItemRequirement("Silver necklace", ItemID.MURDERNECKLACE); - silverNecklaceFlour = new ItemRequirement("Silver necklace", ItemID.MURDERNECKLACEDUST); - silverBook = new ItemRequirement("Silver book", ItemID.MURDERBOOK); - silverBookFlour = new ItemRequirement("Silver book", ItemID.MURDERBOOKDUST); + var checkingPrintSteps = new ConditionalStep(this, pickUpDagger); + /* compare prints */ + checkingPrintSteps.addStep(and(unknownPrint, hasSuspectPrint), comparePrints); + checkingPrintSteps.addStep(and(unknownPrint, hasSilverItemFlour, flypaper), useFlypaper); + checkingPrintSteps.addStep(and(unknownPrint, hasCriminalSilverItem, flypaper, potOfFlourHighlighted), useFlour); + checkingPrintSteps.addStep(and(unknownPrint, hasCriminalSilverItem, flypaper), fillPotWithFlourForSilver); + checkingPrintSteps.addStep(and(unknownPrint, hasCriminalSilverItem), collectFlypaper); + /* Unknown print */ + checkingPrintSteps.addStep(and(criminalsDaggerFlour, hasCriminalSilverItem), useFlypaperOnDagger); + checkingPrintSteps.addStep(and(criminalsDaggerAny, hasCriminalSilverItem, potOfFlourHighlighted), useFlourOnDagger); + checkingPrintSteps.addStep(and(criminalsDaggerAny, doesntNeedMoreFlypaper, hasCriminalSilverItem), fillPotWithFlour); + checkingPrintSteps.addStep(and(criminalsDaggerAny, doesntNeedMoreFlypaper), searchBarrel); + checkingPrintSteps.addStep(criminalsDaggerAny, collectTwoFlypaper); + + var investigating = new ConditionalStep(this, searchWindowForThread); + investigating.addStep(and(hadPotAndThread, hadKillerPrint, checkedSuspect), finishQuest); + investigating.addStep(and(hadPotAndThread, hadKillerPrint, talkedToSuspect), searchSuspectItem); + // If we've talked to the Poison Salesman through the "find customers" option, _AND_ through the "i found this pot....." option (but only if we have the pot still), + // then prompt the player to talk to the suspect + investigating.addStep(and(hadPotAndThread, hadKillerPrint, talkedToPoisonSalesman, or(talkedToPoisonSalesman2, not(pungentPot))), talkToSuspect); + investigating.addStep(and(hadPotAndThread, hadKillerPrint, talkedToPoisonSalesman2, not(talkedToPoisonSalesman)), talkToPoisonSalesman); + investigating.addStep(and(hadPotAndThread, hadKillerPrint, talkedToPoisonSalesman, not(talkedToPoisonSalesman2), pungentPot), talkToPoisonSalesman2); + investigating.addStep(and(hadPotAndThread, hadKillerPrint, heardAboutPoisonSalesman), talkToPoisonSalesman); + investigating.addStep(and(hadPotAndThread, hadKillerPrint), talkToGossip); + investigating.addStep(hadPotAndThread, checkingPrintSteps); /* Get dagger print */ + investigating.addStep(hadThread, pickUpPungentPot); - /* Thread 3 items */ - elizabethPrint = new ItemRequirement("Elizabeth's print", ItemID.MURDERFINGERPRINTE); - frankPrint = new ItemRequirement("Frank's print", ItemID.MURDERFINGERPRINTF); - silverNeedle = new ItemRequirement("Silver needle", ItemID.MURDERNEEDLE); - silverNeedleFlour = new ItemRequirement("Silver needle", ItemID.MURDERNEEDLEDUST); - silverPot = new ItemRequirement("Silver needle", ItemID.MURDERPOT); - silverPotFlour = new ItemRequirement("Silver needle", ItemID.MURDERPOTDUST); + steps.put(1, investigating); - killersPrint = new ItemRequirement("Killer's print", ItemID.MURDERFINGERPRINT); + return steps; } public void setupSteps() { talkToGuard = new NpcStep(this, NpcID.MURDERGUARD, new WorldPoint(2741, 3561, 0), "Talk to the Guard in the Sinclair Manor north of Camelot."); - talkToGuard.addDialogSteps("Yes.", "Sure, I'll help."); + talkToGuard.addDialogSteps("Yes."); - pickUpPungentPot = new DetailedQuestStep(this, new WorldPoint(2747, 3579, 0), "Enter the mansion and pick up the pungent pot inside the east room.", pungentPot); - pickUpDagger = new DetailedQuestStep(this, new WorldPoint(2746, 3578, 0), "Pick up the criminal's dagger.", criminalsDaggerAny); + pickUpPungentPot = new ItemStep(this, new WorldPoint(2747, 3579, 0), "Enter the mansion and pick up the pungent pot inside the east room.", pungentPot); + pickUpDagger = new ItemStep(this, new WorldPoint(2746, 3578, 0), "Pick up the criminal's dagger.", criminalsDaggerAny); searchWindowForThread = new ObjectStep(this, ObjectID.MURDERWINDOW, new WorldPoint(2748, 3577, 0), "Search the window for a clothing thread. The colour of the thread will match the killer's trousers.", criminalsThread); - fillPotWithFlour = new ObjectStep(this, ObjectID.FLOURBARREL, new WorldPoint(2733, 3582, 0), "Fill your pot with flour from the barrel in the mansion's kitchen.", pot); + var actuallyFillPotWithFlour = new ObjectStep(this, ObjectID.FLOURBARREL, new WorldPoint(2733, 3582, 0), "", pot); + var goDownstairs = new ObjectStep(this, ObjectID.MURDER_QIP_SPIRALSTAIRSTOP, new WorldPoint(2736, 3581, 1), "Head downstairs to the ground floor."); + fillPotWithFlour = new ConditionalStep(this, actuallyFillPotWithFlour, "Fill your pot with flour from the barrel in the mansion's kitchen."); + ((ConditionalStep) fillPotWithFlour).addStep(isUpstairs, goDownstairs); useFlourOnDagger = new DetailedQuestStep(this, "Use the pot of flour on the Criminal's dagger.", potOfFlourHighlighted, criminalsDaggerHighlighted); collectTwoFlypaper = new ObjectStep(this, ObjectID.MURDERSACKS, new WorldPoint(2731, 3582, 0), "Investigate the sacks in the shed for flypaper. Get 2 pieces.", twoFlypaper); collectTwoFlypaper.addDialogStep("Yes, it might be useful."); @@ -451,13 +505,16 @@ public void setupSteps() compareFrank = new DetailedQuestStep(this, "Use Frank's prints on the killer's print to compare them.", unknownPrint.highlighted(), frankPrint.highlighted()); talkToGossip = new NpcStep(this, NpcID.GOSSIPY_MAN, new WorldPoint(2741, 3557, 0), "Talk to Gossip, just south of the Sinclair Mansion."); - talkToGossip.addDialogStep(2, "Who do you think was responsible?"); + talkToGossip.addDialogStep("Who do you think was responsible?"); - talkToPoisonSalesman = new NpcStep(this, NpcID.POISON_SALESMAN, new WorldPoint(2694, 3493, 0), "Talk to the " + - "Poison Salesman in the Seers' Village pub."); + talkToPoisonSalesman = new NpcStep(this, NpcID.POISON_SALESMAN, new WorldPoint(2694, 3493, 0), "Talk to the Poison Salesman in the Seers' Village pub about his customers."); talkToPoisonSalesman.addDialogStep("Who did you sell Poison to at the house?"); talkToPoisonSalesman.addDialogStep("Talk about the Murder Mystery Quest"); + talkToPoisonSalesman2 = new NpcStep(this, NpcID.POISON_SALESMAN, new WorldPoint(2694, 3493, 0), "Talk to the Poison Salesman in the Seers' Village pub about the pungent pot.", pungentPot); + talkToPoisonSalesman2.addDialogStep("I have this pot I found at the murder scene..."); + talkToPoisonSalesman2.addDialogStep("Talk about the Murder Mystery Quest"); + talkToAnna = new NpcStep(this, NpcID.ANNA_SINCLAIR, new WorldPoint(2734, 3575, 0), "Talk to Anna in the mansion about what she used the poison for. Make sure to finish the dialog."); talkToBob = new NpcStep(this, NpcID.BOB_SINCLAIR, new WorldPoint(2748, 3559, 0), "Talk to Bob south of the mansion about what he used the poison for. Make sure to finish the dialog."); talkToFrank = new NpcStep(this, NpcID.FRANK_SINCLAIR, new WorldPoint(2742, 3577, 0), "Talk to Frank in the mansion about what he used the poison for. Make sure to finish the dialog."); @@ -471,7 +528,7 @@ public void setupSteps() searchBob = new ObjectStep(this, ObjectID.MURDERHIVE, new WorldPoint(2730, 3559, 0), "Search the beehive south west of the mansion. If a dialog box doesn't come up, go back to Bob to ask about poison, and COMPLETE THE DIALOG."); searchCarol = new ObjectStep(this, ObjectID.MURDERDRAIN, new WorldPoint(2736, 3573, 0), "Search the drain south of the mansion. If a dialog box doesn't come up, go back to Carol to ask about poison, and COMPLETE THE DIALOG."); searchDavid = new ConditionalStep(this, goUpstairs, "Search the spider's nest, upstairs in the mansion to the south. If a dialog box doesn't come up, go back to David to ask about poison, and COMPLETE THE DIALOG."); - ((ConditionalStep)searchDavid).addStep(isUpstairs, new ObjectStep(this, ObjectID.MURDERWEB, new WorldPoint(2740, 3574, 1), "")); + ((ConditionalStep) searchDavid).addStep(isUpstairs, new ObjectStep(this, ObjectID.MURDERWEB, new WorldPoint(2740, 3574, 1), "")); searchElizabeth = new ObjectStep(this, ObjectID.MURDERFOUNTAIN, new WorldPoint(2747, 3563, 0), "Search the fountain south east of the mansion. If a dialog box doesn't come up, go back to Elizabeth to ask about poison, and COMPLETE THE DIALOG."); searchFrank = new ObjectStep(this, ObjectID.MURDERSIGN, new WorldPoint(2746, 3573, 0), "Search the family crest attached to the south side of the mansion to the east. If a dialog box doesn't come up, go back to Frank to ask about poison, and COMPLETE THE DIALOG."); @@ -485,74 +542,74 @@ public void setupSteps() remainingSteps.addDialogStep("I know who did it!"); remainingSteps.setShowInSidebar(false); - useFlour = new ConditionalStep(this, new DetailedQuestStep(this, "")); - useFlour.addStep(new Conditions(elizabethGuilty), useFlourOnNeedle); - useFlour.addStep(new Conditions(annaGuilty), useFlourOnNecklace); - useFlour.addStep(new Conditions(carolGuilty), useFlourOnBottle); - useFlour.addStep(new Conditions(davidGuilty), useFlourOnBook); - useFlour.addStep(new Conditions(frankGuilty), useFlourOnPot); - useFlour.addStep(new Conditions(bobGuilty), useFlourOnCup); - useFlourSidebar = new DetailedQuestStep(this, "Use flour on the suspect's item."); - useFlourSidebar.addSubSteps(useFlourOnNeedle, useFlourOnNecklace, useFlourOnBottle, useFlourOnBook, useFlourOnPot, useFlourOnCup); - - searchBarrel = new ConditionalStep(this, new DetailedQuestStep(this, "")); - searchBarrel.addStep(new Conditions(elizabethGuilty), searchElizabethsBarrel); - searchBarrel.addStep(new Conditions(annaGuilty), searchAnnasBarrel); - searchBarrel.addStep(new Conditions(carolGuilty), searchCarolsBarrel); - searchBarrel.addStep(new Conditions(davidGuilty), searchDavidsBarrel); - searchBarrel.addStep(new Conditions(frankGuilty), searchFranksBarrel); - searchBarrel.addStep(new Conditions(bobGuilty), searchBobsBarrel); - searchBarrelSidebar = new DetailedQuestStep(this, "Search the suspect's barrel."); - searchBarrelSidebar.addSubSteps(searchElizabethsBarrel, searchAnnasBarrel, searchCarolsBarrel, searchDavidsBarrel, searchFranksBarrel, searchBobsBarrel); - - useFlypaper = new ConditionalStep(this, new DetailedQuestStep(this, "")); - useFlypaper.addStep(new Conditions(elizabethGuilty), useFlypaperOnNeedle); - useFlypaper.addStep(new Conditions(annaGuilty), useFlypaperOnNecklace); - useFlypaper.addStep(new Conditions(carolGuilty), useFlypaperOnBottle); - useFlypaper.addStep(new Conditions(davidGuilty), useFlypaperOnBook); - useFlypaper.addStep(new Conditions(frankGuilty), useFlypaperOnPot); - useFlypaper.addStep(new Conditions(bobGuilty), useFlypaperOnCup); - useFlypaperSidebar = new DetailedQuestStep(this, "Use flypaper on the floured item."); - useFlypaperSidebar.addSubSteps(useFlypaperOnNeedle, useFlypaperOnNecklace, useFlypaperOnBottle, useFlypaperOnBook, useFlypaperOnPot, useFlypaperOnCup); - - comparePrints = new ConditionalStep(this, new DetailedQuestStep(this, "")); - comparePrints.addStep(new Conditions(annaGuilty), compareAnna); - comparePrints.addStep(new Conditions(bobGuilty), compareBob); - comparePrints.addStep(new Conditions(carolGuilty), compareCarol); - comparePrints.addStep(new Conditions(davidGuilty), compareDavid); - comparePrints.addStep(new Conditions(elizabethGuilty), compareElizabeth); - comparePrints.addStep(new Conditions(frankGuilty), compareFrank); - comparePrintsSidebar = new DetailedQuestStep(this, "Compare the suspect's prints to the unknown prints."); - comparePrintsSidebar.addSubSteps(compareAnna, compareBob, compareCarol, compareDavid, compareElizabeth, compareFrank); - - talkToSuspect = new ConditionalStep(this, new DetailedQuestStep(this, "")); - talkToSuspect.addStep(new Conditions(elizabethGuilty), talkToElizabeth); - talkToSuspect.addStep(new Conditions(carolGuilty), talkToCarol); - talkToSuspect.addStep(new Conditions(davidGuilty), talkToDavid); - talkToSuspect.addStep(new Conditions(frankGuilty), talkToFrank); - talkToSuspect.addStep(new Conditions(bobGuilty), talkToBob); - talkToSuspect.addStep(new Conditions(annaGuilty), talkToAnna); + var useFlourFallback = new DetailedQuestStep(this, "Use flour on the suspect's item."); + useFlour = new ConditionalStep(this, useFlourFallback); + useFlour.setShouldPassthroughText(true); + useFlour.addStep(elizabethGuilty, useFlourOnNeedle); + useFlour.addStep(annaGuilty, useFlourOnNecklace); + useFlour.addStep(carolGuilty, useFlourOnBottle); + useFlour.addStep(davidGuilty, useFlourOnBook); + useFlour.addStep(frankGuilty, useFlourOnPot); + useFlour.addStep(bobGuilty, useFlourOnCup); + + var searchBarrelFallback = new DetailedQuestStep(this, "Search the suspect's barrel."); + searchBarrel = new ConditionalStep(this, searchBarrelFallback); + searchBarrel.setShouldPassthroughText(true); + searchBarrel.addStep(elizabethGuilty, searchElizabethsBarrel); + searchBarrel.addStep(annaGuilty, searchAnnasBarrel); + searchBarrel.addStep(carolGuilty, searchCarolsBarrel); + searchBarrel.addStep(davidGuilty, searchDavidsBarrel); + searchBarrel.addStep(frankGuilty, searchFranksBarrel); + searchBarrel.addStep(bobGuilty, searchBobsBarrel); + + var useFlypaperFallback = new DetailedQuestStep(this, "Use flypaper on the suspect's item."); + useFlypaper = new ConditionalStep(this, useFlypaperFallback); + useFlypaper.setShouldPassthroughText(true); + useFlypaper.addStep(elizabethGuilty, useFlypaperOnNeedle); + useFlypaper.addStep(annaGuilty, useFlypaperOnNecklace); + useFlypaper.addStep(carolGuilty, useFlypaperOnBottle); + useFlypaper.addStep(davidGuilty, useFlypaperOnBook); + useFlypaper.addStep(frankGuilty, useFlypaperOnPot); + useFlypaper.addStep(bobGuilty, useFlypaperOnCup); + + var comparePrintsFallback = new DetailedQuestStep(this, "Compare prints with the suspect."); + comparePrints = new ConditionalStep(this, comparePrintsFallback); + comparePrints.setShouldPassthroughText(true); + comparePrints.addStep(annaGuilty, compareAnna); + comparePrints.addStep(bobGuilty, compareBob); + comparePrints.addStep(carolGuilty, compareCarol); + comparePrints.addStep(davidGuilty, compareDavid); + comparePrints.addStep(elizabethGuilty, compareElizabeth); + comparePrints.addStep(frankGuilty, compareFrank); + + var talkToSuspectFallback = new DetailedQuestStep(this, "Talk to the suspect."); + talkToSuspect = new ConditionalStep(this, talkToSuspectFallback); + talkToSuspect.setShouldPassthroughText(true); + talkToSuspect.addStep(elizabethGuilty, talkToElizabeth); + talkToSuspect.addStep(carolGuilty, talkToCarol); + talkToSuspect.addStep(davidGuilty, talkToDavid); + talkToSuspect.addStep(frankGuilty, talkToFrank); + talkToSuspect.addStep(bobGuilty, talkToBob); + talkToSuspect.addStep(annaGuilty, talkToAnna); talkToSuspect.addDialogStep("Why'd you buy poison the other day?"); - talkToSuspectSidebar = new DetailedQuestStep(this, "Talk to the suspect."); - talkToSuspectSidebar.addSubSteps(talkToElizabeth, talkToCarol, talkToDavid, talkToFrank, talkToBob, talkToAnna); - - searchSuspectItem = new ConditionalStep(this, new DetailedQuestStep(this, "")); - searchSuspectItem.addStep(new Conditions(elizabethGuilty), searchElizabeth); - searchSuspectItem.addStep(new Conditions(carolGuilty), searchCarol); - searchSuspectItem.addStep(new Conditions(davidGuilty), searchDavid); - searchSuspectItem.addStep(new Conditions(frankGuilty), searchFrank); - searchSuspectItem.addStep(new Conditions(bobGuilty), searchBob); - searchSuspectItem.addStep(new Conditions(annaGuilty), searchAnna); - searchSuspectItemSidebar = new DetailedQuestStep(this, "Disprove the suspect's alibi by checking the thing they claimed to clean."); - searchSuspectItemSidebar.addSubSteps(searchElizabeth, searchCarol, searchDavid, searchFrank, searchBob, searchAnna); + + var searchSuspectItemFallback = new DetailedQuestStep(this, "Disprove the suspect's alibi by checking the thing they claimed to clean."); + searchSuspectItem = new ConditionalStep(this, searchSuspectItemFallback); + searchSuspectItem.setShouldPassthroughText(true); + searchSuspectItem.addStep(elizabethGuilty, searchElizabeth); + searchSuspectItem.addStep(carolGuilty, searchCarol); + searchSuspectItem.addStep(davidGuilty, searchDavid); + searchSuspectItem.addStep(frankGuilty, searchFrank); + searchSuspectItem.addStep(bobGuilty, searchBob); + searchSuspectItem.addStep(annaGuilty, searchAnna); } @Override public List getItemRequirements() { - ArrayList required = new ArrayList<>(); - required.add(pot); - return required; + return List.of( + pot + ); } @Override @@ -564,25 +621,57 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.CRAFTING, 1406)); + return List.of( + new ExperienceReward(Skill.CRAFTING, 1406) + ); } @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Coins", ItemID.COINS, 2000)); + return List.of( + new ItemReward("Coins", ItemID.COINS, 2000) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); + var allSteps = new ArrayList(); + + allSteps.add(new PanelDetails("Go to the Sinclair Manor", List.of( + talkToGuard + ), List.of( + pot + ))); + + allSteps.add(new PanelDetails("Collect evidence", List.of( + searchWindowForThread, + pickUpPungentPot, + pickUpDagger + ))); + + allSteps.add(new PanelDetails("Collect fingerprints", List.of( + collectTwoFlypaper, + searchBarrel, + fillPotWithFlour, + useFlourOnDagger, + useFlypaperOnDagger, + fillPotWithFlourForSilver, + useFlour, + useFlypaper, + comparePrints + ))); + + allSteps.add(new PanelDetails("Finishing off", List.of( + talkToGossip, + talkToPoisonSalesman, + talkToPoisonSalesman2, + talkToSuspect, + searchSuspectItem, + finishQuest + ))); - allSteps.add(new PanelDetails("Go to the Sinclair Manor", Collections.singletonList(talkToGuard), pot)); - allSteps.add(new PanelDetails("Collect evidence", Arrays.asList(pickUpPungentPot, pickUpDagger, searchWindowForThread))); - allSteps.add(new PanelDetails("Collect fingerprints", Arrays.asList(collectTwoFlypaper, searchBarrelSidebar, fillPotWithFlour, - useFlourOnDagger, useFlypaperOnDagger, fillPotWithFlourForSilver, useFlourSidebar, useFlypaperSidebar, comparePrintsSidebar))); - allSteps.add(new PanelDetails("Finishing off", Arrays.asList(talkToGossip, talkToPoisonSalesman, talkToSuspectSidebar, searchSuspectItemSidebar, finishQuest))); return allSteps; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddCompost.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddCompost.java index 559534663a3..6471f2b3274 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddCompost.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddCompost.java @@ -31,6 +31,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -56,7 +57,7 @@ public void onGameTick(GameTick event) protected void updateSteps() { - int numCompToAdd = 7 - client.getVarbitValue(2792); + int numCompToAdd = 7 - client.getVarbitValue(VarbitID.MYARM_SUPERCOMPOST); compost.setQuantity(numCompToAdd); this.setRequirements(Arrays.asList(compost, spade)); this.setText("Add " + numCompToAdd + " supercompost on My Arm's soil patch."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddDung.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddDung.java index cf1a4189010..a2693749cdd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddDung.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/AddDung.java @@ -7,6 +7,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -32,7 +33,7 @@ public void onGameTick(GameTick event) protected void updateSteps() { - int numCompToAdd = 3 - client.getVarbitValue(2791); + int numCompToAdd = 3 - client.getVarbitValue(VarbitID.MYARM_DUNG); dung.setQuantity(numCompToAdd); this.setRequirements(Arrays.asList(dung, spade)); this.setText("Add " + numCompToAdd + " ugthanki dung on My Arm's soil patch."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/MyArmsBigAdventure.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/MyArmsBigAdventure.java index 206015cfd52..dff3eeb43c7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/MyArmsBigAdventure.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/myarmsbigadventure/MyArmsBigAdventure.java @@ -105,10 +105,10 @@ public Map loadSteps() steps.put(50, goTalkToBurntmeat); ConditionalStep getGout = new ConditionalStep(this, useBucketOnPot); - getGout.addStep(new Conditions(goutLump.alsoCheckBank(questBank), inStrongholdFloor1), talkToArmWithLump); - getGout.addStep(new Conditions(goutLump.alsoCheckBank(questBank), inStrongholdFloor2), goDownToArmWithLump); - getGout.addStep(new Conditions(goutLump.alsoCheckBank(questBank), inPrison), goUpToArmWithLump); - getGout.addStep(goutLump.alsoCheckBank(questBank), enterStrongholdWithLump); + getGout.addStep(new Conditions(goutLump.alsoCheckBank(), inStrongholdFloor1), talkToArmWithLump); + getGout.addStep(new Conditions(goutLump.alsoCheckBank(), inStrongholdFloor2), goDownToArmWithLump); + getGout.addStep(new Conditions(goutLump.alsoCheckBank(), inPrison), goUpToArmWithLump); + getGout.addStep(goutLump.alsoCheckBank(), enterStrongholdWithLump); steps.put(60, getGout); @@ -279,15 +279,15 @@ public void setupConditions() inPrison = new ZoneRequirement(prison); onRoof = new ZoneRequirement(roof); - added3Dung = new VarbitRequirement(2791, 3); - added7Comp = new VarbitRequirement(2792, 7); + added3Dung = new VarbitRequirement(VarbitID.MYARM_DUNG, 3); + added7Comp = new VarbitRequirement(VarbitID.MYARM_SUPERCOMPOST, 7); - givenHardy = new VarbitRequirement(2794, 1); - usedRake = new VarbitRequirement(2799, 6); - givenCompost = new VarbitRequirement(2799, 7); + givenHardy = new VarbitRequirement(VarbitID.MYARM_TUBERS, 1); + usedRake = new VarbitRequirement(VarbitID.MYARM_FAKEPATCH, 6); + givenCompost = new VarbitRequirement(VarbitID.MYARM_FAKEPATCH, 7); givenDibber = new VarbitRequirement(VarbitID.MYARM_FAKEPATCH, 9, Operation.GREATER_EQUAL); - givenCure = new VarbitRequirement(2798, 1); + givenCure = new VarbitRequirement(VarbitID.MYARM_BARNABYSWAP, 1); hasRakeHeadAndHandle = new Conditions(rakeHead, rakeHandle); rakeHeadNearby = new ItemOnTileRequirement(rakeHead); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/ObservatoryQuest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/ObservatoryQuest.java index 25ce672c7d4..ecea6eb3551 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/ObservatoryQuest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/ObservatoryQuest.java @@ -27,11 +27,10 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitBuilder; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -40,146 +39,156 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class ObservatoryQuest extends BasicQuestHelper { - //Items Required - ItemRequirement plank, bronzeBar, moltenGlass; + // Required items + ItemRequirement plank; + ItemRequirement bronzeBar; + ItemRequirement moltenGlass; - //Items Recommended - ItemRequirement food, duelingRing, antipoison; + // Recommended items + ItemRequirement food; + ItemRequirement duelingRing; + ItemRequirement antipoison; - ItemRequirement mould, lens, key; + // Mid-quest item requirements + ItemRequirement mould; + ItemRequirement lens; + ItemRequirement key; - Requirement inObservatoryDungeon, inObservatoryF1, inObservatoryF2, usedKey, sleepingGuardNearby, hasMould, - lookedThroughTelescope; + // Zones + Zone observatoryDungeon; + Zone observatoryF1; + Zone observatoryF2; - DetailedQuestStep talkToProfessor, giveProfessorPlanks, giveProfessorBar, giveProfessorGlass, talkToAssistant, - enterDungeon, searchChests, prodGuard, inspectStove, leaveDungeon, giveProfessorMould, useGlassOnMould, - giveProfessorLensAndMould, enterDungeonAgain, enterObservatory, goToF2Observatory, viewTelescope, - tellProfessorConstellation; + // Miscllaneous requirements + ZoneRequirement inObservatoryDungeon; + ZoneRequirement inObservatoryF1; + ZoneRequirement inObservatoryF2; + VarbitRequirement usedKey; + NpcCondition sleepingGuardNearby; + VarbitRequirement hasMould; + Conditions inObservatoryCutscene; + VarbitRequirement lookedThroughTelescope; - //Zones - Zone observatoryDungeon, observatoryF1, observatoryF2; + // Steps + NpcStep talkToProfessor; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); + NpcStep giveProfessorPlanks; - steps.put(0, talkToProfessor); - steps.put(1, giveProfessorPlanks); - steps.put(2, giveProfessorBar); - steps.put(3, giveProfessorGlass); + NpcStep giveProfessorBar; - ConditionalStep goGetLens = new ConditionalStep(this, enterDungeon); - goGetLens.addStep(new Conditions(inObservatoryDungeon, hasMould), leaveDungeon); - goGetLens.addStep(hasMould, giveProfessorMould); - goGetLens.addStep(new Conditions(inObservatoryDungeon, new Conditions(LogicType.OR, - key.alsoCheckBank(questBank), usedKey), sleepingGuardNearby), prodGuard); - goGetLens.addStep(new Conditions(inObservatoryDungeon, new Conditions(LogicType.OR, - key.alsoCheckBank(questBank), usedKey)), inspectStove); - goGetLens.addStep(inObservatoryDungeon, searchChests); - steps.put(4, goGetLens); + NpcStep giveProfessorGlass; - ConditionalStep makeLens = new ConditionalStep(this, enterDungeon); - makeLens.addStep(lens, giveProfessorLensAndMould); - makeLens.addStep(new Conditions(inObservatoryDungeon, hasMould), leaveDungeon); - makeLens.addStep(hasMould, useGlassOnMould); - makeLens.addStep(new Conditions(inObservatoryDungeon, usedKey, sleepingGuardNearby), prodGuard); - makeLens.addStep(new Conditions(inObservatoryDungeon, usedKey), inspectStove); - steps.put(5, makeLens); + ObjectStep enterDungeon; + ObjectStep searchChests; + NpcStep prodGuard; + ObjectStep inspectStove; + ObjectStep leaveDungeon; + NpcStep giveProfessorMould; + DetailedQuestStep useGlassOnMould; + NpcStep giveProfessorLensAndMould; + ObjectStep enterDungeonAgain; + ObjectStep enterObservatory; + DetailedQuestStep watchCutscene; + ObjectStep goToF2Observatory; + ObjectStep viewTelescope; + NpcStep tellProfessorConstellationBase; + NpcStep tellAquarius; + NpcStep tellCapricorn; + NpcStep tellSagittarius; + NpcStep tellScorpio; + NpcStep tellLibra; + NpcStep tellVirgo; + NpcStep tellLeo; + NpcStep tellCancer; + NpcStep tellGemini; + NpcStep tellTaurus; + NpcStep tellAries; + NpcStep tellPisces; + ConditionalStep tellProfessorConstellation; + PuzzleWrapperStep pwTellProfessorConstellation; - ConditionalStep goLookInTelescope = new ConditionalStep(this, enterDungeonAgain); - goLookInTelescope.addStep(new Conditions(lookedThroughTelescope, inObservatoryF2), tellProfessorConstellation); - goLookInTelescope.addStep(inObservatoryF2, viewTelescope); - goLookInTelescope.addStep(inObservatoryF1, goToF2Observatory); - goLookInTelescope.addStep(inObservatoryDungeon, enterObservatory); - steps.put(6, goLookInTelescope); - - return steps; + @Override + protected void setupZones() + { + observatoryDungeon = new Zone(new WorldPoint(2295, 9340, 0), new WorldPoint(2370, 9410, 0)); + observatoryF1 = new Zone(new WorldPoint(2433, 3154, 0), new WorldPoint(2448, 3169, 0)); + observatoryF2 = new Zone(new WorldPoint(2433, 3154, 1), new WorldPoint(2448, 3169, 1)); } @Override protected void setupRequirements() { - plank = new ItemRequirement("Plank", ItemID.WOODPLANK); + plank = new ItemRequirement("Plank", ItemID.WOODPLANK, 3); bronzeBar = new ItemRequirement("Bronze bar", ItemID.BRONZE_BAR); moltenGlass = new ItemRequirement("Molten glass", ItemID.MOLTEN_GLASS); food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); duelingRing = new ItemRequirement("Ring of dueling", ItemCollections.RING_OF_DUELINGS); - antipoison = new ItemRequirement("Antipoison (there is a spawn near the Observatory of superantipoison)", - ItemCollections.ANTIPOISONS); + antipoison = new ItemRequirement("Antipoison (there is a spawn of superantipoison near the Observatory)", ItemCollections.ANTIPOISONS); mould = new ItemRequirement("Lens mould", ItemID.LENS_MOULD).isNotConsumed(); lens = new ItemRequirement("Observatory lens", ItemID.LENS).isNotConsumed(); key = new ItemRequirement("Goblin kitchen key", ItemID.KEEP_KEY).isNotConsumed(); - } - public void setupConditions() - { inObservatoryDungeon = new ZoneRequirement(observatoryDungeon); inObservatoryF1 = new ZoneRequirement(observatoryF1); inObservatoryF2 = new ZoneRequirement(observatoryF2); - // Started quest - // 3828 = 9 - // 3827 = 1 - usedKey = new VarbitRequirement(3826, 1); + usedKey = new VarbitRequirement(VarbitID.OBSERVATORY_GATELOCK, 1); sleepingGuardNearby = new NpcCondition(NpcID.QIP_OBS_GOBLIN_GUARD); - hasMould = new VarbitRequirement(3837, 1); - // Watched cutscene, 3838 = 1 - lookedThroughTelescope = new VarbitRequirement(3836, 1); - } - - @Override - protected void setupZones() - { - observatoryDungeon = new Zone(new WorldPoint(2295, 9340, 0), new WorldPoint(2370, 9410, 0)); - observatoryF1 = new Zone(new WorldPoint(2433, 3154, 0), new WorldPoint(2448, 3169, 0)); - observatoryF2 = new Zone(new WorldPoint(2433, 3154, 1), new WorldPoint(2448, 3169, 1)); + hasMould = new VarbitRequirement(VarbitID.OBSERVATORY_MOULD_PRES, 1); + inObservatoryCutscene = and(new VarbitRequirement(VarbitID.CUTSCENE_STATUS, 1), or(inObservatoryF1, inObservatoryF2)); + lookedThroughTelescope = new VarbitRequirement(VarbitID.OBSERVATORY_SCOPELOOKED, 1); } public void setupSteps() { talkToProfessor = new NpcStep(this, NpcID.OBSERVATORY_PROFESSOR, new WorldPoint(2442, 3186, 0), - "Talk to the Observatory professor north of Castle Wars.", plank.quantity(3), moltenGlass, bronzeBar); + "Talk to the Observatory professor north of Castle Wars.", plank, moltenGlass, bronzeBar); talkToProfessor.addDialogSteps("Talk about the Observatory quest.", "An Observatory?", "Yes."); + giveProfessorPlanks = new NpcStep(this, NpcID.OBSERVATORY_PROFESSOR, new WorldPoint(2442, 3186, 0), - "Give the professor 3 planks.", plank.quantity(3)); + "Give the professor 3 planks.", plank); giveProfessorPlanks.addDialogSteps("Talk about the Observatory quest."); + giveProfessorBar = new NpcStep(this, NpcID.OBSERVATORY_PROFESSOR, new WorldPoint(2442, 3186, 0), "Give the professor a bronze bar.", bronzeBar); giveProfessorBar.addDialogSteps("Talk about the Observatory quest."); + giveProfessorGlass = new NpcStep(this, NpcID.OBSERVATORY_PROFESSOR, new WorldPoint(2442, 3186, 0), "Give the professor some molten glass.", moltenGlass); giveProfessorGlass.addDialogSteps("Talk about the Observatory quest."); - talkToAssistant = new NpcStep(this, NpcID.QIP_OBS_PROFFESORS_ASSISTANT, new WorldPoint(2443, 3189, 0), - "Talk to the observatory assistant."); + enterDungeon = new ObjectStep(this, ObjectID.QIP_OBS_VSTAIRS2, new WorldPoint(2458, 3186, 0), "Enter the dungeon east of the Professor."); searchChests = new ObjectStep(this, ObjectID.QIP_OBS_DUNGEON_CHEST_CLOSED, "Search only the marked chests in the dungeon. " + "Unmarked chests contain monsters and may poison you."); - ((ObjectStep) searchChests).addAlternateObjects(ObjectID.QIP_OBS_DUNGEON_CHEST_OPEN, ObjectID.QIP_OBS_DUNGEON_CHEST_CLOSED2, + searchChests.addAlternateObjects(ObjectID.QIP_OBS_DUNGEON_CHEST_OPEN, ObjectID.QIP_OBS_DUNGEON_CHEST_CLOSED2, ObjectID.QIP_OBS_DUNGEON_CHEST_OPEN2, ObjectID.QIP_OBS_DUNGEON_CHEST_CLOSED3, ObjectID.QIP_OBS_DUNGEON_CHEST_OPEN3); + + // [2025-09-27T13:01:56Z 1308] varbit OBSERVATORY_CHESTCHOICE (3827) 0 -> 2 + // I had to open the 2351,9361,0 chest + prodGuard = new NpcStep(this, NpcID.QIP_OBS_GOBLIN_GUARD, new WorldPoint(2327, 9394, 0), "Prod the sleeping guard in the north of the dungeon. He'll attack you. You need to then either kill him," + " or get him in the marked spot to the north of the gate."); - prodGuard.addTileMarker(new WorldPoint(2327, 9399, 0), SpriteID.BARBARIAN_ASSAULT_HORN_FOR_HEALER_ICON); + prodGuard.addTileMarker(new WorldPoint(2327, 9399, 0), SpriteID.BarbassaultIcons.HORN_FOR_HEALER); inspectStove = new ObjectStep(this, ObjectID.QIP_OBS_DUNGEON_STOVE_TOP_MULTI, new WorldPoint(2327, 9389, 0), "Either kill or trap the guard on the marked tile to the north, then search the goblin stove."); - inspectStove.addTileMarker(new WorldPoint(2327, 9399, 0), SpriteID.BARBARIAN_ASSAULT_HORN_FOR_HEALER_ICON); + inspectStove.addTileMarker(new WorldPoint(2327, 9399, 0), SpriteID.BarbassaultIcons.HORN_FOR_HEALER); leaveDungeon = new ObjectStep(this, ObjectID.QIP_OBS_STAIRS1_DUNGEON, new WorldPoint(2355, 9396, 0), "Climb the stairs back to the surface."); giveProfessorMould = new NpcStep(this, NpcID.OBSERVATORY_PROFESSOR, new WorldPoint(2442, 3186, 0), @@ -198,26 +207,158 @@ public void setupSteps() "Climb up the stairs in the observatory."); viewTelescope = new ObjectStep(this, ObjectID.QIP_OBS_TELE_GEAR_UPPER_MULTI, new WorldPoint(2441, 3162, 1), "Use the telescope."); - tellProfessorConstellation = new StarSignAnswer(this); - tellProfessorConstellation.addDialogSteps("Talk about the Observatory quest."); + + watchCutscene = new DetailedQuestStep(this, "Watch the cutscene."); + enterObservatory.addSubSteps(watchCutscene); + + // Holds the varbit that controls which constellation / star sign you see in the observatory + var signState = new VarbitBuilder(VarbitID.OBSERVATORY_STARSIGN); + + tellProfessorConstellationBase = new NpcStep(this, NpcID.OBSERVATORY_PROFESSOR, new WorldPoint(2440, 3159, 1), "Tell the professor which constellation you observed."); + + // 0 + tellAquarius = tellProfessorConstellationBase.copy(); + tellAquarius.addDialogSteps("Talk about the Observatory quest.", "Aquarius", "~ previous ~"); + + // 1 + tellCapricorn = tellProfessorConstellationBase.copy(); + tellCapricorn.addDialogSteps("Talk about the Observatory quest.", "Capricorn", "~ previous ~"); + + // 2 + tellSagittarius = tellProfessorConstellationBase.copy(); + tellSagittarius.addDialogSteps("Talk about the Observatory quest.", "Sagittarius", "~ previous ~"); + + // 3 + tellScorpio = tellProfessorConstellationBase.copy(); + tellScorpio.addDialogSteps("Talk about the Observatory quest.", "Scorpio", "~ previous ~"); + + // 4 + tellLibra = tellProfessorConstellationBase.copy(); + tellLibra.addDialogSteps("Talk about the Observatory quest.", "Libra"); + tellLibra.addDialogStepWithExclusions("~ next ~", "Libra", "Cancer"); + tellLibra.addDialogStepWithExclusions("~ previous ~", "Libra"); + + // 5 + tellVirgo = tellProfessorConstellationBase.copy(); + tellVirgo.addDialogSteps("Talk about the Observatory quest.", "Virgo"); + tellVirgo.addDialogStepWithExclusions("~ next ~", "Virgo", "Cancer"); + tellVirgo.addDialogStepWithExclusions("~ previous ~", "Virgo"); + + // 6 + tellLeo = tellProfessorConstellationBase.copy(); + tellLeo.addDialogSteps("Talk about the Observatory quest.", "Leo"); + tellLeo.addDialogStepWithExclusions("~ next ~", "Leo", "Cancer"); + tellLeo.addDialogStepWithExclusions("~ previous ~", "Leo"); + + // 7 + tellCancer = tellProfessorConstellationBase.copy(); + tellCancer.addDialogSteps("Talk about the Observatory quest.", "Cancer"); + tellCancer.addDialogStepWithExclusions("~ next ~", "Cancer"); + tellCancer.addDialogStepWithExclusions("~ previous ~", "Cancer", "Libra"); + + // 8 + tellGemini = tellProfessorConstellationBase.copy(); + tellGemini.addDialogSteps("Talk about the Observatory quest.", "Gemini"); + tellGemini.addDialogStepWithExclusions("~ next ~", "Gemini"); + tellGemini.addDialogStepWithExclusions("~ previous ~", "Gemini", "Libra"); + + // 9 + tellTaurus = tellProfessorConstellationBase.copy(); + tellTaurus.addDialogSteps("Talk about the Observatory quest.", "Taurus"); + tellTaurus.addDialogStepWithExclusions("~ next ~", "Taurus"); + tellTaurus.addDialogStepWithExclusions("~ previous ~", "Taurus", "Libra"); + + // 10 + tellAries = tellProfessorConstellationBase.copy(); + tellAries.addDialogSteps("Talk about the Observatory quest.", "Aries", "~ next ~"); + + // 11 + tellPisces = tellProfessorConstellationBase.copy(); + tellPisces.addDialogSteps("Talk about the Observatory quest.", "Pisces", "~ next ~"); + + tellProfessorConstellation = new ConditionalStep(this, tellProfessorConstellationBase); + tellProfessorConstellation.addStep(signState.eq(0), tellAquarius); + tellProfessorConstellation.addStep(signState.eq(1), tellCapricorn); + tellProfessorConstellation.addStep(signState.eq(2), tellSagittarius); + tellProfessorConstellation.addStep(signState.eq(3), tellScorpio); + tellProfessorConstellation.addStep(signState.eq(4), tellLibra); + tellProfessorConstellation.addStep(signState.eq(5), tellVirgo); + tellProfessorConstellation.addStep(signState.eq(6), tellLeo); + tellProfessorConstellation.addStep(signState.eq(7), tellCancer); + tellProfessorConstellation.addStep(signState.eq(8), tellGemini); + tellProfessorConstellation.addStep(signState.eq(9), tellTaurus); + tellProfessorConstellation.addStep(signState.eq(10), tellAries); + tellProfessorConstellation.addStep(signState.eq(11), tellPisces); + + pwTellProfessorConstellation = tellProfessorConstellation.puzzleWrapStep(); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToProfessor); + steps.put(1, giveProfessorPlanks); + steps.put(2, giveProfessorBar); + steps.put(3, giveProfessorGlass); + + var goGetLens = new ConditionalStep(this, enterDungeon); + goGetLens.addStep(and(inObservatoryDungeon, hasMould), leaveDungeon); + goGetLens.addStep(hasMould, giveProfessorMould); + goGetLens.addStep(and(inObservatoryDungeon, or(key.alsoCheckBank(), usedKey), sleepingGuardNearby), prodGuard); + goGetLens.addStep(and(inObservatoryDungeon, or(key.alsoCheckBank(), usedKey)), inspectStove); + goGetLens.addStep(inObservatoryDungeon, searchChests); + steps.put(4, goGetLens); + + var makeLens = new ConditionalStep(this, enterDungeon); + makeLens.addStep(lens, giveProfessorLensAndMould); + makeLens.addStep(and(inObservatoryDungeon, hasMould), leaveDungeon); + makeLens.addStep(hasMould, useGlassOnMould); + makeLens.addStep(and(inObservatoryDungeon, usedKey, sleepingGuardNearby), prodGuard); + makeLens.addStep(and(inObservatoryDungeon, usedKey), inspectStove); + steps.put(5, makeLens); + + var goLookInTelescope = new ConditionalStep(this, enterDungeonAgain); + goLookInTelescope.addStep(and(lookedThroughTelescope, inObservatoryF2), pwTellProfessorConstellation); + goLookInTelescope.addStep(inObservatoryCutscene, watchCutscene); + goLookInTelescope.addStep(inObservatoryF2, viewTelescope); + goLookInTelescope.addStep(inObservatoryF1, goToF2Observatory); + goLookInTelescope.addStep(inObservatoryDungeon, enterObservatory); + steps.put(6, goLookInTelescope); + + return steps; } @Override public List getItemRequirements() { - return Arrays.asList(plank.quantity(3), bronzeBar, moltenGlass); + return List.of( + plank, + bronzeBar, + moltenGlass + ); } @Override public List getItemRecommended() { - return Arrays.asList(duelingRing, antipoison, food); + return List.of( + duelingRing, + antipoison, + food + ); } @Override public List getCombatRequirements() { - return Collections.singletonList("Goblin Guard (level 42, or you can lure it/have someone else kill it)"); + return List.of( + "Goblin Guard (level 42, or you can lure it/have someone else kill it)" + ); } @Override @@ -229,26 +370,48 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.CRAFTING, 2250)); + return List.of( + new ExperienceReward(Skill.CRAFTING, 2250) + ); } @Override public List getUnlockRewards() { - return Collections.singletonList(new UnlockReward("A reward depending on which constellation you observed.")); + return List.of( + new UnlockReward("A reward depending on which constellation you observed.") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Helping the Professor", - Arrays.asList(talkToProfessor, giveProfessorPlanks, giveProfessorBar, giveProfessorGlass, - enterDungeon, searchChests, prodGuard, inspectStove, leaveDungeon, giveProfessorMould, useGlassOnMould, - giveProfessorLensAndMould, enterDungeonAgain, enterObservatory, goToF2Observatory, viewTelescope, - tellProfessorConstellation), plank.quantity(3), bronzeBar, moltenGlass)); + var sections = new ArrayList(); + sections.add(new PanelDetails("Helping the Professor", List.of( + talkToProfessor, + giveProfessorPlanks, + giveProfessorBar, + giveProfessorGlass, + enterDungeon, + searchChests, + prodGuard, + inspectStove, + leaveDungeon, + giveProfessorMould, + useGlassOnMould, + giveProfessorLensAndMould, + enterDungeonAgain, + enterObservatory, + goToF2Observatory, + viewTelescope, + pwTellProfessorConstellation + ), List.of( + plank, + bronzeBar, + moltenGlass + ))); - return allSteps; + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/StarSignAnswer.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/StarSignAnswer.java index ef165b16239..89661aad860 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/StarSignAnswer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/observatoryquest/StarSignAnswer.java @@ -24,12 +24,12 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.observatoryquest; -import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; -import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestVarPlayer; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.NpcID; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestVarPlayer; +import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import java.util.HashMap; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/OlafsQuest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/OlafsQuest.java index bf475122d86..6253eab3a07 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/OlafsQuest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/OlafsQuest.java @@ -188,13 +188,13 @@ public void setupConditions() puzzleOpen = new WidgetModelRequirement(253, 0, 24126); hasBarrel3Ropes = new Conditions(rottenBarrel, ropes3); has2Barrels6Ropes = new Conditions(rottenBarrels2, ropes6); - placedBarrel1 = new VarbitRequirement(3547, 1); - placedBarrel2 = new VarbitRequirement(3548, 1); + placedBarrel1 = new VarbitRequirement(VarbitID.OLAF2_WALKWAY_1, 1); + placedBarrel2 = new VarbitRequirement(VarbitID.OLAF2_WALKWAY_2, 1); keyInterfaceOpen = new WidgetModelRequirement(252, 0, 24124); ulfricNearby = new NpcCondition(NpcID.OLAF2_ULFRIC); - killedUlfric = new VarbitRequirement(3539, 1); + killedUlfric = new VarbitRequirement(VarbitID.OLAF2_KILLED_ULFRIC, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/PaintingWall.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/PaintingWall.java index bf3367fc2ff..61b27dbf862 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/PaintingWall.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/olafsquest/PaintingWall.java @@ -5,6 +5,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -12,11 +13,6 @@ public class PaintingWall extends QuestStep { - private final int RIGHT_VARBIT = 3541; - private final int BOTTOM_VARBIT = 3542; - private final int LEFT_VARBIT = 3543; - private final int TOP_VARBIT = 3544; - private int highlightWidget = -1; int rightPiece, bottomPiece, leftPiece, topPiece; @@ -40,10 +36,10 @@ public void onGameTick(GameTick event) private void updateSolvedPositionState() { - rightPiece = client.getVarbitValue(RIGHT_VARBIT); - bottomPiece = client.getVarbitValue(BOTTOM_VARBIT); - leftPiece = client.getVarbitValue(LEFT_VARBIT); - topPiece = client.getVarbitValue(TOP_VARBIT); + rightPiece = client.getVarbitValue(VarbitID.OLAF2_GATE_DISK_1); + bottomPiece = client.getVarbitValue(VarbitID.OLAF2_GATE_DISK_2); + leftPiece = client.getVarbitValue(VarbitID.OLAF2_GATE_DISK_3); + topPiece = client.getVarbitValue(VarbitID.OLAF2_GATE_DISK_4); if (rightPiece != 4) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/onesmallfavour/OneSmallFavour.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/onesmallfavour/OneSmallFavour.java index 9e0ab0cefc6..18224d1ca4e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/onesmallfavour/OneSmallFavour.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/onesmallfavour/OneSmallFavour.java @@ -48,6 +48,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -197,7 +198,7 @@ public Map loadSteps() fightSlagilith.addStep(slagilithNearby, killSlagilith); fightSlagilith.addStep(inScrollSpot, readScroll); fightSlagilith.addStep(inGoblinCave, standNextToSculpture); - fightSlagilith.addStep(pigeonCages5.alsoCheckBank(questBank), enterGoblinCaveAgain); + fightSlagilith.addStep(pigeonCages5.alsoCheckBank(), enterGoblinCaveAgain); steps.put(145, fightSlagilith); steps.put(150, fightSlagilith); @@ -206,7 +207,7 @@ public Map loadSteps() freePetra.addStep(petraNearby, talkToPetra); freePetra.addStep(inScrollSpot, readScroll); freePetra.addStep(inGoblinCave, standNextToSculpture); - freePetra.addStep(pigeonCages5.alsoCheckBank(questBank), enterGoblinCaveAgain); + freePetra.addStep(pigeonCages5.alsoCheckBank(), enterGoblinCaveAgain); steps.put(152, freePetra); steps.put(155, freePetra); @@ -467,27 +468,27 @@ public void setupConditions() inDwarvenMine = new ZoneRequirement(dwarvenMine); inGoblinCave = new ZoneRequirement(goblinCave); - lamp1Empty = new VarbitRequirement(6225, 1); - lamp2Empty = new VarbitRequirement(6226, 1); - lamp3Empty = new VarbitRequirement(6227, 1); - lamp4Empty = new VarbitRequirement(6228, 1); - lamp5Empty = new VarbitRequirement(6229, 1); - lamp6Empty = new VarbitRequirement(6230, 1); - lamp7Empty = new VarbitRequirement(6231, 1); - lamp8Empty = new VarbitRequirement(6232, 1); + lamp1Empty = new VarbitRequirement(VarbitID.JADELIGHT1_TAKEN, 1); + lamp2Empty = new VarbitRequirement(VarbitID.TOPAZLIGHT1_TAKEN, 1); + lamp3Empty = new VarbitRequirement(VarbitID.OPALLIGHT1_TAKEN, 1); + lamp4Empty = new VarbitRequirement(VarbitID.SAPPHIRELIGHT1_TAKEN, 1); + lamp5Empty = new VarbitRequirement(VarbitID.JADELIGHT2_TAKEN, 1); + lamp6Empty = new VarbitRequirement(VarbitID.TOPAZLIGHT2_TAKEN, 1); + lamp7Empty = new VarbitRequirement(VarbitID.OPALLIGHT2_TAKEN, 1); + lamp8Empty = new VarbitRequirement(VarbitID.SAPPHIRELIGHT2_TAKEN, 1); - allEmpty = new VarbitRequirement(244, 255); + allEmpty = new VarbitRequirement(VarbitID.CHECKLANDINGLIGHTS, 255); - lamp1Full = new VarbitRequirement(6233, 1); - lamp2Full = new VarbitRequirement(6234, 1); - lamp3Full = new VarbitRequirement(6235, 1); - lamp4Full = new VarbitRequirement(6236, 1); - lamp5Full = new VarbitRequirement(6237, 1); - lamp6Full = new VarbitRequirement(6238, 1); - lamp7Full = new VarbitRequirement(6239, 1); - lamp8Full = new VarbitRequirement(6240, 1); + lamp1Full = new VarbitRequirement(VarbitID.JADELIGHT1_FIXED, 1); + lamp2Full = new VarbitRequirement(VarbitID.TOPAZLIGHT1_FIXED, 1); + lamp3Full = new VarbitRequirement(VarbitID.OPALLIGHT1_FIXED, 1); + lamp4Full = new VarbitRequirement(VarbitID.SAPPHIRELIGHT1_FIXED, 1); + lamp5Full = new VarbitRequirement(VarbitID.JADELIGHT2_FIXED, 1); + lamp6Full = new VarbitRequirement(VarbitID.TOPAZLIGHT2_FIXED, 1); + lamp7Full = new VarbitRequirement(VarbitID.OPALLIGHT2_FIXED, 1); + lamp8Full = new VarbitRequirement(VarbitID.SAPPHIRELIGHT2_FIXED, 1); - allFull = new VarbitRequirement(6241, 255); + allFull = new VarbitRequirement(VarbitID.FIXEDLANDINGLIGHTS, 255); slagilithNearby = new NpcCondition(NpcID.SLAGILITH); inScrollSpot = new ZoneRequirement(scrollSpot); @@ -496,13 +497,13 @@ public void setupConditions() petraNearby = new NpcCondition(NpcID.FAVOUR_PETRA); - addedOrnaments = new VarbitRequirement(255, 1); - addedDirectionals = new VarbitRequirement(254, 1); - addedWeathervanePillar = new VarbitRequirement(253, 1); + addedOrnaments = new VarbitRequirement(VarbitID.ORNAMENTFIXED, 1); + addedDirectionals = new VarbitRequirement(VarbitID.DIRECTIONALSFIXED, 1); + addedWeathervanePillar = new VarbitRequirement(VarbitID.ROTATINGPILLARFIXED, 1); - hasOrUsedDirectionals = new Conditions(LogicType.OR, addedDirectionals, directionals.alsoCheckBank(questBank)); - hasOrUsedOrnament = new Conditions(LogicType.OR, addedOrnaments, ornament.alsoCheckBank(questBank)); - hasOrUsedWeathervanePillar = new Conditions(LogicType.OR, addedWeathervanePillar, weathervanePillar.alsoCheckBank(questBank)); + hasOrUsedDirectionals = new Conditions(LogicType.OR, addedDirectionals, directionals.alsoCheckBank()); + hasOrUsedOrnament = new Conditions(LogicType.OR, addedOrnaments, ornament.alsoCheckBank()); + hasOrUsedWeathervanePillar = new Conditions(LogicType.OR, addedWeathervanePillar, weathervanePillar.alsoCheckBank()); } public void setupSteps() @@ -510,7 +511,7 @@ public void setupSteps() talkToYanni = new NpcStep(this, NpcID.SHILOANTIQUES, new WorldPoint(2836, 2983, 0), "Talk to Yanni Salika in Shilo Village. CKR fairy ring or take cart from Brimhaven."); talkToYanni.addDialogStep("Yes."); talkToYanni.addDialogSteps("Is there anything else interesting to do around here?", "Ok, see you in a tick!"); - talkToJungleForester = new NpcStep(this, new int[]{NpcID.JUNGLEFORESTER_F, NpcID.JUNGLEFORESTER_M}, new WorldPoint(2861, 2942, 0), "Talk to a Jungle Forester south of Shilo Village.", true, bluntAxe); + talkToJungleForester = new NpcStep(this, new int[]{NpcID.JUNGLEFORESTER_F, NpcID.JUNGLEFORESTER_M}, new WorldPoint(2861, 2942, 0), "Talk to a Jungle Forester south of Shilo Village.", true); talkToJungleForester.addDialogSteps("I'll get going then!", "I need to talk to you about red mahogany."); talkToJungleForester.addDialogStep("Okay, I'll take your axe to get it sharpened."); talkToBrian = new NpcStep(this, NpcID.BRIAN, new WorldPoint(3027, 3249, 0), "Talk to Brian in the Port Sarim axe shop.", bluntAxe); @@ -594,7 +595,7 @@ public void setupSteps() talkToBleemadge.addSubSteps(talkToBleemadgeNoTea); talkToArhein = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2804, 3432, 0), "Talk to Arhein in Catherby."); - talkToArhein.addDialogStep("I need to talk T.R.A.S.H to you."); + talkToArhein.addDialogStep("I need to talk T.R.A.S.H. to you."); talkToArhein.addDialogStep("Yes, Ok, I'll do it!"); talkToPhantuwti = new NpcStep(this, NpcID.FAVOUR_PHANTUWTI_FARSIGHT, new WorldPoint(2702, 3473, 0), "Talk to Phantuwti in the south west house of Seers' Village."); @@ -731,6 +732,7 @@ public void setupSteps() finishWithPhantuwti.addDialogStep("I've fixed the weather vane!"); returnToArhein = new NpcStep(this, NpcID.ARHEIN, new WorldPoint(2804, 3432, 0), "Talk to Arhein in Catherby.", weatherReport); + returnToArhein.addDialogStep("What did you want me to do again?"); returnToArhein.addDialogStep("I have the weather report for you."); returnToBleemadge = new NpcStep(this, NpcID.PILOT_WHITE_WOLF_BASE, new WorldPoint(2847, 3498, 0), "Right-click talk to Captain Bleemadge on White Wolf Mountain."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/pandemonium/Pandemonium.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/pandemonium/Pandemonium.java new file mode 100644 index 00000000000..1d1cfc0ac43 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/pandemonium/Pandemonium.java @@ -0,0 +1,332 @@ +/* + * Copyright (c) 2025, TTvanWillegen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.quests.pandemonium; + +import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.NoItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.ShipInPortRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.ItemSlots; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Port; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; +import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; +import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.*; + +import java.util.*; +import java.util.regex.Pattern; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + +public class Pandemonium extends BasicQuestHelper +{ + NpcStep getToPandemonium, talkToWill, boardWAShip, explainJob, explainJob2, learnWhereYouAre, learnWhoWAare, talkToRibs, findLocationWA, enterShipyard, informAboutShip, showCup, getLogBook, getNewJob, talkToJim, meetGrog, finishQuest; + ObjectStep buildCargoHold, embarkShipSY, disembarkShipSY, leaveShipyard,dropCargoInCargoHold, disembarkShipPS, deliverCargo, disembarkShipP, getHammer, getSaw; + Zone pandemonium, portSarim, pandemoniumDockZone, portSarimDockZone, shipWreckZone; + DetailedQuestStep navigateShip, watchSalvageCutscene, takeHelm, takeHelm2, takeHelm3, raiseSails, raiseSails2, raiseSails3, salvageShipwreck, sailToPortSarim, pickupCargo, pickupCargoShip, sailToPandemonium, letGoOfHelm, letGoOfHelm2; + BoardShipStep boardShip, boardShip2, boardShip3; + Requirement onPandemonium, boatAtPortSarim, onboardShip, takenHelm, setSails, sailing, atShipwreck, notAtShipwreck, canSalvage, hammerAndSaw, atShipyard, atPortSarimDock, atPandemoniumDock, holdingCargo, cargoPickedUp, cargoNotPickedUp, cargoInCargoHold; + ItemRequirement hammer, saw, cup; + NoItemRequirement nothingInHands; + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupConditions(); + setupSteps(); + Map steps = new HashMap<>(); + + steps.put(0, talkToWill); + steps.put(2, talkToWill); + + steps.put(4, boardWAShip); + + ConditionalStep goListenOnShip = new ConditionalStep(this, talkToWill); + goListenOnShip.addStep(onboardShip, explainJob); + steps.put(6, goListenOnShip); + + ConditionalStep cNavigateToShipwreckOnShip = new ConditionalStep(this, takeHelm); + cNavigateToShipwreckOnShip.addStep(canSalvage, salvageShipwreck); + cNavigateToShipwreckOnShip.addStep(atShipwreck, explainJob2); + cNavigateToShipwreckOnShip.addStep(sailing, navigateShip); + cNavigateToShipwreckOnShip.addStep(takenHelm, raiseSails); + cNavigateToShipwreckOnShip.addStep(notAtShipwreck, takeHelm); + + ConditionalStep cNavigateToShipwreck = new ConditionalStep(this, boardWAShip); + cNavigateToShipwreck.addStep(and(new VarbitRequirement(VarbitID.CUTSCENE_STATUS, 1), canSalvage), watchSalvageCutscene); + cNavigateToShipwreck.addStep(onboardShip, cNavigateToShipwreckOnShip); + steps.put(8, cNavigateToShipwreck); + steps.put(10, cNavigateToShipwreck); + steps.put(12, cNavigateToShipwreck); + steps.put(14, cNavigateToShipwreck); + + ConditionalStep cLearnWhereYouAre = new ConditionalStep(this, getToPandemonium); + cLearnWhereYouAre.addStep(onPandemonium, learnWhereYouAre); + steps.put(16, cLearnWhereYouAre); + ConditionalStep cLearnWhoWAare = new ConditionalStep(this, getToPandemonium); + cLearnWhoWAare.addStep(onPandemonium, learnWhoWAare); + steps.put(18, cLearnWhoWAare); + ConditionalStep cTalkToRibs = new ConditionalStep(this, getToPandemonium); + cTalkToRibs.addStep(onPandemonium, talkToRibs); + steps.put(20, cTalkToRibs); + ConditionalStep cFindLocationWA = new ConditionalStep(this, getToPandemonium); + cFindLocationWA.addStep(onPandemonium, findLocationWA); + steps.put(22, cFindLocationWA); + ConditionalStep cInformAboutShip = new ConditionalStep(this, getToPandemonium); + cInformAboutShip.addStep(onPandemonium, informAboutShip); + steps.put(24, cInformAboutShip); + ConditionalStep cShowCup = new ConditionalStep(this, getToPandemonium); + cShowCup.addStep(onPandemonium, showCup); + steps.put(26, cShowCup); + + ConditionalStep cBuildCargoHold = new ConditionalStep(this, getToPandemonium); + cBuildCargoHold.addStep(and(atShipyard, onboardShip), buildCargoHold); + cBuildCargoHold.addStep(and(atShipyard, hammerAndSaw), embarkShipSY); + cBuildCargoHold.addStep(and(atShipyard, saw), getHammer); + cBuildCargoHold.addStep(atShipyard, getSaw); + cBuildCargoHold.addStep(onPandemonium, enterShipyard); + steps.put(28, cBuildCargoHold); + + + ConditionalStep cGetLogBook = new ConditionalStep(this, getToPandemonium); + cGetLogBook.addStep(onPandemonium, getLogBook); + cGetLogBook.addStep(atShipyard, leaveShipyard); + steps.put(30, cGetLogBook); // Jim + + steps.put(32, getNewJob); // Jim + steps.put(34, boardShip); + ConditionalStep cSailToPortSarim = new ConditionalStep(this, boardShip); + cSailToPortSarim.addStep(and(not(atPortSarimDock), sailing), sailToPortSarim); + cSailToPortSarim.addStep(and(not(atPortSarimDock), takenHelm), raiseSails2); + cSailToPortSarim.addStep(and(not(atPortSarimDock), onboardShip), takeHelm2); + steps.put(36, cSailToPortSarim); + ConditionalStep cCheckPortMaster = new ConditionalStep(this, cSailToPortSarim); + cCheckPortMaster.addStep(and(boatAtPortSarim, holdingCargo, not(onboardShip)), boardShip2); + cCheckPortMaster.addStep(and(boatAtPortSarim, cargoNotPickedUp, not(onboardShip)), pickupCargo); + cCheckPortMaster.addStep(and(atPortSarimDock, cargoNotPickedUp, takenHelm), letGoOfHelm); + cCheckPortMaster.addStep(and(atPortSarimDock, cargoNotPickedUp, onboardShip), disembarkShipPS); + steps.put(38, cCheckPortMaster); + ConditionalStep cSailToPandemonium = new ConditionalStep(this, cCheckPortMaster); + cSailToPandemonium.addStep(and(not(atPandemoniumDock), cargoInCargoHold, onboardShip, takenHelm, sailing), sailToPandemonium); + cSailToPandemonium.addStep(and(not(atPandemoniumDock), cargoInCargoHold, onboardShip, takenHelm), raiseSails3); + cSailToPandemonium.addStep(and(not(atPandemoniumDock), cargoInCargoHold, onboardShip), takeHelm3); + cSailToPandemonium.addStep(and(not(atPandemoniumDock), cargoPickedUp, holdingCargo, onboardShip), dropCargoInCargoHold); + + ConditionalStep cDeliverCargo = new ConditionalStep(this, cSailToPandemonium); + cDeliverCargo.addStep(and(onPandemonium, not(onboardShip), holdingCargo), deliverCargo); + cDeliverCargo.addStep(and(atPandemoniumDock, onboardShip, holdingCargo), disembarkShipP); + cDeliverCargo.addStep(and(atPandemoniumDock, onboardShip, nor(takenHelm, setSails), cargoInCargoHold), pickupCargoShip); + cDeliverCargo.addStep(and(onPandemonium, not(onboardShip), cargoInCargoHold), boardShip3); + cDeliverCargo.addStep(and(atPandemoniumDock, cargoInCargoHold, takenHelm), letGoOfHelm2); + steps.put(40, cDeliverCargo); + steps.put(42, cDeliverCargo); + steps.put(44, talkToJim); + steps.put(46, meetGrog); + steps.put(48, finishQuest); + + return steps; + } + + public void setupConditions() + { + onboardShip = new VarbitRequirement(VarbitID.SAILING_BOARDED_BOAT, 1); + takenHelm = new VarbitRequirement(VarbitID.SAILING_SIDEPANEL_HELM_STATUS, 2); + setSails = new VarbitRequirement(VarbitID.SAILING_SIDEPANEL_BOAT_MOVE_MODE, 0, Operation.GREATER); + canSalvage = and(atShipwreck, new VarbitRequirement(VarbitID.SAILING_INTRO, 14, Operation.GREATER_EQUAL)); // At wreck, with explanation about salvaging + sailing = and(takenHelm, setSails, onboardShip); + + atShipyard = new VarbitRequirement(VarbitID.SAILING_SIDEPANEL_SHIPYARD_MODE, 1); + holdingCargo = new VarbitRequirement(VarbitID.SAILING_CARRYING_CARGO, 1); + + cargoPickedUp = new VarbitRequirement(VarbitID.PORT_TASK_SLOT_0_CARGO_TAKEN, 1); + cargoNotPickedUp = not(cargoPickedUp); + cargoInCargoHold = and(cargoPickedUp, not(holdingCargo)); + + nothingInHands = new NoItemRequirement("Nothing equipped in your hands.",ItemSlots.WEAPON, ItemSlots.SHIELD); + } + + @Override + protected void setupZones() + { + shipWreckZone = new Zone(new WorldPoint(3018, 3030, 0), new WorldPoint(3040, 3050, 0)); + pandemonium = new Zone(new WorldPoint(3069, 3005, 0), new WorldPoint(3028, 2963, 0)); + portSarim = new Zone(new WorldPoint(3027, 3192, 0), new WorldPoint(3050, 3204, 0)); + pandemoniumDockZone = new Zone(new WorldPoint(3065, 2974, 0), new WorldPoint(3084, 2998, 0)); + portSarimDockZone = new Zone(new WorldPoint(3045, 3183, 0), new WorldPoint(3061, 3208, 0)); + atShipwreck = new VarbitRequirement(VarbitID.SAILING_INTRO_REACHED_WRECK, 1); + notAtShipwreck = not(atShipwreck); + onPandemonium = new ZoneRequirement(pandemonium); + boatAtPortSarim = new ShipInPortRequirement(Port.PORT_SARIM); + atPandemoniumDock = new ZoneRequirement(pandemoniumDockZone); + atPortSarimDock = new ZoneRequirement(portSarimDockZone); + } + + @Override + protected void setupRequirements() + { + hammer = new ItemRequirement("Hammer", ItemCollections.HAMMER).isNotConsumed().canBeObtainedDuringQuest(); + hammer.setTooltip("You can pick this up at the shipyard."); + saw = new ItemRequirement("Saw", ItemCollections.SAW).isNotConsumed().canBeObtainedDuringQuest(); + saw.setTooltip("You can pick this up at the shipyard."); + hammerAndSaw = and(hammer, saw); + + // Quest items + cup = new ItemRequirement("Old cup", ItemID.SAILING_INTRO_CUP); + cup.setTooltip("You can get another from Steve Beanie behind the bar on Pandemonium"); + } + + public void setupSteps() + { + //guardrails + getToPandemonium = new NpcStep(this, new int[]{NpcID.SEAMAN_LORRIS, NpcID.CAPTAIN_TOBIAS, NpcID.SEAMAN_THRESNOR}, new WorldPoint(3027, 3218, 0), "Get back to the Pandemonium. You can travel with Captain Tobias on Port Sarim dock for 30gp.", true); + getToPandemonium.addDialogSteps("Yes please.", "I'd like to go to the Pandemonium."); + getToPandemonium.conditionToHideInSidebar(onPandemonium); + getToPandemonium.setHighlightZone(pandemonium); + + //You got the Job! + talkToWill = new NpcStep(this, new int[]{NpcID.SAILING_INTRO_WILL_SARIM, NpcID.SAILING_INTRO_ANNE_SARIM}, new WorldPoint(3025, 3208, 0), "Talk to Will or Anne on the docks of Port Sarim to start the quest.", true); + talkToWill.addDialogSteps("Yes.", "Okay."); + boardWAShip = new NpcStep(this, new int[]{NpcID.SAILING_INTRO_WILL_SARIM, NpcID.SAILING_INTRO_ANNE_SARIM}, new WorldPoint(3025, 3208, 0), "Talk to Will or Anne on the docks to board the ship.", true); + boardWAShip.addDialogStep(Pattern.compile("(I guess I'm ready\\.\\.\\.)|(I guess so\\.\\.\\.)|(Okay\\.)")); + + // What is the job? + explainJob = new NpcStep(this, new int[]{NpcID.SAILING_INTRO_WILL_BOAT, NpcID.SAILING_INTRO_ANNE_BOAT}, new WorldPoint(3056, 3190, 0), "Listen to the job explanation.", true); + takeHelm = new ObjectStep(this, ObjectID.SAILING_INTRO_NAVIGATING, "Navigate using the helm."); + raiseSails = new ObjectStep(this, ObjectID.SAILING_BOAT_SAILS_INTRO, "Raise your sails."); + navigateShip = new DetailedQuestStep(this, new WorldPoint(3031, 3039, 0), "Sail south to the wreck north of the Pandemonium!"); + navigateShip.setHighlightZone(shipWreckZone); + explainJob2 = new NpcStep(this, new int[]{NpcID.SAILING_INTRO_WILL_BOAT, NpcID.SAILING_INTRO_ANNE_BOAT}, new WorldPoint(3027, 3048, 0), "Learn about the other part of your job.", true); + salvageShipwreck = new ObjectStep(this, ObjectID.SAILING_INTRO_SALVAGING_HOOK, new WorldPoint(3843, 6402, 1), "Deploy the Salvaging Hook."); + watchSalvageCutscene = new DetailedQuestStep(this, "Watch the salvaging cutscene."); + // You lost the Job! + learnWhereYouAre = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Talk to 'Squawking' Steve Beanie behind the bar to learn about where you are.", true); + learnWhoWAare = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Talk to 'Squawking' Steve Beanie about Will and Anne.", true); + talkToRibs = new NpcStep(this, NpcID.SAILING_INTRO_RIBS, new WorldPoint(3051, 2973, 0), "Talk to Ribs near the door to learn about the map.", true); + talkToRibs.addDialogSteps("No, tell me about him.", "Now's not really the time for tales."); + findLocationWA = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Ask 'Squawking' Steve Beanie behind the bar about Will and Anne's location.", true); + findLocationWA.addDialogStep("About Will and Anne..."); + findLocationWA.addDialogStep("Do you have any idea where Will and Anne might have gone?"); + informAboutShip = new NpcStep(this, NpcID.JUNIOR_JIM, new WorldPoint(3059, 2979, 0), "Ask Junior Jim by the docks about getting a ship.", true, cup); + informAboutShip.addDialogStep("I think I might have lost a cup here."); + showCup = new NpcStep(this, NpcID.JUNIOR_JIM, new WorldPoint(3059, 2979, 0), "Hand over the cup to Junior Jim and receive your mighty vessel!", true, cup); + showCup.addDialogStep("I think I might have lost a cup here."); + + // Your mighty vessel + enterShipyard = new NpcStep(this, NpcID.JUNIOR_JIM, new WorldPoint(3059, 2979, 0), "Talk to Junior Jim to enter the shipyard."); + getHammer = new ObjectStep(this, ObjectID.CRATE_HAMMERS, "Pick up a hammer from the crate of hammers."); + getSaw = new ObjectStep(this, ObjectID.CRATE_SAWS, "Pick up a from the crate of saws."); + embarkShipSY = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_PROXY_WIDE, "Board your vessel."); + buildCargoHold = new ObjectStep(this, ObjectID.SAILING_BOAT_FACILITY_PLACEHOLDER_RAFT_0, "Build the Cargo Hold."); + disembarkShipSY = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_SHIPYARD_DISEMBARK, "Disembark your vessel."); + leaveShipyard = new ObjectStep(this, ObjectID.SAILING_SHIPYARD_PORTAL_EXIT, "Leave the shipyard using the portal."); + getLogBook = new NpcStep(this, NpcID.JUNIOR_JIM, new WorldPoint(3059, 2979, 0), "Talk to Junior Jim to get a log book."); + + // You got the job! + getNewJob = new NpcStep(this, NpcID.JUNIOR_JIM, new WorldPoint(3059, 2979, 0), "Talk to Junior Jim for a new job."); + boardShip = new BoardShipStep(this); + takeHelm2 = new ObjectStep(this, ObjectID.SAILING_BOAT_STEERING_KANDARIN_1X3_WOOD_IDLE, new WorldPoint(3843, 6460, 1), "Navigate using the helm."); + raiseSails2 = new ObjectStep(this, ObjectID.SAILING_BOAT_SAIL_KANDARIN_1X3_WOOD, "Raise your sails."); + raiseSails2.addWidgetHighlight(InterfaceID.SAILING_SIDEPANEL, InterfaceID.SailingSidepanel.FACILITIES_CONTENT_CLICKLAYER & 0xFFFF, 0); + sailToPortSarim = new SailStep(this, Port.PORT_SARIM); + letGoOfHelm = new ObjectStep(this, ObjectID.SAILING_BOAT_STEERING_KANDARIN_1X3_WOOD_IN_USE, new WorldPoint(3843, 6460, 1), "Let go of the helm."); + disembarkShipPS = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_DISEMBARK, new WorldPoint(3051, 3193, 0), "Leave your ship."); + + pickupCargo = new ObjectStep(this, ObjectID.DOCK_LOADING_BAY_LEDGER_TABLE_WITHDRAW, new WorldPoint(3028, 3194, 0), "Pick up the cargo from the ledger table on the docks.", nothingInHands); + boardShip2 = new BoardShipStep(this); + dropCargoInCargoHold = new ObjectStep(this, ObjectID.SAILING_BOAT_CARGO_HOLD_REGULAR_RAFT, "Deposit the crate into your cargo hold."); + takeHelm3 = new ObjectStep(this, ObjectID.SAILING_BOAT_STEERING_KANDARIN_1X3_WOOD_IDLE, new WorldPoint(3843, 6460, 1), "Navigate using the helm."); + raiseSails3 = new ObjectStep(this, ObjectID.SAILING_BOAT_SAIL_KANDARIN_1X3_WOOD, "Raise your sails."); + raiseSails3.addWidgetHighlight(InterfaceID.SAILING_SIDEPANEL, InterfaceID.SailingSidepanel.FACILITIES_CONTENT_CLICKLAYER & 0xFFFF, 0); + sailToPandemonium = new SailStep(this, Port.PANDEMONIUM); + letGoOfHelm2 = new ObjectStep(this, ObjectID.SAILING_BOAT_STEERING_KANDARIN_1X3_WOOD_IN_USE, new WorldPoint(3843, 6460, 1), "Let go of the helm."); + pickupCargoShip = new ObjectStep(this, ObjectID.SAILING_BOAT_CARGO_HOLD_REGULAR_RAFT, "Pick up the cargo from your ship's cargo hold.", nothingInHands); + boardShip3 = new BoardShipStep(this); + disembarkShipP = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_DISEMBARK, new WorldPoint(3070, 2987, 0), "Leave your ship."); + deliverCargo = new ObjectStep(this, ObjectID.DOCK_LOADING_BAY_LEDGER_TABLE_DEPOSIT, new WorldPoint(3061, 2985, 0), "Deliver the cargo at the ledger table on the docks."); + //Finish up + talkToJim = new NpcStep(this, NpcID.JUNIOR_JIM, new WorldPoint(3059, 2979, 0), "Tell Junior Jim about your delivery."); + meetGrog = new NpcStep(this, new int[]{NpcID.STEVE_BEANIE, NpcID.SAILING_INTRO_GROG_VIS}, new WorldPoint(3050, 2966, 0), "Meet 'Squawking' Steve Beanie and Old Grog at the bar.", true); + finishQuest = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Talk to 'Squawking' Steve Beanie to finish the quest."); + } + + @Override + public QuestPointReward getQuestPointReward() + { + return new QuestPointReward(1); + } + + @Override + public List getItemRequirements() + { + return Arrays.asList(hammer, saw); + } + + @Override + public List getExperienceRewards() + { + return List.of(new ExperienceReward(Skill.SAILING, 300)); + } + + @Override + public List getItemRewards() + { + return Arrays.asList( + new ItemReward("Sawmill Coupon (wood plank)", ItemID.SAWMILL_COUPON, 25), + new ItemReward("Repair kits", ItemID.BOAT_REPAIR_KIT, 2), + new ItemReward("Spyglass", ItemID.SAILING_CHARTING_SPYGLASS, 1)); + } + + @Override + public List getUnlockRewards() + { + return Arrays.asList(new UnlockReward("Access to the Sailing Skill"), new UnlockReward("Access to Pandemonium"), new UnlockReward("Your very own mighty ship!")); + } + + @Override + public List getPanels() + { + List allSteps = new ArrayList<>(); + allSteps.add(new PanelDetails("You got the job!", Arrays.asList(talkToWill, boardWAShip))); + allSteps.add(new PanelDetails("What's the job?", Arrays.asList(explainJob, takeHelm, raiseSails, navigateShip, explainJob2, salvageShipwreck, watchSalvageCutscene))); + allSteps.add(new PanelDetails("You lost the job!", Arrays.asList(getToPandemonium, learnWhereYouAre, learnWhoWAare, talkToRibs, findLocationWA, informAboutShip, showCup))); + allSteps.add(new PanelDetails("Your mighty vessel", Arrays.asList(enterShipyard, getSaw, getHammer, embarkShipSY, buildCargoHold, disembarkShipSY, leaveShipyard, getLogBook))); + allSteps.add(new PanelDetails("You got the job... again!", Arrays.asList(getNewJob, boardShip, takeHelm2, raiseSails2, sailToPortSarim, letGoOfHelm, disembarkShipPS, pickupCargo, boardShip2))); + allSteps.add(new PanelDetails("Deliver the cargo.", Arrays.asList(dropCargoInCargoHold, takeHelm3, raiseSails3, sailToPandemonium, letGoOfHelm2, pickupCargoShip, disembarkShipP, deliverCargo))); + allSteps.add(new PanelDetails("Finishing up", Arrays.asList(talkToJim, meetGrog, finishQuest))); + return allSteps; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/perilousmoon/PerilousMoon.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/perilousmoon/PerilousMoon.java index b8d6317df8a..ddd6df33568 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/perilousmoon/PerilousMoon.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/perilousmoon/PerilousMoon.java @@ -37,7 +37,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -120,7 +119,7 @@ public Map loadSteps() steps.put(4, returnToAttala); ConditionalStep goTalkToJess = new ConditionalStep(this, enterCamTorum); - goTalkToJess.addStep(LogicHelper.and(inCamTorum), talkToJessamine); + goTalkToJess.addStep(and(inCamTorum), talkToJessamine); steps.put(5, goTalkToJess); // 5->6 when entered cam torum // 9826 0->1, probably builders going @@ -198,7 +197,7 @@ public Map loadSteps() getItemsWhenInStream.addStep(and(hadPaste, hadScales), getHunterSupplies); getItemsWhenInStream.addStep(and(hadPaste, bream), useKnifeOnBream); getItemsWhenInStream.addStep(and(hadPaste, bigFishingNet), fishBream); - getItemsWhenInStream.addStep(LogicHelper.and(hadPaste), getFishingSupplies); + getItemsWhenInStream.addStep(and(hadPaste), getFishingSupplies); getItemsWhenInStream.addStep(and(pestleAndMortar, moonlightGrub), useGrubOnPestle); getItemsWhenInStream.addStep(and(pestleAndMortar), collectGrub); @@ -322,11 +321,11 @@ protected void setupRequirements() private void setupConditions() { - talkedToBuilders = new VarbitRequirement(9824, 1); + talkedToBuilders = new VarbitRequirement(VarbitID.PMOON_RUIN_DIALOGUE, 1); inCamTorum = new ZoneRequirement(camTorum); inAntechamber = new ZoneRequirement(antechamber); - talkedToAttalaInNey = new VarbitRequirement(9823, 1); - talkedToZumaInNey = new VarbitRequirement(9823, 2); + talkedToAttalaInNey = new VarbitRequirement(VarbitID.PMOON_MURALS_INSPECTED, 1); + talkedToZumaInNey = new VarbitRequirement(VarbitID.PMOON_MURALS_INSPECTED, 2); // 9826 0->2 // 9827 0->1 (Interrupted by guard to not risk stuff), increments each time, reached 5 @@ -341,9 +340,9 @@ private void setupConditions() bloodMoonRoom, eclipseRoom); // 15064 0->100 - madePrisonCamp = new VarbitRequirement(9820, 1); - madeEarthCamp = new VarbitRequirement(9821, 1); - madeStreamCamp = new VarbitRequirement(9822, 1); + madePrisonCamp = new VarbitRequirement(VarbitID.PMOON_CAMP_1, 1); + madeEarthCamp = new VarbitRequirement(VarbitID.PMOON_CAMP_2, 1); + madeStreamCamp = new VarbitRequirement(VarbitID.PMOON_CAMP_3, 1); // Found eyat // Location: 1525, 9580, 0. 3x3 region for summoning. Directions work for exact row/column @@ -351,8 +350,8 @@ private void setupConditions() // 9825 0->1 eyatlalliNearby = new NpcRequirement(NpcID.PMOON_EYATLALLI_VIS); // icosahedron - trapSetup = or(new VarbitRequirement(9871, 1), new VarbitRequirement(9872, 1), - new VarbitRequirement(9873, 1)); + trapSetup = or(new VarbitRequirement(VarbitID.PMOON_LIZARD_TRAP_SET_1, 1), new VarbitRequirement(VarbitID.PMOON_LIZARD_TRAP_SET_2, 1), + new VarbitRequirement(VarbitID.PMOON_LIZARD_TRAP_SET_3, 1)); lizardNearby = new ItemOnTileRequirement(ItemID.RAW_LIZARD); // 9871/2/3 for traps, 0->1 @@ -375,9 +374,9 @@ private void setupConditions() // Varp 4150 0->1 blood moon ded - defeatedBloodMoon = new VarbitRequirement(9858, 1); - defeatedBlueMoon = new VarbitRequirement(9859, 1); - defeatedEclipseMoon = new VarbitRequirement(9860, 1); + defeatedBloodMoon = new VarbitRequirement(VarbitID.PMOON_BOSS_BLOOD_DEAD, 1); + defeatedBlueMoon = new VarbitRequirement(VarbitID.PMOON_BOSS_BLUE_DEAD, 1); + defeatedEclipseMoon = new VarbitRequirement(VarbitID.PMOON_BOSS_ECLIPSE_DEAD, 1); } private void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java index c3c4b80bb61..0766746b7b1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/PiratesTreasure.java @@ -33,21 +33,17 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DigStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class PiratesTreasure extends BasicQuestHelper { // Required items diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java index b4952501757..805f3e4c309 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/piratestreasure/RumSmugglingStep.java @@ -32,24 +32,22 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.DialogRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetTextRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import java.util.ArrayList; -import java.util.List; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import java.util.ArrayList; +import java.util.List; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; + public class RumSmugglingStep extends ConditionalStep { private final PiratesTreasure pt; @@ -187,11 +185,11 @@ private void setupSteps() talkToLuthas.addDialogStep("Could you offer me employment on your plantation?"); talkToLuthas.addDialogStep("Will you pay me for another crate full?"); - addRumToCrate = new ObjectStep(getQuestHelper(), ObjectID.BANANACRATE, new WorldPoint(2943, 3151, 0), + addRumToCrate = new ObjectStep(getQuestHelper(), ObjectID.BANANACRATE, new WorldPoint(2939, 3149, 0), "Put the Karamjan rum into the crate.", karamjanRum.highlighted(), pt.tenBananas); addRumToCrate.addIcon(ItemID.KARAMJA_RUM); - addBananasToCrate = new ObjectStep(getQuestHelper(), ObjectID.BANANACRATE, new WorldPoint(2943, 3151, 0), + addBananasToCrate = new ObjectStep(getQuestHelper(), ObjectID.BANANACRATE, new WorldPoint(2939, 3149, 0), "Right-click fill the rest of the crate with bananas, then talk to Luthas.", pt.tenBananas); talkToLuthasAgain = new NpcStep(getQuestHelper(), NpcID.LUTHAS, new WorldPoint(2938, 3154, 0), @@ -203,6 +201,8 @@ private void setupSteps() talkToCustomsOfficer.addDialogStep("Can I journey on this ship?"); talkToCustomsOfficer.addDialogStep("Search away, I have nothing to hide."); talkToCustomsOfficer.addDialogStep("Ok."); + talkToCustomsOfficer.addDialogStep("Search away. I have nothing to hide."); + talkToCustomsOfficer.addDialogStep("Okay."); getWhiteApron = new DetailedQuestStep(getQuestHelper(), new WorldPoint(3016, 3229, 0), "Grab the white apron from the Fishing Shop.", whiteApronHanging); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/plaguecity/PlagueCity.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/plaguecity/PlagueCity.java index fc60ffdf16a..f2e6906212c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/plaguecity/PlagueCity.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/plaguecity/PlagueCity.java @@ -26,8 +26,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ObjectCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; @@ -42,148 +40,120 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class PlagueCity extends BasicQuestHelper { - //Items Required - ItemRequirement spade, dwellberries, rope, bucketOfMilk, chocolateDust, snapeGrass, - pictureOfElena, gasMask, book, bucketOfChocolateMilk, hangoverCure, warrant, key; - - //Items Recommended - ItemRequirement fourBucketsOfWater, threeBucketsOfWater, twoBucketsOfWater, bucketOfWater; - - Requirement inUnderground, hasTriedToPullGrill, inWestArdougne, inUpstairsMathasHouse, - inPlagueHouse, inDownstairsOfPlagueHouse, manholeClosed; - - QuestStep talkToEdmond, talkToAlrena, talkToEdmondAgain, useWaterOnMudPatch1, useWaterOnMudPatch2, useWaterOnMudPatch3, useWaterOnMudPatch4, - digHole, grabPictureOfElena, goDownHole, attemptToPullGrill, climbMudPile, talkToEdmondUnderground, useRopeOnGrill, climbThroughPipe, talkToJethick, - enterMarthasHouse, talkToMartha, talkToMilli, goUpstairsInMarthasHouse, tryToEnterPlagueHouse, talkToClerk, talkToBravek, useDustOnMilk, - useSnapeGrassOnChocolateMilk, giveHangoverCureToBravek, talkToBravekAgain, tryToEnterPlagueHouseAgain, searchBarrel, goDownstairsInPlagueHouse, - goUpstairsInPlagueHouse, talkToElena, goUpstairsInPlagueHouseToFinish, goDownManhole, goDownManhole2, climbMudPileToFinish, talkToEdmondToFinish; - - //Zones - Zone underground, westArdougne1, westArdougne2, westArdougne3, upstairsMathasHouse, plagueHouse1, plagueHouse2, downstairsOfPlagueHouse; + // Required items + ItemRequirement spade; + ItemRequirement dwellberries; + ItemRequirement rope; + ItemRequirement bucketOfMilk; + ItemRequirement chocolateDust; + ItemRequirement snapeGrass; + + // Recommended items + ItemRequirement fourBucketsOfWater; + ItemRequirement threeBucketsOfWater; + ItemRequirement twoBucketsOfWater; + ItemRequirement bucketOfWater; + + // Mid-quest requirements + ItemRequirement pictureOfElena; + ItemRequirement gasMask; + ItemRequirement book; + ItemRequirement bucketOfChocolateMilk; + ItemRequirement hangoverCure; + ItemRequirement warrant; + ItemRequirement key; + + // Zones + Zone underground; + Zone westArdougne1; + Zone westArdougne2; + Zone westArdougne3; + Zone upstairsMathasHouse; + Zone plagueHouse1; + Zone plagueHouse2; + Zone downstairsOfPlagueHouse; + + // Miscellaneous requirements + ZoneRequirement inUnderground; + VarbitRequirement hasTriedToPullGrill; + ZoneRequirement inWestArdougne; + ZoneRequirement inUpstairsMathasHouse; + ZoneRequirement inPlagueHouse; + ZoneRequirement inDownstairsOfPlagueHouse; + ObjectCondition manholeClosed; + + // Steps + NpcStep talkToEdmond; + NpcStep talkToAlrena; + DetailedQuestStep grabPictureOfElena; + NpcStep talkToEdmondAgain; + DetailedQuestStep useWaterOnMudPatch1; + DetailedQuestStep useWaterOnMudPatch2; + DetailedQuestStep useWaterOnMudPatch3; + DetailedQuestStep useWaterOnMudPatch4; + ObjectStep digHole; + ObjectStep goDownHole; + ObjectStep attemptToPullGrill; + ObjectStep climbMudPile; + NpcStep talkToEdmondUnderground; + ObjectStep useRopeOnGrill; + ObjectStep climbThroughPipe; + NpcStep talkToJethick; + ObjectStep enterMarthasHouse; + NpcStep talkToMartha; + NpcStep talkToMilli; + ObjectStep goUpstairsInMarthasHouse; + ObjectStep tryToEnterPlagueHouse; + NpcStep talkToClerk; + NpcStep talkToBravek; + DetailedQuestStep useDustOnMilk; + DetailedQuestStep useSnapeGrassOnChocolateMilk; + NpcStep giveHangoverCureToBravek; + NpcStep talkToBravekAgain; + ObjectStep tryToEnterPlagueHouseAgain; + ObjectStep searchBarrel; + ObjectStep goDownstairsInPlagueHouse; + ObjectStep goUpstairsInPlagueHouse; + NpcStep talkToElena; + ObjectStep goUpstairsInPlagueHouseToFinish; + ObjectStep goDownManhole; + ObjectStep goDownManhole2; + ObjectStep climbMudPileToFinish; + NpcStep talkToEdmondToFinish; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToEdmond); - steps.put(1, talkToAlrena); - - ConditionalStep getPictureThenTalkEdmond = new ConditionalStep(this, grabPictureOfElena); - getPictureThenTalkEdmond.addStep(pictureOfElena, talkToEdmondAgain); - steps.put(2, getPictureThenTalkEdmond); - - steps.put(3, useWaterOnMudPatch1); - steps.put(4, useWaterOnMudPatch2); - steps.put(5, useWaterOnMudPatch3); - steps.put(6, useWaterOnMudPatch4); - - ConditionalStep getPictureThenDig = new ConditionalStep(this, grabPictureOfElena); - getPictureThenDig.addStep(pictureOfElena, digHole); - steps.put(7, getPictureThenDig); - - ConditionalStep attemptToOpenGrill = new ConditionalStep(this, grabPictureOfElena); - attemptToOpenGrill.addStep(new Conditions(hasTriedToPullGrill, inUnderground, pictureOfElena), useRopeOnGrill); - attemptToOpenGrill.addStep(new Conditions(inUnderground, pictureOfElena), attemptToPullGrill); - attemptToOpenGrill.addStep(inUnderground, climbMudPile); - attemptToOpenGrill.addStep(pictureOfElena, goDownHole); - - steps.put(8, attemptToOpenGrill); - - ConditionalStep pullOffGrill = new ConditionalStep(this, grabPictureOfElena); - pullOffGrill.addStep(new Conditions(inUnderground, pictureOfElena), talkToEdmondUnderground); - pullOffGrill.addStep(inUnderground, climbMudPile); - pullOffGrill.addStep(pictureOfElena, goDownHole); - - steps.put(9, pullOffGrill); - - ConditionalStep enterWestArdougne = new ConditionalStep(this, grabPictureOfElena); - enterWestArdougne.addStep(new Conditions(inWestArdougne, pictureOfElena), talkToJethick); - enterWestArdougne.addStep(new Conditions(inUnderground, pictureOfElena), climbThroughPipe); - enterWestArdougne.addStep(inUnderground, climbMudPile); - enterWestArdougne.addStep(pictureOfElena, goDownHole); - - steps.put(10, enterWestArdougne); - - ConditionalStep goToMarthasHouse = new ConditionalStep(this, goDownHole); - goToMarthasHouse.addStep(new Conditions(inWestArdougne, book), enterMarthasHouse); - goToMarthasHouse.addStep(inWestArdougne, talkToJethick); - goToMarthasHouse.addStep(inUnderground, climbThroughPipe); - - steps.put(20, goToMarthasHouse); - - ConditionalStep talkToMarthaInHouse = new ConditionalStep(this, goDownHole); - talkToMarthaInHouse.addStep(inWestArdougne, talkToMartha); - talkToMarthaInHouse.addStep(inUnderground, climbThroughPipe); - - steps.put(21, talkToMarthaInHouse); - - ConditionalStep talkToMilliInHouse = new ConditionalStep(this, goDownHole); - talkToMilliInHouse.addStep(inUpstairsMathasHouse, talkToMilli); - talkToMilliInHouse.addStep(inWestArdougne, goUpstairsInMarthasHouse); - talkToMilliInHouse.addStep(inUnderground, climbThroughPipe); - - steps.put(22, talkToMilliInHouse); - - ConditionalStep goToPlagueHouse = new ConditionalStep(this, goDownHole); - goToPlagueHouse.addStep(inWestArdougne, tryToEnterPlagueHouse); - goToPlagueHouse.addStep(inUnderground, climbThroughPipe); - - steps.put(23, goToPlagueHouse); - - ConditionalStep goSpeakToClerk = new ConditionalStep(this, goDownHole); - goSpeakToClerk.addStep(inWestArdougne, talkToClerk); - goSpeakToClerk.addStep(inUnderground, climbThroughPipe); - - steps.put(24, goSpeakToClerk); - - ConditionalStep goTalkToBravek = new ConditionalStep(this, goDownHole); - goTalkToBravek.addStep(inWestArdougne, talkToBravek); - goTalkToBravek.addStep(inUnderground, climbThroughPipe); - - steps.put(25, goTalkToBravek); - - ConditionalStep createHangoverCureForBravek = new ConditionalStep(this, useDustOnMilk); - createHangoverCureForBravek.addStep(new Conditions(inWestArdougne, hangoverCure), giveHangoverCureToBravek); - createHangoverCureForBravek.addStep(new Conditions(hangoverCure, inUnderground), climbThroughPipe); - createHangoverCureForBravek.addStep(hangoverCure, goDownHole); - createHangoverCureForBravek.addStep(bucketOfChocolateMilk, useSnapeGrassOnChocolateMilk); - - steps.put(26, createHangoverCureForBravek); - - ConditionalStep continueTalkingToBravek = new ConditionalStep(this, goDownHole); - continueTalkingToBravek.addStep(new Conditions(inDownstairsOfPlagueHouse, key), talkToElena); - continueTalkingToBravek.addStep(new Conditions(inPlagueHouse, key), goDownstairsInPlagueHouse); - continueTalkingToBravek.addStep(inPlagueHouse, searchBarrel); - continueTalkingToBravek.addStep(inDownstairsOfPlagueHouse, goUpstairsInPlagueHouse); - continueTalkingToBravek.addStep(new Conditions(warrant, inWestArdougne), tryToEnterPlagueHouseAgain); - continueTalkingToBravek.addStep(inWestArdougne, talkToBravekAgain); - continueTalkingToBravek.addStep(inUnderground, climbThroughPipe); - - steps.put(27, continueTalkingToBravek); - - ConditionalStep finishQuest = new ConditionalStep(this, talkToEdmondToFinish); - finishQuest.addStep(inDownstairsOfPlagueHouse, goUpstairsInPlagueHouseToFinish); - finishQuest.addStep(new Conditions(inWestArdougne, manholeClosed), goDownManhole2); - finishQuest.addStep(inWestArdougne, goDownManhole); - finishQuest.addStep(inUnderground, climbMudPileToFinish); - - steps.put(28, finishQuest); - - return steps; + underground = new Zone(new WorldPoint(2506, 9737, 0), new WorldPoint(2532, 9781, 0)); + westArdougne1 = new Zone(new WorldPoint(2460, 3279, 0), new WorldPoint(2556, 3334, 2)); + westArdougne2 = new Zone(new WorldPoint(2434, 3305, 0), new WorldPoint(2464, 3323, 2)); + westArdougne3 = new Zone(new WorldPoint(2510, 3265, 0), new WorldPoint(2556, 3280, 2)); + upstairsMathasHouse = new Zone(new WorldPoint(2527, 3329, 1), new WorldPoint(2533, 3333, 1)); + plagueHouse1 = new Zone(new WorldPoint(2532, 3268, 0), new WorldPoint(2541, 3271, 0)); + plagueHouse2 = new Zone(new WorldPoint(2535, 3272, 0), new WorldPoint(2541, 3272, 0)); + downstairsOfPlagueHouse = new Zone(new WorldPoint(2535, 9670, 0), new WorldPoint(2542, 9673, 0)); } @Override protected void setupRequirements() { + inUnderground = new ZoneRequirement(underground); + hasTriedToPullGrill = new VarbitRequirement(VarbitID.PLAGUECITY_CHECKED_GRILL, 1); + inWestArdougne = new ZoneRequirement(westArdougne1, westArdougne2, westArdougne3); + inUpstairsMathasHouse = new ZoneRequirement(upstairsMathasHouse); + manholeClosed = new ObjectCondition(ObjectID.PLAGUEMANHOLECLOSED); + dwellberries = new ItemRequirement("Dwellberries", ItemID.DWELLBERRIES); dwellberries.setTooltip("You can get these from McGrubor's Wood west of Seers' Village"); rope = new ItemRequirement("Rope", ItemID.ROPE); @@ -192,17 +162,15 @@ protected void setupRequirements() spade.canBeObtainedDuringQuest(); spade.setTooltip("A spawn is found in Edmond's garden at the start of the quest"); spade.setHighlightInInventory(true); - fourBucketsOfWater = new ItemRequirement("Buckets of water", ItemID.BUCKET_WATER, 4); + + fourBucketsOfWater = new ItemRequirement("Bucket of water", ItemID.BUCKET_WATER, 4); + fourBucketsOfWater.canBeObtainedDuringQuest(); fourBucketsOfWater.setHighlightInInventory(true); - fourBucketsOfWater.setTooltip("You can use the bucket near the start of the quest on the sink nearby"); - threeBucketsOfWater = new ItemRequirement("Buckets of water", ItemID.BUCKET_WATER, 3); - threeBucketsOfWater.setHighlightInInventory(true); - threeBucketsOfWater.setTooltip("You can use the bucket near the start of the quest on the sink nearby"); - twoBucketsOfWater = new ItemRequirement("Buckets of water", ItemID.BUCKET_WATER, 2); - twoBucketsOfWater.setHighlightInInventory(true); - twoBucketsOfWater.setTooltip("You can use the bucket near the start of the quest on the sink nearby"); - bucketOfWater = new ItemRequirement("Bucket of water", ItemID.BUCKET_WATER); - bucketOfWater.setHighlightInInventory(true); + fourBucketsOfWater.setTooltip("An empty bucket can be found next to Edmond's garden patch, which can be filled in the sink inside Edmond's house."); + threeBucketsOfWater = fourBucketsOfWater.quantity(3); + twoBucketsOfWater = fourBucketsOfWater.quantity(2); + bucketOfWater = fourBucketsOfWater.quantity(1); + bucketOfMilk = new ItemRequirement("Bucket of milk", ItemID.BUCKET_MILK); bucketOfMilk.setHighlightInInventory(true); chocolateDust = new ItemRequirement("Chocolate dust", ItemID.CHOCOLATE_DUST); @@ -222,33 +190,19 @@ protected void setupRequirements() key = new ItemRequirement("A small key", ItemID.ELENAKEY); } - @Override - protected void setupZones() { - underground = new Zone(new WorldPoint(2506,9737,0), new WorldPoint(2532,9781,0)); - westArdougne1 = new Zone(new WorldPoint(2460,3279,0), new WorldPoint(2556, 3334,2)); - westArdougne2 = new Zone(new WorldPoint(2434,3305,0), new WorldPoint(2464, 3323,2)); - westArdougne3 = new Zone(new WorldPoint(2510,3265,0), new WorldPoint(2556, 3280,2)); - upstairsMathasHouse = new Zone(new WorldPoint(2527,3329,1), new WorldPoint(2533, 3333,1)); - plagueHouse1 = new Zone(new WorldPoint(2532,3268,0), new WorldPoint(2541, 3271,0)); - plagueHouse2 = new Zone(new WorldPoint(2535,3272,0), new WorldPoint(2541, 3272,0)); - downstairsOfPlagueHouse = new Zone(new WorldPoint(2535, 9670,0), new WorldPoint(2542, 9673,0)); - } - - public void setupConditions() { - inUnderground = new ZoneRequirement(underground); - hasTriedToPullGrill = new VarbitRequirement(1786, 1); - inWestArdougne = new ZoneRequirement(westArdougne1, westArdougne2, westArdougne3); - inUpstairsMathasHouse = new ZoneRequirement(upstairsMathasHouse); - manholeClosed = new ObjectCondition(ObjectID.PLAGUEMANHOLECLOSED); - } - public void setupSteps() { - talkToEdmond = new NpcStep(this, NpcID.WILDERNESS_CAPESELLER_8, new WorldPoint(2568, 3333, 0), "Talk to Edmond in the north-west corner of East Ardougne."); + talkToEdmond = new NpcStep(this, NpcID.EDMOND, new WorldPoint(2568, 3333, 0), "Talk to Edmond in the north-west corner of East Ardougne."); talkToEdmond.addDialogStep("What's happened to her?"); talkToEdmond.addDialogStep("Yes."); - talkToAlrena = new NpcStep(this, NpcID.ALRENA, new WorldPoint(2573, 3333, 0), "Talk to Alrena nearby.", dwellberries); - talkToEdmondAgain = new NpcStep(this, NpcID.WILDERNESS_CAPESELLER_8, new WorldPoint(2568, 3332, 0), "Talk to Edmond again."); + + talkToAlrena = new NpcStep(this, NpcID.ALRENA, new WorldPoint(2573, 3333, 0), "Talk to Alrena and give her the dwellberries.", dwellberries); + + grabPictureOfElena = new DetailedQuestStep(this, new WorldPoint(2576, 3334, 0), + "Grab the Picture from Edmond's house.", pictureOfElena); + + talkToEdmondAgain = new NpcStep(this, NpcID.EDMOND, new WorldPoint(2568, 3332, 0), "Talk to Edmond again."); + useWaterOnMudPatch1 = new ObjectStep(this, ObjectID.PLAGUEMUDPATCH2, new WorldPoint(2566, 3332, 0), "Use four buckets of water on the mud patch in Edmond's garden patch.", fourBucketsOfWater); useWaterOnMudPatch1.addIcon(ItemID.BUCKET_WATER); @@ -268,20 +222,18 @@ public void setupSteps() "Use a spade on the mud patch.", spade); digHole.addIcon(ItemID.SPADE); - grabPictureOfElena = new DetailedQuestStep(this, new WorldPoint(2576, 3334, 0), - "Grab the Picture from Edmond's house.", pictureOfElena); goDownHole = new ObjectStep(this, ObjectID.PLAGUEMUDPATCH2, new WorldPoint(2566, 3332, 0), "Go down the hole."); - attemptToPullGrill = new ObjectStep(this, ObjectID.PLAGUE_GRILL, new WorldPoint(2514,9739,0), "Attempt to pull the grill in the south of the sewer."); - climbMudPile = new ObjectStep(this, ObjectID.PLAGUEMUDPILE, new WorldPoint(2519,9760,0), "Climb the mud pile."); + attemptToPullGrill = new ObjectStep(this, ObjectID.PLAGUE_GRILL, new WorldPoint(2514, 9739, 0), "Attempt to pull the grill in the south of the sewer."); + climbMudPile = new ObjectStep(this, ObjectID.PLAGUEMUDPILE, new WorldPoint(2519, 9760, 0), "Climb the mud pile."); grabPictureOfElena.addSubSteps(climbMudPile); - useRopeOnGrill = new ObjectStep(this, ObjectID.PLAGUE_GRILL, new WorldPoint(2514,9739,0), "Use a rope on the grill.", rope); + useRopeOnGrill = new ObjectStep(this, ObjectID.PLAGUE_GRILL, new WorldPoint(2514, 9739, 0), "Use a rope on the grill.", rope); useRopeOnGrill.addIcon(ItemID.ROPE); - talkToEdmondUnderground = new NpcStep(this, NpcID.WILDERNESS_CAPESELLER_8, new WorldPoint(2517, 9753, 0), "Talk to Edmond."); + talkToEdmondUnderground = new NpcStep(this, NpcID.EDMOND, new WorldPoint(2517, 9753, 0), "Talk to Edmond and ask him to help you pull off the grill."); climbThroughPipe = new ObjectStep(this, ObjectID.PLAGUESEWERPIPE_OPEN, new WorldPoint(2514, 9738, 0), "Equip the gas mask and climb through the pipe.", gasMask.highlighted()); @@ -290,7 +242,8 @@ public void setupSteps() enterMarthasHouse = new ObjectStep(this, ObjectID.REHNISONDOORSHUT, new WorldPoint(2531, 3328, 0), "Enter the tall house in north West Ardougne."); - talkToMartha = new NpcStep(this, NpcID.MARTHA_REHNISON, new WorldPoint(2531, 3331, 0), "Talk to Martha or Ted Renison"); + talkToMartha = new NpcStep(this, NpcID.MARTHA_REHNISON, new WorldPoint(2531, 3331, 0), "Talk to Martha or Ted Rehnison", true); + talkToMartha.addAlternateNpcs(NpcID.TED_REHNISON); goUpstairsInMarthasHouse = new ObjectStep(this, ObjectID.REHNISONSTAIRS, new WorldPoint(2528, 3333, 0), "Talk to Milli upstairs."); talkToMilli = new NpcStep(this, NpcID.MILLI, new WorldPoint(2531, 3331, 1), "Talk to Milli."); @@ -304,7 +257,7 @@ public void setupSteps() talkToClerk.addDialogStep("I need permission to enter a plague house."); talkToClerk.addDialogStep("This is urgent though! Someone's been kidnapped!"); - talkToBravek = new NpcStep(this, NpcID.BRAVEK, new WorldPoint(2534, 3314, 0), "Talk to the Bravek in the room to the east."); + talkToBravek = new NpcStep(this, NpcID.BRAVEK, new WorldPoint(2534, 3314, 0), "Talk to Bravek in the room to the east."); talkToBravek.addDialogStep("This is really important though!"); talkToBravek.addDialogStep("Do you know what's in the cure?"); @@ -312,18 +265,16 @@ public void setupSteps() useDustOnMilk = new DetailedQuestStep(this, "Use your chocolate dust on the bucket of milk.", bucketOfMilk, chocolateDust); useSnapeGrassOnChocolateMilk = new DetailedQuestStep(this, "Use the snape grass on the chocolatey milk", bucketOfChocolateMilk, snapeGrass); - giveHangoverCureToBravek = new NpcStep(this, NpcID.BRAVEK, new WorldPoint(2534, 3314, 0), "Talk to the Bravek again.", hangoverCure); + giveHangoverCureToBravek = new NpcStep(this, NpcID.BRAVEK, new WorldPoint(2534, 3314, 0), "Give the hangover cure to Bravek.", hangoverCure); - talkToBravekAgain = new NpcStep(this, NpcID.BRAVEK, new WorldPoint(2534, 3314, 0), "Talk to the Bravek again.", warrant); + talkToBravekAgain = new NpcStep(this, NpcID.BRAVEK, new WorldPoint(2534, 3314, 0), "Talk to Bravek to receive the warrant you need to enter the plague house."); talkToBravekAgain.addDialogStep("They won't listen to me!"); - giveHangoverCureToBravek.addSubSteps(talkToBravekAgain); - tryToEnterPlagueHouseAgain = new ObjectStep(this, ObjectID.PLAGUEELENADOORSHUT, new WorldPoint(2540, 3273, 0), "Try to enter the plague house again.", warrant); searchBarrel = new ObjectStep(this, ObjectID.PLAGUEKEYBARREL, new WorldPoint(2534, 3268, 0), "Search the barrel in the room for a small key."); - goDownstairsInPlagueHouse = new ObjectStep(this, ObjectID.PLAGUEHOUSESTAIRSDOWN, new WorldPoint(2537, 3269, 0), "Go downstairs.", key); + goDownstairsInPlagueHouse = new ObjectStep(this, ObjectID.PLAGUEHOUSESTAIRSDOWN, new WorldPoint(2537, 3269, 0), "Go downstairs in the plague house.", key); goUpstairsInPlagueHouse = new ObjectStep(this, ObjectID.PLAGUEHOUSESTAIRSUP, new WorldPoint(2537, 9672, 0), "Go back upstairs to get the key for Elena's cell."); searchBarrel.addSubSteps(goUpstairsInPlagueHouse); @@ -334,31 +285,150 @@ public void setupSteps() goDownManhole = new ObjectStep(this, ObjectID.PLAGUEMANHOLEOPEN, new WorldPoint(2529, 3303, 0), "Go back down the manhole to return to Edmond."); goDownManhole2 = new ObjectStep(this, ObjectID.PLAGUEMANHOLECLOSED, new WorldPoint(2529, 3303, 0), "Go back down the manhole to return to Edmond."); - climbMudPileToFinish = new ObjectStep(this, ObjectID.PLAGUEMUDPILE, new WorldPoint(2519,9760,0), "Climb the mud pile to return to Edmond."); + climbMudPileToFinish = new ObjectStep(this, ObjectID.PLAGUEMUDPILE, new WorldPoint(2519, 9760, 0), "Climb the mud pile to return to Edmond."); - talkToEdmondToFinish = new NpcStep(this, NpcID.WILDERNESS_CAPESELLER_8, new WorldPoint(2568, 3333, 0), "Return to Edmond to finish the quest."); + talkToEdmondToFinish = new NpcStep(this, NpcID.EDMOND, new WorldPoint(2568, 3333, 0), "Return to Edmond to finish the quest."); talkToEdmondToFinish.addSubSteps(goUpstairsInPlagueHouseToFinish, goDownManhole, goDownManhole2, climbMudPileToFinish); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToEdmond); + steps.put(1, talkToAlrena); + + var getPictureThenTalkEdmond = new ConditionalStep(this, grabPictureOfElena); + getPictureThenTalkEdmond.addStep(pictureOfElena, talkToEdmondAgain); + steps.put(2, getPictureThenTalkEdmond); + + steps.put(3, useWaterOnMudPatch1); + steps.put(4, useWaterOnMudPatch2); + steps.put(5, useWaterOnMudPatch3); + steps.put(6, useWaterOnMudPatch4); + + var getPictureThenDig = new ConditionalStep(this, grabPictureOfElena); + getPictureThenDig.addStep(pictureOfElena, digHole); + steps.put(7, getPictureThenDig); + + var attemptToOpenGrill = new ConditionalStep(this, grabPictureOfElena); + attemptToOpenGrill.addStep(and(hasTriedToPullGrill, inUnderground, pictureOfElena), useRopeOnGrill); + attemptToOpenGrill.addStep(and(inUnderground, pictureOfElena), attemptToPullGrill); + attemptToOpenGrill.addStep(inUnderground, climbMudPile); + attemptToOpenGrill.addStep(pictureOfElena, goDownHole); + + steps.put(8, attemptToOpenGrill); + + var pullOffGrill = new ConditionalStep(this, grabPictureOfElena); + pullOffGrill.addStep(and(inUnderground, pictureOfElena), talkToEdmondUnderground); + pullOffGrill.addStep(inUnderground, climbMudPile); + pullOffGrill.addStep(pictureOfElena, goDownHole); + + steps.put(9, pullOffGrill); + + var enterWestArdougne = new ConditionalStep(this, grabPictureOfElena); + enterWestArdougne.addStep(and(inWestArdougne, pictureOfElena), talkToJethick); + enterWestArdougne.addStep(and(inUnderground, pictureOfElena), climbThroughPipe); + enterWestArdougne.addStep(inUnderground, climbMudPile); + enterWestArdougne.addStep(pictureOfElena, goDownHole); + + steps.put(10, enterWestArdougne); + + var goToMarthasHouse = new ConditionalStep(this, goDownHole); + goToMarthasHouse.addStep(and(inWestArdougne, book), enterMarthasHouse); + goToMarthasHouse.addStep(inWestArdougne, talkToJethick); + goToMarthasHouse.addStep(inUnderground, climbThroughPipe); + + steps.put(20, goToMarthasHouse); + + var talkToMarthaInHouse = new ConditionalStep(this, goDownHole); + talkToMarthaInHouse.addStep(inWestArdougne, talkToMartha); + talkToMarthaInHouse.addStep(inUnderground, climbThroughPipe); + + steps.put(21, talkToMarthaInHouse); + + var talkToMilliInHouse = new ConditionalStep(this, goDownHole); + talkToMilliInHouse.addStep(inUpstairsMathasHouse, talkToMilli); + talkToMilliInHouse.addStep(inWestArdougne, goUpstairsInMarthasHouse); + talkToMilliInHouse.addStep(inUnderground, climbThroughPipe); + + steps.put(22, talkToMilliInHouse); + + var goToPlagueHouse = new ConditionalStep(this, goDownHole); + goToPlagueHouse.addStep(inWestArdougne, tryToEnterPlagueHouse); + goToPlagueHouse.addStep(inUnderground, climbThroughPipe); + + steps.put(23, goToPlagueHouse); + + var goSpeakToClerk = new ConditionalStep(this, goDownHole); + goSpeakToClerk.addStep(inWestArdougne, talkToClerk); + goSpeakToClerk.addStep(inUnderground, climbThroughPipe); + + steps.put(24, goSpeakToClerk); + + var goTalkToBravek = new ConditionalStep(this, goDownHole); + goTalkToBravek.addStep(inWestArdougne, talkToBravek); + goTalkToBravek.addStep(inUnderground, climbThroughPipe); + + steps.put(25, goTalkToBravek); + + var createHangoverCureForBravek = new ConditionalStep(this, useDustOnMilk); + createHangoverCureForBravek.addStep(and(inWestArdougne, hangoverCure), giveHangoverCureToBravek); + createHangoverCureForBravek.addStep(and(hangoverCure, inUnderground), climbThroughPipe); + createHangoverCureForBravek.addStep(hangoverCure, goDownHole); + createHangoverCureForBravek.addStep(bucketOfChocolateMilk, useSnapeGrassOnChocolateMilk); + + steps.put(26, createHangoverCureForBravek); + + var continueTalkingToBravek = new ConditionalStep(this, goDownHole); + continueTalkingToBravek.addStep(and(inDownstairsOfPlagueHouse, key), talkToElena); + continueTalkingToBravek.addStep(and(inPlagueHouse, key), goDownstairsInPlagueHouse); + continueTalkingToBravek.addStep(inPlagueHouse, searchBarrel); + continueTalkingToBravek.addStep(inDownstairsOfPlagueHouse, goUpstairsInPlagueHouse); + continueTalkingToBravek.addStep(and(warrant, inWestArdougne), tryToEnterPlagueHouseAgain); + continueTalkingToBravek.addStep(inWestArdougne, talkToBravekAgain); + continueTalkingToBravek.addStep(inUnderground, climbThroughPipe); + + steps.put(27, continueTalkingToBravek); + + var finishQuest = new ConditionalStep(this, talkToEdmondToFinish); + finishQuest.addStep(inDownstairsOfPlagueHouse, goUpstairsInPlagueHouseToFinish); + finishQuest.addStep(and(inWestArdougne, manholeClosed), goDownManhole2); + finishQuest.addStep(inWestArdougne, goDownManhole); + finishQuest.addStep(inUnderground, climbMudPileToFinish); + + steps.put(28, finishQuest); + + // 29: quest finished + // 30: has read ardougne scroll, so can use ardougne teleport / teleport tablet + + return steps; + } + + @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(dwellberries); - reqs.add(spade); - reqs.add(rope); - reqs.add(bucketOfMilk); - reqs.add(chocolateDust); - reqs.add(snapeGrass); - return reqs; + return List.of( + dwellberries, + spade, + rope, + bucketOfMilk, + chocolateDust, + snapeGrass + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(fourBucketsOfWater); - return reqs; + return List.of( + fourBucketsOfWater + ); } @Override @@ -370,27 +440,73 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.MINING, 2426)); + return List.of( + new ExperienceReward(Skill.MINING, 2425) + ); } @Override public List getUnlockRewards() { - return Collections.singletonList(new UnlockReward("Ability to use Ardougne teleport spell and tablets")); + return List.of( + new UnlockReward("Ability to use Ardougne teleport spell and tablets") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Start the quest", Collections.singletonList(talkToEdmond), dwellberries, spade, rope, bucketOfMilk, chocolateDust, snapeGrass)); - allSteps.add(new PanelDetails("Infiltrate West Ardougne", Arrays.asList(talkToAlrena, talkToEdmondAgain, useWaterOnMudPatch1, - grabPictureOfElena, digHole, goDownHole, attemptToPullGrill, useRopeOnGrill, talkToEdmondUnderground, climbThroughPipe))); - allSteps.add(new PanelDetails("Discover Elena's location", Arrays.asList(talkToJethick, enterMarthasHouse, talkToMartha, - goUpstairsInMarthasHouse))); - allSteps.add(new PanelDetails("Freeing Elena", Arrays.asList(tryToEnterPlagueHouse, talkToClerk, talkToBravek, useDustOnMilk, useSnapeGrassOnChocolateMilk, - giveHangoverCureToBravek, tryToEnterPlagueHouseAgain, searchBarrel, goDownstairsInPlagueHouse, talkToElena))); - allSteps.add(new PanelDetails("Finishing off", Collections.singletonList(talkToEdmondToFinish))); - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Start the quest", List.of( + talkToEdmond + ), List.of( + dwellberries, + spade, + rope, + bucketOfMilk, + chocolateDust, + snapeGrass + ))); + + sections.add(new PanelDetails("Infiltrate West Ardougne", List.of( + talkToAlrena, + grabPictureOfElena, + talkToEdmondAgain, + useWaterOnMudPatch1, + digHole, + goDownHole, + attemptToPullGrill, + useRopeOnGrill, + talkToEdmondUnderground, + climbThroughPipe + ))); + + sections.add(new PanelDetails("Discover Elena's location", List.of( + talkToJethick, + enterMarthasHouse, + talkToMartha, + goUpstairsInMarthasHouse + ))); + + sections.add(new PanelDetails("Freeing Elena", List.of( + tryToEnterPlagueHouse, + talkToClerk, + talkToBravek, + useDustOnMilk, + useSnapeGrassOnChocolateMilk, + giveHangoverCureToBravek, + talkToBravekAgain, + tryToEnterPlagueHouseAgain, + searchBarrel, + goDownstairsInPlagueHouse, + talkToElena + ))); + + sections.add(new PanelDetails("Finishing off", List.of( + talkToEdmondToFinish + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/priestinperil/PriestInPeril.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/priestinperil/PriestInPeril.java index 01ecfa75c55..9bbc2830699 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/priestinperil/PriestInPeril.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/priestinperil/PriestInPeril.java @@ -271,7 +271,6 @@ public void setupSteps() fillBucket.addIcon(ItemID.BUCKET_EMPTY); useKeyForKey = new DetailedQuestStep(this, "Go to the central room, and study the monuments to find which has a key on it. Use the Golden Key on it.", goldenKeyHighlighted); - useKeyForKey.addIcon(ItemID.PIPKEY_GOLD); goDownToFloorOneTemple = new ObjectStep(this, ObjectID.LADDERTOP, new WorldPoint(3410, 3485, 2), "Go down to the underground of the temple.", bucket); goDownToGroundFloorTemple = new ObjectStep(this, ObjectID.SPIRALSTAIRSTOP, new WorldPoint(3417, 3485, 0), "Go down to the underground of the temple.", bucket); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/princealirescue/PrinceAliRescue.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/princealirescue/PrinceAliRescue.java index d88a15041ba..df394cbc6c9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/princealirescue/PrinceAliRescue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/princealirescue/PrinceAliRescue.java @@ -80,11 +80,11 @@ public Map loadSteps() steps.put(10, talkToOsman); makeDyedWig = new ConditionalStep(this, talkToNed); - makeDyedWig.addStep(wig.alsoCheckBank(questBank), dyeWig); - makeDyedWig.setLockingCondition(dyedWig.alsoCheckBank(questBank)); + makeDyedWig.addStep(wig.alsoCheckBank(), dyeWig); + makeDyedWig.setLockingCondition(dyedWig.alsoCheckBank()); makePaste = new ConditionalStep(this, talkToAggie); - makePaste.setLockingCondition(paste.alsoCheckBank(questBank)); + makePaste.setLockingCondition(paste.alsoCheckBank()); makeKeyMould = new ConditionalStep(this, talkToKeli); makeKeyMould.setLockingCondition(hasOrGivenKeyMould); @@ -93,17 +93,17 @@ public Map loadSteps() getKey.setLockingCondition(givenKeyMould); ConditionalStep prepareToSaveAli = new ConditionalStep(this, makeDyedWig); - prepareToSaveAli.addStep(new Conditions(dyedWig.alsoCheckBank(questBank), paste.alsoCheckBank(questBank), + prepareToSaveAli.addStep(new Conditions(dyedWig.alsoCheckBank(), paste.alsoCheckBank(), new Conditions(LogicType.OR, madeMould, givenKeyMould)), talkToLeela); - prepareToSaveAli.addStep(new Conditions(dyedWig.alsoCheckBank(questBank), paste.alsoCheckBank(questBank), hasOrGivenKeyMould), getKey); - prepareToSaveAli.addStep(new Conditions(dyedWig.alsoCheckBank(questBank), paste.alsoCheckBank(questBank)), makeKeyMould); - prepareToSaveAli.addStep(dyedWig.alsoCheckBank(questBank), makePaste); + prepareToSaveAli.addStep(new Conditions(dyedWig.alsoCheckBank(), paste.alsoCheckBank(), hasOrGivenKeyMould), getKey); + prepareToSaveAli.addStep(new Conditions(dyedWig.alsoCheckBank(), paste.alsoCheckBank()), makeKeyMould); + prepareToSaveAli.addStep(dyedWig.alsoCheckBank(), makePaste); steps.put(20, prepareToSaveAli); ConditionalStep getJoeDrunk = new ConditionalStep(this, makeDyedWig); getJoeDrunk.addStep(hasWigPasteAndKey, talkToJoe); - getJoeDrunk.addStep(dyedWig.alsoCheckBank(questBank), makePaste); + getJoeDrunk.addStep(dyedWig.alsoCheckBank(), makePaste); steps.put(30, getJoeDrunk); steps.put(31, getJoeDrunk); @@ -112,13 +112,13 @@ public Map loadSteps() ConditionalStep tieUpKeli = new ConditionalStep(this, makeDyedWig); tieUpKeli.addStep(hasWigPasteAndKey, useRopeOnKeli); - tieUpKeli.addStep(dyedWig.alsoCheckBank(questBank), makePaste); + tieUpKeli.addStep(dyedWig.alsoCheckBank(), makePaste); steps.put(40, tieUpKeli); ConditionalStep freeAli = new ConditionalStep(this, makeDyedWig); freeAli.addStep(new Conditions(hasWigPasteAndKey, inCell), talkToAli); freeAli.addStep(hasWigPasteAndKey, useKeyOnDoor); - freeAli.addStep(dyedWig.alsoCheckBank(questBank), makePaste); + freeAli.addStep(dyedWig.alsoCheckBank(), makePaste); steps.put(50, freeAli); steps.put(100, returnToHassan); @@ -163,18 +163,18 @@ protected void setupRequirements() public void setupConditions() { inCell = new ZoneRequirement(cell); - hasWigPasteAndKey = new Conditions(dyedWig.alsoCheckBank(questBank), paste.alsoCheckBank(questBank), key.alsoCheckBank(questBank)); + hasWigPasteAndKey = new Conditions(dyedWig.alsoCheckBank(), paste.alsoCheckBank(), key.alsoCheckBank()); givenKeyMould = new Conditions(true, LogicType.OR, // TODO quest journal widget text outdated new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "I have duplicated a key, I need to get it from"), new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "I got a duplicated cell door key"), new WidgetTextRequirement(11, 2, true, "You give Osman the imprint along with a bronze bar."), new DialogRequirement("I'll use this to have a copy of the key made. I'll send it to Leela once it's ready."), new DialogRequirement("I think I have everything needed."), - key.alsoCheckBank(questBank)); + key.alsoCheckBank()); madeMould = new RuneliteRequirement(getConfigManager(), "princealikeymouldhandedin", "true", givenKeyMould); madeMould.initWithValue("false"); - hasOrGivenKeyMould = new Conditions(LogicType.OR, keyMould, givenKeyMould, key.alsoCheckBank(questBank)); + hasOrGivenKeyMould = new Conditions(LogicType.OR, keyMould, givenKeyMould, key.alsoCheckBank()); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/pryingtimes/PryingTimes.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/pryingtimes/PryingTimes.java new file mode 100644 index 00000000000..c625f54b27a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/pryingtimes/PryingTimes.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2025, TTvanWillegen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.quests.pryingtimes; + +import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; +import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.TeleportItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreePortTaskSlotsRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.ShipInPortRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Port; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; +import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.api.QuestState; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; + +import java.util.*; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + +public class PryingTimes extends BasicQuestHelper +{ + ItemRequirement hammerRequirement, steelBarRequirement, redberryPieRequirement, captainsLogRequirement, gotTheKey, gotStout, crowbar; + SkillRequirement sailingSkillRequirement, smithingSkillRequirement; + QuestRequirement pandemoniumQuestRequirement, knightsSwordQuestRequirement; + FreePortTaskSlotsRequirement freeTaskSlotRequirement; + ShipInPortRequirement shipAtPortSarimDock; + TeleportItemRequirement thurgoTeleportRecommend; + NpcRequirement spawnedTroll; + VarbitRequirement drankStout; + Requirement haveDeliveryTask; + + Zone portSarimDockZone; + + NpcStep startQuest, getDeliveryTask, letSteveKnow, getKey, giveKey, killTheTroll, goToSteve; + PortTaskStep deliverCargo; + ObjectStep testKey, openCrate; + SailStep sailToCrate; + ItemStep drinkTheStout; + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupConditions(); + setupSteps(); + Map steps = new HashMap<>(); + steps.put(0, startQuest); + ConditionalStep cDeliverCargo = new ConditionalStep(this, getDeliveryTask); + cDeliverCargo.addStep(haveDeliveryTask, deliverCargo); + steps.put(5, cDeliverCargo); + steps.put(10, letSteveKnow); + steps.put(15, getKey); + ConditionalStep goGetAndGiveKey = new ConditionalStep(this, getKey); + goGetAndGiveKey.addStep(gotTheKey.alsoCheckBank(), giveKey); + steps.put(20, goGetAndGiveKey); + ConditionalStep cTestKey = new ConditionalStep(this, sailToCrate); + cTestKey.addStep(and(sailToCrate.getZoneRequirement(), not(gotStout), not(drankStout)), testKey); + cTestKey.addStep(gotStout, drinkTheStout); + cTestKey.addStep(drankStout, goToSteve); + steps.put(25, cTestKey); + steps.put(30, openCrate); + + return steps; + } + + public void setupConditions() + { + + } + + @Override + protected void setupZones() + { + portSarimDockZone = new Zone(new WorldPoint(3045, 3183, 0), new WorldPoint(3061, 3208, 0)); + } + + @Override + protected void setupRequirements() + { + //Quest Requirements + hammerRequirement = new ItemRequirement("Hammer", ItemCollections.HAMMER).isNotConsumed(); + hammerRequirement.setTooltip("You can pick this up at the shipyard."); + steelBarRequirement = new ItemRequirement("Steel bar", ItemID.STEEL_BAR, 1); + redberryPieRequirement = new ItemRequirement("Redberry pie", ItemID.REDBERRY_PIE, 1); + captainsLogRequirement = new ItemRequirement("Captain's log", ItemID.SAILING_LOG, 1); + sailingSkillRequirement = new SkillRequirement(Skill.SAILING, 12); + smithingSkillRequirement = new SkillRequirement(Skill.SMITHING, 30); + pandemoniumQuestRequirement = new QuestRequirement(QuestHelperQuest.PANDEMONIUM, QuestState.FINISHED); + knightsSwordQuestRequirement = new QuestRequirement(QuestHelperQuest.THE_KNIGHTS_SWORD, QuestState.FINISHED); + freeTaskSlotRequirement = new FreePortTaskSlotsRequirement(1); + + var PORT_TASK_ID = 600; + haveDeliveryTask = or( + new VarbitRequirement(VarbitID.PORT_TASK_SLOT_0_ID, PORT_TASK_ID), + new VarbitRequirement(VarbitID.PORT_TASK_SLOT_1_ID, PORT_TASK_ID), + new VarbitRequirement(VarbitID.PORT_TASK_SLOT_2_ID, PORT_TASK_ID), + new VarbitRequirement(VarbitID.PORT_TASK_SLOT_3_ID, PORT_TASK_ID), + new VarbitRequirement(VarbitID.PORT_TASK_SLOT_4_ID, PORT_TASK_ID) + ); + + shipAtPortSarimDock = new ShipInPortRequirement(Port.PORT_SARIM); + gotTheKey = new ItemRequirement("Crowbar", ItemID.SAILING_CHARTING_CROWBAR); + gotTheKey.setTooltip("You can get another from Thurgo. You'll need another redberry pie, steel bar, and hammer"); + + crowbar = new ItemRequirement("Crowbar", ItemID.SAILING_CHARTING_CROWBAR); + crowbar.setTooltip("You can get another from the cargo hold of your boat"); + gotStout = new ItemRequirement("Bottle of fish bladder stout", ItemID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES); + spawnedTroll = new NpcRequirement(NpcID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES_EFFECT_TROLL); + drankStout = new VarbitRequirement(VarbitID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES_COMPLETE, 1); + + //Recommended + thurgoTeleportRecommend = new TeleportItemRequirement("Fairy Ring [AIQ]", ItemCollections.FAIRY_STAFF); + } + + public void setupSteps() + { + startQuest = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Talk to 'Squawking' Steve Beanie behind the Pandemonium bar to start the quest. You can travel there via Captain Tobias on Port Sarim docks for 30gp.", true, captainsLogRequirement); + startQuest.addDialogStep("Any word from Old Grog?"); + startQuest.addDialogStep("Yes."); + + getDeliveryTask = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Talk to 'Squawking' Steve Beanie behind the Pandemonium bar to start the quest.", true, captainsLogRequirement); + getDeliveryTask.addDialogStep("About that job you wanted doing..."); + startQuest.addSubSteps(getDeliveryTask); + + deliverCargo = new PortTaskStep(this, Port.PORT_SARIM, Port.PANDEMONIUM, 600); + letSteveKnow = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Let 'Squawking' Steve Beanie behind the bar know you delivered the looty.", true); + letSteveKnow.addDialogStep("I delivered that cargo for you."); + + getKey = new NpcStep(this, NpcID.THURGO, new WorldPoint(3000, 3145, 0), "Get the key from Thurgo in the shed near Mudskipper's Point.", true,hammerRequirement, steelBarRequirement,redberryPieRequirement); + getKey.addDialogSteps("I need some help with a 'special key'.", "So, can you help me make a crowbar?", "Can you help me make another crowbar?"); + getKey.addDialogStep("Yes."); + getKey.setRecommended(Arrays.asList(thurgoTeleportRecommend)); + giveKey = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Give the 'key' to 'Squawking' Steve Beanie behind the Pandemonium bar. You can travel there via Captain Tobias on Port Sarim docks for 30gp.", true, gotTheKey); + giveKey.addDialogStep("I made that 'special key' you needed."); + testKey = new ObjectStep(this, ObjectID.SAILING_CHARTING_DRINK_CRATE, new WorldPoint(3013, 2998, 0), "Open the Sealed crate with the newly acquired 'key'.", crowbar); + sailToCrate = new SailStep(this, new WorldPoint(3013, 2998, 0), "Sail to the crate north-west of Pandemonium.", crowbar); + drinkTheStout = new ItemStep(this, "Drink the stout. Warning: you will be attacked by a level 14 Drink Troll.", gotStout.highlighted()); + killTheTroll = new NpcStep(this, NpcID.SAILING_CHARTING_DRINK_CRATE_PRYING_TIMES_EFFECT_TROLL, new WorldPoint(3013, 2998, 0), "Kill the Drink Troll, or log out."); + goToSteve = new NpcStep(this, NpcID.STEVE_BEANIE, new WorldPoint(3050, 2966, 0), "Tell 'Squawking' Steve Beanie behind the Pandemonium bar the key works.", true, crowbar); + goToSteve.addDialogStep("About that crate..."); + openCrate = new ObjectStep(this, ObjectID.PRY_CRATE_SEALED, new WorldPoint(3048, 2965, 0), "Open Steve's crate in the corner behind the bar.", crowbar); + } + + @Override + public QuestPointReward getQuestPointReward() + { + return new QuestPointReward(1); + } + + @Override + public List getItemRequirements() + { + return Arrays.asList(hammerRequirement, steelBarRequirement, redberryPieRequirement, captainsLogRequirement); + } + + @Override + public List getGeneralRequirements() + { + return Arrays.asList(sailingSkillRequirement, smithingSkillRequirement, pandemoniumQuestRequirement, knightsSwordQuestRequirement, freeTaskSlotRequirement); + } + + @Override + public List getCombatRequirements() + { + return Arrays.asList("Drink Troll (level 14) (can be ignored)"); + } + + @Override + public List getExperienceRewards() + { + return Arrays.asList(new ExperienceReward(Skill.SAILING, 800), new ExperienceReward(Skill.SMITHING, 1000)); + } + + @Override + public List getItemRewards() + { + return Arrays.asList( + new ItemReward("Sawmill Coupon (oak plank)", ItemID.SAWMILL_COUPON, 25) + ); + } + + @Override + public List getUnlockRewards() + { + return Arrays.asList( + new UnlockReward("Unlimited Crowbars from the crate of crowbars"), + new UnlockReward("Ability to chart forgotten drinks")); + } + + @Override + public List getPanels() + { + List allSteps = new ArrayList<>(); + allSteps.add(new PanelDetails("Looty!", Arrays.asList(startQuest, deliverCargo, letSteveKnow), captainsLogRequirement, freeTaskSlotRequirement)); + allSteps.add(new PanelDetails("A key!", Arrays.asList(getKey, giveKey, sailToCrate, testKey, drinkTheStout, killTheTroll, goToSteve, openCrate), hammerRequirement, steelBarRequirement, redberryPieRequirement)); + return allSteps; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManI.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManI.java index 15dd93ec900..a5a7abd6c3c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManI.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManI.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.ragandboneman; +import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankSlotIcons; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.managers.QuestContainerManager; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; @@ -39,9 +40,7 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; -import net.runelite.client.plugins.microbot.questhelper.tools.QuestTile; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; @@ -58,18 +57,18 @@ public class RagAndBoneManI extends BasicQuestHelper { //Items Required - ItemRequirement coins, pots, logs, tinderbox, lightSource, rope; + ItemRequirement coins, pots, logs, tinderbox; //Items Recommended - ItemRequirement spinyHelmet, varrockTeleport, lumbridgeTeleport, digsitePendant, - draynorTeleport, karamjaTeleport, dramenStaff; + ItemRequirement varrockTeleport, lumbridgeTeleport, digsitePendant, + draynorTeleport, karamjaTeleport, dramenStaff, combatGear; ItemRequirement jugOfVinegar, jugOfVinegarNeeded, potOfVinegar, potOfVinegarNeeded, potNeeded; DetailedQuestStep talkToOddOldMan, killGiantRat, killUnicorn, killBear, killRam, killGoblin, killFrog, killMonkey , killBat, pickupBone; - DetailedQuestStep addRope, enterSwamp, leaveJunaRoom, enterKaramjaDungeon; + DetailedQuestStep enterKaramjaDungeon; DetailedQuestStep talkToFortunato, makePotOfVinegar, useBonesOnVinegar; @@ -102,7 +101,7 @@ public Map loadSteps() collectBonesSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state.")); collectBonesSteps.addStep(boneNearby, pickupBone); - stepsForRagAndBoneManI.forEach((RagBoneState state, QuestStep step) -> collectBonesSteps.addStep(nor(state.hadBoneItem(questBank)), step)); + stepsForRagAndBoneManI.forEach((RagBoneState state, QuestStep step) -> collectBonesSteps.addStep(nor(state.hadBoneItem()), step)); collectBonesSteps.setLockingCondition(hadAllBones); preparingBonesSteps = new ConditionalStep(this, talkToFortunato); @@ -135,14 +134,11 @@ protected void setupRequirements() // Required items coins = new ItemRequirement("Coins", ItemCollections.COINS); pots = new ItemRequirement("Pot", ItemID.POT_EMPTY).isNotConsumed(); - potNeeded = new ItemRequirement("Pot", ItemID.POT_EMPTY, 8).alsoCheckBank(questBank).highlighted(); + potNeeded = new ItemRequirement("Pot", ItemID.POT_EMPTY, 8).alsoCheckBank().highlighted(); logs = new ItemRequirement("Logs", ItemID.LOGS); tinderbox = new ItemRequirement("Tinderbox", ItemID.TINDERBOX).isNotConsumed(); - lightSource = new ItemRequirement("Light source", ItemCollections.LIGHT_SOURCES).isNotConsumed(); // Optional items - rope = new ItemRequirement("Rope", ItemID.ROPE); - spinyHelmet = new ItemRequirement("Spiny helmet", ItemID.WALLBEAST_SPIKE_HELMET); varrockTeleport = new ItemRequirement("Varrock teleport", ItemID.POH_TABLET_VARROCKTELEPORT); lumbridgeTeleport = new ItemRequirement("Lumbridge teleport", ItemID.POH_TABLET_LUMBRIDGETELEPORT); digsitePendant = new ItemRequirement("Digsite pendant", ItemCollections.DIGSITE_PENDANTS); @@ -151,14 +147,16 @@ protected void setupRequirements() karamjaTeleport = new ItemRequirement("Karamja teleport", ItemCollections.AMULET_OF_GLORIES); karamjaTeleport.addAlternates(ItemID.NZONE_TELETAB_BRIMHAVEN, ItemID.TELEPORTSCROLL_TAIBWO); dramenStaff = new ItemRequirement("Dramen staff for fairy rings", ItemID.DRAMEN_STAFF).isNotConsumed(); + combatGear = new ItemRequirement("Combat gear", -1, -1).isNotConsumed(); + combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); // Quest items jugOfVinegar = new ItemRequirement("Jar of vinegar", ItemID.RAG_VINEGAR); potOfVinegar = new ItemRequirement("Pot of vinegar", ItemID.RAG_POT_VINEGAR); potOfVinegarNeeded = - new ItemRequirement("Pot of vinegar", ItemID.RAG_POT_VINEGAR, 8).alsoCheckBank(questBank).highlighted(); + new ItemRequirement("Pot of vinegar", ItemID.RAG_POT_VINEGAR, 8).alsoCheckBank().highlighted(); jugOfVinegarNeeded = - new ItemRequirement("Jug of vinegar", ItemID.RAG_VINEGAR, 8).alsoCheckBank(questBank).highlighted(); + new ItemRequirement("Jug of vinegar", ItemID.RAG_VINEGAR, 8).alsoCheckBank().highlighted(); } @Subscribe @@ -167,7 +165,7 @@ public void onGameTick(GameTick event) AtomicInteger winesNeededQuantity = new AtomicInteger(8); stepsForRagAndBoneManI.forEach((RagBoneState state, QuestStep step) -> { - if (state.hadBoneInVinegarItem(questBank).check(client)) + if (state.hadBoneInVinegarItem().check(client)) { winesNeededQuantity.getAndDecrement(); } @@ -199,27 +197,27 @@ private void setupConditions() // 2044 = 1, talked a bit to Odd Old Man - addedRope = new VarbitRequirement(279, 1); + addedRope = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); boneNearby = new Conditions(LogicType.OR, RagBoneGroups.getBonesOnFloor(RagBoneGroups.getBones(RagBoneGroups.getRagBoneIStates()))); logAdded = new VarbitRequirement(VarbitID.RAG_BOILER, 1, Operation.GREATER_EQUAL); boneAddedToBoiler = new VarbitRequirement(VarbitID.RAG_BOILER, 2, Operation.GREATER_EQUAL); logLit = new VarbitRequirement(VarbitID.RAG_BOILER, 3, Operation.GREATER_EQUAL); - boneReady = new VarbitRequirement(2046, 4); + boneReady = new VarbitRequirement(VarbitID.RAG_BOILER, 4); // Every time handing in a bone, 2045 iterates from 0->28 1 by 1. Next time you hand in a bone it goes back // to 0 and repeats??? - allBonesPolished = new Conditions(RagBoneGroups.allBonesPolished(RagBoneGroups.getRagBoneIStates(), questBank)); + allBonesPolished = new Conditions(RagBoneGroups.allBonesPolished(RagBoneGroups.getRagBoneIStates())); - allBonesAtLeastAddedToVinegar = new Conditions(RagBoneGroups.allBonesAddedToVinegar(RagBoneGroups.getRagBoneIStates(), questBank)); + allBonesAtLeastAddedToVinegar = new Conditions(RagBoneGroups.allBonesAddedToVinegar(RagBoneGroups.getRagBoneIStates())); - hadAllBones = new Conditions(RagBoneGroups.allBonesObtained(RagBoneGroups.getRagBoneIStates(), questBank)); + hadAllBones = new Conditions(RagBoneGroups.allBonesObtained(RagBoneGroups.getRagBoneIStates())); - talkedToFortunato = new VarbitRequirement(2047, 1); + talkedToFortunato = new VarbitRequirement(VarbitID.RAG_WINE, 1); - hadVinegar = new Conditions(jugOfVinegar.alsoCheckBank(questBank)); + hadVinegar = new Conditions(jugOfVinegar.alsoCheckBank()); } public void setupSteps() @@ -250,24 +248,8 @@ public void setupSteps() NpcID.GOBLIN_UNARMED_MELEE_IN_6, NpcID.GOBLIN_UNARMED_MELEE_IN_7, NpcID.GOBLIN_UNARMED_MELEE_IN_8, NpcID.GOBLIN_ARMED, NpcID.GOBLIN_HELMET, NpcID.GOBLIN_RED_SOLDIER_1, NpcID.GOBLIN_GREEN_SOLDIER_1); - addRope = new ObjectStep(this, ObjectID.GOBLIN_CAVE_ENTRANCE, new WorldPoint(3169, 3172, 0), - "Enter the hole to the Lumbridge Swamp caves.", rope.highlighted(), lightSource, tinderbox); - addRope.addIcon(ItemID.ROPE); - leaveJunaRoom = new ObjectStep(this, ObjectID.TOG_CAVE_UP, new WorldPoint(3219, 9534, 2), - "Enter the Lumbridge Swamp caves."); - enterSwamp = new ObjectStep(this, ObjectID.GOBLIN_CAVE_ENTRANCE, new WorldPoint(3169, 3172, 0), - "Enter the hole to the Lumbridge Swamp caves.", lightSource, tinderbox); - enterSwamp.addSubSteps(addRope, leaveJunaRoom); - killFrog = new NpcStep(this, NpcID.MEDIUM_FROG, new WorldPoint(3153, 9558, 0), - "Kill a big frog in the south west of the caves. Make sure to RUN between the two marked run tiles to " + - "avoid the Wall Beast.", true); - killFrog.addTileMarker(new QuestTile(new WorldPoint(3161, 9574, 0), SpriteID.OPTIONS_RUNNING)); - killFrog.addTileMarker(new QuestTile(new WorldPoint(3163, 9574, 0), SpriteID.OPTIONS_RUNNING)); - - ConditionalStep killFrogSteps = new ConditionalStep(this, addRope); - killFrogSteps.addStep(inSwamp, killFrog); - killFrogSteps.addStep(inJunaRoom, leaveJunaRoom); - killFrogSteps.addStep(addedRope, enterSwamp); + killFrog = new NpcStep(this, NpcID.MEDIUM_FROG_NODROPS, new WorldPoint(3216, 3182, 0), + "Kill a big frog in the Lumbridge Swamp.", true); killMonkey = new NpcStep(this, NpcID.MONKEY, new WorldPoint(2886, 3167, 0), "Kill a monkey on Karamja.", true); @@ -287,7 +269,7 @@ public void setupSteps() stepsForRagAndBoneManI.put(RagBoneState.RAM_SKULL, killRam); stepsForRagAndBoneManI.put(RagBoneState.GOBLIN_SKULL, killGoblin); - stepsForRagAndBoneManI.put(RagBoneState.BIG_FROG_LEG, killFrogSteps); + stepsForRagAndBoneManI.put(RagBoneState.BIG_FROG_LEG, killFrog); stepsForRagAndBoneManI.put(RagBoneState.MONKEY_PAW, killMonkey); stepsForRagAndBoneManI.put(RagBoneState.GIANT_BAT_WING, killBatSteps); @@ -302,7 +284,7 @@ public void setupSteps() jugOfVinegarNeeded, potNeeded); useBonesOnVinegar = new DetailedQuestStep(this, "Use the bones on the pots of vinegar.", potOfVinegar.highlighted()); - useBonesOnVinegar.addItemRequirements(RagBoneGroups.bonesToAddToVinegar(RagBoneGroups.getRagBoneIStates(), questBank)); + useBonesOnVinegar.addItemRequirements(RagBoneGroups.bonesToAddToVinegar(RagBoneGroups.getRagBoneIStates())); placeLogs = new ObjectStep(this, ObjectID.RAG_MULTI_POTBOILER, new WorldPoint(3360, 3505, 0), "Place logs under the pot-boiler near the Odd Old Man. If you've already polished all the bones, hand " + @@ -312,7 +294,7 @@ public void setupSteps() useBoneOnBoiler = new ObjectStep(this, ObjectID.RAG_MULTI_POTBOILER, new WorldPoint(3360, 3505, 0), "Add a bone to the pot boiler."); useBoneOnBoiler.addIcon(ItemID.RAG_POT_GOBLIN_BONE); - useBoneOnBoiler.addItemRequirements(RagBoneGroups.bonesToAddToBoiler(RagBoneGroups.getRagBoneIStates(), questBank)); + useBoneOnBoiler.addItemRequirements(RagBoneGroups.bonesToAddToBoiler(RagBoneGroups.getRagBoneIStates())); lightLogs = new ObjectStep(this, ObjectID.RAG_MULTI_POTBOILER, new WorldPoint(3360, 3505, 0), "Light the logs under the pot-boiler.", tinderbox.highlighted()); @@ -343,14 +325,13 @@ public List getCombatRequirements() @Override public List getItemRequirements() { - return Arrays.asList(coins.quantity(8), pots.quantity(8), logs.quantity(8), tinderbox, - lightSource, rope.hideConditioned(addedRope)); + return Arrays.asList(coins.quantity(8), pots.quantity(8), logs.quantity(8), tinderbox); } @Override public List getItemRecommended() { - return Arrays.asList(varrockTeleport, lumbridgeTeleport, digsitePendant, + return Arrays.asList(combatGear, varrockTeleport, lumbridgeTeleport, digsitePendant, draynorTeleport, karamjaTeleport); } @@ -382,8 +363,7 @@ public List getPanels() allSteps.add(new PanelDetails("Starting out", Collections.singletonList(talkToOddOldMan))); PanelDetails collectingPanel = new PanelDetails("Collecting bones", Arrays.asList(killGiantRat, killUnicorn, killBear, killRam, - killGoblin, enterSwamp, killFrog, killMonkey, killBat, pickupBone), tinderbox, lightSource, - rope.hideConditioned(addedRope)); + killGoblin, killFrog, killMonkey, killBat, pickupBone), List.of(), List.of(combatGear)); collectingPanel.setLockingStep(collectBonesSteps); allSteps.add(collectingPanel); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManII.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManII.java index d7dd9b2c1e3..544bf9cd527 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManII.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagAndBoneManII.java @@ -53,13 +53,9 @@ import net.runelite.client.plugins.microbot.questhelper.tools.QuestTile; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.*; import net.runelite.client.eventbus.Subscribe; import java.util.*; @@ -211,7 +207,7 @@ protected void setupRequirements() // Required items coins = new ItemRequirement("Coins", ItemCollections.COINS); pots = new ItemRequirement("Pot", ItemID.POT_EMPTY).isNotConsumed(); - potNeeded = new ItemRequirement("Pot", ItemID.POT_EMPTY, 8).alsoCheckBank(questBank).highlighted().isNotConsumed(); + potNeeded = new ItemRequirement("Pot", ItemID.POT_EMPTY, 8).alsoCheckBank().highlighted().isNotConsumed(); logs = new ItemRequirement("Logs", ItemID.LOGS); tinderbox = new ItemRequirement("Tinderbox", ItemID.TINDERBOX).isNotConsumed(); lightSource = new ItemRequirement("Light source", ItemCollections.LIGHT_SOURCES).isNotConsumed(); @@ -261,9 +257,9 @@ protected void setupRequirements() jugOfVinegar = new ItemRequirement("Jar of vinegar", ItemID.RAG_VINEGAR); potOfVinegar = new ItemRequirement("Pot of vinegar", ItemID.RAG_POT_VINEGAR); potOfVinegarNeeded = - new ItemRequirement("Pot of vinegar", ItemID.RAG_POT_VINEGAR, 8).alsoCheckBank(questBank).highlighted(); + new ItemRequirement("Pot of vinegar", ItemID.RAG_POT_VINEGAR, 8).alsoCheckBank().highlighted(); jugOfVinegarNeeded = - new ItemRequirement("Jug of vinegar", ItemID.RAG_VINEGAR, 8).alsoCheckBank(questBank).highlighted(); + new ItemRequirement("Jug of vinegar", ItemID.RAG_VINEGAR, 8).alsoCheckBank().highlighted(); coinsOrVinegar = new ItemRequirement("Pots/Jugs of vinegar, or coins to buy", ItemID.RAG_POT_VINEGAR); coinsOrVinegar.addAlternates(ItemID.RAG_VINEGAR, ItemID.COINS); @@ -284,7 +280,7 @@ public void onGameTick(GameTick event) AtomicInteger winesNeededQuantity = new AtomicInteger(27); stepsForRagAndBoneManII.forEach((RagBoneState state, QuestStep step) -> { - if (state.hadBoneInVinegarItem(questBank).check(client)) + if (state.hadBoneInVinegarItem().check(client)) { winesNeededQuantity.getAndDecrement(); } @@ -342,7 +338,7 @@ private void setupConditions() onWaterbirth = new ZoneRequirement(waterbirth); inWaterbirthDungeon = new ZoneRequirement(waterbirthDungeon); - addedRope = new VarbitRequirement(279, 1); + addedRope = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); boneNearby = new Conditions(LogicType.OR, RagBoneGroups.getBonesOnFloor(RagBoneGroups.getBones(RagBoneGroups.getRagBoneIIStates()))); @@ -350,21 +346,21 @@ private void setupConditions() logAdded = new VarbitRequirement(VarbitID.RAG_BOILER, 1, Operation.GREATER_EQUAL); boneAddedToBoiler = new VarbitRequirement(VarbitID.RAG_BOILER, 2, Operation.GREATER_EQUAL); logLit = new VarbitRequirement(VarbitID.RAG_BOILER, 3, Operation.GREATER_EQUAL); - boneReady = new VarbitRequirement(2046, 4); + boneReady = new VarbitRequirement(VarbitID.RAG_BOILER, 4); jailKeyOnFloor = new ItemOnTileRequirement(jailKey); mogreNearby = new NpcInteractingRequirement(NpcID.MUDSKIPPER_OGRE); - allBonesPolished = new Conditions(RagBoneGroups.allBonesPolished(RagBoneGroups.getRagBoneIIStates(), - questBank)); + allBonesPolished = new Conditions(RagBoneGroups.allBonesPolished(RagBoneGroups.getRagBoneIIStates() + )); allBonesAtLeastAddedToVinegar = - new Conditions(RagBoneGroups.allBonesAddedToVinegar(RagBoneGroups.getRagBoneIIStates(), questBank)); + new Conditions(RagBoneGroups.allBonesAddedToVinegar(RagBoneGroups.getRagBoneIIStates())); - hadAllBones = new Conditions(RagBoneGroups.allBonesObtained(RagBoneGroups.getRagBoneIIStates(), questBank)); + hadAllBones = new Conditions(RagBoneGroups.allBonesObtained(RagBoneGroups.getRagBoneIIStates())); - hadVinegar = new Conditions(jugOfVinegar.alsoCheckBank(questBank)); + hadVinegar = new Conditions(jugOfVinegar.alsoCheckBank()); // TODO: Setup check for marking bones 'done' if not on list // Widget 220, 7-15, check Text @@ -422,17 +418,17 @@ public void setupSteps() "Beasts.", true); ((NpcStep) killCaveGoblin).addAlternateNpcs(NpcID.CAVE_GOBLIN2, NpcID.CAVE_GOBLIN3, NpcID.CAVE_GOBLIN4); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3161, 9573, 0), SpriteID.OPTIONS_RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3163, 9573, 0), SpriteID.OPTIONS_RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3161, 9573, 0), SpriteID.OptionsIcons.RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3163, 9573, 0), SpriteID.OptionsIcons.RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3163, 9555, 0), SpriteID.OPTIONS_RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3165, 9555, 0), SpriteID.OPTIONS_RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3163, 9555, 0), SpriteID.OptionsIcons.RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3165, 9555, 0), SpriteID.OptionsIcons.RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3197, 9553, 0), SpriteID.OPTIONS_RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3199, 9553, 0), SpriteID.OPTIONS_RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3197, 9553, 0), SpriteID.OptionsIcons.RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3199, 9553, 0), SpriteID.OptionsIcons.RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3214, 9559, 0), SpriteID.OPTIONS_RUNNING)); - killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3216, 9559, 0), SpriteID.OPTIONS_RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3214, 9559, 0), SpriteID.OptionsIcons.RUNNING)); + killCaveGoblin.addTileMarker(new QuestTile(new WorldPoint(3216, 9559, 0), SpriteID.OptionsIcons.RUNNING)); killJackal = new NpcStep(this, NpcID.ICS_LITTLE_JACKAL, new WorldPoint(3400, 2997, 0), "Kill Jackals north of Nardah.", true); @@ -546,7 +542,7 @@ public void setupSteps() jugOfVinegarNeeded, potNeeded); useBonesOnVinegar = new DetailedQuestStep(this, "Use the bones on the pots of vinegar.", potOfVinegar.highlighted()); - useBonesOnVinegar.addItemRequirements(RagBoneGroups.bonesToAddToVinegar(RagBoneGroups.getRagBoneIIStates(), questBank)); + useBonesOnVinegar.addItemRequirements(RagBoneGroups.bonesToAddToVinegar(RagBoneGroups.getRagBoneIIStates())); placeLogs = new ObjectStep(this, ObjectID.RAG_MULTI_POTBOILER, new WorldPoint(3360, 3505, 0), "Place logs under the pot-boiler near the Odd Old Man. If you've already polished all the bones, hand " + @@ -694,7 +690,7 @@ public void setupConditionalSteps() // Take all reqs and compile as locking step for mory morySteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Morytania")); mapForMory.forEach((RagBoneState state, QuestStep step) -> { - moryReqsList.add(state.hadBoneItem(questBank)); + moryReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -702,14 +698,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - morySteps.addStep(nor(state.hadBoneItem(questBank)), step); + morySteps.addStep(nor(state.hadBoneItem()), step); }); moryReqs = new Conditions(moryReqsList); morySteps.setLockingCondition(moryReqs); varrockSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Varrock")); mapForVarrock.forEach((RagBoneState state, QuestStep step) -> { - varrockReqsList.add(state.hadBoneItem(questBank)); + varrockReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -717,14 +713,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - varrockSteps.addStep(nor(state.hadBoneItem(questBank)), step); + varrockSteps.addStep(nor(state.hadBoneItem()), step); }); varrockReqs = new Conditions(varrockReqsList); varrockSteps.setLockingCondition(varrockReqs); lumbridgeSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Lumbridge")); mapForLumbridge.forEach((RagBoneState state, QuestStep step) -> { - lumbridgeReqsList.add(state.hadBoneItem(questBank)); + lumbridgeReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -732,14 +728,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - lumbridgeSteps.addStep(nor(state.hadBoneItem(questBank)), step); + lumbridgeSteps.addStep(nor(state.hadBoneItem()), step); }); lumbridgeReqs = new Conditions(lumbridgeReqsList); lumbridgeSteps.setLockingCondition(lumbridgeReqs); desertSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Desert")); mapForDesert.forEach((RagBoneState state, QuestStep step) -> { - desertReqsList.add(state.hadBoneItem(questBank)); + desertReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -747,14 +743,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - desertSteps.addStep(nor(state.hadBoneItem(questBank)), step); + desertSteps.addStep(nor(state.hadBoneItem()), step); }); desertReqs = new Conditions(desertReqsList); desertSteps.setLockingCondition(desertReqs); sarimSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Port Sarim")); mapForSarim.forEach((RagBoneState state, QuestStep step) -> { - sarimReqsList.add(state.hadBoneItem(questBank)); + sarimReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -762,14 +758,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - sarimSteps.addStep(nor(state.hadBoneItem(questBank)), step); + sarimSteps.addStep(nor(state.hadBoneItem()), step); }); sarimReqs = new Conditions(sarimReqsList); sarimSteps.setLockingCondition(sarimReqs); karamjaSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Karamja")); mapForKaramja.forEach((RagBoneState state, QuestStep step) -> { - karamjaReqsList.add(state.hadBoneItem(questBank)); + karamjaReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -777,14 +773,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - karamjaSteps.addStep(nor(state.hadBoneItem(questBank)), step); + karamjaSteps.addStep(nor(state.hadBoneItem()), step); }); karamjaReqs = new Conditions(karamjaReqsList); karamjaSteps.setLockingCondition(karamjaReqs); taverleySteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Taverley")); mapForTaverley.forEach((RagBoneState state, QuestStep step) -> { - taverleyReqsList.add(state.hadBoneItem(questBank)); + taverleyReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -792,14 +788,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - taverleySteps.addStep(nor(state.hadBoneItem(questBank)), step); + taverleySteps.addStep(nor(state.hadBoneItem()), step); }); taverleyReqs = new Conditions(taverleyReqsList); taverleySteps.setLockingCondition(taverleyReqs); fremennikSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Fremennik")); mapForFremennik.forEach((RagBoneState state, QuestStep step) -> { - fremennikReqsList.add(state.hadBoneItem(questBank)); + fremennikReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -807,14 +803,14 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - fremennikSteps.addStep(nor(state.hadBoneItem(questBank)), step); + fremennikSteps.addStep(nor(state.hadBoneItem()), step); }); fremennikReqs = new Conditions(fremennikReqsList); fremennikSteps.setLockingCondition(fremennikReqs); strongholdSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Gnome")); mapForStronghold.forEach((RagBoneState state, QuestStep step) -> { - strongholdReqsList.add(state.hadBoneItem(questBank)); + strongholdReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); if (step instanceof ConditionalStep) @@ -822,18 +818,18 @@ public void setupConditionalSteps() ((ConditionalStep) step).getSteps().forEach((QuestStep substep) -> substep.addSubSteps(pickupBoneStep)); } pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - strongholdSteps.addStep(nor(state.hadBoneItem(questBank)), step); + strongholdSteps.addStep(nor(state.hadBoneItem()), step); }); strongholdReqs = new Conditions(strongholdReqsList); strongholdSteps.setLockingCondition(strongholdReqs); feldipSteps = new ConditionalStep(this, new DetailedQuestStep(this, "Unknown state Feldip")); mapForFeldip.forEach((RagBoneState state, QuestStep step) -> { - feldipReqsList.add(state.hadBoneItem(questBank)); + feldipReqsList.add(state.hadBoneItem()); ItemStep pickupBoneStep = new ItemStep(this, "Pickup the bone.", state.getBoneItem()); step.addSubSteps(pickupBoneStep); pickupBoneSteps.addStep(new ItemOnTileRequirement(state.getBoneItem()), pickupBoneStep); - feldipSteps.addStep(nor(state.hadBoneItem(questBank)), step); + feldipSteps.addStep(nor(state.hadBoneItem()), step); }); feldipReqs = new Conditions(feldipReqsList); feldipSteps.setLockingCondition(feldipReqs); @@ -856,7 +852,7 @@ public List getGeneralRequirements() requirements.add(new QuestRequirement(QuestHelperQuest.SKIPPY_AND_THE_MOGRES, QuestState.FINISHED)); Conditions canAccessExperimentCave = new Conditions(LogicType.OR, - new VarbitRequirement(192, 1), + new VarbitRequirement(VarbitID.FENK_COFFIN, 1), new VarplayerRequirement(QuestVarPlayer.QUEST_CREATURE_OF_FENKENSTRAIN.getId(), 2, Operation.GREATER_EQUAL) ); canAccessExperimentCave.setText("Partial completion of Creature of Fenkenstrain"); @@ -943,7 +939,7 @@ public List getPanels() PanelDetails collectingKaramjaPanel = new PanelDetails("Karamja bones", Arrays.asList(killJogre, enterBrimhavenDungeon, killMossGiant, killFireGiant), - coins.quantity(875).hideConditioned(new VarbitRequirement(8122, 1)), axe); + coins.quantity(875).hideConditioned(new VarbitRequirement(VarbitID.KARAM_DUNGEON_PERMANENTACCESS, 1)), axe); collectingKaramjaPanel.setLockingStep(karamjaSteps); allSteps.add(collectingKaramjaPanel); // 8123 0->8 also when paid 1m for perm access diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneGroups.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneGroups.java index 3e2234ce8d6..d1c5580a617 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneGroups.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneGroups.java @@ -24,7 +24,6 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.ragandboneman; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; @@ -78,32 +77,32 @@ public static List getBonesOnFloor(List bones) return bonesOnFloor; } - public static List allBonesObtained(List states, QuestBank questBank) + public static List allBonesObtained(List states) { List boneReq = new ArrayList<>(); for (RagBoneState ragBoneIState : states) { - boneReq.add(ragBoneIState.hadBoneItem(questBank)); + boneReq.add(ragBoneIState.hadBoneItem()); } return boneReq; } - public static List allBonesAddedToVinegar(List states, QuestBank questBank) + public static List allBonesAddedToVinegar(List states) { List boneReq = new ArrayList<>(); for (RagBoneState ragBoneIState : states) { - boneReq.add(ragBoneIState.hadBoneInVinegarItem(questBank)); + boneReq.add(ragBoneIState.hadBoneInVinegarItem()); } return boneReq; } - public static List allBonesPolished(List states, QuestBank questBank) + public static List allBonesPolished(List states) { List boneReq = new ArrayList<>(); for (RagBoneState ragBoneIState : states) { - boneReq.add(ragBoneIState.boneProcessed(questBank)); + boneReq.add(ragBoneIState.boneProcessed()); } return boneReq; } @@ -120,24 +119,24 @@ public static List pickupBones(List states) return boneReq; } - public static List bonesToAddToVinegar(List states, QuestBank questBank) + public static List bonesToAddToVinegar(List states) { List boneReq = new ArrayList<>(); for (RagBoneState ragBoneIState : states) { - boneReq.add(ragBoneIState.getBoneItem().hideConditioned(ragBoneIState.hadBoneInVinegarItem(questBank)).highlighted()); + boneReq.add(ragBoneIState.getBoneItem().hideConditioned(ragBoneIState.hadBoneInVinegarItem()).highlighted()); } return boneReq; } - public static List bonesToAddToBoiler(List states, QuestBank questBank) + public static List bonesToAddToBoiler(List states) { List boneReq = new ArrayList<>(); for (RagBoneState ragBoneIState : states) { boneReq.add(ragBoneIState.getBoneInVinegarItem().hideConditioned( new Conditions(LogicType.OR, - ragBoneIState.boneProcessed(questBank) + ragBoneIState.boneProcessed() ) ).highlighted()); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneState.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneState.java index cb90f1bb231..74acb0106bf 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneState.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ragandboneman/RagBoneState.java @@ -24,7 +24,6 @@ */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.ragandboneman; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; @@ -35,6 +34,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.VarbitID; import net.runelite.client.util.Text; @@ -87,7 +87,7 @@ public enum RagBoneState VULTURE_WING("Vulture", 34), JACKAL_BONE("Jackal", 35); - private final int START_BONE_ID = 7809; + private final int START_BONE_ID = ItemID.SOULBANE_ANGER_SPEARQ; private final int boneID; @@ -116,46 +116,46 @@ public enum RagBoneState boneCleanedItem = new ItemRequirement(Text.titleCase(this), boneID + 2); VarbitRequirement boneAddedToBoiler = new VarbitRequirement(VarbitID.RAG_BOILER, 2, Operation.GREATER_EQUAL); - boneIsBeingCleaned = new Conditions(boneAddedToBoiler, new VarbitRequirement(2043, pos)); + boneIsBeingCleaned = new Conditions(boneAddedToBoiler, new VarbitRequirement(VarbitID.RAG_POTBOILER, pos)); // Mark always true once obtained as no way to identify if a bone has been handed in easily WidgetTextRequirement hadFromWidgetsCheck = new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "" + nameInList); hadFromWidgets = new Conditions(true, hadFromWidgetsCheck); } - public Requirement hadBoneItem(QuestBank questBank) + public Requirement hadBoneItem() { if (hadBoneItem == null) { hadBoneItem = new Conditions(LogicType.OR, - hadBoneInVinegarItem(questBank), - boneItem.alsoCheckBank(questBank) + hadBoneInVinegarItem(), + boneItem.alsoCheckBank() ); } return hadBoneItem; } - public Requirement hadBoneInVinegarItem(QuestBank questBank) + public Requirement hadBoneInVinegarItem() { if (hadBoneInVinegar == null) { hadBoneInVinegar = new Conditions(LogicType.OR, - boneProcessed(questBank), + boneProcessed(), boneIsBeingCleaned, - boneInVinegarItem.alsoCheckBank(questBank) + boneInVinegarItem.alsoCheckBank() ); } return hadBoneInVinegar; } - public Requirement boneProcessed(QuestBank questBank) + public Requirement boneProcessed() { if (hadBoneProcessed == null) { hadBoneProcessed = new Conditions(LogicType.OR, - boneCleanedItem.alsoCheckBank(questBank), + boneCleanedItem.alsoCheckBank(), handedInBone() ); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCatchers.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCatchers.java index f4a03decae6..40a971a3ed7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCatchers.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCatchers.java @@ -48,11 +48,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; import java.util.*; @@ -287,18 +284,18 @@ public void setupConditions() // 1423 = 1, // 1424 = 1 - caughtRat1 = new VarbitRequirement(1424, 1); + caughtRat1 = new VarbitRequirement(VarbitID.VC_RATON_OFF1, 1); caughtRat2And3 = new Conditions( - new VarbitRequirement(1425, 1), - new VarbitRequirement(1426, 1) + new VarbitRequirement(VarbitID.VC_RATON_OFF2, 1), + new VarbitRequirement(VarbitID.VC_RATON_OFF3, 1) ); - poisonedHole1 = new VarbitRequirement(1406, 1); - poisonedHole2 = new VarbitRequirement(1407, 1); - poisonedHole3 = new VarbitRequirement(1408, 1); - poisonedHole4 = new VarbitRequirement(1409, 1); + poisonedHole1 = new VarbitRequirement(VarbitID.RATCATCH_RATHOLE_1, 1); + poisonedHole2 = new VarbitRequirement(VarbitID.RATCATCH_RATHOLE_2, 1); + poisonedHole3 = new VarbitRequirement(VarbitID.RATCATCH_RATHOLE_3, 1); + poisonedHole4 = new VarbitRequirement(VarbitID.RATCATCH_RATHOLE_4, 1); - catSeenFailure = new VarbitRequirement(1410, 1); + catSeenFailure = new VarbitRequirement(VarbitID.RATCATCH_CATKNOWSDRILL, 1); // 1422, cat's told you how to get kelda rats inPlayWidget = new WidgetTextRequirement(282, 20, "PLAY"); @@ -355,12 +352,12 @@ public void setupSteps() climbTrellis.addSubSteps(climbTrellisNoPath); catchRat1 = new NpcStep(this, NpcID.VC_PARTY_RAT, new WorldPoint(2835, 5098, 1), "Catch the rat in the north west room with your cat.", catFollower); - catchRat1.addTileMarker(new WorldPoint(2841, 5104, 1), SpriteID.EQUIPMENT_SLOT_SHIELD); + catchRat1.addTileMarker(new WorldPoint(2841, 5104, 1), SpriteID.Wornicons.SHIELD); catchRat1.setMaxRoamRange(7); catchRat2And3 = new NpcStep(this, NpcID.VC_PARTY_RAT, new WorldPoint(2859, 5091, 1), "Hide in the north east room until it's safe to go to the south east room, then catch the rats there.", true); - catchRat2And3.addTileMarker(new WorldPoint(2857, 5098, 1), SpriteID.EQUIPMENT_SLOT_SHIELD); + catchRat2And3.addTileMarker(new WorldPoint(2857, 5098, 1), SpriteID.Wornicons.SHIELD); climbDownLadderInMansion = new ObjectStep(this, ObjectID.LADDERTOP, new WorldPoint(2862, 5092, 1), "Climb down the ladder."); catchRemainingRats = new NpcStep(this, NpcID.VC_PARTY_RAT, new WorldPoint(2860, 5093, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCharming.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCharming.java index 33537285bcb..173162ba463 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCharming.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/ratcatchers/RatCharming.java @@ -33,6 +33,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.WidgetStep; import net.runelite.api.events.GameTick; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.ArrayList; @@ -55,7 +56,7 @@ public RatCharming(QuestHelper questHelper) @Override protected void updateSteps() { - int currentPage = client.getVarbitValue(1420); + int currentPage = client.getVarbitValue(VarbitID.VC_NOTE_NUMBER); for (int i = 0; i < noteSteps.length; i++) { @@ -75,7 +76,7 @@ protected void updateSteps() // If need to raise octave if (i == 4) { - int octaveRaised = client.getVarbitValue(1413); + int octaveRaised = client.getVarbitValue(VarbitID.VC_NOTE_CURRENT_HI); if (octaveRaised == 0) { startUpStep(clickOctave); @@ -101,66 +102,66 @@ public void setupRequirements() noteRequirements = new Requirement[8]; noteRequirements[0] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 63), - new VarbitRequirement(1420, 0) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 63), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 0) ), - new VarbitRequirement(1395, 63) + new VarbitRequirement(VarbitID.VC_NOTE1, 63) ); noteRequirements[1] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 56), - new VarbitRequirement(1420, 1) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 56), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 1) ), - new VarbitRequirement(1396, 56) + new VarbitRequirement(VarbitID.VC_NOTE2, 56) ); noteRequirements[2] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 62), - new VarbitRequirement(1420, 2) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 62), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 2) ), - new VarbitRequirement(1397, 62) + new VarbitRequirement(VarbitID.VC_NOTE3, 62) ); noteRequirements[3] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 60), - new VarbitRequirement(1420, 3) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 60), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 3) ), - new VarbitRequirement(1398, 60) + new VarbitRequirement(VarbitID.VC_NOTE4, 60) ); noteRequirements[4] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 127), - new VarbitRequirement(1420, 4) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 127), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 4) ), - new VarbitRequirement(1399, 127) + new VarbitRequirement(VarbitID.VC_NOTE5, 127) ); noteRequirements[5] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 32), - new VarbitRequirement(1420, 5) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 32), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 5) ), - new VarbitRequirement(1400, 32) + new VarbitRequirement(VarbitID.VC_NOTE6, 32) ); noteRequirements[6] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 1), - new VarbitRequirement(1420, 6) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 1), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 6) ), - new VarbitRequirement(1401, 1) + new VarbitRequirement(VarbitID.VC_NOTE7, 1) ); noteRequirements[7] = new Conditions(LogicType.OR, new Conditions( - new VarbitRequirement(1411, 48), - new VarbitRequirement(1420, 7) + new VarbitRequirement(VarbitID.VC_NOTE_CURRENT, 48), + new VarbitRequirement(VarbitID.VC_NOTE_NUMBER, 7) ), - new VarbitRequirement(1402, 48) + new VarbitRequirement(VarbitID.VC_NOTE8, 48) ); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/AskAboutFishCake.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/AskAboutFishCake.java index bea179ecee5..a7bf77aecce 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/AskAboutFishCake.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/AskAboutFishCake.java @@ -30,13 +30,14 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; public class AskAboutFishCake extends NpcStep { public AskAboutFishCake(QuestHelper questHelper) { - super(questHelper, NpcID.POH_SERVANT_COOK_WOMAN, new WorldPoint(3209, 3215, 0), + super(questHelper, NpcID.COOK, new WorldPoint(3209, 3215, 0), "Talk to the Lumbridge Cook and ask him all the options about Pirate Pete."); } @@ -48,10 +49,10 @@ public void onGameTick(GameTick event) private void updateCorrectChoice() { - boolean askedAboutKelp = client.getVarbitValue(1873) == 1; // And 1874 = 1 - boolean askedAboutCrab = client.getVarbitValue(1874) == 1; - boolean askedAboutBread = client.getVarbitValue(1876) == 1; - boolean askedAboutCod = client.getVarbitValue(1877) == 1; + boolean askedAboutKelp = client.getVarbitValue(VarbitID.HUNDRED_PIRATE_MEAT_INTRO) == 1; // And 1874 = 1 + boolean askedAboutCrab = client.getVarbitValue(VarbitID.HUNDRED_PIRATE_KELP_INTRO) == 1; + boolean askedAboutBread = client.getVarbitValue(VarbitID.HUNDRED_PIRATE_CRUMB_INTRO) == 1; + boolean askedAboutCod = client.getVarbitValue(VarbitID.HUNDRED_PIRATE_COD_INTRO) == 1; choices = new DialogChoiceSteps(); addDialogStep("Protecting the Pirate"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/GetRohakDrunk.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/GetRohakDrunk.java index 1b01b812d8c..9debdda7619 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/GetRohakDrunk.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/GetRohakDrunk.java @@ -30,6 +30,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Collections; @@ -54,7 +55,7 @@ public void onGameTick(GameTick event) protected void updateSteps() { - int numAle = 4 - client.getVarbitValue(1893); + int numAle = 4 - client.getVarbitValue(VarbitID.HUNDRED_DWARF_DRUNK); asgoldianAle.setQuantity(numAle); if (numAle == 0) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/MakeEvilStew.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/MakeEvilStew.java index 0b81c5e9c61..a601bf0c2d5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/MakeEvilStew.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/MakeEvilStew.java @@ -33,7 +33,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; -import net.runelite.api.Varbits; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; @@ -73,21 +72,6 @@ public void onGameTick(GameTick event) @Override protected void updateSteps() { - int redNeeded = client.getVarbitValue(1883); - int yellowNeeded = client.getVarbitValue(1884); - int brownNeeded = client.getVarbitValue(1885); - int orangeNeeded = client.getVarbitValue(1886); - - int redInStew = client.getVarbitValue(Varbits.SPICY_STEW_RED_SPICES); - int yellowInStew = client.getVarbitValue(Varbits.SPICY_STEW_YELLOW_SPICES); - int brownInStew = client.getVarbitValue(Varbits.SPICY_STEW_BROWN_SPICES); - int orangeInStew = client.getVarbitValue(Varbits.SPICY_STEW_ORANGE_SPICES); - - int numRedStillNeeded = redNeeded - redInStew; - int numOrangeStillNeeded = orangeNeeded - orangeInStew; - int numBrownStillNeeded = brownNeeded - brownInStew; - int numYellowStillNeeded = yellowNeeded - yellowInStew; - if (!inEvilDaveRoom.check(client)) { startUpStep(enterBasement); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/QuizSteps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/QuizSteps.java index 6abd9ca34c2..fa1cb5cf206 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/QuizSteps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/QuizSteps.java @@ -36,6 +36,7 @@ import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -70,9 +71,9 @@ public void onGameTick(GameTick event) @Override protected void updateSteps() { - boolean eggEnchanted = client.getVarbitValue(1894) == 1; - boolean flourEnchanted = client.getVarbitValue(1897) == 1; - boolean milkEnchanted = client.getVarbitValue(1898) == 1; + boolean eggEnchanted = client.getVarbitValue(VarbitID._100GUIDE_EGGDONE) == 1; + boolean flourEnchanted = client.getVarbitValue(VarbitID._100GUIDE_FLOURDONE) == 1; + boolean milkEnchanted = client.getVarbitValue(VarbitID._100GUIDE_MILKDONE) == 1; ArrayList items = new ArrayList<>(); if (!eggEnchanted) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDDwarf.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDDwarf.java index cfb954d1389..6200b6aba18 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDDwarf.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDDwarf.java @@ -100,7 +100,7 @@ public Map loadSteps() ConditionalStep giveCakeToDwarf = new ConditionalStep(this, pickUpRockCake); giveCakeToDwarf.addStep(new Conditions(rockCake, inDiningRoom), useRockCakeOnDwarf); - giveCakeToDwarf.addStep(rockCake.alsoCheckBank(questBank), enterDiningRoomAgain); + giveCakeToDwarf.addStep(rockCake.alsoCheckBank(), enterDiningRoomAgain); giveCakeToDwarf.addStep(rockCakeHot, coolRockCake); steps.put(50, giveCakeToDwarf); @@ -162,8 +162,8 @@ public void setupConditions() inDiningRoom = new ZoneRequirement(diningRoom); inTunnel = new ZoneRequirement(tunnel); - learnedHowToMakeAle = new VarbitRequirement(1891, 1); - givenAle = new VarbitRequirement(1893, 1); + learnedHowToMakeAle = new VarbitRequirement(VarbitID.HUNDRED_DWARF_BEER, 1); + givenAle = new VarbitRequirement(VarbitID.HUNDRED_DWARF_DRUNK, 1); has4AleOrGivenAle = new Conditions(LogicType.OR, asgoldianAle4, givenAle); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDFinal.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDFinal.java index 3acd0cddb69..654f5d93f3c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDFinal.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDFinal.java @@ -33,6 +33,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestPointRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; @@ -51,6 +52,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -58,7 +60,7 @@ public class RFDFinal extends BasicQuestHelper { ItemRequirement iceGloves, restorePotions, combatGear; - Requirement inFightArena, killedAgrith, killedFlambeed, killedKaramel, killedDessourt, killedMother; + Requirement inFightArena, killedAgrith, killedFlambeed, killedKaramel, killedDessourt, killedMother, inventorySlot1; QuestStep enterPortal, killAgrith, enterPortalFlambeed, killFlambeed, enterPortalKaramel, killKaramel, enterPortalDessourt, killDessourt, enterPortalMother, killMother, enterPortalCulinaromancer, killCulinaromancer; @@ -106,17 +108,18 @@ protected void setupRequirements() combatGear = new ItemRequirement("Combat gear, food and potions", -1, -1).isNotConsumed(); combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); + inventorySlot1 = new FreeInventorySlotRequirement(1); } @Override protected void setupZones() { fightArena = new Zone(new WorldPoint(1889, 5345, 2), new WorldPoint(1910, 5366, 2)); - killedAgrith = new VarbitRequirement(1855, 1); - killedFlambeed = new VarbitRequirement(1855, 2); - killedKaramel = new VarbitRequirement(1855, 3); - killedDessourt = new VarbitRequirement(1855, 4); - killedMother = new VarbitRequirement(1855, 5); + killedAgrith = new VarbitRequirement(VarbitID.HUNDRED_MINIONSKILLED_TALLY, 1); + killedFlambeed = new VarbitRequirement(VarbitID.HUNDRED_MINIONSKILLED_TALLY, 2); + killedKaramel = new VarbitRequirement(VarbitID.HUNDRED_MINIONSKILLED_TALLY, 3); + killedDessourt = new VarbitRequirement(VarbitID.HUNDRED_MINIONSKILLED_TALLY, 4); + killedMother = new VarbitRequirement(VarbitID.HUNDRED_MINIONSKILLED_TALLY, 5); } public void setupConditions() @@ -126,11 +129,15 @@ public void setupConditions() public void setupSteps() { - enterPortal = new ObjectStep(this, ObjectID.HUNDRED_PORTAL_MULTI, new WorldPoint(3209, 3218, 0), "Enter the portal in Lumbridge Castle, ready to fight. You can leave between fights to re-gear.", combatGear); + enterPortal = new ObjectStep(this, ObjectID.HUNDRED_PORTAL_MULTI, new WorldPoint(3209, 3218, 0), "Enter the portal in Lumbridge Castle, ready to fight. " + + "You can leave between fights to re-gear. Have your ice gloves pre-equipped for the second fight against Flambeed to avoid them making you drop your weapon on the floor.", iceGloves.equipped(), combatGear, inventorySlot1); killAgrith = new NpcStep(this, NpcID.HUNDRED_MINION1, new WorldPoint(1900, 5355, 2),"Kill Agrith-Na-Na. He uses magic at ranged, and melee up close."); - enterPortalFlambeed = new ObjectStep(this, ObjectID.HUNDRED_PORTAL_MULTI, new WorldPoint(3209, 3218, 0), "Enter the portal in Lumbridge Castle, ready to fight kill Flambeed. Water spells are especially effective.", combatGear, iceGloves); - killFlambeed = new NpcStep(this, NpcID.HUNDRED_MINION2, new WorldPoint(1900, 5355, 2),"Equip ice gloves and kill Flambeed. Water spells are especially effective.", iceGloves); + enterPortalFlambeed = new ObjectStep(this, ObjectID.HUNDRED_PORTAL_MULTI, new WorldPoint(3209, 3218, 0), "Enter the portal in Lumbridge Castle, ready to fight kill Flambeed." + + " Water spells are especially effective. If you have a full inventory and no ice gloves on Flambeed can make you drop your weapon, so it's recommended you keep a free inventory slot.", combatGear, iceGloves.equipped(), + inventorySlot1); + killFlambeed = new NpcStep(this, NpcID.HUNDRED_MINION2, new WorldPoint(1900, 5355, 2),"Equip ice gloves and kill Flambeed. Water spells are especially effective. " + + "FLAMBEED WILL MAKE YOU DROP YOUR WEAPON ON THE FLOOR if you do not have ice gloves on and have a full inventory.", iceGloves.equipped(), inventorySlot1); killFlambeed.addSubSteps(enterPortalFlambeed); enterPortalKaramel = new ObjectStep(this, ObjectID.HUNDRED_PORTAL_MULTI, new WorldPoint(3209, 3218, 0), "Enter the portal to fight Karamel. Stand in melee distance, and bring restore potions to as they drain your stats. Fire spells are especially effective.", combatGear, restorePotions); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDLumbridgeGuide.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDLumbridgeGuide.java index c0094048e3e..5980f64421c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDLumbridgeGuide.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDLumbridgeGuide.java @@ -49,6 +49,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -88,7 +89,7 @@ public Map loadSteps() ConditionalStep saveGuide = new ConditionalStep(this, mixIngredients); saveGuide.addStep(new Conditions(guidanceCake, inDiningRoom), useCakeOnLumbridgeGuide); - saveGuide.addStep(guidanceCake.alsoCheckBank(questBank), enterDiningRoomAgain); + saveGuide.addStep(guidanceCake.alsoCheckBank(), enterDiningRoomAgain); saveGuide.addStep(rawGuidanceCake, cookCake); steps.put(3, saveGuide); steps.put(4, saveGuide); @@ -241,6 +242,6 @@ public QuestState getState(Client client) @Override public boolean isCompleted() { - return (client.getVarbitValue(1896) >= 5 || client.getVarbitValue(QuestVarbits.QUEST_RECIPE_FOR_DISASTER.getId()) < 3); + return (client.getVarbitValue(VarbitID._100GUIDE_PROG) >= 5 || client.getVarbitValue(QuestVarbits.QUEST_RECIPE_FOR_DISASTER.getId()) < 3); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDPiratePete.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDPiratePete.java index 20e2b7db03f..af346440f17 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDPiratePete.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDPiratePete.java @@ -53,6 +53,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -119,8 +120,8 @@ public Map loadSteps() ConditionalStep goLearnHowToMakeFishCake = new ConditionalStep(this, goDivingAgain); goLearnHowToMakeFishCake.addStep(new Conditions(fishCake, inDiningRoom), useCakeOnPete); - goLearnHowToMakeFishCake.addStep(new Conditions(fishCake.alsoCheckBank(questBank)), enterDiningRoomAgain); - goLearnHowToMakeFishCake.addStep(new Conditions(rawFishCake.alsoCheckBank(questBank)), cookCake); + goLearnHowToMakeFishCake.addStep(new Conditions(fishCake.alsoCheckBank()), enterDiningRoomAgain); + goLearnHowToMakeFishCake.addStep(new Conditions(rawFishCake.alsoCheckBank()), cookCake); goLearnHowToMakeFishCake.addStep(new Conditions(hasKelp, hasCrabMeat, inUnderWater), climbAnchor); goLearnHowToMakeFishCake.addStep(new Conditions(hasKelp, inUnderWater, hasEnoughRocks), killCrab); goLearnHowToMakeFishCake.addStep(new Conditions(hasKelp, inUnderWater), pickUpRocksAgain); @@ -135,7 +136,7 @@ public Map loadSteps() ConditionalStep savePete = new ConditionalStep(this, useCrabOnKelp); savePete.addStep(new Conditions(fishCake, inDiningRoom), useCakeOnPete); - savePete.addStep(new Conditions(fishCake.alsoCheckBank(questBank)), enterDiningRoomAgain); + savePete.addStep(new Conditions(fishCake.alsoCheckBank()), enterDiningRoomAgain); savePete.addStep(new Conditions(rawFishCake), cookCake); steps.put(100, savePete); @@ -199,16 +200,16 @@ protected void setupZones() public void setupConditions() { inDiningRoom = new ZoneRequirement(diningRoom); - walkingUnderwater = new VarbitRequirement(1871, 1); + walkingUnderwater = new VarbitRequirement(VarbitID.HUNDRED_PIRATE_UNDERWATER_ONFLOOR, 1); askedCookOptions = new Conditions( - new VarbitRequirement(1873, 1), - new VarbitRequirement(1876, 1), - new VarbitRequirement(1877, 1)); + new VarbitRequirement(VarbitID.HUNDRED_PIRATE_MEAT_INTRO, 1), + new VarbitRequirement(VarbitID.HUNDRED_PIRATE_CRUMB_INTRO, 1), + new VarbitRequirement(VarbitID.HUNDRED_PIRATE_COD_INTRO, 1)); inUnderWater = new ZoneRequirement(underwater); - hasEnoughRocks = new VarbitRequirement(1869, 5); + hasEnoughRocks = new VarbitRequirement(VarbitID.HUNDRED_PIRATE_ROCKS, 5); hasCrabMeat = new Conditions(LogicType.OR, crabMeat, groundCrabMeatHighlighted); hasKelp = new Conditions(LogicType.OR, kelp, groundKelpHighlighted); @@ -257,7 +258,7 @@ public void setupSteps() grindKelp = new DetailedQuestStep(this, "Use a pestle and mortar on the kelp.", pestleHighlighted, kelpHighlighted); grindCrab = new DetailedQuestStep(this, "Use a pestle and mortar on the crab.", pestleHighlighted, crabMeatHighlighted); climbAnchor = new ObjectStep(this, ObjectID.ANCHOR_MIDDLE, new WorldPoint(2963, 9477, 1), "Climb the anchor to the south to return to the surface."); - talkToCookAgain = new NpcStep(this, NpcID.POH_SERVANT_COOK_WOMAN, new WorldPoint(3209, 3215, 0), + talkToCookAgain = new NpcStep(this, NpcID.COOK, new WorldPoint(3209, 3215, 0), "Talk to the Lumbridge Cook about Pirate Pete again.", groundCod, groundCrabMeatHighlighted, groundKelpHighlighted, breadcrumbs); talkToCookAgain.addDialogStep("Protecting the Pirate"); useCrabOnKelp = new DetailedQuestStep(this, "Use the ingredients together to make the cake.", groundCrabMeatHighlighted, groundKelpHighlighted, groundCod, breadcrumbs); @@ -365,6 +366,6 @@ public QuestState getState(Client client) @Override public boolean isCompleted() { - return (client.getVarbitValue(1895) >= 110 || client.getVarbitValue(QuestVarbits.QUEST_RECIPE_FOR_DISASTER.getId()) < 3); + return (client.getVarbitValue(VarbitID._100_PIRATE_QUEST_VAR) >= 110 || client.getVarbitValue(QuestVarbits.QUEST_RECIPE_FOR_DISASTER.getId()) < 3); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSirAmikVarze.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSirAmikVarze.java index 4517f316dc6..cf8a06758f9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSirAmikVarze.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSirAmikVarze.java @@ -97,7 +97,7 @@ public Map loadSteps() tokenAndEggSteps = new ConditionalStep(this, enterZanaris); tokenAndEggSteps.addStep(tokenNearby, pickUpToken); - tokenAndEggSteps.addStep(new Conditions(evilEgg.alsoCheckBank(questBank), inEvilChickenLair), killBlackDragon); + tokenAndEggSteps.addStep(new Conditions(evilEgg.alsoCheckBank(), inEvilChickenLair), killBlackDragon); tokenAndEggSteps.addStep(eggNearby, pickUpEgg); tokenAndEggSteps.addStep(inEvilChickenLair, killEvilChicken); tokenAndEggSteps.addStep(inZanaris, useChickenOnShrine); @@ -114,7 +114,7 @@ public Map loadSteps() ConditionalStep saveAmik = new ConditionalStep(this, talkToWom); saveAmik.addStep(new Conditions(inDiningRoom, finishedBrulee), useBruleeOnVarze); - saveAmik.addStep(finishedBrulee.alsoCheckBank(questBank), enterDiningRoomAgain); + saveAmik.addStep(finishedBrulee.alsoCheckBank(), enterDiningRoomAgain); saveAmik.addStep(hasEggAndToken, makeBrulee); saveAmik.addStep(talkedToWom, tokenAndEggSteps); steps.put(10, saveAmik); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSkrachUglogwee.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSkrachUglogwee.java index ef40c329692..edfcb62abc9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSkrachUglogwee.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDSkrachUglogwee.java @@ -105,7 +105,7 @@ public Map loadSteps() steps.put(100, talkToRantzAfterReturn); ConditionalStep getJubbly = new ConditionalStep(this, fillUpBellows); - getJubbly.addStep(rawJubbly.alsoCheckBank(questBank), cookJubbly); + getJubbly.addStep(rawJubbly.alsoCheckBank(), cookJubbly); getJubbly.addStep(rawJubblyOnFloor, pickUpRawJubbly); getJubbly.addStep(jubblyCarcassNearby, lootJubbly); getJubbly.addStep(jubblyNearby, killJubbly); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDStart.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDStart.java index a7001ba3e06..ab28abb6290 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDStart.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recipefordisaster/RFDStart.java @@ -63,7 +63,7 @@ public Map loadSteps() steps.put(0, talkToCook); ConditionalStep goGiveCookItems = new ConditionalStep(this, useAshesOnFruitBlast); - goGiveCookItems.addStep(dirtyBlast.alsoCheckBank(questBank), talkToCookAgain); + goGiveCookItems.addStep(dirtyBlast.alsoCheckBank(), talkToCookAgain); steps.put(1, goGiveCookItems); steps.put(2, enterDiningRoom); @@ -97,7 +97,7 @@ public void setupConditions() public void setupSteps() { - talkToCook = new NpcStep(this, NpcID.POH_SERVANT_COOK_WOMAN, new WorldPoint(3209, 3215, 0), + talkToCook = new NpcStep(this, NpcID.COOK, new WorldPoint(3209, 3215, 0), "Talk to the Lumbridge Cook.", eyeOfNewt, greenmansAle, rottenTomato, ashes, fruitBlast); talkToCook.addDialogStep("Do you have any other quests for me?"); talkToCook.addDialogSteps("Angry! It makes me angry!", "I don't really care to be honest."); @@ -106,7 +106,7 @@ public void setupSteps() useAshesOnFruitBlast = new DetailedQuestStep(this, "Use ashes on the fruit blast.", ashesHighlighted, fruitBlastHighlighted); - talkToCookAgain = new NpcStep(this, NpcID.POH_SERVANT_COOK_WOMAN, new WorldPoint(3209, 3215, 0), + talkToCookAgain = new NpcStep(this, NpcID.COOK, new WorldPoint(3209, 3215, 0), "Talk to the Lumbridge Cook with the required items.", eyeOfNewt, greenmansAle, rottenTomato, dirtyBlast); talkToCookAgain.addDialogStep("About those ingredients you wanted for the banquet..."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/LadyTableStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/LadyTableStep.java index 5ee1918b82c..8f3713f1f6b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/LadyTableStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/LadyTableStep.java @@ -36,6 +36,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.Collection; @@ -47,12 +48,10 @@ public class LadyTableStep extends DetailedOwnerStep protected Client client; private Statue[] statues; - private final int VARBIT_FINISHED_ROOM = 660; - private final int VARBIT_STATUE_ANSWER = 667; private ObjectStep clickMissingStatue, leaveRoom; - VarbitRequirement finishedRoom = new VarbitRequirement(VARBIT_FINISHED_ROOM, 1); + VarbitRequirement finishedRoom = new VarbitRequirement(VarbitID.RD_ROOM2_COMPLETE, 1); public LadyTableStep(QuestHelper questHelper, Requirement... requirements) { @@ -63,7 +62,7 @@ public LadyTableStep(QuestHelper questHelper, Requirement... requirements) public void startUp() { super.startUp(); - Statue answerStatue = statues[client.getVarbitValue(VARBIT_STATUE_ANSWER)]; + Statue answerStatue = statues[client.getVarbitValue(VarbitID.RD_TEMPLOCK_2)]; clickMissingStatue.setText("Click the " + answerStatue.text + " once it appears."); clickMissingStatue.setWorldPoint(answerStatue.point); } @@ -72,7 +71,7 @@ public void startUp() public void onVarbitChanged(VarbitChanged varbitChanged) { super.onVarbitChanged(varbitChanged); - Statue answerStatue = statues[client.getVarbitValue(VARBIT_STATUE_ANSWER)]; + Statue answerStatue = statues[client.getVarbitValue(VarbitID.RD_TEMPLOCK_2)]; clickMissingStatue.setText("Click the " + answerStatue.text + " once it appears."); clickMissingStatue.setWorldPoint(answerStatue.point); } @@ -99,7 +98,7 @@ public void setupSteps() new Statue("Gold axe", new WorldPoint(2454, 4972, 0)) }; - leaveRoom = new ObjectStep(questHelper, 7302, "Leave through the door to enter the portal and continue."); + leaveRoom = new ObjectStep(questHelper, ObjectID.RD_ROOM2_EXITDOOR, "Leave through the door to enter the portal and continue."); clickMissingStatue = new ObjectStep(questHelper, 0, statues[0].point, "CLick the missing statue."); clickMissingStatue.addAlternateObjects(ObjectID.RD_1G, ObjectID.RD_1S, ObjectID.RD_1B, ObjectID.RD_2G, ObjectID.RD_2S, ObjectID.RD_2B, ObjectID.RD_3G, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsCheevesSetup.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsCheevesSetup.java index bbfa4992ce1..b80ed3d2127 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsCheevesSetup.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsCheevesSetup.java @@ -37,6 +37,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.List; @@ -77,26 +78,6 @@ public class MsCheevesSetup private VarbitRequirement hasLiquidInTin; ItemRequirement hasGypsumTin, hasTinKeyPrint, hasTinCupricOre, hasTinWithTinOre, hasTinWithAllOre; - private final int VARBIT_NITROUS_OXIDE = 5581; - private final int VARBIT_VIAL_OF_LIQUID = 671; - private final int VARBIT_ACETIC_ACIDE = 672; - private final int VARBIT_CUPRIC_SULFATE = 673; - private final int VARBIT_GYPSUM = 674; - private final int VARBIT_SODIUM_CHLORIDE = 675; - private final int VARBIT_NITROUS_OXIDE_RETRIEVED = 676; - private final int VARBIT_TIN_ORE_POWDER = 677; - private final int VARBIT_CUPRIC_ORE_POWDER = 678; - private final int VARBIT_THREE_VIALS = 679; //(0 -> 3) - - private final int VARBIT_SPADEHEAD_ON_DOOR = 686; //1 - private final int VARBIT_USE_CUPRIC_SULFATE_ON_DOOR = 687; - private final int VARBIT_VIAL_OF_LIQUID_ON_DOOR = 686; // 2 - private final int VARBIT_FIRST_DOOR_OPEN = 686; //3 - - private final int VARBIT_LIQUID_IN_TIN = 689; - - private final int VARBIT_COMPLETE_ROOM = 664; - public MsCheevesSetup(QuestHelper questHelper) { this.questHelper = questHelper; @@ -138,19 +119,19 @@ private void setupSteps() , metalSpade); useSpadeOnBunsenBurner.addIcon(ItemID.RD_METAL_SPADE); - useSpadeHeadOnDoor = new ObjectStep(questHelper, 7342, "Use the spade in your inventory on the door.", + useSpadeHeadOnDoor = new ObjectStep(questHelper, ObjectID.RD_STONE_DOOR, "Use the spade in your inventory on the door.", metalSpadeHead); useSpadeHeadOnDoor.addIcon(ItemID.RD_METAL_SPADE_NO_HANDLE); - useCupricSulfateOnDoor = new ObjectStep(questHelper, 7342, "Use Cupric Sulfate in your inventory on the door.", + useCupricSulfateOnDoor = new ObjectStep(questHelper, ObjectID.RD_STONE_DOOR, "Use Cupric Sulfate in your inventory on the door.", cupricSulfate); useCupricSulfateOnDoor.addIcon(ItemID.RD_CUPRIC_SULPHATE); - useVialOfLiquidOnDoor = new ObjectStep(questHelper, 7342, "Use vial of liquid in your inventory on the door.", + useVialOfLiquidOnDoor = new ObjectStep(questHelper, ObjectID.RD_STONE_DOOR, "Use vial of liquid in your inventory on the door.", vialOfLiquid); useVialOfLiquidOnDoor.addIcon(ItemID.RD_DIHYDROGEN_MONOXIDE); - openDoor = new ObjectStep(questHelper, 7342, "Open the door."); + openDoor = new ObjectStep(questHelper, ObjectID.RD_STONE_DOOR, "Open the door."); useVialOfLiquidOnCakeTin = new DetailedQuestStep(questHelper, "Use a vial of liquid on the tin in your inventory.", tin, vialOfLiquid); @@ -172,10 +153,10 @@ private void setupSteps() "Use your tin with the bunsen burner to create a bronze key.", tinWithTinOre); useTinOnBunsenBurner.addIcon(ItemID.RD_FULL_KEYMOULD_UNHEATED); - useEquipmentOnTin = new DetailedQuestStep(questHelper, "Use your chisel,knife or bronze wires on your tin in your inventory.", + useEquipmentOnTin = new DetailedQuestStep(questHelper, "Use your chisel, knife or bronze wires on your tin in your inventory.", tinWithAllOre, chisel, knife, bronzeWire); - leaveRoom = new ObjectStep(questHelper, 7326, new WorldPoint(2478, 4940, 0), "Leave the room by the second door to enter the portal"); + leaveRoom = new ObjectStep(questHelper, ObjectID.RD_ROOM6_EXITDOOR, new WorldPoint(2478, 4940, 0), "Leave the room by the second door to enter the portal"); } private void addSteps() @@ -391,13 +372,13 @@ private void setupConditions() hasBronzeKey = bronzeKey; - hasRetrievedThreeVials = new VarbitRequirement(VARBIT_THREE_VIALS, 3); - hasSpadeHeadOnDoor = new VarbitRequirement(VARBIT_SPADEHEAD_ON_DOOR, 1); - hasCupricSulfateOnDoor = new VarbitRequirement(VARBIT_USE_CUPRIC_SULFATE_ON_DOOR, 1); - hasVialOfLiquidOnDoor = new VarbitRequirement(VARBIT_VIAL_OF_LIQUID_ON_DOOR, 2); - hasFirstDoorOpen = new VarbitRequirement(VARBIT_FIRST_DOOR_OPEN, 3); - finishedRoom = new VarbitRequirement(VARBIT_COMPLETE_ROOM, 1); + hasRetrievedThreeVials = new VarbitRequirement(VarbitID.RD_SPARE_WATER, 3); + hasSpadeHeadOnDoor = new VarbitRequirement(VarbitID.RD_ROOM6_STONE_DOOR, 1); + hasCupricSulfateOnDoor = new VarbitRequirement(VarbitID.RD_REACT_ON_SPADE, 1); + hasVialOfLiquidOnDoor = new VarbitRequirement(VarbitID.RD_ROOM6_STONE_DOOR, 2); + hasFirstDoorOpen = new VarbitRequirement(VarbitID.RD_ROOM6_STONE_DOOR, 3); + finishedRoom = new VarbitRequirement(VarbitID.RD_ROOM6_COMPLETE, 1); - hasLiquidInTin = new VarbitRequirement(VARBIT_LIQUID_IN_TIN, 1); + hasLiquidInTin = new VarbitRequirement(VarbitID.RD_WATER_IN_TIN, 1); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsHynnAnswerDialogQuizStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsHynnAnswerDialogQuizStep.java index 7731968d1e5..e9caf82dd3f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsHynnAnswerDialogQuizStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/MsHynnAnswerDialogQuizStep.java @@ -32,6 +32,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.List; @@ -40,9 +42,6 @@ public class MsHynnAnswerDialogQuizStep extends ConditionalStep { private QuestStep leaveRoom, talkToMsHynnTerprett; - private final int VARBIT_FINISHED_ROOM = 665; - private final int VARBIT_PUZZLE_SOLUTION = 667; - String[] answers = { "unknown", "10", @@ -69,7 +68,7 @@ public MsHynnAnswerDialogQuizStep(QuestHelper questHelper, QuestStep step, Requi public void startUp() { super.startUp(); - int answerID = client.getVarbitValue(VARBIT_PUZZLE_SOLUTION); + int answerID = client.getVarbitValue(VarbitID.RD_TEMPLOCK_2); if (answerID == 0) { return; @@ -81,7 +80,7 @@ public void startUp() @Override public void onVarbitChanged(VarbitChanged varbitChanged) { - int answerID = client.getVarbitValue(VARBIT_PUZZLE_SOLUTION); + int answerID = client.getVarbitValue(VarbitID.RD_TEMPLOCK_2); if (answerID == 0) { return; @@ -92,8 +91,8 @@ public void onVarbitChanged(VarbitChanged varbitChanged) private void addSteps() { - VarbitRequirement finishedRoomCondition = new VarbitRequirement(VARBIT_FINISHED_ROOM, 1); - leaveRoom = new ObjectStep(questHelper, 7354, "Leave through the door to enter the portal and continue."); + VarbitRequirement finishedRoomCondition = new VarbitRequirement(VarbitID.RD_ROOM7_COMPLETE, 1); + leaveRoom = new ObjectStep(questHelper, ObjectID.RD_ROOM7_EXITDOOR, "Leave through the door to enter the portal and continue."); addStep(finishedRoomCondition, leaveRoom); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/RecruitmentDrive.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/RecruitmentDrive.java index 65c4cce6fe8..55e2025ffc5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/RecruitmentDrive.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/RecruitmentDrive.java @@ -183,13 +183,13 @@ private LadyTableStep getLadyTableStep() private QuestStep getSirKuam() { - VarbitRequirement finishedRoom = new VarbitRequirement(661, 1); + VarbitRequirement finishedRoom = new VarbitRequirement(VarbitID.RD_ROOM3_COMPLETE, 1); talkToSirKuam = new NpcStep(this, NpcID.RD_OBSERVER_ROOM_3, "Talk to Sir Kuam Ferentse to have him spawn Sir Leye."); killSirLeye = new NpcStep(this, NpcID.RD_COMBAT_NPC_ROOM_3, "Defeat Sir Leye to win this challenge. You must use the steel warhammer or your barehands to deal the final hit on him.", true); - leaveSirKuamRoom = new ObjectStep(this, 7317, "Leave through the portal to continue."); + leaveSirKuamRoom = new ObjectStep(this, ObjectID.RD_ROOM3_EXITDOOR, "Leave through the portal to continue."); NpcCondition npcCondition = new NpcCondition(NpcID.RD_COMBAT_NPC_ROOM_3); ConditionalStep sirKuamConditional = new ConditionalStep(this, talkToSirKuam); @@ -211,31 +211,29 @@ private QuestStep getSirSpishyus() WorldPoint foxOnRightPoint = new WorldPoint(2485, 4974, 0); WorldPoint grainOnRightPoint = new WorldPoint(2486, 4974, 0); - VarbitRequirement foxOnRightSide = new VarbitRequirement(680, 0); - VarbitRequirement foxOnLeftSide = new VarbitRequirement(681, 1); - VarbitRequirement foxNotOnRightSide = new VarbitRequirement(680, 1); - VarbitRequirement foxNotOnLeftSide = new VarbitRequirement(681, 0); - VarbitRequirement chickenOnRightSide = new VarbitRequirement(682, 0); - VarbitRequirement chickenOnLeftSide = new VarbitRequirement(683, 1); - VarbitRequirement chickenNotOnRightSide = new VarbitRequirement(682, 1); - VarbitRequirement chickenNotOnLeftSide = new VarbitRequirement(683, 0); - VarbitRequirement grainOnRightSide = new VarbitRequirement(684, 0); - VarbitRequirement grainOnLeftSide = new VarbitRequirement(685, 1); - VarbitRequirement grainNotOnRightSide = new VarbitRequirement(684, 1); - VarbitRequirement grainNotOnLeftSide = new VarbitRequirement(685, 0); - VarbitRequirement finishedSpishyus = new VarbitRequirement(659, 1); + VarbitRequirement foxOnRightSide = new VarbitRequirement(VarbitID.RD_FOXLEFT, 0); + VarbitRequirement foxOnLeftSide = new VarbitRequirement(VarbitID.RD_FOXRIGHT, 1); + VarbitRequirement foxNotOnRightSide = new VarbitRequirement(VarbitID.RD_FOXLEFT, 1); + VarbitRequirement foxNotOnLeftSide = new VarbitRequirement(VarbitID.RD_FOXRIGHT, 0); + VarbitRequirement chickenOnRightSide = new VarbitRequirement(VarbitID.RD_CHICKLEFT, 0); + VarbitRequirement chickenOnLeftSide = new VarbitRequirement(VarbitID.RD_CHICKRIGHT, 1); + VarbitRequirement chickenNotOnRightSide = new VarbitRequirement(VarbitID.RD_CHICKLEFT, 1); + VarbitRequirement chickenNotOnLeftSide = new VarbitRequirement(VarbitID.RD_CHICKRIGHT, 0); + VarbitRequirement grainOnRightSide = new VarbitRequirement(VarbitID.RD_GRAINLEFT, 0); + VarbitRequirement grainOnLeftSide = new VarbitRequirement(VarbitID.RD_GRAINRIGHT, 1); + VarbitRequirement grainNotOnRightSide = new VarbitRequirement(VarbitID.RD_GRAINLEFT, 1); + VarbitRequirement grainNotOnLeftSide = new VarbitRequirement(VarbitID.RD_GRAINRIGHT, 0); + VarbitRequirement finishedSpishyus = new VarbitRequirement(VarbitID.RD_ROOM1_COMPLETE, 1); Conditions foxPickedUp = new Conditions(LogicType.AND, foxNotOnLeftSide, foxNotOnRightSide); Conditions chickenPickedUp = new Conditions(LogicType.AND, chickenNotOnRightSide, chickenNotOnLeftSide); Conditions grainPickedUp = new Conditions(LogicType.AND, grainNotOnLeftSide, grainNotOnRightSide); - int chickenOnRightId = 7279; - moveChickenOnRightToLeft = new ObjectStep(this, chickenOnRightId, chickenOnRightPoint, + moveChickenOnRightToLeft = new ObjectStep(this, ObjectID.RD_ROOM2_CHICKEN_MULTI, chickenOnRightPoint, getSpishyusPickupText("Chicken", true)); - finishedSpishyusRoom = new ObjectStep(this, 7274, "Leave through the portal to continue."); + finishedSpishyusRoom = new ObjectStep(this, ObjectID.RD_ROOM1_EXITDOOR, "Leave through the portal to continue."); - int foxOnRightId = 7275; - moveFoxOnRightToLeft = new ObjectStep(this, foxOnRightId, foxOnRightPoint, + moveFoxOnRightToLeft = new ObjectStep(this, ObjectID.RD_ROOM2_FOX_MULTI, foxOnRightPoint, getSpishyusPickupText("Fox", true)); DetailedQuestStep moveChickenToLeft = new DetailedQuestStep(this, getSpishyusMoveText("Chicken", false)); @@ -244,19 +242,17 @@ private QuestStep getSirSpishyus() DetailedQuestStep moveFoxToLeft = new DetailedQuestStep(this, getSpishyusMoveText("Fox", false)); moveFoxOnRightToLeft.addSubSteps(moveFoxToLeft); - int chickenOnLeftId = 7280; - moveChickenOnLeftToRight = new ObjectStep(this, chickenOnLeftId, chickenOnLeftPoint, + moveChickenOnLeftToRight = new ObjectStep(this, ObjectID.RD_ROOM2_CHICKEN_MULTI_RIGHT, chickenOnLeftPoint, getSpishyusPickupText("Chicken", false)); DetailedQuestStep moveChickenToRight = new DetailedQuestStep(this, getSpishyusMoveText("Chicken", true)); moveChickenOnLeftToRight.addSubSteps(moveChickenToRight); - int grainOnRightId = 7282; - moveGrainOnRightToLeft = new ObjectStep(this, grainOnRightId, grainOnRightPoint, + moveGrainOnRightToLeft = new ObjectStep(this, ObjectID.RD_ROOM2_GRAIN_MULTI, grainOnRightPoint, getSpishyusPickupText("Grain", true)); DetailedQuestStep moveGrainToLeft = new DetailedQuestStep(this, getSpishyusMoveText("Grain", false)); moveGrainOnRightToLeft.addSubSteps(moveGrainToLeft); - moveChickenOnRightToLeftAgain = new ObjectStep(this, chickenOnRightId, chickenOnRightPoint, + moveChickenOnRightToLeftAgain = new ObjectStep(this, ObjectID.RD_ROOM2_CHICKEN_MULTI, chickenOnRightPoint, getSpishyusPickupText("Chicken", true)); DetailedQuestStep moveChickenToLeftAgain = new DetailedQuestStep(this, getSpishyusMoveText("Chicken", false)); moveChickenOnRightToLeftAgain.addSubSteps(moveChickenToLeftAgain); @@ -295,7 +291,7 @@ private String getSpishyusMoveText(String itemName, boolean rightSide) private QuestStep getSirRenItchood() { - NpcStep talkToSirRenItchood = new NpcStep(this, NpcID.RD_OBSERVER_ROOM_5, "Talk to Sir Ren Itchood to recieve the clue."); + NpcStep talkToSirRenItchood = new NpcStep(this, NpcID.RD_OBSERVER_ROOM_5, "Talk to Sir Ren Itchood to receive the clue."); talkToSirRenItchood.addDialogSteps("Can I have the clue for the door?"); sirRenStep = new SirRenItchoodStep(this, talkToSirRenItchood); @@ -308,10 +304,10 @@ private QuestStep getSirTinley() "Talk to Sir Tinley. \n Once you have pressed continue do not do anything or you will fail."); doNothingStep = new DetailedQuestStep(this, "Press Continue and do nothing. Sir Tinley will eventually talk to you and let you pass."); - leaveSirTinleyRoom = new ObjectStep(this, 7320, "Leave through the portal to continue."); + leaveSirTinleyRoom = new ObjectStep(this, ObjectID.RD_ROOM4_EXITDOOR, "Leave through the portal to continue."); VarbitRequirement waitForCondition = new VarbitRequirement(VarbitID.RD_TEMPLOCK_2, 1, Operation.GREATER_EQUAL); - VarbitRequirement finishedRoom = new VarbitRequirement(662, 1); + VarbitRequirement finishedRoom = new VarbitRequirement(VarbitID.RD_ROOM4_COMPLETE, 1); ConditionalStep sirTinleyStep = new ConditionalStep(this, talkToSirTinley); sirTinleyStep.addStep(finishedRoom, leaveSirTinleyRoom); @@ -338,7 +334,7 @@ private QuestStep TalkToSirAmikVarze() ObjectStep climbSecondSteps = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_SPIRALSTAIRS, secondStairsPosition, "Climb up the stairs to talk to Sir Amik Vaze."); - NpcStep talkToSirAmikVarze = new NpcStep(this, NpcID.HUNDRED_VARZE, ""); + NpcStep talkToSirAmikVarze = new NpcStep(this, NpcID.SIR_AMIK_VARZE, ""); talkToSirAmikVarze.addDialogStep("Yes please"); conditionalTalkToSirAmikVarze = new ConditionalStep(this, climbBottomSteps, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/SirRenItchoodStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/SirRenItchoodStep.java index cdbfac526bc..b7c1e17cf30 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/SirRenItchoodStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/recruitmentdrive/SirRenItchoodStep.java @@ -34,6 +34,8 @@ import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.List; @@ -46,9 +48,6 @@ public class SirRenItchoodStep extends ConditionalStep "NULL", "TIME", "FISH", "RAIN", "BITE", "MEAT", "LAST" }; - private final int VARBIT_FINISHED_ROOM = 663; - private final int VARBIT_ANSWER = 666; - private Requirement answerWidgetOpen; private DoorPuzzle enterDoorcode; private QuestStep talkToRen, openAnswerWidget, leaveRoom; @@ -66,7 +65,7 @@ public SirRenItchoodStep(QuestHelper questHelper, QuestStep step, Requirement... public void startUp() { super.startUp(); - int answerID = client.getVarbitValue(VARBIT_ANSWER); + int answerID = client.getVarbitValue(VarbitID.RD_TEMPLOCK_1); if (answerID == 0) { return; @@ -79,7 +78,7 @@ public void startUp() public void onVarbitChanged(VarbitChanged varbitChanged) { super.onVarbitChanged(varbitChanged); - int answerID = client.getVarbitValue(VARBIT_ANSWER); + int answerID = client.getVarbitValue(VarbitID.RD_TEMPLOCK_1); if (answerID == 0) { return; @@ -90,11 +89,11 @@ public void onVarbitChanged(VarbitChanged varbitChanged) private void addRenSteps() { - finishedRoomCondition = new VarbitRequirement(VARBIT_FINISHED_ROOM, 1); - openAnswerWidget = new ObjectStep(questHelper, 7323, "Open the door to be prompted to enter a code."); + finishedRoomCondition = new VarbitRequirement(VarbitID.RD_ROOM5_COMPLETE, 1); + openAnswerWidget = new ObjectStep(questHelper, ObjectID.RD_ROOM5_EXITDOOR, "Open the door to be prompted to enter a code."); answerWidgetOpen = new WidgetTextRequirement(285, 55, "Combination Lock Door"); enterDoorcode = new DoorPuzzle(questHelper, "NONE"); - leaveRoom = new ObjectStep(questHelper, 7323, "Leave through the door to enter the portal and continue."); + leaveRoom = new ObjectStep(questHelper, ObjectID.RD_ROOM5_EXITDOOR, "Leave through the door to enter the portal and continue."); addStep(finishedRoomCondition, leaveRoom); addStep(new Conditions(answerWidgetOpen), enterDoorcode); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/regicide/Regicide.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/regicide/Regicide.java index 5a54f5185a0..c94c17b5ffe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/regicide/Regicide.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/regicide/Regicide.java @@ -50,6 +50,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -421,19 +422,19 @@ private void setupConditions() guardNearby = new NpcInteractingRequirement(NpcID.REGICIDE_OLD_CAMP_GUARD, NpcID.REGICIDE_TYRAS_CAMP_GUARD); // Guard appeared, 8446 0->1 // Gone through dart trap, 8450 0->1 - hasReadBook = new VarbitRequirement(8453, 1); - knowHowToMakeFuse = new VarbitRequirement(8455, 1); - askedAboutBarrel = new VarbitRequirement(8456, 1); - askedAboutSulphur = new VarbitRequirement(8457, 1); - askedAboutQuicklime = new VarbitRequirement(8458, 1); - askedAboutNaptha = new VarbitRequirement(8459, 1); + hasReadBook = new VarbitRequirement(VarbitID.REGICIDE_READ_BOOK, 1); + knowHowToMakeFuse = new VarbitRequirement(VarbitID.REGICIDE_FUSE_CHAT, 1); + askedAboutBarrel = new VarbitRequirement(VarbitID.REGICIDE_BARREL_CHAT, 1); + askedAboutSulphur = new VarbitRequirement(VarbitID.REGICIDE_SULPHUR_CHAT, 1); + askedAboutQuicklime = new VarbitRequirement(VarbitID.REGICIDE_QUICKLIME_CHAT, 1); + askedAboutNaptha = new VarbitRequirement(VarbitID.REGICIDE_NAPHTHA_CHAT, 1); knowHowToMakeBomb = new Conditions(hasReadBook, knowHowToMakeFuse, askedAboutBarrel, askedAboutQuicklime, askedAboutSulphur, askedAboutNaptha); hadGroundQuicklime = new Conditions(true, groundQuicklime); hadGroundSulphur = new Conditions(true, groundSulphur); - talkedToChemist = new VarbitRequirement(8449, 1); - coalInStill = new VarbitRequirement(8448, 1); - givenRabbit = new VarbitRequirement(8447, 1); + talkedToChemist = new VarbitRequirement(VarbitID.REGICIDE_CHEMIST_CHAT, 1); + coalInStill = new VarbitRequirement(VarbitID.REGICIDE_HAD_TAR, 1); + givenRabbit = new VarbitRequirement(VarbitID.REGICIDE_GIVEN_RABBIT, 1); arianwynNearby = new NpcInteractingRequirement(NpcID.REGICIDE_GOOD_ELF3); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/romeoandjuliet/RomeoAndJuliet.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/romeoandjuliet/RomeoAndJuliet.java index a3c07cb635a..b2628343eb1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/romeoandjuliet/RomeoAndJuliet.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/romeoandjuliet/RomeoAndJuliet.java @@ -26,8 +26,6 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -41,67 +39,59 @@ import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class RomeoAndJuliet extends BasicQuestHelper { - //Items Required - ItemRequirement cadavaBerry, letter, potion; - - Requirement inJulietRoom; + // Required items + ItemRequirement cadavaBerry; - QuestStep talkToRomeo, goUpToJuliet, talkToJuliet, giveLetterToRomeo, talkToLawrence, talkToApothecary, goUpToJuliet2, givePotionToJuliet, finishQuest; - - //Zones + // Zones Zone julietRoom; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); + // Miscellaneous requirements + ItemRequirement letter; + ItemRequirement cadavaPotion; + ZoneRequirement inJulietRoom; - steps.put(0, talkToRomeo); + // Steps + NpcStep talkToRomeo; - ConditionalStep tellJulietAboutRomeo = new ConditionalStep(this, goUpToJuliet); - tellJulietAboutRomeo.addStep(inJulietRoom, talkToJuliet); + ObjectStep goUpToJuliet; + NpcStep talkToJuliet; - steps.put(10, tellJulietAboutRomeo); - steps.put(20, giveLetterToRomeo); - steps.put(30, talkToLawrence); - steps.put(40, talkToApothecary); + ObjectStep goDownstairsToGiveLetterToRomeo; + NpcStep giveLetterToRomeo; - ConditionalStep bringPotionToJuliet = new ConditionalStep(this, talkToApothecary); - bringPotionToJuliet.addStep(new Conditions(potion, inJulietRoom), givePotionToJuliet); - bringPotionToJuliet.addStep(potion, goUpToJuliet2); + NpcStep talkToLawrence; + NpcStep talkToApothecary; + ObjectStep goUpToJuliet2; + NpcStep givePotionToJuliet; - steps.put(50, bringPotionToJuliet); - steps.put(60, finishQuest); + ObjectStep goDownstairsToFinishQuest; + NpcStep finishQuest; - return steps; + @Override + protected void setupZones() + { + julietRoom = new Zone(new WorldPoint(3147, 3425, 1), new WorldPoint(3166, 3443, 1)); } @Override protected void setupRequirements() { + inJulietRoom = new ZoneRequirement(julietRoom); + cadavaBerry = new ItemRequirement("Cadava berries", ItemID.CADAVABERRIES); cadavaBerry.setTooltip("You can pick some from bushes south east of Varrock"); letter = new ItemRequirement("Message", ItemID.JULIETMESSAGE); letter.setTooltip("You can get another from Juliet"); - potion = new ItemRequirement("Cadava potion", ItemID.CADAVA); - } - - public void setupConditions() - { - inJulietRoom = new ZoneRequirement(julietRoom); - } - - @Override - protected void setupZones() - { - julietRoom = new Zone(new WorldPoint(3147, 3425, 1), new WorldPoint(3166, 3443, 1)); + cadavaPotion = new ItemRequirement("Cadava potion", ItemID.CADAVA); } public void setupSteps() @@ -109,31 +99,70 @@ public void setupSteps() talkToRomeo = new NpcStep(this, NpcID.ROMEO, new WorldPoint(3211, 3422, 0), "Talk to Romeo in Varrock Square."); talkToRomeo.addDialogStep("Yes, I have seen her actually!"); talkToRomeo.addDialogStep("Yes, ok, I'll let her know."); + talkToRomeo.addDialogStep("Yes."); goUpToJuliet = new ObjectStep(this, ObjectID.FAI_VARROCK_STAIRS_TALLER, new WorldPoint(3157, 3436, 0), "Talk to Juliet in the house west of Varrock."); goUpToJuliet.addDialogStep("Ok, thanks."); talkToJuliet = new NpcStep(this, NpcID.JULIET, new WorldPoint(3158, 3427, 1), "Talk to Juliet in the house west of Varrock."); talkToJuliet.addSubSteps(goUpToJuliet); + goDownstairsToGiveLetterToRomeo = new ObjectStep(this, ObjectID.FAI_VARROCK_STAIRS_TOP, new WorldPoint(3156, 3435, 1), "Bring the letter to Romeo in Varrock Square.", letter); giveLetterToRomeo = new NpcStep(this, NpcID.ROMEO, new WorldPoint(3211, 3422, 0), "Bring the letter to Romeo in Varrock Square.", letter); + giveLetterToRomeo.addSubSteps(goDownstairsToGiveLetterToRomeo); + talkToLawrence = new NpcStep(this, NpcID.FATHER_LAWRENCE, new WorldPoint(3254, 3483, 0), "Talk to Father Lawrence in north east Varrock."); talkToLawrence.addDialogStep("Ok, thanks."); talkToApothecary = new NpcStep(this, NpcID.APOTHECARY, new WorldPoint(3195, 3405, 0), "Bring the cadava berries to the Apothecary in south west Varrock.", cadavaBerry); talkToApothecary.addDialogStep("Talk about something else."); talkToApothecary.addDialogStep("Talk about Romeo & Juliet."); - goUpToJuliet2 = new ObjectStep(this, ObjectID.FAI_VARROCK_STAIRS_TALLER, new WorldPoint(3157, 3436, 0), "Bring the potion to Juliet in the house west of Varrock.", potion); - givePotionToJuliet = new NpcStep(this, NpcID.JULIET, new WorldPoint(3158, 3427, 1), "Bring the potion to Juliet in the house west of Varrock.", potion); + goUpToJuliet2 = new ObjectStep(this, ObjectID.FAI_VARROCK_STAIRS_TALLER, new WorldPoint(3157, 3436, 0), "Bring the potion to Juliet in the house west of Varrock.", cadavaPotion); + givePotionToJuliet = new NpcStep(this, NpcID.JULIET, new WorldPoint(3158, 3427, 1), "Bring the potion to Juliet in the house west of Varrock.", cadavaPotion); givePotionToJuliet.addSubSteps(goUpToJuliet2); + goDownstairsToFinishQuest = new ObjectStep(this, ObjectID.FAI_VARROCK_STAIRS_TOP, new WorldPoint(3156, 3435, 1), "Talk to Romeo in Varrock Square to finish the quest."); finishQuest = new NpcStep(this, NpcID.ROMEO, new WorldPoint(3211, 3422, 0), "Talk to Romeo in Varrock Square to finish the quest."); + finishQuest.addSubSteps(goDownstairsToFinishQuest); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToRomeo); + var tellJulietAboutRomeo = new ConditionalStep(this, goUpToJuliet); + tellJulietAboutRomeo.addStep(inJulietRoom, talkToJuliet); + + steps.put(10, tellJulietAboutRomeo); + + var giveLetterToRomeo = new ConditionalStep(this, this.giveLetterToRomeo); + giveLetterToRomeo.addStep(inJulietRoom, goDownstairsToGiveLetterToRomeo); + steps.put(20, giveLetterToRomeo); + steps.put(30, talkToLawrence); + steps.put(40, talkToApothecary); + + var bringPotionToJuliet = new ConditionalStep(this, talkToApothecary); + bringPotionToJuliet.addStep(and(cadavaPotion, inJulietRoom), givePotionToJuliet); + bringPotionToJuliet.addStep(cadavaPotion, goUpToJuliet2); + + steps.put(50, bringPotionToJuliet); + + var cFinishQuest = new ConditionalStep(this, finishQuest); + giveLetterToRomeo.addStep(inJulietRoom, goDownstairsToFinishQuest); + steps.put(60, cFinishQuest); + + return steps; } @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(cadavaBerry); - return reqs; + return List.of( + cadavaBerry + ); } @Override @@ -145,11 +174,26 @@ public QuestPointReward getQuestPointReward() @Override public List getPanels() { - List allSteps = new ArrayList<>(); - - allSteps.add(new PanelDetails("Helping Romeo", Arrays.asList(talkToRomeo, talkToJuliet, giveLetterToRomeo))); - allSteps.add(new PanelDetails("Hatching a plan", Arrays.asList(talkToLawrence, talkToApothecary), cadavaBerry)); - allSteps.add(new PanelDetails("Enact the plan", Arrays.asList(givePotionToJuliet, finishQuest))); - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Helping Romeo", List.of( + talkToRomeo, + talkToJuliet, + giveLetterToRomeo + ))); + + sections.add(new PanelDetails("Hatching a plan", List.of( + talkToLawrence, + talkToApothecary + ), List.of( + cadavaBerry + ))); + + sections.add(new PanelDetails("Enact the plan", List.of( + givePotionToJuliet, + finishQuest + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rovingelves/RovingElves.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rovingelves/RovingElves.java index 07bbfd41d2c..20228170927 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rovingelves/RovingElves.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rovingelves/RovingElves.java @@ -78,7 +78,7 @@ public Map loadSteps() steps.put(2, talkToEluned); ConditionalStep getTheSeed = new ConditionalStep(this, enterGlarialsTombstone); - getTheSeed.addStep(seed.alsoCheckBank(questBank), returnSeedToEluned); + getTheSeed.addStep(seed.alsoCheckBank(), returnSeedToEluned); getTheSeed.addStep(seedNearby, pickUpSeed); getTheSeed.addStep(inGlarialsTomb, killGuardian); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/royaltrouble/RoyalTrouble.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/royaltrouble/RoyalTrouble.java index fa16f7bcd4a..696a2810a09 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/royaltrouble/RoyalTrouble.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/royaltrouble/RoyalTrouble.java @@ -332,13 +332,13 @@ public void setupConditions() hasCoalOrPickaxe = coal5; } - astridIsHeir = new VarbitRequirement(14607, 0); // Goes to 1 for Brand - isMarryingNotFriend = new VarbitRequirement(14608, 0); // Goes to 1 for friend - startedInvestigation = new VarbitRequirement(2141, 10); + astridIsHeir = new VarbitRequirement(VarbitID.MISC_PARTNER_MULTIVAR, 0); // Goes to 1 for Brand + isMarryingNotFriend = new VarbitRequirement(VarbitID.MISC_NO_ROMANCE_MULTIVAR, 0); // Goes to 1 for friend + startedInvestigation = new VarbitRequirement(VarbitID.ROYAL_MISC, 10); reportedToVargas = new VarbitRequirement(VarbitID.ROYAL_MISC, 20, Operation.GREATER_EQUAL); - talkedToGhrimInInvestigation = new VarbitRequirement(2141, 30); - talkedToSailor = new VarbitRequirement(2141, 40); - gottenScrollFromVargas = new VarbitRequirement(2141, 50); + talkedToGhrimInInvestigation = new VarbitRequirement(VarbitID.ROYAL_MISC, 30); + talkedToSailor = new VarbitRequirement(VarbitID.ROYAL_MISC, 40); + gottenScrollFromVargas = new VarbitRequirement(VarbitID.ROYAL_MISC, 50); enteredDungeon = new VarbitRequirement(VarbitID.ROYAL_MISC, 60, Operation.GREATER_EQUAL); // Missing 70 talkedToDonal = new VarbitRequirement(VarbitID.ROYAL_MISC, 80, Operation.GREATER_EQUAL); @@ -346,41 +346,41 @@ public void setupConditions() talkedToKids = new VarbitRequirement(VarbitID.ROYAL_MISC, 110, Operation.GREATER_EQUAL); killedBoss = new VarbitRequirement(VarbitID.ROYAL_MISC, 120, Operation.GREATER_EQUAL); - talkedToSigrid = new VarbitRequirement(2142, 10); + talkedToSigrid = new VarbitRequirement(VarbitID.ROYAL_ETC, 10); reportedToSigrid = new VarbitRequirement(VarbitID.ROYAL_ETC, 20, Operation.GREATER_EQUAL); - finishedFinalConvoWithSigrid = new VarbitRequirement(2142, 40); + finishedFinalConvoWithSigrid = new VarbitRequirement(VarbitID.ROYAL_ETC, 40); - talkedToMiscSubject = new VarbitRequirement(2143, 1); + talkedToMiscSubject = new VarbitRequirement(VarbitID.ROYAL_MISC_VILLAGERS_ABOUTTHEFTS, 1); talkedToEtcSubject = new VarbitRequirement(VarbitID.ROYAL_ETC_VILLAGERS_ABOUTTHEFTS, 1, Operation.GREATER_EQUAL); - usedProp = new VarbitRequirement(2145, 1); - hasUsedPulley = new VarbitRequirement(2146, 1); - hasUsedLongerPulley = new VarbitRequirement(2146, 2); - hasUsedPulley2 = new VarbitRequirement(2146, 3); - hasUsedRope = new VarbitRequirement(2146, 4); - hasUsedBeam = new VarbitRequirement(2146, 5); - hasUsedEngine = new VarbitRequirement(2146, 6); + usedProp = new VarbitRequirement(VarbitID.ROYAL_MISC_USEDMININGPROP, 1); + hasUsedPulley = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 1); + hasUsedLongerPulley = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 2); + hasUsedPulley2 = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 3); + hasUsedRope = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 4); + hasUsedBeam = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 5); + hasUsedEngine = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 6); hasRepairedScaffold = new VarbitRequirement(VarbitID.ROYAL_LIFTSTAGE, 7, Operation.GREATER_EQUAL); - has1CoalInEngine = new VarbitRequirement(2156, 1); - has2CoalInEngine = new VarbitRequirement(2156, 2); - has3CoalInEngine = new VarbitRequirement(2156, 3); - has4CoalInEngine = new VarbitRequirement(2156, 4); - hasFullEngine = new VarbitRequirement(2156, 5); + has1CoalInEngine = new VarbitRequirement(VarbitID.ROYAL_COALINENGINE, 1); + has2CoalInEngine = new VarbitRequirement(VarbitID.ROYAL_COALINENGINE, 2); + has3CoalInEngine = new VarbitRequirement(VarbitID.ROYAL_COALINENGINE, 3); + has4CoalInEngine = new VarbitRequirement(VarbitID.ROYAL_COALINENGINE, 4); + hasFullEngine = new VarbitRequirement(VarbitID.ROYAL_COALINENGINE, 5); - attachedRope = new VarbitRequirement(2147, 1); + attachedRope = new VarbitRequirement(VarbitID.ROYAL_MISC_ROPELOC, 1); inPlankRoom = new ZoneRequirement(plankRoom); - seenFire = new VarbitRequirement(2154, 1); + seenFire = new VarbitRequirement(VarbitID.ROYAL_NOTICED_FIRES, 1); searchedFire1 = new VarbitRequirement(VarbitID.ROYAL_MISC_NUMBEROFCHAPTERS, 1, Operation.GREATER_EQUAL); - searchedFire2 = new VarbitRequirement(2148, 2); - searchedFire3 = new VarbitRequirement(2148, 3); + searchedFire2 = new VarbitRequirement(VarbitID.ROYAL_MISC_NUMBEROFCHAPTERS, 2); + searchedFire3 = new VarbitRequirement(VarbitID.ROYAL_MISC_NUMBEROFCHAPTERS, 3); searchedFire4 = new VarbitRequirement(VarbitID.ROYAL_MISC_NUMBEROFCHAPTERS, 4, Operation.GREATER_EQUAL); searchedFire5 = new VarbitRequirement(VarbitID.ROYAL_MISC_NUMBEROFCHAPTERS, 5, Operation.GREATER_EQUAL); // TODO: hasReadDiary probably wrong varbit, need to verify - hasReadDiary = new VarbitRequirement(2149, 1); - enteredSnakeRoom = new VarbitRequirement(2157, 1); + hasReadDiary = new VarbitRequirement(VarbitID.ROYAL_MISC_DIARYCHAPTER1READ, 1); + enteredSnakeRoom = new VarbitRequirement(VarbitID.ROYAL_MEDDLINGKIDS_CUTSCENE, 1); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rumdeal/RumDeal.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rumdeal/RumDeal.java index fa9f05c4895..69b1e0e51d9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rumdeal/RumDeal.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/rumdeal/RumDeal.java @@ -51,6 +51,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -302,11 +303,11 @@ public void setupConditions() onNorthIsland = new ZoneRequirement(northIsland); inSpiderRoom = new ZoneRequirement(spiderRoom); - rakedPatch = new VarbitRequirement(1366, 3); - plantedPatch = new VarbitRequirement(1366, 4); - grownPatch = new VarbitRequirement(1366, 5); + rakedPatch = new VarbitRequirement(VarbitID.DEAL_FARMING, 3); + plantedPatch = new VarbitRequirement(VarbitID.DEAL_FARMING, 4); + grownPatch = new VarbitRequirement(VarbitID.DEAL_FARMING, 5); - added5Sluglings = new VarbitRequirement(1354, 5); + added5Sluglings = new VarbitRequirement(VarbitID.DEAL_BARREL, 5); evilSpiritNearby = new NpcCondition(NpcID.DEAL_EVIL_SPIRIT); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/runemysteries/RuneMysteries.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/runemysteries/RuneMysteries.java index aa38c146d07..c09884adb5a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/runemysteries/RuneMysteries.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/runemysteries/RuneMysteries.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Zoinkwiz + * Copyright (c) 2025, pajlada * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,8 +28,8 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; @@ -38,65 +39,73 @@ import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.util.QHObjectID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; public class RuneMysteries extends BasicQuestHelper { - //Items Required - ItemRequirement airTalisman, researchPackage, notes; - - //Items Recommended - ItemRequirement varrockTeleport, wizardTeleport; - - Requirement inUpstairsLumbridge, inWizardBasement; - - QuestStep goUpToHoracio, talkToHoracio, goF1ToF0LumbridgeCastle, goDownToSedridor, talkToSedridor, finishTalkingToSedridor, talkToAubury, talkToAudburyAgain, goDownToSedridor2, talkToSedridor2; - - //Zones - Zone wizardBasement, upstairsLumbridge; + // Recommended items + ItemRequirement varrockTeleport; + ItemRequirement wizardTeleport; + + // Zones + Zone wizardBasement; + Zone upstairsLumbridge; + + // Miscellaneous requirements + ItemRequirement airTalisman; + ItemRequirement researchPackage; + ItemRequirement notes; + + ZoneRequirement inUpstairsLumbridge; + ZoneRequirement inWizardBasement; + + VarbitRequirement needsToGrabPackage; + VarbitRequirement needsToGrabResearchNotes; + VarbitRequirement hasGivenSedridorTheNotes; + + // Steps + ObjectStep goUpToHoracio; + NpcStep talkToHoracio; + ObjectStep goF1ToF0LumbridgeCastle; + ObjectStep goDownToSedridor; + NpcStep bringTalismanToSedridor; + ObjectStep goDownToSedridorAfterHandingInAirTalisman; + NpcStep getResearchPackageFromSedridor; + NpcStep deliverPackageToAubury; + NpcStep talkToAudburyAgain; + ObjectStep goDownToSedridor2; + NpcStep deliverResearchNotesToSedridor; + NpcStep talkToSedridorAfterGivingHimTheNotes; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - ConditionalStep goTalkToHoracio = new ConditionalStep(this, goUpToHoracio); - goTalkToHoracio.addStep(inUpstairsLumbridge, talkToHoracio); - - steps.put(0, goTalkToHoracio); - - ConditionalStep goTalkToSedridor = new ConditionalStep(this, goDownToSedridor); - goTalkToSedridor.addStep(and(airTalisman, inUpstairsLumbridge), goF1ToF0LumbridgeCastle); - goTalkToSedridor.addStep(inWizardBasement, talkToSedridor); - - steps.put(1, goTalkToSedridor); - - steps.put(2, finishTalkingToSedridor); - - steps.put(3, talkToAubury); - - steps.put(4, talkToAudburyAgain); - - ConditionalStep goTalkToSedridor2 = new ConditionalStep(this, goDownToSedridor2); - goTalkToSedridor2.addStep(inWizardBasement, talkToSedridor2); - steps.put(5, goTalkToSedridor2); - - return steps; + upstairsLumbridge = new Zone(new WorldPoint(3203, 3206, 1), new WorldPoint(3218, 3231, 1)); + wizardBasement = new Zone(new WorldPoint(3094, 9553, 0), new WorldPoint(3125, 9582, 0)); } @Override protected void setupRequirements() { + inUpstairsLumbridge = new ZoneRequirement(upstairsLumbridge); + inWizardBasement = new ZoneRequirement(wizardBasement); + + needsToGrabPackage = new VarbitRequirement(VarbitID.RUNEMYSTERIES_PACKAGE, 0); + needsToGrabResearchNotes = new VarbitRequirement(VarbitID.RUNEMYSTERIES_NOTES, 0); + hasGivenSedridorTheNotes = new VarbitRequirement(VarbitID.RUNEMYSTERIES_NOTES_GIVEN, 1); + airTalisman = new ItemRequirement("Air talisman", ItemID.AIR_TALISMAN).isNotConsumed(); airTalisman.setTooltip("You can get another from Duke Horacio if you lost it"); researchPackage = new ItemRequirement("Research package", ItemID.RESEARCH_PACKAGE); @@ -107,58 +116,92 @@ protected void setupRequirements() wizardTeleport = new ItemRequirement("A teleport to the Wizard's Tower", ItemCollections.NECKLACE_OF_PASSAGES); } - public void setupConditions() - { - inUpstairsLumbridge = new ZoneRequirement(upstairsLumbridge); - inWizardBasement = new ZoneRequirement(wizardBasement); - } - - @Override - protected void setupZones() - { - upstairsLumbridge = new Zone(new WorldPoint(3203, 3206, 1), new WorldPoint(3218, 3231, 1)); - wizardBasement = new Zone(new WorldPoint(3094, 9553, 0), new WorldPoint(3125, 9582, 0)); - } - public void setupSteps() { - goUpToHoracio = new ObjectStep(this, ObjectID.SPIRALSTAIRS, new WorldPoint(3205, 3208, 0), "Talk to Duke Horacio on the first floor of Lumbridge castle."); - talkToHoracio = new NpcStep(this, NpcID.DUKE_OF_LUMBRIDGE, new WorldPoint(3210, 3220, 1), "Talk to Duke Horacio on the first floor of Lumbridge castle."); + goUpToHoracio = new ObjectStep(this, QHObjectID.LUMBRIDGE_CASTLE_F0_SOUTH_STAIRCASE, new WorldPoint(3205, 3208, 0), "Talk to Duke Horacio on the first floor of Lumbridge castle."); + + talkToHoracio = new NpcStep(this, NpcID.DUKE_OF_LUMBRIDGE, new WorldPoint(3209, 3222, 1), "Talk to Duke Horacio on the first floor of Lumbridge castle."); talkToHoracio.addDialogStep("Have you any quests for me?"); talkToHoracio.addDialogStep("Yes."); talkToHoracio.addSubSteps(goUpToHoracio); goF1ToF0LumbridgeCastle = new ObjectStep(this, ObjectID.SPIRALSTAIRSMIDDLE, new WorldPoint(3204, 3207, 1), - "Bring the Air Talisman to Sedridor in the Wizard Tower's basement."); + "Bring the Air Talisman to Sedridor in the Wizard Tower's basement.", airTalisman); + goF1ToF0LumbridgeCastle.addDialogStep("Climb down the stairs."); goDownToSedridor = new ObjectStep(this, ObjectID.WIZARDS_TOWER_LADDERTOP, new WorldPoint(3104, 3162, 0), "Bring the Air Talisman to Sedridor in the Wizard Tower's basement.", airTalisman); goDownToSedridor.addDialogStep("Have you any quests for me?"); - talkToSedridor = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Bring the Air Talisman to Sedridor in the Wizard Tower's basement.", airTalisman); - talkToSedridor.addDialogStep("I'm looking for the head wizard."); - talkToSedridor.addDialogStep("Okay, here you are."); + bringTalismanToSedridor = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Bring the Air Talisman to Sedridor in the Wizard Tower's basement.", airTalisman); + bringTalismanToSedridor.addDialogStep("I'm looking for the head wizard."); + bringTalismanToSedridor.addDialogStep("Okay, here you are."); + + bringTalismanToSedridor.addSubSteps(goDownToSedridor, goF1ToF0LumbridgeCastle); - finishTalkingToSedridor = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Accept taking the package for Sedridor."); - finishTalkingToSedridor.addDialogStep("Yes, certainly."); + goDownToSedridorAfterHandingInAirTalisman = new ObjectStep(this, ObjectID.WIZARDS_TOWER_LADDERTOP, new WorldPoint(3104, 3162, 0), "Talk to Sedridor in the Wizard Tower's basement and accept the Research Package."); + goDownToSedridorAfterHandingInAirTalisman.addDialogStep("Have you any quests for me?"); - talkToSedridor.addSubSteps(goDownToSedridor, finishTalkingToSedridor, goF1ToF0LumbridgeCastle); + getResearchPackageFromSedridor = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Talk to Sedridor in the Wizard Tower's basement and accept the Research Package."); + getResearchPackageFromSedridor.addDialogSteps("Go ahead.", "Actually, I'm not interested.", "Yes, certainly."); + getResearchPackageFromSedridor.addSubSteps(goDownToSedridorAfterHandingInAirTalisman); - talkToAubury = new NpcStep(this, NpcID.AUBURY_2OP, new WorldPoint(3253, 3401, 0), "Bring the Research Package to Aubury in south east Varrock.", researchPackage); - talkToAubury.addDialogStep("I've been sent here with a package for you."); + deliverPackageToAubury = new NpcStep(this, NpcID.AUBURY_2OP, new WorldPoint(3253, 3401, 0), "Bring the Research Package to Aubury in south east Varrock.", researchPackage); + deliverPackageToAubury.addDialogStep("I've been sent here with a package for you."); + deliverPackageToAubury.addTeleport(varrockTeleport); talkToAudburyAgain = new NpcStep(this, NpcID.AUBURY_2OP, new WorldPoint(3253, 3401, 0), "Talk to Aubury again in south east Varrock."); goDownToSedridor2 = new ObjectStep(this, ObjectID.WIZARDS_TOWER_LADDERTOP, new WorldPoint(3104, 3162, 0), "Bring the research notes to Sedridor in the Wizard Tower's basement.", notes); - talkToSedridor2 = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Bring the notes to Sedridor in the Wizard Tower's basement.", notes); - talkToSedridor2.addSubSteps(goDownToSedridor2); + deliverResearchNotesToSedridor = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Bring the notes to Sedridor in the Wizard Tower's basement.", notes); + talkToSedridorAfterGivingHimTheNotes = new NpcStep(this, NpcID.HEAD_WIZARD_1OP, new WorldPoint(3104, 9571, 0), "Talk to Sedridor in the Wizard Tower's basement to finish the quest."); + deliverResearchNotesToSedridor.addSubSteps(goDownToSedridor2, talkToSedridorAfterGivingHimTheNotes); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + var goTalkToHoracio = new ConditionalStep(this, goUpToHoracio); + goTalkToHoracio.addStep(inUpstairsLumbridge, talkToHoracio); + + steps.put(0, goTalkToHoracio); + + var goTalkToSedridor = new ConditionalStep(this, goDownToSedridor); + goTalkToSedridor.addStep(and(airTalisman, inUpstairsLumbridge), goF1ToF0LumbridgeCastle); + goTalkToSedridor.addStep(inWizardBasement, bringTalismanToSedridor); + + steps.put(1, goTalkToSedridor); + + var getPackageFromSedridor = new ConditionalStep(this, goDownToSedridorAfterHandingInAirTalisman); + getPackageFromSedridor.addStep(inWizardBasement, getResearchPackageFromSedridor); + steps.put(2, getPackageFromSedridor); + + var cDeliverPackageToAbury = new ConditionalStep(this, deliverPackageToAubury); + cDeliverPackageToAbury.addStep(and(inWizardBasement, needsToGrabPackage), getResearchPackageFromSedridor); + cDeliverPackageToAbury.addStep(needsToGrabPackage, goDownToSedridorAfterHandingInAirTalisman); + steps.put(3, cDeliverPackageToAbury); + + steps.put(4, talkToAudburyAgain); + + var cDeliverResearchNotesToSedridor = new ConditionalStep(this, goDownToSedridor2); + cDeliverResearchNotesToSedridor.addStep(needsToGrabResearchNotes, talkToAudburyAgain); + cDeliverResearchNotesToSedridor.addStep(and(inWizardBasement, hasGivenSedridorTheNotes), talkToSedridorAfterGivingHimTheNotes); + cDeliverResearchNotesToSedridor.addStep(inWizardBasement, deliverResearchNotesToSedridor); + steps.put(5, cDeliverResearchNotesToSedridor); + + return steps; } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(varrockTeleport); - reqs.add(wizardTeleport); - return reqs; + return List.of( + varrockTeleport, + wizardTeleport + ); } @Override @@ -170,23 +213,36 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Air Talisman", ItemID.AIR_TALISMAN, 1)); + return List.of( + new ItemReward("Air Talisman", ItemID.AIR_TALISMAN, 1) + ); } @Override public List getUnlockRewards() { - return Arrays.asList( - new UnlockReward("Ability to use the Runecrafting Skill."), - new UnlockReward("Ability to mine Rune and Pure Essence.")); + return List.of( + new UnlockReward("Ability to mine Rune and Pure Essence.") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToHoracio, + bringTalismanToSedridor + ))); + + sections.add(new PanelDetails("Discovering the lost incantation", List.of( + getResearchPackageFromSedridor, + deliverPackageToAubury, + talkToAudburyAgain, + deliverResearchNotesToSedridor + ))); - allSteps.add(new PanelDetails("Discover Runecrafting", Arrays.asList(talkToHoracio, talkToSedridor, talkToAubury, talkToAudburyAgain, talkToSedridor2))); - return allSteps; + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scorpioncatcher/ScorpionCatcher.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scorpioncatcher/ScorpionCatcher.java index d79c1196de8..c9f9666182c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scorpioncatcher/ScorpionCatcher.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scorpioncatcher/ScorpionCatcher.java @@ -75,13 +75,13 @@ public Map loadSteps() goGetTaverleyScorpion.addStep(new Conditions(inTaverleyDungeon), killJailerForKey); ConditionalStep scorpions = new ConditionalStep(this, finishQuest); - scorpions.addStep(scorpionCageMissingTaverley.alsoCheckBank(questBank), goGetTaverleyScorpion); + scorpions.addStep(scorpionCageMissingTaverley.alsoCheckBank(), goGetTaverleyScorpion); scorpions.addStep(new Conditions(scorpionCageMissingMonastery, inUpstairsMonastery), catchMonasteryScorpion); - scorpions.addStep(scorpionCageMissingMonastery.alsoCheckBank(questBank), enterMonastery); + scorpions.addStep(scorpionCageMissingMonastery.alsoCheckBank(), enterMonastery); scorpions.addStep(new Conditions(scorpionCageTaverleyAndMonastery, inBarbarianOutpost), catchOutpostScorpion); - scorpions.addStep(scorpionCageTaverleyAndMonastery.alsoCheckBank(questBank), enterOutpost); + scorpions.addStep(scorpionCageTaverleyAndMonastery.alsoCheckBank(), enterOutpost); steps.put(0, beginQuest); steps.put(1, speakToSeer1); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/EggSolver.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/EggSolver.java index 12d28d95b3a..0e7d7940a20 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/EggSolver.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/EggSolver.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2025, pajlada + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.runelite.client.plugins.microbot.questhelper.helpers.quests.scrambled; import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; @@ -8,14 +32,15 @@ import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; -import java.awt.*; -import java.util.List; -import javax.annotation.Nullable; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.gameval.InterfaceID; import net.runelite.api.widgets.Widget; +import javax.annotation.Nullable; +import java.awt.*; +import java.util.List; + @Slf4j public class EggSolver extends DetailedOwnerStep { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/Scrambled.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/Scrambled.java index cd2246d6566..69ed9eef58e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/Scrambled.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/scrambled/Scrambled.java @@ -30,7 +30,6 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcHintArrowRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; @@ -44,6 +43,10 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.api.QuestState; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.*; import java.util.ArrayList; import java.util.HashMap; @@ -51,17 +54,7 @@ import java.util.Map; import java.util.regex.Pattern; -import net.runelite.api.gameval.InterfaceID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.QuestState; -import net.runelite.api.Skill; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.VarbitID; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; /** * The quest guide for the "Scrambled" OSRS quest diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/AskAboutRitual.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/AskAboutRitual.java index d5be581377f..55b8d554e45 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/AskAboutRitual.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/AskAboutRitual.java @@ -30,6 +30,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; public class AskAboutRitual extends NpcStep @@ -49,8 +50,8 @@ public void onGameTick(GameTick event) private void updateCorrectChoice() { - boolean askedAboutKiller = client.getVarbitValue(14743) == 1; - boolean askedAboutRitual = client.getVarbitValue(14744) == 1; + boolean askedAboutKiller = client.getVarbitValue(VarbitID.SOTN_GHORROCK_QUESTION) == 1; + boolean askedAboutRitual = client.getVarbitValue(VarbitID.SOTN_RITUAL_QUESTION) == 1; choices = new DialogChoiceSteps(); if (!askedAboutKiller) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SecretsOfTheNorth.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SecretsOfTheNorth.java index 9a02affd11c..39fce3c530a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SecretsOfTheNorth.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SecretsOfTheNorth.java @@ -282,25 +282,25 @@ protected void setupRequirements() notGoneUpstairs = new VarbitRequirement(VarbitID.SOTN, 4, Operation.GREATER_EQUAL); notInspectedCrimeScene = new VarbitRequirement(VarbitID.SOTN, 6, Operation.GREATER_EQUAL); - notInspectWall = new VarbitRequirement(14726, 0); - notInspectCeril = new VarbitRequirement(14727, 0); - notInspectWindow = new VarbitRequirement(14728, 0); - notInspectChest = new VarbitRequirement(14729, 0); + notInspectWall = new VarbitRequirement(VarbitID.SOTN_INSPECTED_WALL, 0); + notInspectCeril = new VarbitRequirement(VarbitID.SOTN_INSPECTED_BODY, 0); + notInspectWindow = new VarbitRequirement(VarbitID.SOTN_INSPECTED_WINDOW, 0); + notInspectChest = new VarbitRequirement(VarbitID.SOTN_INSPECTED_CHEST, 0); inspectedCrimeScene = new VarbitRequirement(VarbitID.SOTN, 8, Operation.GREATER_EQUAL); - toldWindow = new VarbitRequirement(14731, 1); - toldCeril = new VarbitRequirement(14730, 1); - toldWall = new VarbitRequirement(14732, 1); + toldWindow = new VarbitRequirement(VarbitID.SOTN_EXPLAINED_WINDOW, 1); + toldCeril = new VarbitRequirement(VarbitID.SOTN_EXPLAINED_BODY, 1); + toldWall = new VarbitRequirement(VarbitID.SOTN_EXPLAINED_CHEST, 1); onTheTrail = new VarbitRequirement(VarbitID.SOTN, 20, Operation.GREATER_EQUAL); - checkedBarrel = new VarbitRequirement(14733, 1); - checkedBoulder = new VarbitRequirement(14734, 1); - checkedBush = new VarbitRequirement(14735, 1); - checkedStump = new VarbitRequirement(14736, 1); - checkedBoulder2 = new VarbitRequirement(14737, 1); - checkedBush2 = new VarbitRequirement(14738, 1); + checkedBarrel = new VarbitRequirement(VarbitID.SOTN_HUNTING_TRAIL_1, 1); + checkedBoulder = new VarbitRequirement(VarbitID.SOTN_HUNTING_TRAIL_2, 1); + checkedBush = new VarbitRequirement(VarbitID.SOTN_HUNTING_TRAIL_3, 1); + checkedStump = new VarbitRequirement(VarbitID.SOTN_HUNTING_TRAIL_4, 1); + checkedBoulder2 = new VarbitRequirement(VarbitID.SOTN_HUNTING_TRAIL_5, 1); + checkedBush2 = new VarbitRequirement(VarbitID.SOTN_HUNTING_TRAIL_6, 1); evelotDefeated = new VarbitRequirement(VarbitID.SOTN, 28, Operation.GREATER_EQUAL); talkedToAlomoneOrClivet = new VarbitRequirement(VarbitID.SOTN, 32, Operation.GREATER_EQUAL); @@ -419,17 +419,17 @@ public void setupSteps() speakToBarman = new NpcStep(this, NpcID.KHAZARD_BARMAN, new WorldPoint(2566, 3140, 0), "Head to the Fight Arena Bar and talk to the Khazard Barman.", coins, combatGear); speakToBarman.addDialogStep("Do you know anyone called Evelot?"); - inspectBarrel = new ObjectStep(this, 46873, new WorldPoint(2568, 3152, 0), + inspectBarrel = new ObjectStep(this, ObjectID.SOTN_HUNTING_BARREL, new WorldPoint(2568, 3152, 0), "Inspect the barrels outside the Fight Arena Bar entrance.", combatGear); - inspectBoulder = new ObjectStep(this, 46874, new WorldPoint(2573, 3180, 0), + inspectBoulder = new ObjectStep(this, ObjectID.SOTN_HUNTING_BOULDER1, new WorldPoint(2573, 3180, 0), "Inspect the boulder to the north.", combatGear); - inspectBush = new ObjectStep(this, 46878, new WorldPoint(2567, 3202, 0), + inspectBush = new ObjectStep(this, ObjectID.SOTN_HUNTING_BUSH, new WorldPoint(2567, 3202, 0), "Continue north and inspect the bush there.", combatGear); - inspectStump = new ObjectStep(this, 46877, new WorldPoint(2584, 3197, 0), + inspectStump = new ObjectStep(this, ObjectID.SOTN_HUNTING_TREESTUMP, new WorldPoint(2584, 3197, 0), "Inspect the stump to the east.", combatGear); - inspectBoulder2 = new ObjectStep(this, 46875, new WorldPoint(2605, 3188, 0), + inspectBoulder2 = new ObjectStep(this, ObjectID.SOTN_HUNTING_BOULDER2, new WorldPoint(2605, 3188, 0), "Inspect the boulder to the south east.", combatGear); - inspectBush2 = new ObjectStep(this, 46878, new WorldPoint(2621, 3193, 0), + inspectBush2 = new ObjectStep(this, ObjectID.SOTN_HUNTING_BUSH, new WorldPoint(2621, 3193, 0), "Inspect the bush to the east.", combatGear); fightEvelot = new NpcStep(this, NpcID.SOTN_EVELOT_VIS, new WorldPoint(2643, 3202, 0), "Approach Evelot to the east to start the fight.\n\n" + @@ -461,10 +461,10 @@ public void setupSteps() examineShelves = new ObjectStep(this, ObjectID.SOTN_SHELVES_BUTTON, new WorldPoint(2540, 9694, 0), "Search the cooking shelves for a button."); examineShelves.addDialogStep("Yes."); - examineWall = new ObjectStep(this, 46897, new WorldPoint(2544, 9698, 0), + examineWall = new ObjectStep(this, ObjectID.SOTN_HIDDEN_DOOR_1, new WorldPoint(2544, 9698, 0), "Inspect the wall next to the noticeboard."); examineWall.addDialogStep("Enter the passage."); - lockpickChest = new ObjectStep(this, 46899, new WorldPoint(2535, 9621, 0), + lockpickChest = new ObjectStep(this, ObjectID.SOTN_HIDDEN_CHEST_CLOSED, new WorldPoint(2535, 9621, 0), "Picklock the chest.", lockpick); lockpickChest.addText("Green means it's the right number and position."); lockpickChest.addText("Blue means it's the right position but wrong number."); @@ -495,7 +495,7 @@ public void setupSteps() talkToSnowflake.addDialogStep("Have you seen anything odd around here recently?"); moveToWeissCave = new ObjectStep(this, ObjectID.MY2ARM_THRONEROOM_STAIRSDOWN, new WorldPoint(2867, 3940, 0), "Prepare for a fight and climb down the stairs in the middle of Weiss.", combatGear, antipoison); - enterWeissCave = new ObjectStep(this, 46905, new WorldPoint(2846, 10332, 0), + enterWeissCave = new ObjectStep(this, ObjectID.MY2ARM_MINE_WALL_CAVE_EXIT_02, new WorldPoint(2846, 10332, 0), "Enter the cave to the south.", combatGear, antipoison); enterWeissCave.addDialogStep("Yes."); fightAssassin = new NpcStep(this, NpcID.AKD_SETTLEMENT_RUINS_ASSASSIN, new WorldPoint(2927, 10348, 0), "Defeat the assassin."); @@ -558,7 +558,7 @@ public void setupSteps() ((NpcStep) defeatMuspah).addAlternateNpcs(NpcID.MUSPAH_QUEST, NpcID.SOTN_MUSPAH_CUTSCENE, NpcID.MUSPAH_SOULSPLIT_QUEST, NpcID.MUSPAH_SOULSPLIT_QUEST); moveToWeissCaveEnd = new ObjectStep(this, ObjectID.MY2ARM_THRONEROOM_STAIRSDOWN, new WorldPoint(2867, 3940, 0), "Speak to Jhallan in the Muspah room."); - enterWeissCaveEnd = new ObjectStep(this, 46905, new WorldPoint(2846, 10332, 0), + enterWeissCaveEnd = new ObjectStep(this, ObjectID.MY2ARM_MINE_WALL_CAVE_EXIT_02, new WorldPoint(2846, 10332, 0), "Speak to Jhallan in the Muspah room."); enterCreviceEnd = new ObjectStep(this, ObjectID.GHORROCK_DUNGEON_CAVE_ENTRY, new WorldPoint(2908, 10317, 0), "Speak to Jhallan in the Muspah room."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveChestCode.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveChestCode.java index 2c0bd1ed977..012f0c45153 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveChestCode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveChestCode.java @@ -30,6 +30,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarClientIntChanged; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarClientID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.FontManager; @@ -77,10 +78,10 @@ public void onVarClientIntChanged(VarClientIntChanged varClientIntChanged) private void updateSolvedPositionState() { - final int SLOT_ONE = 1113; - final int SLOT_TWO = 1114; - final int SLOT_THREE = 1115; - final int SLOT_FOUR = 1116; + final int SLOT_ONE = VarClientID.COMBINATION_LOCK_VALUE_0; + final int SLOT_TWO = VarClientID.COMBINATION_LOCK_VALUE_1; + final int SLOT_THREE = VarClientID.COMBINATION_LOCK_VALUE_2; + final int SLOT_FOUR = VarClientID.COMBINATION_LOCK_VALUE_3; final int ENTRY_ONE = 7; final int ENTRY_TWO = 4; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveDoorCode.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveDoorCode.java index 322118f8cfd..a78efcc88a4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveDoorCode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/SolveDoorCode.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarClientIntChanged; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarClientID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.FontManager; @@ -80,11 +81,11 @@ public void onVarClientIntChanged(VarClientIntChanged varClientIntChanged) private void updateSolvedPositionState() { - final int SLOT_ONE = 1113; - final int SLOT_TWO = 1114; - final int SLOT_THREE = 1115; - final int SLOT_FOUR = 1116; - final int SLOT_FIVE = 1117; + final int SLOT_ONE = VarClientID.COMBINATION_LOCK_VALUE_0; + final int SLOT_TWO = VarClientID.COMBINATION_LOCK_VALUE_1; + final int SLOT_THREE = VarClientID.COMBINATION_LOCK_VALUE_2; + final int SLOT_FOUR = VarClientID.COMBINATION_LOCK_VALUE_3; + final int SLOT_FIVE = VarClientID.COMBINATION_LOCK_VALUE_4; final int ENTRY_ONE = 3; final int ENTRY_TWO = 5; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/TellAboutMurder.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/TellAboutMurder.java index 69063aae079..56d978b217e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/TellAboutMurder.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/secretsofthenorth/TellAboutMurder.java @@ -30,6 +30,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; public class TellAboutMurder extends NpcStep @@ -49,9 +50,9 @@ public void onGameTick(GameTick event) private void updateCorrectChoice() { - boolean saidAboutWindow = client.getVarbitValue(14731) == 1; - boolean saidAboutCeril = client.getVarbitValue(14730) == 1; - boolean saidAboutWall = client.getVarbitValue(14732) == 1; + boolean saidAboutWindow = client.getVarbitValue(VarbitID.SOTN_EXPLAINED_WINDOW) == 1; + boolean saidAboutCeril = client.getVarbitValue(VarbitID.SOTN_EXPLAINED_BODY) == 1; + boolean saidAboutWall = client.getVarbitValue(VarbitID.SOTN_EXPLAINED_CHEST) == 1; choices = new DialogChoiceSteps(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadesofmortton/ShadesOfMortton.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadesofmortton/ShadesOfMortton.java index f1a6ff452f6..3070b0ecbf0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadesofmortton/ShadesOfMortton.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadesofmortton/ShadesOfMortton.java @@ -75,7 +75,7 @@ public Map loadSteps() Map steps = new HashMap<>(); ConditionalStep goReadDiary = new ConditionalStep(this, searchShelf); - goReadDiary.addStep(diary.alsoCheckBank(questBank), readDiary); + goReadDiary.addStep(diary.alsoCheckBank(), readDiary); steps.put(0, goReadDiary); steps.put(5, addAshes); @@ -112,7 +112,7 @@ public Map loadSteps() steps.put(60, makeSacredOil); ConditionalStep saveRemains = new ConditionalStep(this, repairTemple); - saveRemains.addStep(new Conditions(serum208.alsoCheckBank(questBank), sacredOilHighlighted), useOilOnLog); + saveRemains.addStep(new Conditions(serum208.alsoCheckBank(), sacredOilHighlighted), useOilOnLog); saveRemains.addStep(new Conditions(litFire, has20Sanctity, sacredOilHighlighted), use207OnFlame); saveRemains.addStep(new Conditions(litFire, has20Sanctity), useOilOnFlame); saveRemains.addStep(litFire, repairTo20Sanctity); @@ -200,14 +200,12 @@ protected void setupRequirements() public void setupConditions() { - has20Sanctity = new VarplayerRequirement(341, 20); - razmirePartlyCured = new VarplayerRequirement(VarPlayerID.MORTTONMULTI, true, 3); curedRazmire = new VarplayerRequirement(VarPlayerID.MORTTONMULTI, true, 6); //64 ulsquirePartlyCured = new VarplayerRequirement(VarPlayerID.MORTTONMULTI, true, 1); curedUlsquire = new VarplayerRequirement(VarPlayerID.MORTTONMULTI, true, 5); - repairedTemple = new VarplayerRequirement(343, 100); + repairedTemple = new VarplayerRequirement(VarPlayerID.TEMPLE_REPAIRED_P, 100); has20Sanctity = new VarplayerRequirement(VarPlayerID.TEMPLE_SANCTITY_P, 20, Operation.GREATER_EQUAL); litFire = new ObjectCondition(ObjectID.TEMPLEFIRE_ALTAR, new WorldPoint(3506, 3316, 0)); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/IncantationStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/IncantationStep.java index 3420e73af02..8de06b032d4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/IncantationStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/IncantationStep.java @@ -32,6 +32,7 @@ import net.runelite.api.events.WidgetLoaded; import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -44,31 +45,31 @@ public class IncantationStep extends DetailedQuestStep * The order of the words received by Denath is reverse. * The value of this varbit maps to the {@link IncantationStep#WORDS} array. */ - private static final @Varbit int INCANTATION_WORD_1 = 1373; + private static final @Varbit int INCANTATION_WORD_1 = VarbitID.AGRITH_INCANTATION_1; /** * The index of the second word in the incantation, as per the order of the Demonic tome (reverse of the order Denath gives you). * The order of the words received by Denath is reverse. * The value of this varbit maps to the {@link IncantationStep#WORDS} array. */ - private static final @Varbit int INCANTATION_WORD_2 = 1374; + private static final @Varbit int INCANTATION_WORD_2 = VarbitID.AGRITH_INCANTATION_2; /** * The index of the third word in the incantation, as per the order of the Demonic tome (reverse of the order Denath gives you). * The order of the words received by Denath is reverse. * The value of this varbit maps to the {@link IncantationStep#WORDS} array. */ - private static final @Varbit int INCANTATION_WORD_3 = 1375; + private static final @Varbit int INCANTATION_WORD_3 = VarbitID.AGRITH_INCANTATION_3; /** * The index of the fourth word in the incantation, as per the order of the Demonic tome (reverse of the order Denath gives you). * The order of the words received by Denath is reverse. * The value of this varbit maps to the {@link IncantationStep#WORDS} array. */ - private static final @Varbit int INCANTATION_WORD_4 = 1376; + private static final @Varbit int INCANTATION_WORD_4 = VarbitID.AGRITH_INCANTATION_4; /** * The index of the fifth word in the incantation, as per the order of the Demonic tome (reverse of the order Denath gives you). * The order of the words received by Denath is reverse. * The value of this varbit maps to the {@link IncantationStep#WORDS} array. */ - private static final @Varbit int INCANTATION_WORD_5 = 1377; + private static final @Varbit int INCANTATION_WORD_5 = VarbitID.AGRITH_INCANTATION_5; /** * The possible words that that can be used the incantation diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/SearchKilns.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/SearchKilns.java index e225c39b49a..36faf859532 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/SearchKilns.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowofthestorm/SearchKilns.java @@ -31,6 +31,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -54,7 +55,7 @@ public void onGameTick(GameTick event) @Override protected void updateSteps() { - int correctKiln = client.getVarbitValue(1378); + int correctKiln = client.getVarbitValue(VarbitID.AGRITH_KILN); if (correctKiln == 0) { startUpStep(searchKiln1); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowsofcustodia/ShadowsOfCustodia.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowsofcustodia/ShadowsOfCustodia.java index 2b0db258100..6ab1fd4999d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowsofcustodia/ShadowsOfCustodia.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shadowsofcustodia/ShadowsOfCustodia.java @@ -34,8 +34,8 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.TeleportItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -43,15 +43,7 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; @@ -60,6 +52,13 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; + /** * The quest guide for the "Shadows of Custodia" OSRS quest */ @@ -122,9 +121,9 @@ public class ShadowsOfCustodia extends BasicQuestHelper @Override public Map loadSteps() { - setupZones(); - setupRequirements(); + initializeRequirements(); setupSteps(); + var steps = new HashMap(); steps.put(0, startQuest); @@ -304,17 +303,15 @@ public List getGeneralRecommended() ); } - @Override - public List getNotes() - { - return List.of( - ); - } - @Override public List getGeneralRequirements() { return List.of( + new QuestRequirement(QuestHelperQuest.CHILDREN_OF_THE_SUN, QuestState.FINISHED), + new SkillRequirement(Skill.SLAYER, 54), + new SkillRequirement(Skill.FISHING, 45), + new SkillRequirement(Skill.CONSTRUCTION, 41), + new SkillRequirement(Skill.HUNTER, 36) ); } @@ -352,7 +349,7 @@ public List getUnlockRewards() } @Override - public ArrayList getPanels() + public List getPanels() { var panels = new ArrayList(); @@ -404,4 +401,4 @@ public ArrayList getPanels() return panels; } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepherder/SheepHerder.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepherder/SheepHerder.java index 8d1c7562594..8530d771fc4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepherder/SheepHerder.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepherder/SheepHerder.java @@ -27,11 +27,10 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitBuilder; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -43,134 +42,135 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class SheepHerder extends BasicQuestHelper { - //Items Required - ItemRequirement coins; + // Required items + ItemRequirement coins100; - //Items Recommended + // Recommended items ItemRequirement energyRestore; - ItemRequirement plagueJacket, plagueTrousers, cattleprod, sheepFeed, bones1, bones2, bones3, bones4; + // Mid-quest item requirements + ItemRequirement sheepFeed; + ItemRequirement plagueJacket; + ItemRequirement plagueTrousers; + ItemRequirement cattleprod; + ItemRequirement redSheepBones; + ItemRequirement greenSheepBones; + ItemRequirement blueSheepBones; + ItemRequirement yellowSheepBones; + + // Zones + Zone enclosure; - Requirement inEnclosure, sheep1InEnclosure, sheep2InEnclosure, sheep3InEnclosure, sheep4InEnclosure, - sheep1HasBones, sheep2HasBones, sheep3HasBones, sheep4HasBones, sheep1Burned, sheep2Burned, sheep3Burned, - sheep4Burned, allSheepBonesObtained, allSheepBurned, bonesNearby; + // Miscellaneous requirements + ZoneRequirement inEnclosure; - DetailedQuestStep talkToHalgrive, talkToOrbon, enterEnclosure, pickupCattleprod, prodSheep1, prodSheep2, - prodSheep3, prodSheep4, feedSheep, pickupBones, useBonesOnIncinerator, talkToHalgriveToFinish; + Conditions blueSheepInEnclosure; + Conditions blueSheepHasBones; + VarbitRequirement blueSheepBurned; - Zone enclosure; + Conditions yellowSheepInEnclosure; + Conditions yellowSheepHasBones; + VarbitRequirement yellowSheepBurned; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); + Conditions greenSheepInEnclosure; + Conditions greenSheepHasBones; + VarbitRequirement greenSheepBurned; - Map steps = new HashMap<>(); - steps.put(0, talkToHalgrive); - steps.put(1, talkToOrbon); + Conditions redSheepInEnclosure; + Conditions redSheepHasBones; + VarbitRequirement redSheepBurned; - ConditionalStep goBurnSheep = new ConditionalStep(this, enterEnclosure); - goBurnSheep.addStep(new Conditions(allSheepBurned), talkToHalgriveToFinish); - goBurnSheep.addStep(new Conditions(allSheepBonesObtained), useBonesOnIncinerator); - goBurnSheep.addStep(new Conditions(bonesNearby), pickupBones); - goBurnSheep.addStep(new Conditions(sheep1InEnclosure, sheep2InEnclosure, sheep3InEnclosure, - sheep4InEnclosure), feedSheep); - goBurnSheep.addStep(new Conditions(cattleprod, sheep1InEnclosure, sheep2InEnclosure, sheep3InEnclosure), - prodSheep4); - goBurnSheep.addStep(new Conditions(cattleprod, sheep1InEnclosure, sheep2InEnclosure), prodSheep3); - goBurnSheep.addStep(new Conditions(cattleprod, sheep1InEnclosure), prodSheep2); - goBurnSheep.addStep(cattleprod, prodSheep1); - goBurnSheep.addStep(inEnclosure, pickupCattleprod); - steps.put(2, goBurnSheep); + Conditions allSheepBonesObtained; + Conditions allSheepBurned; + Conditions bonesNearby; - return steps; + // Steps + NpcStep talkToHalgrive; + NpcStep talkToOrbon; + ObjectStep enterEnclosure; + ItemStep pickupCattleprod; + NpcStep prodBlueSheep; + NpcStep prodYellowSheep; + NpcStep prodGreenSheep; + NpcStep prodRedSheep; + NpcStep feedSheep; + ItemStep pickupBones; + ObjectStep useBonesOnIncinerator; + NpcStep talkToHalgriveToFinish; + + + @Override + protected void setupZones() + { + enclosure = new Zone(new WorldPoint(2595, 3351, 0), new WorldPoint(2609, 3364, 0)); } @Override protected void setupRequirements() { - coins = new ItemRequirement("Coins", ItemCollections.COINS); + // Sheep states: + // 0 = Sheep is loose + // 1 = Sheep has been prodded into the enclosure + // 2 = Sheep has been killed by the poisoned sheep food + // 6 = The bones of the sheep has been incinerated + var blueSheepState = new VarbitBuilder(VarbitID.SHEEPHERDER_SHEEP_C); + var yellowSheepState = new VarbitBuilder(VarbitID.SHEEPHERDER_SHEEP_D); + var greenSheepState = new VarbitBuilder(VarbitID.SHEEPHERDER_SHEEP_B); + var redSheepState = new VarbitBuilder(VarbitID.SHEEPHERDER_SHEEP_A); + + coins100 = new ItemRequirement("Coins", ItemCollections.COINS, 100); energyRestore = new ItemRequirement("Energy restoring items", ItemCollections.RUN_RESTORE_ITEMS); + sheepFeed = new ItemRequirement("Sheep feed", ItemID.POISONED_FEED); + sheepFeed.setTooltip("You can get more from Halgrive"); plagueJacket = new ItemRequirement("Plague jacket", ItemID.PLAGUE_JACKET); plagueJacket.setTooltip("You can buy another from Doctor Orbon for 100 coins"); plagueTrousers = new ItemRequirement("Plague trousers", ItemID.PLAGUE_TROUSERS); plagueTrousers.setTooltip("You can buy another from Doctor Orbon for 100 coins"); cattleprod = new ItemRequirement("Cattle prod", ItemID.CATTLEPROD); - sheepFeed = new ItemRequirement("Sheep feed", ItemID.POISONED_FEED); - sheepFeed.setTooltip("You can get more from Halgrive"); - bones1 = new ItemRequirement("Sheep bones 1", ItemID.SHEEPBONESA); - bones2 = new ItemRequirement("Sheep bones 2", ItemID.SHEEPBONESB); - bones3 = new ItemRequirement("Sheep bones 3", ItemID.SHEEPBONESC); - bones4 = new ItemRequirement("Sheep bones 4", ItemID.SHEEPBONESD); - } - - @Override - protected void setupZones() - { - enclosure = new Zone(new WorldPoint(2595, 3351, 0), new WorldPoint(2609, 3364, 0)); - } - - private void setupConditions() - { + redSheepBones = new ItemRequirement("Sheep bones 1", ItemID.SHEEPBONESA); + greenSheepBones = new ItemRequirement("Sheep bones 2", ItemID.SHEEPBONESB); + blueSheepBones = new ItemRequirement("Sheep bones 3", ItemID.SHEEPBONESC); + yellowSheepBones = new ItemRequirement("Sheep bones 4", ItemID.SHEEPBONESD); inEnclosure = new ZoneRequirement(enclosure); - sheep1Burned = new VarbitRequirement(2233, 6); - sheep1HasBones = new Conditions(LogicType.OR, - bones3, - sheep1Burned - ); - sheep1InEnclosure = new Conditions(LogicType.OR, - new VarbitRequirement(2233, 1), - sheep1HasBones - ); + blueSheepBurned = blueSheepState.eq(6); + blueSheepHasBones = or(blueSheepBones, blueSheepBurned); + blueSheepInEnclosure = or(blueSheepState.eq(1), blueSheepHasBones); - sheep2Burned = new VarbitRequirement(2234, 6); - sheep2HasBones = new Conditions(LogicType.OR, - bones4, - sheep2Burned - ); - sheep2InEnclosure = new Conditions(LogicType.OR, - new VarbitRequirement(2234, 1), - sheep2HasBones - ); + yellowSheepBurned = yellowSheepState.eq(6); + yellowSheepHasBones = or(yellowSheepBones, yellowSheepBurned); + yellowSheepInEnclosure = or(yellowSheepState.eq(1), yellowSheepHasBones); - sheep3Burned = new VarbitRequirement(2232, 6); - sheep3HasBones = new Conditions(LogicType.OR, - bones2, - sheep3Burned - ); - sheep3InEnclosure = new Conditions(LogicType.OR, - new VarbitRequirement(2232, 1), - sheep3HasBones - ); + greenSheepBurned = greenSheepState.eq(6); + greenSheepHasBones = or(greenSheepBones, greenSheepBurned); + greenSheepInEnclosure = or(greenSheepState.eq(1), greenSheepHasBones); - sheep4Burned = new VarbitRequirement(2231, 6); - sheep4HasBones = new Conditions(LogicType.OR, - bones1, - sheep4Burned - ); - sheep4InEnclosure = new Conditions(LogicType.OR, - new VarbitRequirement(2231, 1), - sheep4HasBones - ); + redSheepBurned = redSheepState.eq(6); + redSheepHasBones = or(redSheepBones, redSheepBurned); + redSheepInEnclosure = or(redSheepState.eq(1), redSheepHasBones); - allSheepBonesObtained = new Conditions(sheep1HasBones, sheep2HasBones, sheep3HasBones, sheep4HasBones); - allSheepBurned = new Conditions(sheep1Burned, sheep2Burned, sheep3Burned, sheep4Burned); + allSheepBonesObtained = and(blueSheepHasBones, yellowSheepHasBones, greenSheepHasBones, redSheepHasBones); + allSheepBurned = and(blueSheepBurned, yellowSheepBurned, greenSheepBurned, redSheepBurned); - bonesNearby = new Conditions(LogicType.OR, - new ItemOnTileRequirement(bones1), - new ItemOnTileRequirement(bones2), - new ItemOnTileRequirement(bones3), - new ItemOnTileRequirement(bones4) + bonesNearby = or( + new ItemOnTileRequirement(redSheepBones), + new ItemOnTileRequirement(greenSheepBones), + new ItemOnTileRequirement(blueSheepBones), + new ItemOnTileRequirement(yellowSheepBones) ); } @@ -178,59 +178,94 @@ public void setupSteps() { talkToHalgrive = new NpcStep(this, NpcID.COUNCILLOR_HALGRIVE_VIS, new WorldPoint(2615, 3298, 0), "Talk to Councillor Halgrive outside the East Ardougne church."); - talkToHalgrive.addDialogSteps("What's wrong?", "I can do that for you."); + talkToHalgrive.addDialogSteps("What's wrong?", "Yes."); + talkToOrbon = new NpcStep(this, NpcID.DOCTOR_ORBON, new WorldPoint(2616, 3306, 0), - "Talk to Doctor Orbon in the East Ardougne Church.", coins.quantity(100)); + "Talk to Doctor Orbon in the East Ardougne Church.", coins100); talkToOrbon.addDialogStep("Okay, I'll take it."); + enterEnclosure = new ObjectStep(this, ObjectID.PLAGUESHEEP_GATEL, new WorldPoint(2594, 3362, 0), - "Enter the enclosure north of Ardougne.", plagueJacket.equipped(), plagueTrousers.equipped()); - pickupCattleprod = new DetailedQuestStep(this, new WorldPoint(2604, 3357, 0), "Pickup the nearby cattleprod.", + "Enter the enclosure north of Ardougne wearing the plague jacket and trousers.", plagueJacket.equipped(), plagueTrousers.equipped()); + + pickupCattleprod = new ItemStep(this, new WorldPoint(2604, 3357, 0), "Pick up the nearby cattleprod.", cattleprod); - prodSheep1 = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_3, new WorldPoint(2562, 3389, 0), + prodBlueSheep = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_3, new WorldPoint(2562, 3389, 0), "Prod one of the blue sheep north west of the enclosure to the enclosure gate.", true, cattleprod.equipped(), plagueJacket.equipped(), plagueTrousers.equipped()); - prodSheep1.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); - prodSheep2 = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_4, new WorldPoint(2610, 3389, 0), + prodBlueSheep.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); + prodYellowSheep = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_4, new WorldPoint(2610, 3389, 0), "Prod one of the yellow sheep north of the enclosure to the enclosure gate.", true, cattleprod.equipped(), plagueJacket.equipped(), plagueTrousers.equipped()); - prodSheep2.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); - prodSheep3 = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_2, new WorldPoint(2621, 3367, 0), - "Prod one of the green sheep east of the enclosure to the enclosure gate.", + prodYellowSheep.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); + prodGreenSheep = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_2, new WorldPoint(2621, 3367, 0), + "Prod one of the green sheep east of the enclosure to the enclosure gate.", true, cattleprod.equipped(), plagueJacket.equipped(), plagueTrousers.equipped()); - prodSheep3.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); - prodSheep4 = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_1, new WorldPoint(2609, 3347, 0), - "Prod one of the red sheep south east of the enclosure to the enclosure gate.", + prodGreenSheep.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); + prodRedSheep = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_1, new WorldPoint(2609, 3347, 0), + "Prod one of the red sheep south east of the enclosure to the enclosure gate.", true, cattleprod.equipped(), plagueJacket.equipped(), plagueTrousers.equipped()); - prodSheep4.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); + prodRedSheep.addTileMarker(new QuestTile(new WorldPoint(2594, 3362, 0))); - pickupBones = new ItemStep(this, "Pickup the bones.", bones1.hideConditioned(sheep4HasBones), - bones2.hideConditioned(sheep3HasBones), bones3.hideConditioned(sheep1HasBones), - bones4.hideConditioned(sheep2HasBones)); + pickupBones = new ItemStep(this, "Pick up the bones.", redSheepBones.hideConditioned(redSheepHasBones), + greenSheepBones.hideConditioned(greenSheepHasBones), blueSheepBones.hideConditioned(blueSheepHasBones), + yellowSheepBones.hideConditioned(yellowSheepHasBones)); feedSheep = new NpcStep(this, NpcID.HERDER_PLAGUESHEEP_3, new WorldPoint(2597, 3361, 0), "Feed the sheep the sheep feed.", true, sheepFeed.highlighted()); feedSheep.addIcon(ItemID.POISONED_FEED); - ((NpcStep) feedSheep).setMaxRoamRange(3); - ((NpcStep) feedSheep).addAlternateNpcs(NpcID.HERDER_PLAGUESHEEP_2, NpcID.HERDER_PLAGUESHEEP_1, NpcID.HERDER_PLAGUESHEEP_4); + feedSheep.setMaxRoamRange(3); + feedSheep.addAlternateNpcs(NpcID.HERDER_PLAGUESHEEP_2, NpcID.HERDER_PLAGUESHEEP_1, NpcID.HERDER_PLAGUESHEEP_4); useBonesOnIncinerator = new ObjectStep(this, ObjectID.PLAGUESHEEP_FURNACE, new WorldPoint(2607, 3361, 0), - "Pickup the bones and incinerate them.", bones1.highlighted().hideConditioned(sheep4Burned), - bones2.highlighted().hideConditioned(sheep3Burned), bones3.highlighted().hideConditioned(sheep1Burned), - bones4.highlighted().hideConditioned(sheep2Burned)); + "Pick up the bones and incinerate them.", redSheepBones.highlighted().hideConditioned(redSheepBurned), + greenSheepBones.highlighted().hideConditioned(greenSheepBurned), blueSheepBones.highlighted().hideConditioned(blueSheepBurned), + yellowSheepBones.highlighted().hideConditioned(yellowSheepBurned)); useBonesOnIncinerator.addIcon(ItemID.SHEEPBONESA); talkToHalgriveToFinish = new NpcStep(this, NpcID.COUNCILLOR_HALGRIVE_VIS, new WorldPoint(2615, 3298, 0), "Return to Councillor Halgrive."); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToHalgrive); + + steps.put(1, talkToOrbon); + + var goBurnSheep = new ConditionalStep(this, enterEnclosure); + goBurnSheep.addStep(allSheepBurned, talkToHalgriveToFinish); + goBurnSheep.addStep(allSheepBonesObtained, useBonesOnIncinerator); + goBurnSheep.addStep(bonesNearby, pickupBones); + goBurnSheep.addStep(and(blueSheepInEnclosure, yellowSheepInEnclosure, greenSheepInEnclosure, redSheepInEnclosure), feedSheep); + goBurnSheep.addStep(and(cattleprod, blueSheepInEnclosure, yellowSheepInEnclosure, greenSheepInEnclosure), prodRedSheep); + goBurnSheep.addStep(and(cattleprod, blueSheepInEnclosure, yellowSheepInEnclosure), prodGreenSheep); + goBurnSheep.addStep(and(cattleprod, blueSheepInEnclosure), prodYellowSheep); + goBurnSheep.addStep(cattleprod, prodBlueSheep); + goBurnSheep.addStep(inEnclosure, pickupCattleprod); + steps.put(2, goBurnSheep); + + return steps; + } + + @Override public List getItemRequirements() { - return Collections.singletonList(coins.quantity(100)); + return List.of( + coins100 + ); } @Override public List getItemRecommended() { - return Collections.singletonList(energyRestore); + return List.of( + energyRestore + ); } @Override @@ -242,18 +277,39 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Collections.singletonList(new ItemReward("Coins", ItemID.COINS, 3100)); + return List.of( + new ItemReward("Coins", ItemID.COINS, 3100) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting out", Arrays.asList(talkToHalgrive, talkToOrbon), coins.quantity(100))); - allSteps.add(new PanelDetails("Killing sheep", Arrays.asList(enterEnclosure, pickupCattleprod, prodSheep1, - prodSheep2, prodSheep3, prodSheep4, feedSheep, pickupBones, useBonesOnIncinerator, talkToHalgriveToFinish), - plagueJacket, plagueTrousers)); - - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting out", List.of( + talkToHalgrive, + talkToOrbon + ), List.of( + coins100 + ))); + + sections.add(new PanelDetails("Killing sheep", List.of( + enterEnclosure, + pickupCattleprod, + prodBlueSheep, + prodYellowSheep, + prodGreenSheep, + prodRedSheep, + feedSheep, + pickupBones, + useBonesOnIncinerator, + talkToHalgriveToFinish + ), List.of( + plagueJacket, + plagueTrousers + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepshearer/SheepShearer.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepshearer/SheepShearer.java index 3f35bb58810..1c57e982283 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepshearer/SheepShearer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sheepshearer/SheepShearer.java @@ -29,35 +29,27 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.ManualRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.nor; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ItemStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; import net.runelite.client.plugins.microbot.questhelper.util.QHObjectID; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.ItemContainerChanged; +import net.runelite.api.gameval.*; +import net.runelite.client.eventbus.Subscribe; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.IntStream; -import net.runelite.api.Skill; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.events.ItemContainerChanged; -import net.runelite.api.gameval.InventoryID; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; -import net.runelite.client.eventbus.Subscribe; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; public class SheepShearer extends BasicQuestHelper { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravBlackArmGang.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravBlackArmGang.java index b3b63f748c5..8065d58655a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravBlackArmGang.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravBlackArmGang.java @@ -41,11 +41,7 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.*; import java.util.*; @@ -86,16 +82,16 @@ public Map loadSteps() gettingTheCrossbows.addStep(twoPhoenixCrossbow, returnToKatrine); gettingTheCrossbows.addStep(new Conditions(weaponMasterAlive, inStoreRoom), killWeaponsMaster); gettingTheCrossbows.addStep(inStoreRoom, pickupTwoCrossbows); - gettingTheCrossbows.addStep(storeRoomKey.alsoCheckBank(questBank), goUpToWeaponStore); + gettingTheCrossbows.addStep(storeRoomKey.alsoCheckBank(), goUpToWeaponStore); steps.put(2, gettingTheCrossbows); ConditionalStep completeQuest = new ConditionalStep(this, goUpstairsInBase); - completeQuest.addStep(certificate.alsoCheckBank(questBank), talkToRoald); - completeQuest.addStep(new Conditions(certificateHalf.alsoCheckBank(questBank), phoenixCertificateHalf.alsoCheckBank(questBank)), combineCertificate); - completeQuest.addStep(certificateHalf.alsoCheckBank(questBank), tradeCertificateHalf); - completeQuest.addStep(new Conditions(shieldHalf.alsoCheckBank(questBank), isUpstairsInBase), goDownstairsInBase); - completeQuest.addStep(shieldHalf.alsoCheckBank(questBank), talkToHaig); + completeQuest.addStep(certificate.alsoCheckBank(), talkToRoald); + completeQuest.addStep(new Conditions(certificateHalf.alsoCheckBank(), phoenixCertificateHalf.alsoCheckBank()), combineCertificate); + completeQuest.addStep(certificateHalf.alsoCheckBank(), tradeCertificateHalf); + completeQuest.addStep(new Conditions(shieldHalf.alsoCheckBank(), isUpstairsInBase), goDownstairsInBase); + completeQuest.addStep(shieldHalf.alsoCheckBank(), talkToHaig); completeQuest.addStep(new Conditions(isUpstairsInBase, cupboardOpen), getShieldFromCupboard1); completeQuest.addStep(isUpstairsInBase, getShieldFromCupboard); @@ -185,7 +181,7 @@ public void setupSteps() talkToHaig = new NpcStep(this, NpcID.CURATOR, new WorldPoint(3255, 3449, 0), "Talk to Curator Haig in the Varrock Museum.", shieldHalf); talkToHaig.addSubSteps(goDownstairsInBase); - talkToRoald = new NpcStep(this, NpcID.SUROK_KING, new WorldPoint(3222, 3473, 0), "Talk to King Roald in Varrock Castle to finish the quest.", certificate); + talkToRoald = new NpcStep(this, NpcID.KING_ROALD, new WorldPoint(3222, 3473, 0), "Talk to King Roald in Varrock Castle to finish the quest.", certificate); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravPhoenixGang.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravPhoenixGang.java index 773f47af3b9..f0f58b1e2d3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravPhoenixGang.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shieldofarrav/ShieldOfArravPhoenixGang.java @@ -78,18 +78,18 @@ public Map loadSteps() ConditionalStep goToKillJonny = new ConditionalStep(this, killJonny); goToKillJonny.addStep(new Conditions(intelReport, inPhoenixEntry), talkToStravenAgain); - goToKillJonny.addStep(intelReport.alsoCheckBank(questBank), returnDownLadder); + goToKillJonny.addStep(intelReport.alsoCheckBank(), returnDownLadder); goToKillJonny.addStep(intelReportNearby, pickupIntelReport); goToKillJonny.addStep(inPhoenixEntry, goUpFromPhoenixGang); steps.put(8, goToKillJonny); ConditionalStep completeQuest = new ConditionalStep(this, returnDownLadder); - completeQuest.addStep(certificate.alsoCheckBank(questBank), talkToRoald); - completeQuest.addStep(new Conditions(certificateHalf.alsoCheckBank(questBank), blackArmCertificateHalf.alsoCheckBank(questBank)), combineCertificate); - completeQuest.addStep(certificateHalf.alsoCheckBank(questBank), tradeCertificateHalf); - completeQuest.addStep(new Conditions(inPhoenixBase, shieldHalf.alsoCheckBank(questBank)), leaveAfterGettingShieldHalf); - completeQuest.addStep(shieldHalf.alsoCheckBank(questBank), talkToHaig); + completeQuest.addStep(certificate.alsoCheckBank(), talkToRoald); + completeQuest.addStep(new Conditions(certificateHalf.alsoCheckBank(), blackArmCertificateHalf.alsoCheckBank()), combineCertificate); + completeQuest.addStep(certificateHalf.alsoCheckBank(), tradeCertificateHalf); + completeQuest.addStep(new Conditions(inPhoenixBase, shieldHalf.alsoCheckBank()), leaveAfterGettingShieldHalf); + completeQuest.addStep(shieldHalf.alsoCheckBank(), talkToHaig); completeQuest.addStep(new Conditions(inPhoenixBase, chestOpen), getShieldHalf1); completeQuest.addStep(inPhoenixBase, getShieldHalf); @@ -147,7 +147,7 @@ public void setupSteps() goUpFromPhoenixGang = new ObjectStep(this, ObjectID.PHOENIXLADDER, new WorldPoint(3244, 9783, 0), "Go back up to the surface."); - killJonny = new NpcStep(this, NpcID.JONNY_THE_BEARD_1OP, new WorldPoint(3222, 3395, 0), + killJonny = new NpcStep(this, NpcID.JONNY_THE_BEARD_2OP, new WorldPoint(3222, 3395, 0), "Kill Jonny the Beard in the Blue Moon Inn in Varrock."); pickupIntelReport = new DetailedQuestStep(this, "Pick up the Intel Report.", intelReport); returnDownLadder = new ObjectStep(this, ObjectID.FAI_VARROCK_LADDER_DEEP, new WorldPoint(3244, 3383, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shilovillage/ShiloVillage.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shilovillage/ShiloVillage.java index 814f169a877..df86791175b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shilovillage/ShiloVillage.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/shilovillage/ShiloVillage.java @@ -94,7 +94,7 @@ public Map loadSteps() Map steps = new HashMap<>(); ConditionalStep goStartQuest = new ConditionalStep(this, talkToMosol); - goStartQuest.addStep(belt.alsoCheckBank(questBank), useBeltOnTrufitus); + goStartQuest.addStep(belt.alsoCheckBank(), useBeltOnTrufitus); steps.put(0, goStartQuest); steps.put(1, useSpadeOnGround); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/DoorPuzzleStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/DoorPuzzleStep.java index 1263490cfe5..5072ce38e90 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/DoorPuzzleStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/DoorPuzzleStep.java @@ -40,9 +40,9 @@ import javax.inject.Inject; import java.awt.*; +import java.util.*; import java.util.List; import java.util.Queue; -import java.util.*; @Slf4j public class DoorPuzzleStep extends DetailedQuestStep diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/SinsOfTheFather.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/SinsOfTheFather.java index c5f38366a4d..b99e6b0f0bb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/SinsOfTheFather.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sinsofthefather/SinsOfTheFather.java @@ -258,13 +258,13 @@ public Map loadSteps() steps.put(110, valveStep); ConditionalStep getLogs = new ConditionalStep(this, cutLogs); - getLogs.addStep(blisterwood8.alsoCheckBank(questBank), bringVanesculaLogs); + getLogs.addStep(blisterwood8.alsoCheckBank(), bringVanesculaLogs); steps.put(112, getLogs); ConditionalStep bringItemsToVertida = new ConditionalStep(this, cutLogs); bringItemsToVertida.addStep(new Conditions(inNewBase, blisterwood8), bringVertidaLogs); - bringItemsToVertida.addStep(blisterwood8.alsoCheckBank(questBank), goDownToVerditaWithLogs); + bringItemsToVertida.addStep(blisterwood8.alsoCheckBank(), goDownToVerditaWithLogs); steps.put(114, bringItemsToVertida); steps.put(116, talkToVertidaForFlail); @@ -347,11 +347,11 @@ public void setupConditions() inPuzzleInterface = new WidgetTextRequirement(665, 7, "1"); - talkedToKael = new VarbitRequirement(10347, 1); - talkedToVertida = new VarbitRequirement(10348, 1); - talkedToPolmafi = new VarbitRequirement(10350, 2); - talkedToRadigad = new VarbitRequirement(10351, 1); - talkedToIvan = new VarbitRequirement(10349, 1); + talkedToKael = new VarbitRequirement(VarbitID.MYQ5_KAEL_CONVINCED, 1); + talkedToVertida = new VarbitRequirement(VarbitID.MYQ5_VERTIDA_CONVINCED, 1); + talkedToPolmafi = new VarbitRequirement(VarbitID.MYQ5_POLMAFI_CONVINCED, 2); + talkedToRadigad = new VarbitRequirement(VarbitID.MYQ5_RADIGAD_CONVINCED, 1); + talkedToIvan = new VarbitRequirement(VarbitID.MYQ5_IVAN_CONVINCED, 1); } @Override @@ -656,7 +656,7 @@ public void setupSteps() talkToPolmafi = new NpcStep(this, NpcID.MYQ5_POLMAFI_CHILD, new WorldPoint(3599, 9612, 0), "Bring a Vyrewatch disguise to Polmafi in the Meiyerditch hideout in Old Man Ral's basement.", vyreTop, vyreLegs, vyreShoes); talkToPolmafi.addDialogStep("Here you go."); - talkToPolmafiMore = new NpcStep(this, 9554, new WorldPoint(3599, 9612, 0), + talkToPolmafiMore = new NpcStep(this, NpcID.MYQ5_POLMAFI_CHILD, new WorldPoint(3599, 9612, 0), "Finish speaking to Polmafi in the Meiyerditch hideout."); talkToPolmafiMore.addDialogStep("Here you go."); talkToPolmafi.addSubSteps(talkToPolmafiMore, goDownToPolmafi, goDownToPolmafiNoItems); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sleepinggiants/SleepingGiants.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sleepinggiants/SleepingGiants.java index fd85a8ad70f..a0743034f23 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sleepinggiants/SleepingGiants.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/sleepinggiants/SleepingGiants.java @@ -245,9 +245,9 @@ public void setupConditions() preformObtained = new VarbitRequirement(VarbitID.SLEEPING_GIANTS_TUTORIAL, 50, Operation.GREATER_EQUAL); selectingMould = new WidgetPresenceRequirement(718, 2); - noForteSelected = new VarbitRequirement(13910, 0); - noBladeSelected = new VarbitRequirement(13911, 0); - noTipSelected = new VarbitRequirement(13912, 0); + noForteSelected = new VarbitRequirement(VarbitID.GIANTS_FOUNDRY_MOULD_SELECTED_RICASSO, 0); + noBladeSelected = new VarbitRequirement(VarbitID.GIANTS_FOUNDRY_MOULD_SELECTED_BLADE, 0); + noTipSelected = new VarbitRequirement(VarbitID.GIANTS_FOUNDRY_MOULD_SELECTED_TIP, 0); forteTabOpen = new WidgetSpriteRequirement(718, 12, 1, 297); bladeTabOpen = new WidgetSpriteRequirement(718, 12, 10, 297); tipTabOpen = new WidgetSpriteRequirement(718, 12, 19, 297); @@ -264,7 +264,7 @@ public void setupConditions() metalTooHotForPolishing = new VarbitRequirement(VarbitID.GIANTS_FOUNDRY_PREFORM_TEMPERATURE, 333, Operation.GREATER_EQUAL); metalTooCoolForPolishing = new VarbitRequirement(VarbitID.GIANTS_FOUNDRY_PREFORM_TEMPERATURE, 30, Operation.LESS_EQUAL); - swordMade = new VarbitRequirement(13949, 1000); + swordMade = new VarbitRequirement(VarbitID.GIANTS_FOUNDRY_PREFORM_COMPLETION, 1000); preformHandedIn = new VarbitRequirement(VarbitID.SLEEPING_GIANTS_TUTORIAL, 55, Operation.GREATER_EQUAL); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/AmloddLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/AmloddLightPuzzle.java index 33206dc1d68..761dd0eb0b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/AmloddLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/AmloddLightPuzzle.java @@ -37,6 +37,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -264,30 +265,30 @@ protected void setupConditions() int RED = 5; int GREEN = 7; - notResetCrwys = new VarbitRequirement(8958, MAGENTA); + notResetCrwys = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_B_5_TO_1_A_5, MAGENTA); r1 = new Conditions( - new VarbitRequirement(8947, MAGENTA), // North - new VarbitRequirement(8969, MAGENTA) // West + new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_4_TO_1_D_4, MAGENTA), // North + new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_4_TO_1_D_5, MAGENTA) // West ); - r2 = new Conditions(new VarbitRequirement(8948, MAGENTA), r1); - r3 = new Conditions(new VarbitRequirement(8949, RED), r1); - r4 = new Conditions(new VarbitRequirement(8950, RED), r1); - r5 = new Conditions(new VarbitRequirement(8952, RED), r1); - r6 = new Conditions(new VarbitRequirement(8954, RED), r1); - r7 = new Conditions(new VarbitRequirement(8584, RED), r1); - r8 = new Conditions(new VarbitRequirement(8867, RED), r1); - r9 = new Conditions(new VarbitRequirement(8971, MAGENTA), r1); - r10 = new Conditions(new VarbitRequirement(8586, MAGENTA), r1); - r11 = new Conditions(new VarbitRequirement(8858, MAGENTA), r1); - r12 = new Conditions(new VarbitRequirement(8854, BLUE), r1); - r13 = new Conditions(new VarbitRequirement(8853, BLUE), r1); - r14 = new Conditions(new VarbitRequirement(8843, BLUE), r1); - r15 = new Conditions(new VarbitRequirement(8842, BLUE), r1); - r16 = new Conditions(new VarbitRequirement(8841, CYAN), r1); - r17 = new Conditions(new VarbitRequirement(8861, GREEN), r1); - r18 = new Conditions(new VarbitRequirement(8862, GREEN), r1); - r19 = new Conditions(new VarbitRequirement(8866, RED), r1); + r2 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_4_TO_1_C_5, MAGENTA), r1); + r3 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_5_TO_1_C_6, RED), r1); + r4 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_6_TO_1_D_6, RED), r1); + r5 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_6_TO_1_D_7, RED), r1); + r6 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_7_TO_1_C_7, RED), r1); + r7 = new Conditions(new VarbitRequirement(VarbitID.SOTE_PILLAR_0_C_7_TO_1_C_7, RED), r1); + r8 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_6_TO_0_C_7, RED), r1); + r9 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_5_TO_1_E_5, MAGENTA), r1); + r10 = new Conditions(new VarbitRequirement(VarbitID.SOTE_PILLAR_0_E_5_TO_1_E_5, MAGENTA), r1); + r11 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_4_TO_0_E_5, MAGENTA), r1); + r12 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_3_TO_0_E_3, BLUE), r1); + r13 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_2_TO_0_D_3, BLUE), r1); + r14 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_2_TO_0_D_2, BLUE), r1); + r15 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_2_TO_0_C_3, BLUE), r1); + r16 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_3_TO_0_C_4, CYAN), r1); + r17 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_4_TO_0_C_5, GREEN), r1); + r18 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_5_TO_0_D_5, GREEN), r1); + r19 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_6_TO_0_D_6, RED), r1); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/BaxtorianPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/BaxtorianPuzzle.java index 9dee6a4e69c..a4bfc8ac42c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/BaxtorianPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/BaxtorianPuzzle.java @@ -32,7 +32,6 @@ import net.runelite.client.plugins.microbot.questhelper.steps.DetailedOwnerStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.Client; -import net.runelite.api.GraphicID; import net.runelite.api.GraphicsObject; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; @@ -41,6 +40,7 @@ import net.runelite.api.events.WidgetLoaded; import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.SpotanimID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; @@ -142,7 +142,7 @@ public void onGraphicsObjectCreated(GraphicsObjectCreated event) { final GraphicsObject go = event.getGraphicsObject(); - if (go.getId() == GraphicID.GREY_BUBBLE_TELEPORT) + if (go.getId() == SpotanimID.SMOKEPUFF) { clientThread.invokeLater(() -> { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CadarnLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CadarnLightPuzzle.java index c3998ee719b..147c9cfdd6a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CadarnLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CadarnLightPuzzle.java @@ -40,6 +40,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -149,13 +150,13 @@ protected void setupConditions() int MAGENTA = 4; int BLUE = 3; - r1 = new VarbitRequirement(8971, MAGENTA); - r2 = new VarbitRequirement(8586, MAGENTA); - r3 = new VarbitRequirement(8858, MAGENTA); - r4 = new VarbitRequirement(8854, BLUE); - r5 = new VarbitRequirement(8853, BLUE); - r6 = new VarbitRequirement(8844, MAGENTA); - r7 = new VarbitRequirement(8845, MAGENTA); + r1 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_5_TO_1_E_5, MAGENTA); + r2 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_E_5_TO_1_E_5, MAGENTA); + r3 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_4_TO_0_E_5, MAGENTA); + r4 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_3_TO_0_E_3, BLUE); + r5 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_2_TO_0_D_3, BLUE); + r6 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_1_TO_0_D_2, MAGENTA); + r7 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_1_TO_0_E_1, MAGENTA); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CrwysLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CrwysLightPuzzle.java index 4d531fad051..0d7ad6635e9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CrwysLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/CrwysLightPuzzle.java @@ -37,6 +37,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -232,26 +233,26 @@ protected void setupConditions() int CYAN = 2; int MAGENTA = 4; - notResetCadarn = new VarbitRequirement(8971, MAGENTA); - r1 = new VarbitRequirement(8947, MAGENTA); - r2 = new VarbitRequirement(8948, MAGENTA); - r3 = new VarbitRequirement(8957, MAGENTA); + notResetCadarn = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_5_TO_1_E_5, MAGENTA); + r1 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_4_TO_1_D_4, MAGENTA); + r2 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_4_TO_1_C_5, MAGENTA); + r3 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_5_TO_1_B_5, MAGENTA); r4 = new Conditions( - new VarbitRequirement(8958, MAGENTA), - new VarbitRequirement(8959, MAGENTA) + new VarbitRequirement(VarbitID.SOTE_LIGHT_1_B_5_TO_1_A_5, MAGENTA), + new VarbitRequirement(VarbitID.SOTE_LIGHT_1_B_5_TO_1_B_6, MAGENTA) ); - r5 = new Conditions(new VarbitRequirement(8961, MAGENTA), r4); - r6 = new Conditions(new VarbitRequirement(9011, WHITE), r4); - r7 = new Conditions(new VarbitRequirement(8579, WHITE), r4); + r5 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_A_5_TO_1_A_6, MAGENTA), r4); + r6 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_1_A_6_TO_1_A_8, WHITE), r4); + r7 = new Conditions(new VarbitRequirement(VarbitID.SOTE_PILLAR_0_A_8_TO_1_A_8, WHITE), r4); - r8 = new Conditions(new VarbitRequirement(8873, WHITE), r4); - r9 = new Conditions(new VarbitRequirement(8583, WHITE), r4); + r8 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_0_A_8_TO_0_B_8, WHITE), r4); + r9 = new Conditions(new VarbitRequirement(VarbitID.SOTE_PILLAR_0_B_8_TO_1_B_8, WHITE), r4); - r10 = new Conditions(new VarbitRequirement(8605, CYAN), r4); + r10 = new Conditions(new VarbitRequirement(VarbitID.SOTE_PILLAR_1_B_8_TO_2_B_8, CYAN), r4); - r11 = new Conditions(new VarbitRequirement(8787, CYAN), r4); - r12 = new Conditions(new VarbitRequirement(8604, CYAN), r4); + r11 = new Conditions(new VarbitRequirement(VarbitID.SOTE_LIGHT_2_B_7_TO_2_B_8, CYAN), r4); + r12 = new Conditions(new VarbitRequirement(VarbitID.SOTE_PILLAR_1_B_7_TO_2_B_7, CYAN), r4); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/HefinLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/HefinLightPuzzle.java index a4b540faa2d..deea3c11688 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/HefinLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/HefinLightPuzzle.java @@ -37,6 +37,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -330,28 +331,28 @@ protected void setupConditions() int YELLOW = 6; int GREEN = 7; - notResetMeilyr = new VarbitRequirement(8741, YELLOW); - - r1 = new VarbitRequirement(8971, MAGENTA); - r2 = new VarbitRequirement(8586, MAGENTA); - r3 = new VarbitRequirement(8858, MAGENTA); - r4 = new VarbitRequirement(8854, BLUE); - r5 = new VarbitRequirement(8853, BLUE); - r6 = new VarbitRequirement(8843, BLUE); - r7 = new VarbitRequirement(8842, BLUE); - r8 = new VarbitRequirement(8838, BLUE); - r9 = new VarbitRequirement(8932, WHITE); - r10 = new VarbitRequirement(8931, WHITE); - r11 = new VarbitRequirement(8927, WHITE); - r12 = new VarbitRequirement(8577, GREEN); - r13 = new VarbitRequirement(8834, GREEN); - r14 = new VarbitRequirement(8580, GREEN); - - r15 = new VarbitRequirement(8837, BLUE); - r16 = new VarbitRequirement(8836, BLUE); - r17 = new VarbitRequirement(8578, BLUE); - r18 = new VarbitRequirement(8723, GREEN); - r19 = new VarbitRequirement(8725, GREEN); + notResetMeilyr = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_D_6_TO_2_D_5, YELLOW); + + r1 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_5_TO_1_E_5, MAGENTA); + r2 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_E_5_TO_1_E_5, MAGENTA); + r3 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_4_TO_0_E_5, MAGENTA); + r4 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_3_TO_0_E_3, BLUE); + r5 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_2_TO_0_D_3, BLUE); + r6 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_2_TO_0_D_2, BLUE); + r7 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_2_TO_0_C_3, BLUE); + r8 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_B_3_TO_0_C_3, BLUE); + r9 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_0_TO_1_C_1, WHITE); + r10 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_A_0_TO_1_C_0, WHITE); + r11 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_A_0_TO_1_A_1, WHITE); + r12 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_A_2_TO_1_A_2, GREEN); + r13 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_A_2_TO_0_B_2, GREEN); + r14 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_B_2_TO_1_B_2, GREEN); + + r15 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_B_4_TO_0_B_3, BLUE); + r16 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_A_4_TO_0_B_4, BLUE); + r17 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_A_4_TO_1_A_4, BLUE); + r18 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_B_2_TO_2_B_3, GREEN); + r19 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_B_3_TO_2_A_3, GREEN); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/IorwerthLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/IorwerthLightPuzzle.java index a48874fa157..ed9f0af8793 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/IorwerthLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/IorwerthLightPuzzle.java @@ -38,6 +38,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -446,50 +447,50 @@ protected void setupConditions() int YELLOW = 6; int GREEN = 7; - notResetTra = new VarbitRequirement(8773, YELLOW); + notResetTra = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_H_4_TO_2_I_4, YELLOW); - r1 = new VarbitRequirement(8987, GREEN); - r2 = new VarbitRequirement(8990, CYAN); - r3 = new VarbitRequirement(9002, CYAN); - r4 = new VarbitRequirement(8587, CYAN); - r5 = new VarbitRequirement(8876, CYAN); + r1 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_F_4_TO_1_F_5, GREEN); + r2 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_F_5_TO_1_F_6, CYAN); + r3 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_F_6_TO_1_E_6, CYAN); + r4 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_E_6_TO_1_E_6, CYAN); + r5 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_6_TO_0_E_7, CYAN); r6 = new Conditions( - new VarbitRequirement(8879, CYAN), // NORTH - new VarbitRequirement(8878, CYAN) // EAST + new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_7_TO_0_E_8, CYAN), // NORTH + new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_7_TO_0_F_7, CYAN) // EAST ); - r7 = new Conditions(r6, new VarbitRequirement(8881, CYAN)); - r8 = new Conditions(r6, new VarbitRequirement(8591, CYAN)); + r7 = new Conditions(r6, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_8_TO_0_F_8, CYAN)); + r8 = new Conditions(r6, new VarbitRequirement(VarbitID.SOTE_PILLAR_0_F_8_TO_1_F_8, CYAN)); - r9 = new Conditions(r8, new VarbitRequirement(8882, CYAN)); - r10 = new Conditions(r8, new VarbitRequirement(8883, CYAN)); - r11 = new Conditions(r8, new VarbitRequirement(8885, GREEN)); - r12 = new Conditions(r8, new VarbitRequirement(8886, GREEN)); - r13 = new Conditions(r8, new VarbitRequirement(8887, GREEN)); - r14 = new Conditions(r8, new VarbitRequirement(8888, GREEN)); - r15 = new Conditions(r8, new VarbitRequirement(8592, GREEN)); - r16 = new Conditions(r8, new VarbitRequirement(8992, GREEN)); + r9 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_F_7_TO_0_F_6, CYAN)); + r10 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_F_6_TO_0_G_6, CYAN)); + r11 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_G_6_TO_0_H_6, GREEN)); + r12 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_H_6_TO_0_H_7, GREEN)); + r13 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_H_7_TO_0_G_7, GREEN)); + r14 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_0_G_7_TO_0_G_8, GREEN)); + r15 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_PILLAR_0_G_8_TO_1_G_8, GREEN)); + r16 = new Conditions(r8, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_G_8_TO_1_G_7, GREEN)); // Back to cyan beam - r17 = new Conditions(r16, new VarbitRequirement(8614, BLUE)); + r17 = new Conditions(r16, new VarbitRequirement(VarbitID.SOTE_PILLAR_1_F_8_TO_2_F_8, BLUE)); // Start on yellow beam - r18 = new Conditions(r17, new VarbitRequirement(8974, YELLOW)); - r19 = new Conditions(r17, new VarbitRequirement(8982, YELLOW)); - r20 = new Conditions(r17, new VarbitRequirement(8983, RED)); - r21 = new Conditions(r17, new VarbitRequirement(8984, RED)); - r22 = new Conditions(r17, new VarbitRequirement(8985, RED)); - r23 = new Conditions(r17, new VarbitRequirement(8986, RED)); - r24 = new Conditions(r17, new VarbitRequirement(8995, RED)); - r25 = new Conditions(r17, new VarbitRequirement(8996, RED)); - r26 = new Conditions(r17, new VarbitRequirement(8625, RED)); - - r27 = new Conditions(r17, new VarbitRequirement(8825, RED)); - r28 = new Conditions(r17, new VarbitRequirement(8827, RED)); - r29 = new Conditions(r17, new VarbitRequirement(8823, RED)); - r30 = new Conditions(r17, new VarbitRequirement(8619, RED)); - - r31 = new Conditions(r30, new VarbitRequirement(8804, BLUE)); + r18 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_G_3_TO_1_G_4, YELLOW)); + r19 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_G_4_TO_1_H_4, YELLOW)); + r20 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_H_4_TO_1_I_4, RED)); + r21 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_I_4_TO_1_I_5, RED)); + r22 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_I_5_TO_1_H_5, RED)); + r23 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_H_5_TO_1_H_6, RED)); + r24 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_H_6_TO_1_I_6, RED)); + r25 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_1_I_6_TO_1_I_7, RED)); + r26 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_PILLAR_1_I_7_TO_2_I_7, RED)); + + r27 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_2_I_7_TO_2_I_8, RED)); + r28 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_2_I_8_TO_2_H_8, RED)); + r29 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_LIGHT_2_H_8_TO_2_H_7, RED)); + r30 = new Conditions(r17, new VarbitRequirement(VarbitID.SOTE_PILLAR_1_H_7_TO_2_H_7, RED)); + + r31 = new Conditions(r30, new VarbitRequirement(VarbitID.SOTE_LIGHT_2_F_7_TO_2_F_8, BLUE)); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/MeilyrLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/MeilyrLightPuzzle.java index 23f21fb0346..91784a32d9e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/MeilyrLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/MeilyrLightPuzzle.java @@ -38,6 +38,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -334,26 +335,26 @@ protected void setupConditions() int YELLOW = 6; int GREEN = 7; - notResetAmlodd = new VarbitRequirement(8861, GREEN); - - r1 = new VarbitRequirement(8971, MAGENTA); - r2 = new VarbitRequirement(8586, MAGENTA); - r3 = new VarbitRequirement(8858, MAGENTA); - r4 = new VarbitRequirement(8854, BLUE); - r5 = new VarbitRequirement(8853, BLUE); - r6 = new VarbitRequirement(8843, BLUE); - r7 = new VarbitRequirement(8842, BLUE); - r8 = new VarbitRequirement(8838, BLUE); - r9 = new VarbitRequirement(8837, BLUE); - r10 = new VarbitRequirement(8581, BLUE); - r11 = new VarbitRequirement(8603, MAGENTA); - r12 = new VarbitRequirement(8733, MAGENTA); - r13 = new VarbitRequirement(8602, YELLOW); - r14 = new VarbitRequirement(8764, YELLOW); - r15 = new VarbitRequirement(8742, YELLOW); - r16 = new VarbitRequirement(8741, YELLOW); - r17 = new VarbitRequirement(8739, YELLOW); - r18 = new VarbitRequirement(8738, YELLOW); + notResetAmlodd = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_4_TO_0_C_5, GREEN); + + r1 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_D_5_TO_1_E_5, MAGENTA); + r2 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_E_5_TO_1_E_5, MAGENTA); + r3 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_E_4_TO_0_E_5, MAGENTA); + r4 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_3_TO_0_E_3, BLUE); + r5 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_D_2_TO_0_D_3, BLUE); + r6 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_2_TO_0_D_2, BLUE); + r7 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_C_2_TO_0_C_3, BLUE); + r8 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_B_3_TO_0_C_3, BLUE); + r9 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_B_4_TO_0_B_3, BLUE); + r10 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_B_4_TO_1_B_4, BLUE); + r11 = new VarbitRequirement(VarbitID.SOTE_PILLAR_1_B_4_TO_2_B_4, MAGENTA); + r12 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_B_4_TO_2_B_5, MAGENTA); + r13 = new VarbitRequirement(VarbitID.SOTE_PILLAR_1_F_4_TO_2_F_4, YELLOW); + r14 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_F_4_TO_2_F_5, YELLOW); + r15 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_D_5_TO_2_F_5, YELLOW); + r16 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_D_6_TO_2_D_5, YELLOW); + r17 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_C_6_TO_2_D_6, YELLOW); + r18 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_C_5_TO_2_C_6, YELLOW); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/SongOfTheElves.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/SongOfTheElves.java index 56f9dd7a5b5..2b2c974f94c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/SongOfTheElves.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/SongOfTheElves.java @@ -140,9 +140,9 @@ public class SongOfTheElves extends BasicQuestHelper ConditionalStep finalBattle; //Zones - Zone ardougneCastleF1, passF1, passF0, wellEntrance, ibanRoom, ardyPrison, hideout, westArdyInstance, mournerBasement, eastArdy, llyetaF1, + Zone ardougneCastleF1, passF1, passF0, wellEntrance, ibanRoom, ardyPrison, hideout, westArdyInstance, mournerBasement, eastArdy, lletyaF1, hudonIsland, deadTreeIsland, ledge, falls, baxThroneRoom, valley, traRoom, lightPuzzleRoom, libraryF0, libraryF1, libraryF2, iorwerthCave, - llyetaF0Battle, llyetaF1Battle, llyetaF1Damaged, bossArea; + lletyaF0Battle, lletyaF1Battle, lletyaF1Damaged, bossArea; @Override public Map loadSteps() @@ -654,7 +654,7 @@ public void setupConditions() inMournerBaseHQInstance = new Conditions(new InInstanceRequirement(), new ZoneRequirement(mournerBasement)); inEastArdyInstance = new Conditions(new InInstanceRequirement(), new ZoneRequirement(eastArdy)); inArdougneCastleF1Instance = new Conditions(new InInstanceRequirement(), new ZoneRequirement(ardougneCastleF1)); - inLletyaF1 = new ZoneRequirement(llyetaF1); + inLletyaF1 = new ZoneRequirement(lletyaF1); inValley = new ZoneRequirement(valley); inTraRoom = new ZoneRequirement(traRoom); inLightPuzzle = new ZoneRequirement(lightPuzzleRoom); @@ -669,9 +669,9 @@ public void setupConditions() inBaxThroneRoom = new ZoneRequirement(baxThroneRoom); inIorwerthCave = new ZoneRequirement(iorwerthCave); - inLletyaF0Battle = new Conditions(new ZoneRequirement(llyetaF0Battle)); - inLletyaF1Battle = new Conditions(new ZoneRequirement(llyetaF1Battle)); - inLletyaF1Damaged = new ZoneRequirement(llyetaF1Damaged); + inLletyaF0Battle = new Conditions(new ZoneRequirement(lletyaF0Battle)); + inLletyaF1Battle = new Conditions(new ZoneRequirement(lletyaF1Battle)); + inLletyaF1Damaged = new ZoneRequirement(lletyaF1Damaged); inPassF0 = new ZoneRequirement(passF0); inPassF1 = new ZoneRequirement(passF1); @@ -679,29 +679,29 @@ public void setupConditions() inIbanRoom = new ZoneRequirement(ibanRoom); inBossArea = new ZoneRequirement(bossArea); - burnedGrain1 = new VarbitRequirement(9058, 1); - burnedGrain2 = new VarbitRequirement(9059, 1); - burnedGrain3 = new VarbitRequirement(9060, 1); - talkedToPriest1 = new VarbitRequirement(9079, 1); - talkedToSarah = new VarbitRequirement(9063, 1); - talkedToChadwell = new VarbitRequirement(9065, 1); + burnedGrain1 = new VarbitRequirement(VarbitID.SOTE_WEST_FOOD1, 1); + burnedGrain2 = new VarbitRequirement(VarbitID.SOTE_WEST_FOOD2, 1); + burnedGrain3 = new VarbitRequirement(VarbitID.SOTE_WEST_FOOD3, 1); + talkedToPriest1 = new VarbitRequirement(VarbitID.SOTE_WEST_CHURCH, 1); + talkedToSarah = new VarbitRequirement(VarbitID.SOTE_WEST_NURSE, 1); + talkedToChadwell = new VarbitRequirement(VarbitID.SOTE_WEST_GENERAL_STORE, 1); talkedToWestArdougne = new Conditions(burnedGrain1, burnedGrain2, burnedGrain3, talkedToPriest1, talkedToSarah, talkedToChadwell); - talkedToSilverMerchant = new VarbitRequirement(9074, 1); - talkedToBaker1 = new VarbitRequirement(9081, 1); // East baker - talkedToBaker2 = new VarbitRequirement(9073, 1); // West baker - talkedToGemMerchant = new VarbitRequirement(9072, 1); - talkedToFurTrader = new VarbitRequirement(9071, 1); - talkedToSpiceSeller = new VarbitRequirement(9070, 1); - talkedToSilkMerchant = new VarbitRequirement(9069, 1); + talkedToSilverMerchant = new VarbitRequirement(VarbitID.SOTE_EAST_SILVER_STORE, 1); + talkedToBaker1 = new VarbitRequirement(VarbitID.SOTE_EAST_BAKER_STORE2, 1); // East baker + talkedToBaker2 = new VarbitRequirement(VarbitID.SOTE_EAST_BAKER_STORE, 1); // West baker + talkedToGemMerchant = new VarbitRequirement(VarbitID.SOTE_EAST_GEM_STORE, 1); + talkedToFurTrader = new VarbitRequirement(VarbitID.SOTE_EAST_FUR_STORE, 1); + talkedToSpiceSeller = new VarbitRequirement(VarbitID.SOTE_EAST_SPICE_STORE, 1); + talkedToSilkMerchant = new VarbitRequirement(VarbitID.SOTE_EAST_SILK_STORE, 1); talkedToMarketStalls = new Conditions(talkedToSilverMerchant, talkedToBaker1, talkedToBaker2, talkedToGemMerchant, talkedToFurTrader, talkedToSpiceSeller, talkedToSilkMerchant); - talkedToTownCrier = new VarbitRequirement(9075, 1); - talkedToZenesha = new VarbitRequirement(9068, 1); - talkedToEstateAgent = new VarbitRequirement(9080, 1); - talkedToProbita = new VarbitRequirement(9067, 1); - talkedToAemad = new VarbitRequirement(9066, 1); - talkedToPriest2 = new VarbitRequirement(9078, 1); - talkedToOrbon = new VarbitRequirement(9064, 1); + talkedToTownCrier = new VarbitRequirement(VarbitID.SOTE_EAST_TOWN_CRIER, 1); + talkedToZenesha = new VarbitRequirement(VarbitID.SOTE_EAST_ARMOUR_STORE, 1); + talkedToEstateAgent = new VarbitRequirement(VarbitID.SOTE_EAST_ESTATE_AGENT, 1); + talkedToProbita = new VarbitRequirement(VarbitID.SOTE_EAST_PET_STORE, 1); + talkedToAemad = new VarbitRequirement(VarbitID.SOTE_EAST_GENERAL_STORE, 1); + talkedToPriest2 = new VarbitRequirement(VarbitID.SOTE_EAST_CHURCH, 1); + talkedToOrbon = new VarbitRequirement(VarbitID.SOTE_EAST_DOCTOR, 1); // 9017 0->1 talked to guard in prison @@ -732,23 +732,23 @@ public void setupConditions() askedAboutHefin = new VarbitRequirement(VarbitID.SOTE_HEFIN, 1, Operation.GREATER_EQUAL); foundHefin = new VarbitRequirement(VarbitID.SOTE_HEFIN, 3, Operation.GREATER_EQUAL); - tracked1 = new VarbitRequirement(9028, 1); - tracked2 = new VarbitRequirement(9029, 1); - tracked3 = new VarbitRequirement(9030, 1); - tracked4 = new VarbitRequirement(9031, 1); - tracked5 = new VarbitRequirement(9032, 1); + tracked1 = new VarbitRequirement(VarbitID.SOTE_HUNTING_TRAIL_2, 1); + tracked2 = new VarbitRequirement(VarbitID.SOTE_HUNTING_TRAIL_3, 1); + tracked3 = new VarbitRequirement(VarbitID.SOTE_HUNTING_TRAIL_4, 1); + tracked4 = new VarbitRequirement(VarbitID.SOTE_HUNTING_TRAIL_5, 1); + tracked5 = new VarbitRequirement(VarbitID.SOTE_HUNTING_TRAIL_6, 1); - foundEoin = new VarbitRequirement(9033, 1); + foundEoin = new VarbitRequirement(VarbitID.SOTE_LLETYA_EOIN_FOUND, 1); // foundIona, 9034 = 1 askedAboutIthell = new VarbitRequirement(VarbitID.SOTE_ITHELL, 1, Operation.GREATER_EQUAL); askedAboutMeilyr = new VarbitRequirement(VarbitID.SOTE_MEILYR, 1, Operation.GREATER_EQUAL); - checkedSymbol1 = new VarbitRequirement(9041, 2); - checkedSymbol2 = new VarbitRequirement(9039, 2); - checkedSymbol3 = new VarbitRequirement(9040, 2); - checkedSymbol4 = new VarbitRequirement(9038, 2); - checkedSymbol5 = new VarbitRequirement(9037, 2); + checkedSymbol1 = new VarbitRequirement(VarbitID.SOTE_SYMBOL_5, 2); + checkedSymbol2 = new VarbitRequirement(VarbitID.SOTE_SYMBOL_3, 2); + checkedSymbol3 = new VarbitRequirement(VarbitID.SOTE_SYMBOL_4, 2); + checkedSymbol4 = new VarbitRequirement(VarbitID.SOTE_SYMBOL_2, 2); + checkedSymbol5 = new VarbitRequirement(VarbitID.SOTE_SYMBOL_1, 2); learnedHowToMakeStatue = new VarbitRequirement(VarbitID.SOTE_ITHELL, 2, Operation.GREATER_EQUAL); builtStatue = new VarbitRequirement(VarbitID.SOTE_ITHELL, 3, Operation.GREATER_EQUAL); @@ -761,13 +761,13 @@ public void setupConditions() // 9037->9041 marks // 9042->49 0->1 for holes - filledHole1 = new VarbitRequirement(9042, 2); - filledHole2 = new VarbitRequirement(9043, 2); - filledHole3 = new VarbitRequirement(9044, 2); - filledHole4 = new VarbitRequirement(9045, 2); - filledHole5 = new VarbitRequirement(9047, 2); - filledHole6 = new VarbitRequirement(9048, 2); - filledHole7 = new VarbitRequirement(9049, 2); + filledHole1 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_1, 2); + filledHole2 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_2, 2); + filledHole3 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_3, 2); + filledHole4 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_4, 2); + filledHole5 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_5, 2); + filledHole6 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_6, 2); + filledHole7 = new VarbitRequirement(VarbitID.SOTE_UPASS_HOLE_7, 2); } @@ -780,10 +780,10 @@ protected void setupZones() westArdyInstance = new Zone(new WorldPoint(2509, 3263, 0), new WorldPoint(2558, 3334, 0)); eastArdy = new Zone(new WorldPoint(2559, 3256, 0), new WorldPoint(2696, 3343, 0)); mournerBasement = new Zone(new WorldPoint(2034, 4628, 0), new WorldPoint(2045, 4651, 0)); - llyetaF0Battle = new Zone(new WorldPoint(2882, 6157, 0), new WorldPoint(2940, 6194, 0)); - llyetaF1Battle = new Zone(new WorldPoint(2882, 6157, 1), new WorldPoint(2940, 6194, 1)); - llyetaF1Damaged = new Zone(new WorldPoint(2750, 6070, 1), new WorldPoint(2810, 6140, 1)); - llyetaF1 = new Zone(new WorldPoint(2331, 3154, 1), new WorldPoint(2358, 3189, 1)); + lletyaF0Battle = new Zone(new WorldPoint(2882, 6157, 0), new WorldPoint(2940, 6194, 0)); + lletyaF1Battle = new Zone(new WorldPoint(2882, 6157, 1), new WorldPoint(2940, 6194, 1)); + lletyaF1Damaged = new Zone(new WorldPoint(2750, 6070, 1), new WorldPoint(2810, 6140, 1)); + lletyaF1 = new Zone(new WorldPoint(2331, 3154, 1), new WorldPoint(2358, 3189, 1)); hudonIsland = new Zone(new WorldPoint(2510, 3476, 0), new WorldPoint(2515, 3482, 0)); deadTreeIsland = new Zone(new WorldPoint(2512, 3465, 0), new WorldPoint(2513, 3475, 0)); @@ -1006,7 +1006,7 @@ public void setupSteps() talkToElunedWithSeed = new NpcStep(this, NpcID.ROVING_FEMALE_WOODELF_2OP, new WorldPoint(2322, 3160, 0), "Talk to Eluned in" + " Lletya."); talkToElunedWithSeed.addDialogStep("I have a seed from Baxtorian that I think needs enchanting."); - rubCrystal = new DetailedQuestStep(this, "Rub the teleport crystal to teleport.", crystalSeed); + rubCrystal = new DetailedQuestStep(this, "Rub the crystal seed to teleport.", crystalSeed); talkToFigure = new NpcStep(this, NpcID.SOTE_LORD_AMLODD_VIS_UNKNOWN, new WorldPoint(3051, 4486, 0), "Talk to the Mysterious Figure."); talkToBaxAfterValley = new NpcStep(this, NpcID.SOTE_BAXTORIAN_VIS, new WorldPoint(2352, 3170, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/TrahaearnLightPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/TrahaearnLightPuzzle.java index 64287124d30..648e75951a0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/TrahaearnLightPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/songoftheelves/TrahaearnLightPuzzle.java @@ -39,6 +39,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.List; @@ -355,31 +356,31 @@ protected void setupConditions() int YELLOW = 6; int GREEN = 7; - notResetHefin = new VarbitRequirement(8837, BLUE); - - r1 = new VarbitRequirement(8932, WHITE); - r2 = new VarbitRequirement(8931, WHITE); - r3 = new VarbitRequirement(8927, WHITE); - r4 = new VarbitRequirement(8577, GREEN); - r5 = new VarbitRequirement(8834, GREEN); - r6 = new VarbitRequirement(8580, GREEN); - r7 = new VarbitRequirement(8723, GREEN); - r8 = new VarbitRequirement(8726, GREEN); - r9 = new VarbitRequirement(8746, GREEN); - r10 = new VarbitRequirement(8747, GREEN); - r11 = new VarbitRequirement(8751, CYAN); - r12 = new VarbitRequirement(8753, CYAN); - r13 = new VarbitRequirement(8754, CYAN); - r14 = new VarbitRequirement(8755, CYAN); - r15 = new VarbitRequirement(8756, CYAN); - r16 = new VarbitRequirement(8758, CYAN); - - r17 = new VarbitRequirement(8974, YELLOW); - r18 = new VarbitRequirement(8982, YELLOW); - r19 = new VarbitRequirement(8617, YELLOW); - r20 = new VarbitRequirement(8773, YELLOW); - r21 = new VarbitRequirement(8776, YELLOW); - r22 = new VarbitRequirement(8777, YELLOW); + notResetHefin = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_B_4_TO_0_B_3, BLUE); + + r1 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_C_0_TO_1_C_1, WHITE); + r2 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_A_0_TO_1_C_0, WHITE); + r3 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_A_0_TO_1_A_1, WHITE); + r4 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_A_2_TO_1_A_2, GREEN); + r5 = new VarbitRequirement(VarbitID.SOTE_LIGHT_0_A_2_TO_0_B_2, GREEN); + r6 = new VarbitRequirement(VarbitID.SOTE_PILLAR_0_B_2_TO_1_B_2, GREEN); + r7 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_B_2_TO_2_B_3, GREEN); + r8 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_B_3_TO_2_D_3, GREEN); + r9 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_D_1_TO_2_D_3, GREEN); + r10 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_D_1_TO_2_F_1, GREEN); + r11 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_F_1_TO_2_G_1, CYAN); + r12 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_G_1_TO_2_G_0, CYAN); + r13 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_G_0_TO_2_H_0, CYAN); + r14 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_H_0_TO_2_H_2, CYAN); + r15 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_H_2_TO_2_G_2, CYAN); + r16 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_G_2_TO_2_G_3, CYAN); + + r17 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_G_3_TO_1_G_4, YELLOW); + r18 = new VarbitRequirement(VarbitID.SOTE_LIGHT_1_G_4_TO_1_H_4, YELLOW); + r19 = new VarbitRequirement(VarbitID.SOTE_PILLAR_1_H_4_TO_2_H_4, YELLOW); + r20 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_H_4_TO_2_I_4, YELLOW); + r21 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_I_4_TO_2_I_5, YELLOW); + r22 = new VarbitRequirement(VarbitID.SOTE_LIGHT_2_I_5_TO_2_G_5, YELLOW); } public List getDisplaySteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/spiritsoftheelid/SpiritsOfTheElid.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/spiritsoftheelid/SpiritsOfTheElid.java index 3876144ebd8..76ba8de1c46 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/spiritsoftheelid/SpiritsOfTheElid.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/spiritsoftheelid/SpiritsOfTheElid.java @@ -47,6 +47,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -115,7 +116,7 @@ public Map loadSteps() ConditionalStep creviceSteps = new ConditionalStep(this, takeShoes); creviceSteps.addStep(insideCrevice, talkToGenie); - creviceSteps.addStep(soles.alsoCheckBank(questBank), enterCrevice); + creviceSteps.addStep(soles.alsoCheckBank(), enterCrevice); creviceSteps.addStep(new Conditions(shoes, notAwusahHouse), cutShoes); creviceSteps.addStep(new Conditions(shoes), leaveAwusah); steps.put(40, creviceSteps); @@ -209,12 +210,12 @@ public void setupConditions() notAwusahHouse = new ZoneRequirement(outsideAwusahHouse); insideCrevice = new ZoneRequirement(creviceOutsideNardah); - whiteGolem = new VarbitRequirement(1447, 1); - greyGolem = new VarbitRequirement(1448, 1); - blackGolem = new VarbitRequirement(1446, 1); - stabChannel = new VarbitRequirement(1450, 1); - slashChannel = new VarbitRequirement(1449, 1); - crushChannel = new VarbitRequirement(1451, 1); + whiteGolem = new VarbitRequirement(VarbitID.ELID_WHITEGOLEM, 1); + greyGolem = new VarbitRequirement(VarbitID.ELID_GREYGOLEM, 1); + blackGolem = new VarbitRequirement(VarbitID.ELID_BLACKGOLEM, 1); + stabChannel = new VarbitRequirement(VarbitID.ELID_THIEVINGCHANNEL, 1); + slashChannel = new VarbitRequirement(VarbitID.ELID_MININGCHANNEL, 1); + crushChannel = new VarbitRequirement(VarbitID.ELID_RANGINGCHANNEL, 1); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FishMonkfish.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FishMonkfish.java index 51cc52f2977..bc9e2f210bb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FishMonkfish.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FishMonkfish.java @@ -27,14 +27,11 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; -import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -65,8 +62,9 @@ public void onGameTick(GameTick event) @Override protected void updateSteps() { - int numHandedIn = client.getVarbitValue(2105) - 1; - ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY); + int numHandedIn = client.getVarbitValue(VarbitID.SWANSONG_ARNOLD) - 1; + ItemContainer inventory = client.getItemContainer(InventoryID.INV); + int numRaw = 0; int numCooked = 0; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FixWall.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FixWall.java index 265e577246c..d76503da550 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FixWall.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/FixWall.java @@ -35,6 +35,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; import java.util.Arrays; @@ -60,11 +61,11 @@ public void onGameTick(GameTick event) @Override protected void updateSteps() { - int wall1Fixed = client.getVarbitValue(2100); - int wall2Fixed = client.getVarbitValue(2101); - int wall3Fixed = client.getVarbitValue(2102); - int wall4Fixed = client.getVarbitValue(2103); - int wall5Fixed = client.getVarbitValue(2104); + int wall1Fixed = client.getVarbitValue(VarbitID.SWANSONG_WALL_1); + int wall2Fixed = client.getVarbitValue(VarbitID.SWANSONG_WALL_2); + int wall3Fixed = client.getVarbitValue(VarbitID.SWANSONG_WALL_3); + int wall4Fixed = client.getVarbitValue(VarbitID.SWANSONG_WALL_4); + int wall5Fixed = client.getVarbitValue(VarbitID.SWANSONG_WALL_5); int wallsToRepair = 5 - (wall1Fixed + wall2Fixed + wall3Fixed + wall4Fixed + wall5Fixed); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/SwanSong.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/SwanSong.java index 342b6eadb67..a139a96bee9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/SwanSong.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/swansong/SwanSong.java @@ -214,18 +214,18 @@ public void setupConditions() inBasement = new ZoneRequirement(basement); // 2111 is number of trolls killed - talkedToFranklin = new VarbitRequirement(2099, 1); - addedLog = new VarbitRequirement(2099, 2); - litLog = new VarbitRequirement(2099, 3); - wall1Fixed = new VarbitRequirement(2100, 1); - wall2Fixed = new VarbitRequirement(2101, 1); - wall3Fixed = new VarbitRequirement(2102, 1); - wall4Fixed = new VarbitRequirement(2103, 1); - wall5Fixed = new VarbitRequirement(2104, 1); + talkedToFranklin = new VarbitRequirement(VarbitID.SWANSONG_FRANKLIN, 1); + addedLog = new VarbitRequirement(VarbitID.SWANSONG_FRANKLIN, 2); + litLog = new VarbitRequirement(VarbitID.SWANSONG_FRANKLIN, 3); + wall1Fixed = new VarbitRequirement(VarbitID.SWANSONG_WALL_1, 1); + wall2Fixed = new VarbitRequirement(VarbitID.SWANSONG_WALL_2, 1); + wall3Fixed = new VarbitRequirement(VarbitID.SWANSONG_WALL_3, 1); + wall4Fixed = new VarbitRequirement(VarbitID.SWANSONG_WALL_4, 1); + wall5Fixed = new VarbitRequirement(VarbitID.SWANSONG_WALL_5, 1); wallsFixed = new Conditions(wall1Fixed, wall2Fixed, wall3Fixed, wall4Fixed, wall5Fixed); talkedToArnold = new VarbitRequirement(VarbitID.SWANSONG_ARNOLD, 1, Operation.GREATER_EQUAL); - finishedFranklin = new VarbitRequirement(2099, 4); + finishedFranklin = new VarbitRequirement(VarbitID.SWANSONG_FRANKLIN, 4); queenNearby = new NpcCondition(NpcID.SWAN_SEATROLL_QUEEN); // 2108 = number of bones given to Mort diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/taibwowannaitrio/TaiBwoWannaiTrio.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/taibwowannaitrio/TaiBwoWannaiTrio.java index 180f8520326..381941bd11f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/taibwowannaitrio/TaiBwoWannaiTrio.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/taibwowannaitrio/TaiBwoWannaiTrio.java @@ -431,7 +431,7 @@ private void setupConditions() hadRumWithBanana = new Conditions(LogicType.OR, karamjanRumWithBanana, givenRum); hadSeaweed = new Conditions(LogicType.OR, seaweed, seaweedSandwich, givenSandwich); hadSeaweedSandwich = new Conditions(LogicType.OR, seaweedSandwich, givenSandwich); - hadMarinated = new Conditions(LogicType.OR, marinatedJogreBones.alsoCheckBank(questBank), givenBones); + hadMarinated = new Conditions(LogicType.OR, marinatedJogreBones.alsoCheckBank(), givenBones); talkedTinsay1 = new Conditions(true, LogicType.OR, new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "He requires banana in Karamja " + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tearsofguthix/TearsOfGuthix.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tearsofguthix/TearsOfGuthix.java index f4bf3c9094b..b8672c00198 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tearsofguthix/TearsOfGuthix.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tearsofguthix/TearsOfGuthix.java @@ -44,6 +44,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -78,7 +79,7 @@ public Map loadSteps() steps.put(0, goTalkToJuna); ConditionalStep goGetRock = new ConditionalStep(this, getToJunaRoom); - goGetRock.addStep(new Conditions(stoneBowl.alsoCheckBank(questBank), inJunaRoom), talkToJunaToFinish); + goGetRock.addStep(new Conditions(stoneBowl.alsoCheckBank(), inJunaRoom), talkToJunaToFinish); goGetRock.addStep(rockHighlighted, useChiselOnRock); goGetRock.addStep(atRocks, mineRock); goGetRock.addStep(inJunaRoom, useLanternOnLightCreature); @@ -129,7 +130,7 @@ private void setupConditions() inJunaRoom = new ZoneRequirement(junaRoom); atRocks = new ZoneRequirement(rocks); - addedRope = new VarbitRequirement(279, 1); + addedRope = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); // 452 = 1, gone through Juna's first dialog } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeofikov/TempleOfIkov.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeofikov/TempleOfIkov.java index b8df7a120c4..60ac9eb2ff8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeofikov/TempleOfIkov.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeofikov/TempleOfIkov.java @@ -153,12 +153,12 @@ public Map loadSteps() // TODO: Verify taking staff doesn't progress quest beyond varp 26 = 60 ConditionalStep goodOrBadPath = new ConditionalStep(this, enterDungeonGivenLimps); - goodOrBadPath.addStep(staffOfArmadyl.alsoCheckBank(questBank), bringStaffToLucien); + goodOrBadPath.addStep(staffOfArmadyl.alsoCheckBank(), bringStaffToLucien); goodOrBadPath.addStep(new Conditions(inArmaRoom, shinyKey), makeChoice); goodOrBadPath.addStep(new Conditions(inDemonArea, shinyKey), pushWall); goodOrBadPath.addStep(new Conditions(LogicType.OR, inArmaRoom, inDemonArea), pickUpKey); goodOrBadPath.addStep(new Conditions(LogicType.OR, inMainOrNorthRoom, inWitchRoom), talkToWinelda); - goodOrBadPath.addStep(shinyKey.alsoCheckBank(questBank), enterFromMcgrubbors); + goodOrBadPath.addStep(shinyKey.alsoCheckBank(), enterFromMcgrubbors); steps.put(60, goodOrBadPath); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/RuneEnergyStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/RuneEnergyStep.java index 0c8d6bde96b..9a031ba6bb6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/RuneEnergyStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/RuneEnergyStep.java @@ -26,6 +26,7 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.api.ChatMessageType; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; @@ -114,7 +115,7 @@ private void setupHighlights() alternateObjectIDs.clear(); alternateObjectIDs.add(useList[currentPos].id); - worldPoint = useList[currentPos].wp; + definedPoint = DefinedPoint.of(useList[currentPos].wp); loadObjects(); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/TempleOfTheEye.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/TempleOfTheEye.java index 1e5906be821..bbc820645ae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/TempleOfTheEye.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/templeoftheeye/TempleOfTheEye.java @@ -52,6 +52,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -237,21 +238,21 @@ public void setupConditions() inTempleOfTheEye = new ZoneRequirement(templeOfTheEye); inTempleOfTheEyeTutorial = new ZoneRequirement(templeOfTheEye2, mindAltar); - canTeleportFromHerbert = new VarbitRequirement(13740, 0); + canTeleportFromHerbert = new VarbitRequirement(VarbitID.TOTE_ABYSS_TELEPORT_USED, 0); thrownBucket = new VarbitRequirement(QuestVarbits.QUEST_TEMPLE_OF_THE_EYE.getId(), 30, Operation.GREATER_EQUAL); givenAmuletBack = new VarbitRequirement(QuestVarbits.QUEST_TEMPLE_OF_THE_EYE.getId(), 55, Operation.GREATER_EQUAL); - canTeleportFromPersten = new VarbitRequirement(13753, 0); + canTeleportFromPersten = new VarbitRequirement(VarbitID.TOTE_TOWER_TELEPORT_USED, 0); - felixPuzzleNotSeen = new VarbitRequirement(13743, 0); - tamaraPuzzleNotSeen = new VarbitRequirement(13742, 0); - cordeliaPuzzleNotSeen = new VarbitRequirement(13744, 0); + felixPuzzleNotSeen = new VarbitRequirement(VarbitID.TOTE_SPOKEN_TO_FELIX, 0); + tamaraPuzzleNotSeen = new VarbitRequirement(VarbitID.TOTE_SPOKEN_TO_TAMARA, 0); + cordeliaPuzzleNotSeen = new VarbitRequirement(VarbitID.TOTE_SPOKEN_TO_CORDELIA, 0); - felixRiftTalk = new VarbitRequirement(13755, 0); - tamaraRiftTalk = new VarbitRequirement(13754, 0); - cordeliaRiftTalk = new VarbitRequirement(13756, 0); + felixRiftTalk = new VarbitRequirement(VarbitID.TOTE_TEMPLE_FELIX, 0); + tamaraRiftTalk = new VarbitRequirement(VarbitID.TOTE_TEMPLE_TAMARA, 0); + cordeliaRiftTalk = new VarbitRequirement(VarbitID.TOTE_TEMPLE_CORDELIA, 0); // TODO: Seems to be generally done for cutscenes? Happens in Enahkra's Lament - mysteriousVisionSeen = new VarbitRequirement(12139, 1); + mysteriousVisionSeen = new VarbitRequirement(VarbitID.GRAVESTONE_TLI_HIDE, 1); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theascentofarceuus/TheAscentOfArceuus.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theascentofarceuus/TheAscentOfArceuus.java index be76f0d4902..dfe769d4f48 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theascentofarceuus/TheAscentOfArceuus.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theascentofarceuus/TheAscentOfArceuus.java @@ -52,6 +52,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -158,11 +159,11 @@ public void setupConditions() inCastle = new ZoneRequirement(castle); inKaruulm = new ZoneRequirement(karuulm); - foundTrack1 = new VarbitRequirement(7860, 1); - foundTrack2 = new VarbitRequirement(7861, 1); - foundTrack3 = new VarbitRequirement(7862, 1); - foundTrack4 = new VarbitRequirement(7863, 1); - foundTrack5 = new VarbitRequirement(7864, 1); + foundTrack1 = new VarbitRequirement(VarbitID.ARCQUEST_HUNTING_TRAIL_2, 1); + foundTrack2 = new VarbitRequirement(VarbitID.ARCQUEST_HUNTING_TRAIL_3, 1); + foundTrack3 = new VarbitRequirement(VarbitID.ARCQUEST_HUNTING_TRAIL_4, 1); + foundTrack4 = new VarbitRequirement(VarbitID.ARCQUEST_HUNTING_TRAIL_5, 1); + foundTrack5 = new VarbitRequirement(VarbitID.ARCQUEST_HUNTING_TRAIL_6, 1); trappedSoulNearby = new NpcHintArrowRequirement(NpcID.ARCQUEST_SOUL); // Inspected grave: diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecorsaircurse/TheCorsairCurse.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecorsaircurse/TheCorsairCurse.java index 86601973e20..952ea95e55f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecorsaircurse/TheCorsairCurse.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecorsaircurse/TheCorsairCurse.java @@ -197,19 +197,19 @@ public void setupConditions() inArsenHut = new ZoneRequirement(arsenHut); inShip = new ZoneRequirement(ship); inCavern = new ZoneRequirement(cavern); - talkedToIthoi = new VarbitRequirement(6075, 1); + talkedToIthoi = new VarbitRequirement(VarbitID.CORSCURS_NAVIGATOR, 1); talkedToArsen = new VarbitRequirement(VarbitID.CORSCURS_THIEF, 2, Operation.GREATER_EQUAL); - returnedToothPick = new VarbitRequirement(6074, 4); + returnedToothPick = new VarbitRequirement(VarbitID.CORSCURS_THIEF, 4); finishedArsen = new VarbitRequirement(VarbitID.CORSCURS_THIEF, 6, Operation.GREATER_EQUAL); talkedToColin = new VarbitRequirement(VarbitID.CORSCURS_CABINBOY, 1, Operation.GREATER_EQUAL); - lookedThroughTelescope = new VarbitRequirement(6072, 2); - finishedColin = new VarbitRequirement(6072, 3); + lookedThroughTelescope = new VarbitRequirement(VarbitID.CORSCURS_CABINBOY, 2); + finishedColin = new VarbitRequirement(VarbitID.CORSCURS_CABINBOY, 3); - talkedToGnocci = new VarbitRequirement(6073, 1); - foundDoll = new VarbitRequirement(6073, 2); - finishedGnocci = new VarbitRequirement(6073, 3); + talkedToGnocci = new VarbitRequirement(VarbitID.CORSCURS_COOK, 1); + foundDoll = new VarbitRequirement(VarbitID.CORSCURS_COOK, 2); + finishedGnocci = new VarbitRequirement(VarbitID.CORSCURS_COOK, 3); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java index cf6536f5163..2d193ec06a9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TheCurseOfArrav.java @@ -50,11 +50,11 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.annotations.Varbit; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.HashMap; @@ -71,9 +71,6 @@ @SuppressWarnings("FieldCanBeLocal") public class TheCurseOfArrav extends BasicQuestHelper { - static final @Varbit int VARBIT_SOUTH_LEVER_STATE = 11482; - static final @Varbit int VARBIT_NORTH_LEVER_STATE = 11481; - // Required items private ItemRequirement dwellberries3; private ItemRequirement ringOfLife; @@ -302,12 +299,12 @@ protected void setupZones() @Override protected void setupRequirements() { - haveUsedKeyOnSouthLever = new VarbitRequirement(VARBIT_SOUTH_LEVER_STATE, 1, Operation.GREATER_EQUAL); - haveFlippedSouthLever = new VarbitRequirement(VARBIT_SOUTH_LEVER_STATE, 2); - haveUsedKeyOnNorthLever = new VarbitRequirement(VARBIT_NORTH_LEVER_STATE, 1, Operation.GREATER_EQUAL); - haveFlippedNorthLever = new VarbitRequirement(VARBIT_NORTH_LEVER_STATE, 2); + haveUsedKeyOnSouthLever = new VarbitRequirement(VarbitID.COA_MASTABA_LEVER_2, 1, Operation.GREATER_EQUAL); + haveFlippedSouthLever = new VarbitRequirement(VarbitID.COA_MASTABA_LEVER_2, 2); + haveUsedKeyOnNorthLever = new VarbitRequirement(VarbitID.COA_MASTABA_LEVER_1, 1, Operation.GREATER_EQUAL); + haveFlippedNorthLever = new VarbitRequirement(VarbitID.COA_MASTABA_LEVER_1, 2); haveKilledGolem = new QuestRequirement(QuestHelperQuest.THE_CURSE_OF_ARRAV, 12); - finishedTilePuzzle = new VarbitRequirement(11483, 1); + finishedTilePuzzle = new VarbitRequirement(VarbitID.COA_FLOOR_PUZZLE_DISABLED, 1); haveMadeCanopicJar = new QuestRequirement(QuestHelperQuest.THE_CURSE_OF_ARRAV, 18); haveMinedAFullPath = new QuestRequirement(QuestHelperQuest.THE_CURSE_OF_ARRAV, 30); haveUsedPlans = new QuestRequirement(QuestHelperQuest.THE_CURSE_OF_ARRAV, 38); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TilePuzzleSolver.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TilePuzzleSolver.java index ac8ebda08f1..0d95a2ffc17 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TilePuzzleSolver.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/TilePuzzleSolver.java @@ -28,7 +28,6 @@ import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.Tile; @@ -321,26 +320,25 @@ protected void updateSteps() return; } - var playerWp = localPlayer.getWorldLocation(); - var localPoint = QuestPerspective.getRealWorldPointFromLocal(client, localPlayer.getWorldLocation()); - if (localPoint == null) { + var worldPoint = WorldPoint.fromLocalInstance(client, localPlayer.getLocalLocation()); + if (worldPoint == null) + { startUpStep(fallbackStep); return; } - var baseX = 3737; var baseY = 4709; - var xInPuzzle = localPoint.getX() - baseX; - var yInPuzzle = localPoint.getY() - baseY; + var xInPuzzle = worldPoint.getX() - baseX; + var yInPuzzle = worldPoint.getY() - baseY; if (xInPuzzle > 0 && xInPuzzle < SIZE && yInPuzzle >= 0 && yInPuzzle < SIZE) { log.debug("Player is in the puzzle, at {}/{}", xInPuzzle, yInPuzzle); startUpStep(pathStep); } else { - log.debug("player is outside of puzzle: {} / {} / {}/{}", playerWp, localPoint, xInPuzzle, yInPuzzle); - var userIsPastPuzzle = localPoint.getX() <= 3730 || (localPoint.getX() <= baseX && localPoint.getY() >= 4701); + log.debug("player is outside of puzzle: {} / {} / {}/{}", localPlayer.getWorldLocation(), worldPoint, xInPuzzle, yInPuzzle); + var userIsPastPuzzle = worldPoint.getX() <= 3730 || (worldPoint.getX() <= baseX && worldPoint.getY() >= 4701); if (userIsPastPuzzle) { // highlight lever startUpStep(finishPuzzleStep); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java index a4f434fc0e9..e6272886143 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thecurseofarrav/rubblesolvers/RubbleSolver.java @@ -32,10 +32,10 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; -import net.runelite.api.SpriteID; import net.runelite.api.coords.Direction; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; +import net.runelite.api.gameval.SpriteID; import net.runelite.client.eventbus.Subscribe; import javax.inject.Inject; @@ -89,7 +89,7 @@ protected void addMineRubbleStep(int x, int y, RubbleType rubbleType, Direction break; } var posWp = new WorldPoint(offsetX, offsetY, 0); - step.addTileMarker(posWp, SpriteID.SKILL_MINING); + step.addTileMarker(posWp, SpriteID.Staticons.MINING); for (var alternateIDs : validObjectIDs) { // todo this adds the first object again xd step.addAlternateObjects(alternateIDs); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedepthsofdespair/TheDepthsOfDespair.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedepthsofdespair/TheDepthsOfDespair.java index 927fa669dd2..3dd2745cdf6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedepthsofdespair/TheDepthsOfDespair.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedepthsofdespair/TheDepthsOfDespair.java @@ -82,7 +82,7 @@ public Map loadSteps() steps.put(2, talkToGalana); ConditionalStep findAndReadTheVarlamoreEnvoy = new ConditionalStep(this, findTheVarlamoreEnvoy); - findAndReadTheVarlamoreEnvoy.addStep(varlamoreEnvoy.alsoCheckBank(questBank), readTheVarlamoreEnvoy); + findAndReadTheVarlamoreEnvoy.addStep(varlamoreEnvoy.alsoCheckBank(), readTheVarlamoreEnvoy); steps.put(3, findAndReadTheVarlamoreEnvoy); steps.put(4, enterCrabclawCaves); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedigsite/TheDigSite.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedigsite/TheDigSite.java index 0f9781bffb8..5bfbab6f2ac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedigsite/TheDigSite.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thedigsite/TheDigSite.java @@ -176,8 +176,8 @@ public Map loadSteps() steps.put(7, explodeWall); ConditionalStep completeQuest = new ConditionalStep(this, goDownForTablet); - completeQuest.addStep(new Conditions(tablet.alsoCheckBank(questBank), inUndergroundTemple2), goUpWithTablet); - completeQuest.addStep(new Conditions(tablet.alsoCheckBank(questBank)), useTabletOnExpert); + completeQuest.addStep(new Conditions(tablet.alsoCheckBank(), inUndergroundTemple2), goUpWithTablet); + completeQuest.addStep(new Conditions(tablet.alsoCheckBank()), useTabletOnExpert); completeQuest.addStep(inUndergroundTemple2, takeTablet); steps.put(8, completeQuest); @@ -286,7 +286,7 @@ public void setupConditions() new DialogRequirement("You got all the questions correct, well done!"), new DialogRequirement("Great, I'm getting good at this.")); - talkedToGuide = new VarbitRequirement(2544, 1); + talkedToGuide = new VarbitRequirement(VarbitID.ITDIGSITETEA, 1); tea = tea.hideConditioned(talkedToGuide); @@ -361,20 +361,20 @@ public void setupConditions() // 2550 = 1, gotten invite // 3644 = 1, gotten invite - givenTalismanIn = new VarbitRequirement(2550, 1); - rope1Added = new VarbitRequirement(2545, 1); - rope2Added = new VarbitRequirement(2546, 1); + givenTalismanIn = new VarbitRequirement(VarbitID.ITEXPERTLETTER, 1); + rope1Added = new VarbitRequirement(VarbitID.ITDIGSITEWINCH1, 1); + rope2Added = new VarbitRequirement(VarbitID.ITDIGSITEWINCH2, 1); // 45 - 54 hasTeddy = new Conditions(LogicType.OR, teddybear, talkedToFemaleStudent); hasSkull = new Conditions(LogicType.OR, skull, talkedToGreenStudent); hasSpecialCup = new Conditions(LogicType.OR, specialCup, talkedToOrangeStudent); - letterStamped = new VarbitRequirement(2552, 1); + letterStamped = new VarbitRequirement(VarbitID.ITCURATORLETTER, 1); - searchedBricks = new VarbitRequirement(2549, 1); + searchedBricks = new VarbitRequirement(VarbitID.ITDIGSITEHINT, 1); openPowderChestNearby = new ObjectCondition(ObjectID.DIGCHESTOPEN); - openedBarrel = new VarbitRequirement(2547, 1); + openedBarrel = new VarbitRequirement(VarbitID.ITDIGSITEBARREL, 1); hasKeyOrPowderOrMixtures = new Conditions(LogicType.OR, key, powder, nitrate, mixedChemicals, mixedChemicals2, chemicalCompound, openPowderChestNearby); @@ -437,7 +437,7 @@ public void setupSteps() digForTalisman = new ObjectStep(this, ObjectID.DIGDUGUPSOIL2, new WorldPoint(3374, 3438, 0), "Dig in the north east dig spot in the Digsite until you get a talisman.", trowelHighlighted, specimenJar, specimenBrush); digForTalisman.addIcon(ItemID.TROWEL); - talkToExpert = new NpcStep(this, NpcID.ARCHAEOLOGICAL_EXPERT, new WorldPoint(3357, 3334, 0), "Talk Archaeological expert in the Exam Centre.", talisman); + talkToExpert = new NpcStep(this, NpcID.ARCHAEOLOGICAL_EXPERT, new WorldPoint(3357, 3334, 0), "Talk to the Archaeological expert in the Exam Centre.", talisman); useInvitationOnWorkman = new NpcStep(this, NpcID.DIGWORKMAN1, new WorldPoint(3360, 3415, 0), "Use the invitation on any workman.", true, invitation); useInvitationOnWorkman.addIcon(ItemID.DIGEXPERTSCROLL); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theeyesofglouphrie/TheEyesOfGlouphrie.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theeyesofglouphrie/TheEyesOfGlouphrie.java index 76b04da2e40..e7d8040dd99 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theeyesofglouphrie/TheEyesOfGlouphrie.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theeyesofglouphrie/TheEyesOfGlouphrie.java @@ -47,6 +47,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -192,16 +193,16 @@ protected void setupZones() public void setupConditions() { inCave = new ZoneRequirement(cave); - inspectedBowl = new VarbitRequirement(2515, 1); - inspectedMachine = new VarbitRequirement(2516, 1); + inspectedBowl = new VarbitRequirement(VarbitID.EYEGLO_BOWL_SEEN, 1); + inspectedMachine = new VarbitRequirement(VarbitID.EYEGLO_MACHINE_SEEN, 1); inHazelmereHut = new ZoneRequirement(hazelmereHut); - killedCreature1 = new VarbitRequirement(2504, 2); - killedCreature2 = new VarbitRequirement(2505, 2); - killedCreature3 = new VarbitRequirement(2506, 2); - killedCreature4 = new VarbitRequirement(2507, 2); - killedCreature5 = new VarbitRequirement(2508, 2); - killedCreature6 = new VarbitRequirement(2509, 2); + killedCreature1 = new VarbitRequirement(VarbitID.EYEGLO_KILLED_EYE_1, 2); + killedCreature2 = new VarbitRequirement(VarbitID.EYEGLO_KILLED_EYE_2, 2); + killedCreature3 = new VarbitRequirement(VarbitID.EYEGLO_KILLED_EYE_3, 2); + killedCreature4 = new VarbitRequirement(VarbitID.EYEGLO_KILLED_EYE_4, 2); + killedCreature5 = new VarbitRequirement(VarbitID.EYEGLO_KILLED_EYE_5, 2); + killedCreature6 = new VarbitRequirement(VarbitID.EYEGLO_KILLED_EYE_6, 2); inFloor1 = new ZoneRequirement(floor1); inFloor2 = new ZoneRequirement(floor2); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefeud/TheFeud.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefeud/TheFeud.java index 4d493bd4ca9..35a6c64df0c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefeud/TheFeud.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefeud/TheFeud.java @@ -191,12 +191,12 @@ public void setupVarBits() //318 Drunk Ali beer count 0->1->2->3 // 315 -> 2 Talked to thug -> 3 Talked to bandit - talkedToThug = new VarbitRequirement(315, 2); - talkedToBandit = new VarbitRequirement(315, 3); + talkedToThug = new VarbitRequirement(VarbitID.FEUD_VAR_TALK_GANGS, 2); + talkedToBandit = new VarbitRequirement(VarbitID.FEUD_VAR_TALK_GANGS, 3); talkedToBanditReturn = new VarbitRequirement(VarbitID.FEUD_VAR_COMP_GANGS, true, 0); // Might have missed? // 340 -> 1 when pickpocket villager - doorOpen = new VarbitRequirement(320, 1); + doorOpen = new VarbitRequirement(VarbitID.FEUD_VAR_MAYORSDOOR, 1); //Varbit 325 keeps track of correctly entered safe values //UPDATE: 325 keeps track of amount of numbers input. Even if they are incorrect @@ -204,26 +204,26 @@ public void setupVarBits() //TODO: Overlay for safe cracking. // Varbit 342 when found Traitor - traitorFound = new VarbitRequirement(342, 1); + traitorFound = new VarbitRequirement(VarbitID.FEUD_FOUND_TRAIT, 1); // Varbit 321 when talked to bar man - talkedToBarman = new VarbitRequirement(321, 1); + talkedToBarman = new VarbitRequirement(VarbitID.FEUD_VAR_DRINK_FOUND, 1); // 345 and 328 when talking to hag - talkedToAliTheHag = new VarbitRequirement(328, 1); - givenPoisonToHag = new VarbitRequirement(328, 2); + talkedToAliTheHag = new VarbitRequirement(VarbitID.FEUD_HAG_LIST, 1); + givenPoisonToHag = new VarbitRequirement(VarbitID.FEUD_HAG_LIST, 2); // 335 = Poisoned drink //322 Menaphite - menaphiteThugAlive = new VarbitRequirement(322, 1); + menaphiteThugAlive = new VarbitRequirement(VarbitID.FEUD_VAR_MENABOSS, 1); // Talked to villager about Menaphite 343, 338 - talkedToVillagerAboutMenaphite = new VarbitRequirement(343, 1); - banditChampionSpawned = new VarbitRequirement(323, 1); + talkedToVillagerAboutMenaphite = new VarbitRequirement(VarbitID.FEUD_TALK_VILLAGER, 1); + banditChampionSpawned = new VarbitRequirement(VarbitID.FEUD_VAR_BANDITBOSS, 1); // 343 -> Mayor spawned - mayorSpawned = new VarbitRequirement(343, 2); + mayorSpawned = new VarbitRequirement(VarbitID.FEUD_TALK_VILLAGER, 2); } @Override @@ -288,7 +288,7 @@ public void setupConditions() hasDisguiseComponents = new Conditions(fakeBeard, headPiece); doesNotHaveDisguise = new Conditions(LogicType.NAND, desertDisguise); doesNotHaveDisguiseComponents = new Conditions(LogicType.NAND, fakeBeard, headPiece); - hasDisguise = new Conditions(desertDisguise.alsoCheckBank(questBank)); + hasDisguise = new Conditions(desertDisguise.alsoCheckBank()); //a notThroughShantayGate = new Conditions(LogicType.NAND, inShantayDesertSide); @@ -381,13 +381,13 @@ public void setupSteps() //Step 14 //Open the Door - openTheDoor = new ObjectStep(this, 6238, "Open the door.", doorKeys); + openTheDoor = new ObjectStep(this, ObjectID.FEUD_CLOSED_DOOR_LEFT, "Open the door.", doorKeys); openTheDoor.addAlternateObjects(6240); openTheDoor.addIcon(ItemID.FEUD_MAYORS_HOUSE_KEYS); goUpStairs = new ObjectStep(this, ObjectID.FEUD_INSIDESTAIRS_BASE, "Go up the stairs."); - crackTheSafe = new ObjectStep(this, 6276, "Search the painting to reveal the safe. Enter the code 1, 1, 2, 3, 5, 8."); + crackTheSafe = new ObjectStep(this, ObjectID.FEUD_MAYORS_PICTURE, "Search the painting to reveal the safe. Enter the code 1, 1, 2, 3, 5, 8."); //Step 15 //Return the Jewels diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefinaldawn/TheFinalDawn.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefinaldawn/TheFinalDawn.java index 06697c74a04..4c3b5719acd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefinaldawn/TheFinalDawn.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefinaldawn/TheFinalDawn.java @@ -50,9 +50,6 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; import net.runelite.client.plugins.microbot.questhelper.steps.*; - -import java.util.*; - import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetHighlight; import net.runelite.api.QuestState; @@ -64,6 +61,8 @@ import net.runelite.api.gameval.*; import net.runelite.client.eventbus.Subscribe; +import java.util.*; + import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; /** @@ -517,7 +516,7 @@ private int getSumOfLitBraziers() for (WorldPoint wp : wps) { - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, wp); + List localPoints = QuestPerspective.getLocalPointsFromWorldPointInInstance(client.getTopLevelWorldView(), wp); if (localPoints.isEmpty()) return -1; @@ -743,7 +742,7 @@ protected void setupRequirements() notInspectedSkeleton = not(new VarbitRequirement(VarbitID.VMQ4_FINAL_CHAMBER_TABLET_INSPECT, 1)); notInspectedDoor = not(new VarbitRequirement(VarbitID.VMQ4_FINAL_CHAMBER_DOOR_INSPECT, 1)); quetzalMadeSalvagerOverlook = new VarbitRequirement(VarbitID.QUETZAL_SALVAGEROVERLOOK, 1); - hasAtesAndActivatedTeleport = and(pendant.alsoCheckBank(questBank), new VarbitRequirement(VarbitID.PENDANT_OF_ATES_TWILIGHT_FOUND, 1, Operation.GREATER_EQUAL)); + hasAtesAndActivatedTeleport = and(pendant.alsoCheckBank(), new VarbitRequirement(VarbitID.PENDANT_OF_ATES_TWILIGHT_FOUND, 1, Operation.GREATER_EQUAL)); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/JugPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/JugPuzzle.java index 83ba01e4ae6..d2142ed6bc6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/JugPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/JugPuzzle.java @@ -44,6 +44,7 @@ import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; @@ -254,7 +255,7 @@ private void setupZones() private void setupConditions() { missingTinderbox = new ItemRequirements(LogicType.NAND, tinderbox); - hasFilledWithFuel = new VarbitRequirement(7798, 3); + hasFilledWithFuel = new VarbitRequirement(VarbitID.LOVAQUEST_FURNACE, 3); inFirstFloor = new ZoneRequirement(firstFloor); inSecondFloor = new ZoneRequirement(secondFloor); inBasement = new ZoneRequirement(basement); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PotionPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PotionPuzzle.java index fe26de7433a..7fc3d96fb4f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PotionPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PotionPuzzle.java @@ -40,6 +40,7 @@ import net.runelite.api.gameval.InterfaceID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; @@ -195,8 +196,8 @@ private void setupConditions() inSecondFloor = new ZoneRequirement(secondFloor); inBasement = new ZoneRequirement(basement); - triedToActivate = new VarbitRequirement(7799, 2); - cleanedRefinery = new VarbitRequirement(7799, 3); + triedToActivate = new VarbitRequirement(VarbitID.LOVAQUEST_REFINERY, 2); + cleanedRefinery = new VarbitRequirement(VarbitID.LOVAQUEST_REFINERY, 3); hasFluids = new Requirement[]{null, fluid1, fluid2, fluid3, fluid4, fluid5 }; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PowerPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PowerPuzzle.java index d8348a91a4a..60bd53c1f80 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PowerPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/PowerPuzzle.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarbitChanged; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; @@ -70,14 +71,14 @@ private void updateSolvedPositionState() { for (int i=0; i < 36; i++) { - int currentPos = client.getVarbitValue(7811+i); + int currentPos = client.getVarbitValue(VarbitID.LOVAQUEST_POWER_GRID_A1 + i); if (solvedPositions[i] == 4) { currentPositionCorrect[i] = currentPos == 0 || currentPos == 2; } else { - currentPositionCorrect[i] = client.getVarbitValue(7811 + i) == solvedPositions[i]; + currentPositionCorrect[i] = client.getVarbitValue(VarbitID.LOVAQUEST_POWER_GRID_A1 + i) == solvedPositions[i]; } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/TheForsakenTower.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/TheForsakenTower.java index a12f42a2992..bb7aacbcaa5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/TheForsakenTower.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theforsakentower/TheForsakenTower.java @@ -135,11 +135,11 @@ public void setupConditions() inSecondFloor = new ZoneRequirement(secondFloor); inBasement = new ZoneRequirement(basement); - inspectedDisplayCase = new VarbitRequirement(7804, 1); - finishedPowerPuzzle = new VarbitRequirement(7797, 4); - finishedFurnacePuzzle = new VarbitRequirement(7798, 4); - finishedPotionPuzzle = new VarbitRequirement(7799, 4); - finishedAltarPuzzle = new VarbitRequirement(7800, 2); + inspectedDisplayCase = new VarbitRequirement(VarbitID.LOVAQUEST_FOUNDHAMMER, 1); + finishedPowerPuzzle = new VarbitRequirement(VarbitID.LOVAQUEST_ELECTRICITY, 4); + finishedFurnacePuzzle = new VarbitRequirement(VarbitID.LOVAQUEST_FURNACE, 4); + finishedPotionPuzzle = new VarbitRequirement(VarbitID.LOVAQUEST_REFINERY, 4); + finishedAltarPuzzle = new VarbitRequirement(VarbitID.LOVAQUEST_ALTAR, 2); generatorStarted = new VarbitRequirement(VarbitID.LOVAQUEST_ELECTRICITY, 2, Operation.GREATER_EQUAL); powerPuzzleVisible = new WidgetModelRequirement(624, 2, 0, 36246); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikexiles/TheFremennikExiles.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikexiles/TheFremennikExiles.java index 8611edce08e..e43e810233f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikexiles/TheFremennikExiles.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikexiles/TheFremennikExiles.java @@ -53,7 +53,6 @@ import net.runelite.api.Prayer; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.Varbits; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; @@ -244,7 +243,7 @@ protected void setupRequirements() sealOfPassage = new ItemRequirement("Seal of passage", ItemID.LUNAR_SEAL_OF_PASSAGE).isNotConsumed(); sealOfPassageOrEliteDiary = ComplexRequirementBuilder.or("Seal of Passage") - .with(new VarbitRequirement(Varbits.DIARY_FREMENNIK_ELITE, 1)) + .with(new VarbitRequirement(VarbitID.FREMENNIK_DIARY_ELITE_COMPLETE, 1)) .with(sealOfPassage) .build(); @@ -281,17 +280,17 @@ protected void setupRequirements() // Quest events younglingNearby = new NpcCondition(NpcID.VIKINGEXILE_YOUNGLING); letterNearby = new ItemOnTileRequirement(letter); - killedYoungling = new VarbitRequirement(9460, 1); - hasReadLetter = new VarbitRequirement(9461, 1); + killedYoungling = new VarbitRequirement(VarbitID.VIKINGEXILE_YOUNGLING_KILLED, 1); + hasReadLetter = new VarbitRequirement(VarbitID.VIKINGEXILE_LETTER_READ, 1); // 9468 = 1, youngling popped out first time askedAboutShield = new VarbitRequirement(VarbitID.VIKINGEXILE_SHIELD_INFO, 1, Operation.GREATER_EQUAL); askedAboutGlass = new VarbitRequirement(VarbitID.VIKINGEXILE_GLASS_INFO, 1, Operation.GREATER_EQUAL); askedAboutRock = new VarbitRequirement(VarbitID.VIKINGEXILE_ROCK_INFO, 1, Operation.GREATER_EQUAL); askedAboutSigil = new VarbitRequirement(VarbitID.VIKINGEXILE_SIGIL_INFO, 1, Operation.GREATER_EQUAL); askedAboutAllShieldParts = new Conditions(askedAboutShield, askedAboutGlass, askedAboutRock, askedAboutSigil); - triedToThrowRockIntoGeyser = new VarbitRequirement(9464, 2); - talkedToPeer = new VarbitRequirement(9464, 3); - rockInGeyser = new VarbitRequirement(9470, 1); + triedToThrowRockIntoGeyser = new VarbitRequirement(VarbitID.VIKINGEXILE_ROCK_INFO, 2); + talkedToPeer = new VarbitRequirement(VarbitID.VIKINGEXILE_ROCK_INFO, 3); + rockInGeyser = new VarbitRequirement(VarbitID.VIKINGEXILE_ROCK_GONE, 1); // been given shield, 9471 = 1 // Fighting basilisks, 9466 0-30 for 0-100% // Zone checks diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/KillTrolls.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/KillTrolls.java index db9b3d74145..8ece88da9a6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/KillTrolls.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/KillTrolls.java @@ -5,6 +5,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.Subscribe; public class KillTrolls extends NpcStep @@ -23,7 +24,7 @@ public void onGameTick(GameTick event) protected void updateSteps() { - int numToKill = client.getVarbitValue(3312); + int numToKill = client.getVarbitValue(VarbitID.FRIS_TASK); this.setText("Kill " + numToKill + " trolls to continue."); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/TheFremennikIsles.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/TheFremennikIsles.java index cca413db0f6..9eeb50b5f38 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/TheFremennikIsles.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremennikisles/TheFremennikIsles.java @@ -54,6 +54,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -402,18 +403,18 @@ public void setupConditions() inTrollCave = new ZoneRequirement(trollCave); inKingCave = new ZoneRequirement(kingCave); hasJesterOutfit = new ItemRequirements(jesterBoots, jesterHat, jesterTights, jesterTop); - jestering1 = new VarbitRequirement(6719, 2); - repairedBridge1 = new VarbitRequirement(3313, 1); - repairedBridge2 = new VarbitRequirement(3314, 1); - - collectedHring = new VarbitRequirement(3321, 1); - collectedSkuli = new VarbitRequirement(3320, 1); - collectedValigga = new VarbitRequirement(3324, 1); - collectedKeepa = new VarbitRequirement(3325, 1); - collectedRaum = new VarbitRequirement(3323, 1); - collectedFlosi = new VarbitRequirement(3322, 1); - - killedTrolls = new VarbitRequirement(3312, 0); + jestering1 = new VarbitRequirement(VarbitID.MINIMAP_STATE, 2); + repairedBridge1 = new VarbitRequirement(VarbitID.FRIS_M_B3, 1); + repairedBridge2 = new VarbitRequirement(VarbitID.FRIS_M_B4, 1); + + collectedHring = new VarbitRequirement(VarbitID.FRISD_OREMERCHANT_TAXCOLLECTED, 1); + collectedSkuli = new VarbitRequirement(VarbitID.FRISD_WEAPONMERCHANT_TAXCOLLECTED, 1); + collectedValigga = new VarbitRequirement(VarbitID.FRISD_PUB_TAXCOLLECTED, 1); + collectedKeepa = new VarbitRequirement(VarbitID.FRISD_COOK_TAXCOLLECTED, 1); + collectedRaum = new VarbitRequirement(VarbitID.FRISD_ARMOURMERCHANT_TAXCOLLECTED, 1); + collectedFlosi = new VarbitRequirement(VarbitID.FRISD_FISHMONGER_TAXCOLLECTED, 1); + + killedTrolls = new VarbitRequirement(VarbitID.FRIS_TASK, 0); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremenniktrials/TheFremennikTrials.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremenniktrials/TheFremennikTrials.java index c369ea08c3a..1dca85d6b7a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremenniktrials/TheFremennikTrials.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thefremenniktrials/TheFremennikTrials.java @@ -49,10 +49,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.InterfaceID; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; import java.util.*; @@ -117,8 +114,8 @@ public Map loadSteps() steps.put(0, talkToBrundt); olafTask = new ConditionalStep(this, talkToOlaf); - olafTask.addStep(enchantedLyre.alsoCheckBank(questBank), performMusic); - olafTask.addStep(new Conditions(hasStartedOlaf, lyre.alsoCheckBank(questBank)), enchantLyre); + olafTask.addStep(enchantedLyre.alsoCheckBank(), performMusic); + olafTask.addStep(new Conditions(hasStartedOlaf, lyre.alsoCheckBank()), enchantLyre); olafTask.addStep(new Conditions(goldenWool, lyreUnstrung), makeLyre); olafTask.addStep(new Conditions(goldenFleece, lyreUnstrung), spinWool); olafTask.addStep(new Conditions(goldenFleece, branch), fletchLyre); @@ -139,9 +136,9 @@ public Map loadSteps() manniTask.addStep(new Conditions(hasPlacedStrangeObject, alcoholFreeBeer), getKegOfBeer); manniTask.addStep(new Conditions(hasPlacedStrangeObject), getAlcoholFreeBeer); manniTask.addStep(new Conditions(talkedToManni, litStrangeObject, alcoholFreeBeer, isNearPipe), useStrangeObjectOnPipe); - manniTask.addStep(new Conditions(talkedToManni, strangeObject.alsoCheckBank(questBank), alcoholFreeBeer, isNearPipe), useStrangeObject); - manniTask.addStep(new Conditions(talkedToManni, strangeObject.alsoCheckBank(questBank), alcoholFreeBeer), prepareToUseStrangeObject); - manniTask.addStep(new Conditions(talkedToManni, strangeObject.alsoCheckBank(questBank)), getAlcoholFreeBeer); + manniTask.addStep(new Conditions(talkedToManni, strangeObject.alsoCheckBank(), alcoholFreeBeer, isNearPipe), useStrangeObject); + manniTask.addStep(new Conditions(talkedToManni, strangeObject.alsoCheckBank(), alcoholFreeBeer), prepareToUseStrangeObject); + manniTask.addStep(new Conditions(talkedToManni, strangeObject.alsoCheckBank()), getAlcoholFreeBeer); manniTask.addStep(new Conditions(talkedToManni, beer), getStrangeObject); manniTask.addStep(talkedToManni, pickUpBeer); manniTask.setLockingCondition(finishedManniTask); @@ -403,7 +400,7 @@ public void setupConditions() new DialogRequirement("I see... okay, well, bye!"), new DialogRequirement("Human call itself Askeladden!") )); - gottenRock = new VarbitRequirement(6486, 1); + gottenRock = new VarbitRequirement(VarbitID.ASKELLADEN_HASOP, 1); petRockInCauldron = new RuneliteRequirement(configManager, "fremmytrialsaddedpetrock", new ChatMessageRequirement("You put your pet rock into the cauldron.") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegardenofdeath/TheGardenOfDeath.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegardenofdeath/TheGardenOfDeath.java index 0b5c1e2f360..bae2a3a9a33 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegardenofdeath/TheGardenOfDeath.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegardenofdeath/TheGardenOfDeath.java @@ -152,8 +152,8 @@ public Map loadSteps() steps.put(48, t4); ConditionalStep finalStep = new ConditionalStep(this, enterMorraHole); - finalStep.addStep(warningNote.alsoCheckBank(questBank), readWarningNote); - finalStep.addStep(stoneTablet4.alsoCheckBank(questBank), readTabletFinal); + finalStep.addStep(warningNote.alsoCheckBank(), readWarningNote); + finalStep.addStep(stoneTablet4.alsoCheckBank(), readTabletFinal); finalStep.addStep(inMorraHole, searchForTablet4); steps.put(50, finalStep); steps.put(52, finalStep); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegiantdwarf/TheGiantDwarf.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegiantdwarf/TheGiantDwarf.java index c3a85eac4b6..c78e9cdf101 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegiantdwarf/TheGiantDwarf.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegiantdwarf/TheGiantDwarf.java @@ -213,7 +213,7 @@ public void setupConditions() new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "with the book on dwarven costumes that I got from the") ); - talkedToVermundiWithBook = new VarbitRequirement(584, 1); + talkedToVermundiWithBook = new VarbitRequirement(VarbitID.GIANTDWARF_VERMUNDI_GIVENBOOK, 1); askedToStartMachine = new Conditions(true, LogicType.OR, new DialogRequirement(questHelperPlugin.getPlayerStateManager().getPlayerName(), @@ -277,7 +277,7 @@ public void setupConditions() talkedToReldo = new Conditions(true, LogicType.OR, new DialogRequirement("you could try taking them some redberry pie.")); - givenThurgoPie = new VarbitRequirement(580, 1); + givenThurgoPie = new VarbitRequirement(VarbitID.GIANTDWARF_PIE_GIVEN, 1); // Thurgo makes axe, 2781 = 1 givenDwarvenBattleaxe = new VarbitRequirement(VarbitID.GIANTDWARF_MODEL_STATE, true, 2); hasDwarvenBattleaxe = new Conditions(true, LogicType.OR, @@ -290,14 +290,14 @@ public void setupConditions() completedSecretaryTasks = new Conditions(true, new DialogRequirement("I'm afraid I have no more work to offer you", "You should speak directly to the director.")); completedDirectorTasks = new Conditions(true, new DialogRequirement("Have you ever considered joining")); joinedCompany = new Conditions(true, LogicType.OR, - new VarbitRequirement(578, 1), // Purple Pewter - new VarbitRequirement(578, 2), // Yellow Fortune - new VarbitRequirement(578, 3), // Blue Opal - new VarbitRequirement(578, 4), // Green Gem - new VarbitRequirement(578, 5), // White Chisel - new VarbitRequirement(578, 6), // Silver Cog - new VarbitRequirement(578, 7), // Brown Engine - new VarbitRequirement(578, 8), // Would be Red Axe? + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 1), // Purple Pewter + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 2), // Yellow Fortune + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 3), // Blue Opal + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 4), // Green Gem + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 5), // White Chisel + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 6), // Silver Cog + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 7), // Brown Engine + new VarbitRequirement(VarbitID.GIANTDWARF_CURRENT_COMPANY, 8), // Would be Red Axe? new DialogRequirement("I will not disappoint you."), new DialogRequirement("Come in, come in my friend!")); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegolem/TheGolem.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegolem/TheGolem.java index 3bc26cf8457..e3d178d04c4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegolem/TheGolem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegolem/TheGolem.java @@ -30,9 +30,9 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.TeleportItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitBuilder; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -48,103 +48,132 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; public class TheGolem extends BasicQuestHelper { - //Items Required - ItemRequirement strangeImplement, strangeImplementHighlight, programHighlight, pestleAndMortarHighlight, mushroomHighlight, vial, inkHighlight, pestleAndMortar, - papyrus, letter, clay4Highlight, notesHighlight, phoenixFeather, quill, clay3Highlight, clay2Highlight, clay1Highlight, key, statuette, statuetteHighlight, - papyrusHighlight; + // Required items + ItemRequirement clay4Highlight; + ItemRequirement vial; + ItemRequirement pestleAndMortar; + ItemRequirement papyrus; + + // Recommended items + ItemRequirement varrockTeleport; + ItemRequirement digsiteTeleport; + ItemRequirement waterskins; + ItemRequirement necklaceOfPassage; + + // Mid-quest item requirements + ItemRequirement pestleAndMortarHighlight; + ItemRequirement strangeImplement; + ItemRequirement strangeImplementHighlight; + ItemRequirement programHighlight; + ItemRequirement mushroomHighlight; + ItemRequirement inkHighlight; + ItemRequirement letter; + ItemRequirement notesHighlight; + ItemRequirement phoenixFeather; + ItemRequirement quill; + ItemRequirement clay3Highlight; + ItemRequirement clay2Highlight; + ItemRequirement clay1Highlight; + ItemRequirement key; + ItemRequirement statuette; + ItemRequirement statuetteHighlight; + ItemRequirement papyrusHighlight; - //Items Recommended - ItemRequirement varrockTeleport, digsiteTeleport, waterskins, necklaceOfPassage; + // Zones + Zone ruin; + Zone upstairsMuseum; + Zone throneRoom; - Requirement inRuin, turnedStatue1, turnedStatue2, turnedStatue3, turnedStatue4,hasReadLetter, added1Clay, added2Clay, added3Clay, talkedToElissa, - hasReadNotes, talkedToCurator, inUpstairsMuseum, stolenStatuette, inThroneRoom, openedHead, enteredRuins; + // Miscellaneous requirements + ZoneRequirement inRuin; + ZoneRequirement inUpstairsMuseum; + ZoneRequirement inThroneRoom; + VarbitRequirement turnedStatue1; + VarbitRequirement turnedStatue2; + VarbitRequirement turnedStatue3; + VarbitRequirement turnedStatue4; + VarbitRequirement hasReadLetter; + VarbitRequirement added1Clay; + VarbitRequirement added2Clay; + VarbitRequirement added3Clay; + VarbitRequirement talkedToElissa; + VarbitRequirement hasReadNotes; + VarbitRequirement talkedToCurator; + Conditions stolenStatuette; + VarbitRequirement openedHead; + VarbitRequirement enteredRuins; - QuestStep pickUpLetter, readLetter, talkToGolem, useClay, useClay2, useClay3, useClay4, talkToElissa, searchBookcase, readBook, talkToCurator, pickpocketCurator, goUpInMuseum, openCabinet, - stealFeather, enterRuin, useStatuette, turnStatue1, turnStatue2, turnStatue3, turnStatue4, enterThroneRoom, leaveThroneRoom, leaveRuin, pickBlackMushroom, grindMushroom, - useFeatherOnInk, talkToGolemAfterPortal, useQuillOnPapyrus, useImplementOnGolem, useProgramOnGolem, pickUpImplement, enterRuinWithoutStatuette, enterRuinForFirstTime; + // Steps + // -- Starting off + NpcStep talkToGolem; - //Zones - Zone ruin, upstairsMuseum, throneRoom; + NpcStep useClay; + NpcStep useClay2; + NpcStep useClay3; + NpcStep useClay4; - @Override - public Map loadSteps() - { - Map steps = new HashMap<>(); - initializeRequirements(); - setupConditions(); - setupSteps(); + DetailedQuestStep pickUpLetter; + DetailedQuestStep readLetter; - steps.put(0, talkToGolem); + ObjectStep enterRuinForFirstTime; - ConditionalStep repairGolem = new ConditionalStep(this, useClay); - repairGolem.addStep(added3Clay, useClay4); - repairGolem.addStep(added2Clay, useClay3); - repairGolem.addStep(added1Clay, useClay2); + DetailedQuestStep pickUpImplement; - steps.put(1, repairGolem); + // -- Finding the statuette + NpcStep talkToElissa; - ConditionalStep goTalkToElissa = new ConditionalStep(this, pickUpLetter); - goTalkToElissa.addStep(talkedToCurator, pickpocketCurator); - goTalkToElissa.addStep(new Conditions(hasReadNotes, enteredRuins), talkToCurator); - goTalkToElissa.addStep(new Conditions(notesHighlight, enteredRuins), readBook); - goTalkToElissa.addStep(new Conditions(talkedToElissa, enteredRuins), searchBookcase); - goTalkToElissa.addStep(new Conditions(inRuin, strangeImplement), talkToElissa); - goTalkToElissa.addStep(new Conditions(inRuin), pickUpImplement); - goTalkToElissa.addStep(new Conditions(hasReadLetter, enteredRuins), talkToElissa); - goTalkToElissa.addStep(hasReadLetter, enterRuinForFirstTime); - goTalkToElissa.addStep(letter, readLetter); + ObjectStep searchBookcase; - steps.put(2, goTalkToElissa); + DetailedQuestStep readBook; - ConditionalStep getStatuette = new ConditionalStep(this, pickpocketCurator); - getStatuette.addStep(new Conditions(stolenStatuette, inRuin), useStatuette); - getStatuette.addStep(stolenStatuette, enterRuin); - getStatuette.addStep(new Conditions(key, inUpstairsMuseum), openCabinet); - getStatuette.addStep(key, goUpInMuseum); + NpcStep talkToCurator; - steps.put(3, getStatuette); + NpcStep pickpocketCurator; - ConditionalStep openPortal = new ConditionalStep(this, enterRuin); - openPortal.addStep(new Conditions(turnedStatue4, turnedStatue3, turnedStatue2, inRuin), turnStatue1); - openPortal.addStep(new Conditions(turnedStatue4, turnedStatue3, inRuin), turnStatue2); - openPortal.addStep(new Conditions(turnedStatue4, inRuin), turnStatue3); - openPortal.addStep(new Conditions(inRuin), turnStatue4); + ObjectStep goUpInMuseum; - steps.put(4, openPortal); + ObjectStep openCabinet; - ConditionalStep goEnterPortal = new ConditionalStep(this, enterRuin); - goEnterPortal.addStep(new Conditions(inRuin, strangeImplement), enterThroneRoom); - goEnterPortal.addStep(new Conditions(inRuin), pickUpImplement); + // -- Opening the portal + ObjectStep enterRuin; + ObjectStep enterRuinWithoutStatuette; - steps.put(5, goEnterPortal); + ObjectStep useStatuette; - ConditionalStep returnToTheGolem = new ConditionalStep(this, talkToGolemAfterPortal); - returnToTheGolem.addStep(new Conditions(inRuin, strangeImplement), leaveRuin); - returnToTheGolem.addStep(new Conditions(inRuin), pickUpImplement); - returnToTheGolem.addStep(inThroneRoom, leaveThroneRoom); + ObjectStep turnStatue1; + ObjectStep turnStatue2; + ObjectStep turnStatue3; + ObjectStep turnStatue4; - steps.put(6, returnToTheGolem); + ObjectStep enterThroneRoom; + ObjectStep leaveThroneRoom; - ConditionalStep reprogramTheGolem = new ConditionalStep(this, enterRuinWithoutStatuette); - reprogramTheGolem.addStep(new Conditions(openedHead, programHighlight), useProgramOnGolem); - reprogramTheGolem.addStep(new Conditions(strangeImplement, programHighlight), useImplementOnGolem); - reprogramTheGolem.addStep(new Conditions(strangeImplement, quill), useQuillOnPapyrus); - reprogramTheGolem.addStep(new Conditions(strangeImplement, phoenixFeather, inkHighlight), useFeatherOnInk); - reprogramTheGolem.addStep(new Conditions(strangeImplement, inkHighlight), stealFeather); - reprogramTheGolem.addStep(new Conditions(strangeImplement, mushroomHighlight), grindMushroom); - reprogramTheGolem.addStep(new Conditions(inRuin, strangeImplement), leaveRuin); - reprogramTheGolem.addStep(new Conditions(inRuin), pickUpImplement); - reprogramTheGolem.addStep(new Conditions(strangeImplement), pickBlackMushroom); - reprogramTheGolem.addStep(inThroneRoom, leaveThroneRoom); + ObjectStep leaveRuin; + NpcStep talkToGolemAfterPortal; - steps.put(7, reprogramTheGolem); + ObjectStep pickBlackMushroom; - return steps; - } + DetailedQuestStep grindMushroom; + + NpcStep stealFeather; + + DetailedQuestStep useFeatherOnInk; + + DetailedQuestStep useQuillOnPapyrus; + + NpcStep useImplementOnGolem; + + NpcStep useProgramOnGolem; @Override protected void setupZones() @@ -212,48 +241,44 @@ protected void setupRequirements() varrockTeleport = new ItemRequirement("Varrock teleport", ItemID.POH_TABLET_VARROCKTELEPORT); digsiteTeleport = new ItemRequirement("Digsite teleport", ItemCollections.DIGSITE_PENDANTS); digsiteTeleport.addAlternates(ItemID.TELEPORTSCROLL_DIGSITE); - necklaceOfPassage = new ItemRequirement("Necklace of passage to Eagle's Eyrie", ItemCollections.NECKLACE_OF_PASSAGES); + necklaceOfPassage = new TeleportItemRequirement("Necklace of passage to Eagle's Eyrie", ItemCollections.NECKLACE_OF_PASSAGES, 3); waterskins = new ItemRequirement("Waterskins", ItemID.WATER_SKIN4, -1); - } - private void setupConditions() - { inRuin = new ZoneRequirement(ruin); inUpstairsMuseum = new ZoneRequirement(upstairsMuseum); inThroneRoom = new ZoneRequirement(throneRoom); - hasReadLetter = new VarbitRequirement(VarbitID.GOLEM_B, 1, Operation.GREATER_EQUAL); - talkedToElissa = new VarbitRequirement(VarbitID.GOLEM_B, 2, Operation.GREATER_EQUAL); - hasReadNotes = new VarbitRequirement(VarbitID.GOLEM_B, 3, Operation.GREATER_EQUAL); - talkedToCurator = new VarbitRequirement(VarbitID.GOLEM_B, 4, Operation.GREATER_EQUAL); + var questSideState = new VarbitBuilder(VarbitID.GOLEM_B); + hasReadLetter = questSideState.ge(1); + talkedToElissa = questSideState.ge(2); + hasReadNotes = questSideState.ge(3); + talkedToCurator = questSideState.ge(4); - added1Clay = new VarbitRequirement(348, 1); - added2Clay = new VarbitRequirement(348, 2); - added3Clay = new VarbitRequirement(348, 3); + var golemClayState = new VarbitBuilder(VarbitID.GOLEM_CLAY); + added1Clay = golemClayState.eq(1); + added2Clay = golemClayState.eq(2); + added3Clay = golemClayState.eq(3); - turnedStatue1 = new VarbitRequirement(349, 1); - turnedStatue2 = new VarbitRequirement(350, 1); - turnedStatue3 = new VarbitRequirement(351, 0); - turnedStatue4 = new VarbitRequirement(352, 2); + turnedStatue1 = new VarbitRequirement(VarbitID.GOLEM_STATUETTESTATUSA, 1); + turnedStatue2 = new VarbitRequirement(VarbitID.GOLEM_STATUETTESTATUSB, 1); + turnedStatue3 = new VarbitRequirement(VarbitID.GOLEM_STATUETTESTATUSC, 0); + turnedStatue4 = new VarbitRequirement(VarbitID.GOLEM_STATUETTESTATUSD, 2); - openedHead = new VarbitRequirement(353, 1); + openedHead = new VarbitRequirement(VarbitID.GOLEM_HEAD_OPEN, 1); - stolenStatuette = new Conditions(LogicType.OR, new VarbitRequirement(355, 1), statuette); + stolenStatuette = or(new VarbitRequirement(VarbitID.GOLEM_RETRIEVED_STATUETTE, 1), statuette); - enteredRuins = new VarbitRequirement(356, 1); + enteredRuins = new VarbitRequirement(VarbitID.GOLEM_SEEN_UNDERGROUND, 1); } private void setupSteps() { - pickUpLetter = new DetailedQuestStep(this, new WorldPoint(3479, 3092, 0), - "Pick up the letter on the floor in Uzer and read it.", letter); - ((DetailedQuestStep) pickUpLetter).addTeleport(necklaceOfPassage); - pickUpLetter.addDialogSteps("Eagle's Eyrie"); - readLetter = new DetailedQuestStep(this, "Read the letter.", letter); - pickUpLetter.addSubSteps(readLetter); + // -- Starting off + talkToGolem = new NpcStep(this, NpcID.GOLEM_BROKEN_GOLEM, new WorldPoint(3485, 3088, 0), "Talk to the Golem in Uzer to start the quest."); + talkToGolem.addDialogStep("Yes."); + talkToGolem.addTeleport(necklaceOfPassage.quantity(1)); + talkToGolem.addDialogSteps("Eagle's Eyrie"); - talkToGolem = new NpcStep(this, NpcID.GOLEM_BROKEN_GOLEM, new WorldPoint(3485, 3088, 0), "Talk to the Golem in Uzer."); - talkToGolem.addDialogStep("Shall I try to repair you?"); useClay = new NpcStep(this, NpcID.GOLEM_BROKEN_GOLEM, new WorldPoint(3485, 3088, 0), "Use 4 soft clay on the Golem in Uzer.", clay4Highlight); useClay.addIcon(ItemID.SOFTCLAY); useClay2 = new NpcStep(this, NpcID.GOLEM_BROKEN_GOLEM, new WorldPoint(3485, 3088, 0), "Use 3 soft clay on the Golem in Uzer.", clay3Highlight); @@ -262,69 +287,183 @@ private void setupSteps() useClay3.addIcon(ItemID.SOFTCLAY); useClay4 = new NpcStep(this, NpcID.GOLEM_PARTIALLY_BROKEN_GOLEM, new WorldPoint(3485, 3088, 0), "Use 1 soft clay on the Golem in Uzer.", clay1Highlight); useClay4.addIcon(ItemID.SOFTCLAY); + useClay.addSubSteps(useClay2, useClay3, useClay4); + + pickUpLetter = new DetailedQuestStep(this, new WorldPoint(3479, 3092, 0), + "Pick up the letter on the floor in Uzer and read it.", letter); + pickUpLetter.addDialogSteps("Eagle's Eyrie"); + readLetter = new DetailedQuestStep(this, "Read the letter.", letter); + pickUpLetter.addSubSteps(readLetter); - enterRuinForFirstTime = new ObjectStep(this, ObjectID.GOLEM_INSIDESTAIRS_TOP, new WorldPoint(3493, 3090, 0), "Enter the Uzer ruins."); + enterRuinForFirstTime = new ObjectStep(this, ObjectID.GOLEM_INSIDESTAIRS_TOP, new WorldPoint(3493, 3090, 0), "Enter the Uzer ruins. You can drop the Letter you just read."); + pickUpImplement = new DetailedQuestStep(this, new WorldPoint(2713, 4913, 0), "Pick up the strange implement in the north west corner of the ruin.", strangeImplement); + + // -- Finding the statuette talkToElissa = new NpcStep(this, NpcID.GOLEM_ELISSA, new WorldPoint(3378, 3428, 0), "Talk to Elissa in the north east of the Digsite."); talkToElissa.addDialogStep("I found a letter in the desert with your name on."); + talkToElissa.addTeleport(digsiteTeleport); + searchBookcase = new ObjectStep(this, ObjectID.GOLEM_BOOKCASE, new WorldPoint(3367, 3332, 0), "Search the bookcase in the south east corner of the Digsite Exam Centre."); - readBook = new DetailedQuestStep(this, "Read the notes.", notesHighlight); - talkToCurator = new NpcStep(this, NpcID.CURATOR, new WorldPoint(3256, 3449, 0), "Talk to Curator Haig in the Varrock Museum."); + + readBook = new DetailedQuestStep(this, "Read Varmen's notes.", notesHighlight); + + talkToCurator = new NpcStep(this, NpcID.CURATOR, new WorldPoint(3256, 3449, 0), "Talk to Curator Haig in the Varrock Museum. You can drop Varmen's notes."); talkToCurator.addDialogStep("I'm looking for a statuette recovered from the city of Uzer."); - pickpocketCurator = new NpcStep(this, NpcID.CURATOR, new WorldPoint(3256, 3449, 0), "Pickpocket Curator Haig."); - goUpInMuseum = new ObjectStep(this, ObjectID.FAI_VARROCK_WOODENSTAIRS_CASTLE, new WorldPoint(3267, 3453, 0), "Go to the first floor of the Varrock Museum and right-click open the golem statue's display case.", key); + talkToCurator.addTeleport(varrockTeleport); + + pickpocketCurator = new NpcStep(this, NpcID.CURATOR, new WorldPoint(3256, 3449, 0), "Pickpocket Curator Haig for the Display cabinet key."); + + goUpInMuseum = new ObjectStep(this, ObjectID.FAI_VARROCK_WOODENSTAIRS_CASTLE, new WorldPoint(3266, 3452, 0), "Go to the first floor of the Varrock Museum and right-click open the golem statue's display case.", key); + openCabinet = new ObjectStep(this, ObjectID.VM_TIMELINE_TERRACOTTA_STATUE, new WorldPoint(3257, 3453, 1), "Right-click open the golem statue's display case.", key); - stealFeather = new NpcStep(this, NpcID.GOLEM_PHOENIX, new WorldPoint(3414, 3154, 0), "Steal a feather from the desert phoenix north of Uzer."); - ((NpcStep) stealFeather).addTeleport(necklaceOfPassage); - stealFeather.addDialogSteps("Eagle's Eyrie"); + // -- Opening the portal enterRuin = new ObjectStep(this, ObjectID.GOLEM_INSIDESTAIRS_TOP, new WorldPoint(3493, 3090, 0), "Enter the Uzer ruins.", statuette, pestleAndMortar, vial, papyrus); - enterRuinWithoutStatuette = new ObjectStep(this, ObjectID.GOLEM_INSIDESTAIRS_TOP, new WorldPoint(3493, 3090, 0), "Enter the Uzer ruins."); + enterRuin.addTeleport(necklaceOfPassage.quantity(1)); + enterRuin.addDialogSteps("Eagle's Eyrie"); + enterRuinWithoutStatuette = new ObjectStep(this, ObjectID.GOLEM_INSIDESTAIRS_TOP, new WorldPoint(3493, 3090, 0), "Enter the Uzer ruins.", pestleAndMortar, vial, papyrus); enterRuin.addSubSteps(enterRuinWithoutStatuette); - useImplementOnGolem = new NpcStep(this, NpcID.GOLEM_FIXED_GOLEM, new WorldPoint(3485, 3088, 0), "Use the strange implement on the Golem in Uzer.", strangeImplementHighlight); - useImplementOnGolem.addIcon(ItemID.GOLEM_GOLEMKEY); - useProgramOnGolem = new NpcStep(this, NpcID.GOLEM_FIXED_GOLEM, new WorldPoint(3485, 3088, 0), "Use the golem program on the Golem in Uzer.", programHighlight); - useProgramOnGolem.addIcon(ItemID.GOLEM_PROGRAM); - useStatuette = new ObjectStep(this, ObjectID.GOLEM_STATUETTED, new WorldPoint(2725, 4896, 0), "Use the statue on the empty alcove.", statuetteHighlight); useStatuette.addIcon(ItemID.GOLEM_STATUETTE); + turnStatue1 = new ObjectStep(this, ObjectID.GOLEM_STATUETTEA, new WorldPoint(2718, 4899, 0), "Turn each of the statuettes to face the door."); turnStatue2 = new ObjectStep(this, ObjectID.GOLEM_STATUETTEB, new WorldPoint(2718, 4896, 0), "Turn each of the statuettes to face the door."); turnStatue3 = new ObjectStep(this, ObjectID.GOLEM_STATUETTEC, new WorldPoint(2725, 4899, 0), "Turn each of the statuettes to face the door."); turnStatue4 = new ObjectStep(this, ObjectID.GOLEM_STATUETTED, new WorldPoint(2725, 4896, 0), "Turn each of the statuettes to face the door."); turnStatue1.addSubSteps(turnStatue2, turnStatue3, turnStatue4); - enterThroneRoom = new ObjectStep(this, ObjectID.GOLEM_PORTAL, new WorldPoint(2722, 4913, 0), "Enter the portal."); + enterThroneRoom = new ObjectStep(this, ObjectID.GOLEM_PORTAL, new WorldPoint(2720, 4912, 0), "Enter the portal."); leaveThroneRoom = new ObjectStep(this, ObjectID.GOLEM_DEMON_PORTAL, new WorldPoint(2720, 4883, 2), "Leave the throne room and return to the Golem."); - pickUpImplement = new DetailedQuestStep(this, new WorldPoint(2713, 4913, 0), "Pick up the strange implement in the north west corner of the ruin.", strangeImplement); leaveRuin = new ObjectStep(this, ObjectID.GOLEM_INSIDESTAIRS_BASE, new WorldPoint(2722, 4885, 0), "Leave the ruins."); + talkToGolemAfterPortal = new NpcStep(this, NpcID.GOLEM_FIXED_GOLEM, new WorldPoint(3485, 3088, 0), "Talk to the Golem in Uzer."); + talkToGolemAfterPortal.addSubSteps(leaveRuin); pickBlackMushroom = new ObjectStep(this, ObjectID.GOLEM_BLACK_MUSHROOMS, new WorldPoint(3495, 3088, 0), "Pick up some black mushrooms."); + grindMushroom = new DetailedQuestStep(this, "Grind the mushrooms into a vial.", pestleAndMortarHighlight, mushroomHighlight, vial); + + stealFeather = new NpcStep(this, NpcID.GOLEM_PHOENIX, new WorldPoint(3414, 3154, 0), "Steal a feather from the desert phoenix north of Uzer."); + stealFeather.addTeleport(necklaceOfPassage.quantity(1)); + stealFeather.addDialogSteps("Eagle's Eyrie"); + useFeatherOnInk = new DetailedQuestStep(this, "Use the phoenix feather on the ink.", phoenixFeather, inkHighlight); + useQuillOnPapyrus = new DetailedQuestStep(this, "Use the phoenix quill on the papyrus.", quill, papyrusHighlight); - talkToGolemAfterPortal = new NpcStep(this, NpcID.GOLEM_FIXED_GOLEM, new WorldPoint(3485, 3088, 0), "Talk to the Golem in Uzer."); + + useImplementOnGolem = new NpcStep(this, NpcID.GOLEM_FIXED_GOLEM, new WorldPoint(3485, 3088, 0), "Use the strange implement on the Golem in Uzer.", strangeImplementHighlight); + useImplementOnGolem.addIcon(ItemID.GOLEM_GOLEMKEY); + useProgramOnGolem = new NpcStep(this, NpcID.GOLEM_FIXED_GOLEM, new WorldPoint(3485, 3088, 0), "Use the golem program on the Golem in Uzer.", programHighlight); + useProgramOnGolem.addIcon(ItemID.GOLEM_PROGRAM); } @Override - public List getItemRequirements() + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, talkToGolem); + + var repairGolem = new ConditionalStep(this, useClay); + repairGolem.addStep(added3Clay, useClay4); + repairGolem.addStep(added2Clay, useClay3); + repairGolem.addStep(added1Clay, useClay2); + + steps.put(1, repairGolem); + + var goTalkToElissa = new ConditionalStep(this, pickUpLetter); + goTalkToElissa.addStep(talkedToCurator, pickpocketCurator); + goTalkToElissa.addStep(and(hasReadNotes, enteredRuins), talkToCurator); + goTalkToElissa.addStep(and(notesHighlight, enteredRuins), readBook); + goTalkToElissa.addStep(and(talkedToElissa, enteredRuins), searchBookcase); + goTalkToElissa.addStep(and(inRuin, strangeImplement), talkToElissa); + goTalkToElissa.addStep(inRuin, pickUpImplement); + goTalkToElissa.addStep(and(hasReadLetter, enteredRuins), talkToElissa); + goTalkToElissa.addStep(hasReadLetter, enterRuinForFirstTime); + goTalkToElissa.addStep(letter, readLetter); + + steps.put(2, goTalkToElissa); + + var getStatuette = new ConditionalStep(this, pickpocketCurator); + getStatuette.addStep(and(stolenStatuette, inRuin), useStatuette); + getStatuette.addStep(stolenStatuette, enterRuin); + getStatuette.addStep(and(key, inUpstairsMuseum), openCabinet); + getStatuette.addStep(key, goUpInMuseum); + + steps.put(3, getStatuette); + + var openPortal = new ConditionalStep(this, enterRuin); + openPortal.addStep(and(turnedStatue4, turnedStatue3, turnedStatue2, inRuin), turnStatue1); + openPortal.addStep(and(turnedStatue4, turnedStatue3, inRuin), turnStatue2); + openPortal.addStep(and(turnedStatue4, inRuin), turnStatue3); + openPortal.addStep(inRuin, turnStatue4); + + steps.put(4, openPortal); + + var goEnterPortal = new ConditionalStep(this, enterRuinWithoutStatuette); + goEnterPortal.addStep(and(inRuin, strangeImplement), enterThroneRoom); + goEnterPortal.addStep(inRuin, pickUpImplement); + + steps.put(5, goEnterPortal); + + var returnToTheGolem = new ConditionalStep(this, talkToGolemAfterPortal); + returnToTheGolem.addStep(and(inRuin, strangeImplement), leaveRuin); + returnToTheGolem.addStep(inRuin, pickUpImplement); + returnToTheGolem.addStep(inThroneRoom, leaveThroneRoom); + + steps.put(6, returnToTheGolem); + + var reprogramTheGolem = new ConditionalStep(this, enterRuinWithoutStatuette); + reprogramTheGolem.addStep(and(openedHead, programHighlight), useProgramOnGolem); + reprogramTheGolem.addStep(and(strangeImplement, programHighlight), useImplementOnGolem); + reprogramTheGolem.addStep(and(strangeImplement, quill), useQuillOnPapyrus); + reprogramTheGolem.addStep(and(strangeImplement, phoenixFeather, inkHighlight), useFeatherOnInk); + reprogramTheGolem.addStep(and(strangeImplement, inkHighlight), stealFeather); + reprogramTheGolem.addStep(and(strangeImplement, mushroomHighlight), grindMushroom); + reprogramTheGolem.addStep(and(inRuin, strangeImplement), leaveRuin); + reprogramTheGolem.addStep(and(inRuin), pickUpImplement); + reprogramTheGolem.addStep(strangeImplement, pickBlackMushroom); + reprogramTheGolem.addStep(inThroneRoom, leaveThroneRoom); + + steps.put(7, reprogramTheGolem); + + return steps; + } + + @Override + public List getGeneralRequirements() { - return Arrays.asList(clay4Highlight, vial, pestleAndMortar, papyrus); + return List.of( + new SkillRequirement(Skill.CRAFTING, 20), + new SkillRequirement(Skill.THIEVING, 25, true) + ); } @Override - public List getItemRecommended() + public List getItemRequirements() { - return Arrays.asList(varrockTeleport, digsiteTeleport, waterskins); + return List.of( + clay4Highlight, + vial, + pestleAndMortar, + papyrus + ); } @Override - public List getGeneralRequirements() + public List getItemRecommended() { - return Arrays.asList(new SkillRequirement(Skill.CRAFTING, 20), - new SkillRequirement(Skill.THIEVING, 25, true)); + return List.of( + varrockTeleport, + digsiteTeleport, + necklaceOfPassage, + waterskins + ); } @Override @@ -336,39 +475,75 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Arrays.asList( - new ExperienceReward(Skill.THIEVING, 1000), - new ExperienceReward(Skill.CRAFTING, 1000)); + return List.of( + new ExperienceReward(Skill.THIEVING, 1000), + new ExperienceReward(Skill.CRAFTING, 1000) + ); } @Override public List getItemRewards() { - return Arrays.asList( - new ItemReward("Rubies (by using a chisel and hammer on the throne)", ItemID.RUBY, 2), - new ItemReward("Emeralds (by using a chisel and hammer on the throne)", ItemID.EMERALD, 2), - new ItemReward("Sapphires (by using a chisel and hammer on the throne)", ItemID.SAPPHIRE, 2)); + return List.of( + new ItemReward("Rubies (by using a chisel and hammer on the throne)", ItemID.RUBY, 2), + new ItemReward("Emeralds (by using a chisel and hammer on the throne)", ItemID.EMERALD, 2), + new ItemReward("Sapphires (by using a chisel and hammer on the throne)", ItemID.SAPPHIRE, 2) + ); } @Override public List getUnlockRewards() { - return Collections.singletonList(new UnlockReward("Ability to take the Carpet ride from Shantay Pass to Uzer.")); + return List.of( + new UnlockReward("Ability to take the Carpet ride from Shantay Pass to Uzer.") + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - - allSteps.add(new PanelDetails("Starting off", Arrays.asList(talkToGolem, useClay, pickUpLetter, enterRuinForFirstTime, - pickUpImplement), clay4Highlight)); - allSteps.add(new PanelDetails("Finding the statuette", Arrays.asList(talkToElissa, searchBookcase, readBook, - talkToCurator, pickpocketCurator, goUpInMuseum, openCabinet))); - allSteps.add(new PanelDetails("Opening the portal", Arrays.asList(enterRuin, useStatuette, turnStatue1, - enterThroneRoom, leaveThroneRoom, talkToGolemAfterPortal, pickBlackMushroom, grindMushroom, - stealFeather, useFeatherOnInk, useQuillOnPapyrus, useImplementOnGolem, useProgramOnGolem), vial, pestleAndMortar, papyrus)); - - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToGolem, + useClay, + pickUpLetter, + enterRuinForFirstTime, + pickUpImplement + ), List.of( + clay4Highlight + ))); + + sections.add(new PanelDetails("Finding the statuette", List.of( + talkToElissa, + searchBookcase, + readBook, + talkToCurator, + pickpocketCurator, + goUpInMuseum, + openCabinet + ))); + + sections.add(new PanelDetails("Opening the portal", List.of( + enterRuin, + useStatuette, + turnStatue1, + enterThroneRoom, + leaveThroneRoom, + talkToGolemAfterPortal, + pickBlackMushroom, + grindMushroom, + stealFeather, + useFeatherOnInk, + useQuillOnPapyrus, + useImplementOnGolem, + useProgramOnGolem + ), List.of( + vial, + pestleAndMortar, + papyrus + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegreatbrainrobbery/TheGreatBrainRobbery.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegreatbrainrobbery/TheGreatBrainRobbery.java index 385940d0181..5a587745080 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegreatbrainrobbery/TheGreatBrainRobbery.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thegreatbrainrobbery/TheGreatBrainRobbery.java @@ -136,10 +136,10 @@ public Map loadSteps() steps.put(20, returnAfterPeep); ConditionalStep goGetBook = new ConditionalStep(this, searchBookcase); - goGetBook.addStep(new Conditions(prayerBook.alsoCheckBank(questBank), hasReadPrayerBook, inHarmony), + goGetBook.addStep(new Conditions(prayerBook.alsoCheckBank(), hasReadPrayerBook, inHarmony), recitePrayer); - goGetBook.addStep(new Conditions(prayerBook.alsoCheckBank(questBank), hasReadPrayerBook), returnToTranquility); - goGetBook.addStep(prayerBook.alsoCheckBank(questBank), readBook); + goGetBook.addStep(new Conditions(prayerBook.alsoCheckBank(), hasReadPrayerBook), returnToTranquility); + goGetBook.addStep(prayerBook.alsoCheckBank(), readBook); steps.put(30, goGetBook); steps.put(40, goGetBook); @@ -301,8 +301,8 @@ public void setupConditions() // Pulling statue, 3401 =1, statue pulled, 3401 = 2 // 3384, 0->1, entered statue - repairedStairs = new VarbitRequirement(3385, 1); - hasReadPrayerBook = new VarbitRequirement(3386, 1); + repairedStairs = new VarbitRequirement(VarbitID.BRAIN_BROKEN_STEPS, 1); + hasReadPrayerBook = new VarbitRequirement(VarbitID.BRAIN_READ_PRAYERS, 1); // 3387 = 1, talked a bit to Tranq in Mos Le after getting the Prayer book // 3388 = 1, part way through Fenk convo @@ -315,7 +315,7 @@ public void setupConditions() addedCats = new VarbitRequirement(VarbitID.BRAIN_CRATE, 4, Operation.GREATER_EQUAL); fenkInCrate = new VarbitRequirement(VarbitID.BRAIN_CRATE, 5, Operation.GREATER_EQUAL); - addedCatsOrHas10 = new Conditions(LogicType.OR, addedCats, woodenCats.quantity(10).alsoCheckBank(questBank)); + addedCatsOrHas10 = new Conditions(LogicType.OR, addedCats, woodenCats.quantity(10).alsoCheckBank()); // 3392 0->10, added wooden cats @@ -329,18 +329,18 @@ public void setupConditions() hasFuse = new Conditions(LogicType.OR, fuse, addedFuse); hasTinderbox = new Conditions(LogicType.OR, tinderbox, litFuse); - givenClamp = new VarbitRequirement(3396, 1); - givenTongs = new VarbitRequirement(3397, 1); - givenHammer = new VarbitRequirement(3398, 1); - givenBells = new VarbitRequirement(3399, 3); - givenStaples = new VarbitRequirement(3400, 30); + givenClamp = new VarbitRequirement(VarbitID.BRAIN_CLAMP_GIVEN, 1); + givenTongs = new VarbitRequirement(VarbitID.BRAIN_TONGS_GIVEN, 1); + givenHammer = new VarbitRequirement(VarbitID.BRAIN_HAMMER_GIVEN, 1); + givenBells = new VarbitRequirement(VarbitID.BRAIN_JARS_GIVEN, 3); + givenStaples = new VarbitRequirement(VarbitID.BRAIN_STAPLES_GIVEN, 30); hadClamp = new Conditions(LogicType.OR, givenClamp, cranialClamp); hadStaples = new Conditions(LogicType.OR, givenStaples, neededStaples); hadBells = new Conditions(LogicType.OR, givenBells, neededJars); hadTongs = new Conditions(LogicType.OR, givenTongs, brainTongs); - barrelchestAppeared = new VarbitRequirement(3410, 1); + barrelchestAppeared = new VarbitRequirement(VarbitID.BRAIN_SEEN_WALLBREAKER, 1); // received blessing, 3411 = 1 } @@ -349,8 +349,8 @@ public void onGameTick(GameTick event) { int staplesNeeded = 30; int bellsNeeded = 3; - neededStaples.quantity(staplesNeeded - client.getVarbitValue(3400)); - neededJars.quantity(bellsNeeded - client.getVarbitValue(3399)); + neededStaples.quantity(staplesNeeded - client.getVarbitValue(VarbitID.BRAIN_STAPLES_GIVEN)); + neededJars.quantity(bellsNeeded - client.getVarbitValue(VarbitID.BRAIN_JARS_GIVEN)); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thehandinthesand/TheHandInTheSand.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thehandinthesand/TheHandInTheSand.java index 02ba121dc43..a1e867313d6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thehandinthesand/TheHandInTheSand.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thehandinthesand/TheHandInTheSand.java @@ -43,6 +43,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -186,12 +187,12 @@ protected void setupZones() public void setupConditions() { - notTeleportedToSarim = new VarbitRequirement(1531, 0); + notTeleportedToSarim = new VarbitRequirement(VarbitID.HANDSAND_TELE, 0); inYanille = new ZoneRequirement(yanille); inLightSpot = new ZoneRequirement(lightSpot); - receivedBottledWater = new VarbitRequirement(1532, 1); - vialPlaced = new VarbitRequirement(1537, 1); - madeTruthSerum = new VarbitRequirement(1532, 5); + receivedBottledWater = new VarbitRequirement(VarbitID.HANDSAND_SERUM, 1); + vialPlaced = new VarbitRequirement(VarbitID.HANDSAND_COUNTER_MULTI, 1); + madeTruthSerum = new VarbitRequirement(VarbitID.HANDSAND_SERUM, 5); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/ChestCodeStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/ChestCodeStep.java index 0256dbd0e26..e3bbec8656b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/ChestCodeStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/ChestCodeStep.java @@ -29,6 +29,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.events.VarClientIntChanged; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.VarClientID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.FontManager; @@ -78,7 +79,7 @@ private void updateSolvedPositionState() { for (int i = 0; i < NUMBER_OF_DIALS; i++) { - int START_VARCLIENTINT_POS = 1113; + int START_VARCLIENTINT_POS = VarClientID.COMBINATION_LOCK_VALUE_0; int varcIntID = START_VARCLIENTINT_POS + i; int START_DOWN_ARROW = 3; int ARROW_INTERVAL = 7; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/TheHeartOfDarkness.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/TheHeartOfDarkness.java index 7bd517fe123..74be88eb58a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/TheHeartOfDarkness.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theheartofdarkness/TheHeartOfDarkness.java @@ -41,7 +41,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.player.InInstanceRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; @@ -56,7 +55,6 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; @@ -230,7 +228,7 @@ public Map loadSteps() firstTrialPuzzle.addStep(and(southWestChestOpened, scrapOfPaper1, scrapOfPaper2, hasReadPoem), talkToPrinceAfterPoem); firstTrialPuzzle.addStep(and(southWestChestOpened, scrapOfPaper1, scrapOfPaper2, poem), readPoem); firstTrialPuzzle.addStep(and(scrapOfPaper1, book), openKeywordChestSouthWest); - firstTrialPuzzle.addStep(LogicHelper.and(southEastGateUnlocked), searchChestForBookAndPaper); + firstTrialPuzzle.addStep(and(southEastGateUnlocked), searchChestForBookAndPaper); firstTrialPuzzle.addStep(and(towerKey), useKeyOnSouthEastGate); ConditionalStep goDoFirstChallenge = new ConditionalStep(this, climbUpToFirstTrial); @@ -304,12 +302,12 @@ public Map loadSteps() ConditionalStep goPullLevers = new ConditionalStep(this, enterRuins); goPullLevers.addStep(and(inThirdIceArea, pulledFirstLever, pulledSecondLever, pulledThirdLever), pullFourthLever); goPullLevers.addStep(and(inThirdIceArea, pulledFirstLever, pulledSecondLever), pullThirdLever); - goPullLevers.addStep(LogicHelper.and(inThirdIceArea), climbUpLedgeToSecondLever); + goPullLevers.addStep(and(inThirdIceArea), climbUpLedgeToSecondLever); goPullLevers.addStep(and(inSecondIceAreaSecondRoom, pulledFirstLever, pulledSecondLever), jumpOverFrozenPlatforms); goPullLevers.addStep(and(inSecondIceAreaSecondRoom, pulledFirstLever), pullSecondLever); - goPullLevers.addStep(LogicHelper.and(inSecondIceAreaSecondRoom), slideAlongIceLedgeBackToSecondLever); + goPullLevers.addStep(and(inSecondIceAreaSecondRoom), slideAlongIceLedgeBackToSecondLever); goPullLevers.addStep(and(inSecondIceAreaFirstRoom, pulledFirstLever), slideAlongIceLedge); - goPullLevers.addStep(LogicHelper.and(inSecondIceAreaFirstRoom), climbUpLedgeToFirstLever); + goPullLevers.addStep(and(inSecondIceAreaFirstRoom), climbUpLedgeToFirstLever); goPullLevers.addStep(and(inFirstIceRoom, pulledFirstLever), climbDownLedge); goPullLevers.addStep(inFirstIceRoom, pullFirstLever); steps.put(62, goPullLevers); @@ -418,26 +416,26 @@ private void setupConditions() inFirstTrialRoom = new ZoneRequirement(firstTrialRoom); secondTrialRoom = new Zone(new WorldPoint(1635, 3216, 2), new WorldPoint(1650, 3230, 2)); inSecondTrialRoom = new ZoneRequirement(secondTrialRoom); - builtLandingInOverlook = new VarbitRequirement(11379, 4); - talkedToFelius = new VarbitRequirement(11118, 1); - talkedToCaritta = new VarbitRequirement(11119, 1); - talkedToSergius = new VarbitRequirement(11120, 1); -// talkedToNova = new VarbitRequirement(11121, 1); + builtLandingInOverlook = new VarbitRequirement(VarbitID.QUETZAL_SALVAGEROVERLOOK, 4); + talkedToFelius = new VarbitRequirement(VarbitID.VMQ3_RECRUIT_1, 1); + talkedToCaritta = new VarbitRequirement(VarbitID.VMQ3_RECRUIT_2, 1); + talkedToSergius = new VarbitRequirement(VarbitID.VMQ3_RECRUIT_3, 1); +// talkedToNova = new VarbitRequirement(VarbitID.VMQ3_RECRUIT_4, 1); princeIsFollowing = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, 14053, 16); // Overlook landing could also be varp 4182 480 -> 2528 - southEastGateUnlocked = new VarbitRequirement(11165, 1); - southWestChestOpened = new VarbitRequirement(11166, 1); - hasReadPoem = new VarbitRequirement(11170, 1); - knowAboutDirections = new VarbitRequirement(11171, 1); + southEastGateUnlocked = new VarbitRequirement(VarbitID.VMQ3_TOWER_TRIAL_1_DOOR_UNLOCKED, 1); + southWestChestOpened = new VarbitRequirement(VarbitID.VMQ3_TOWER_TRIAL_1_LETTERS_UNLOCKED, 1); + hasReadPoem = new VarbitRequirement(VarbitID.VMQ3_TOWER_TRIAL_1_READ_POEM, 1); + knowAboutDirections = new VarbitRequirement(VarbitID.VMQ3_TOWER_TRIAL_1_FIRST_TRANSLATION, 1); knowPoemSolution = new ManualRequirement(); inArrowPuzzle = new WidgetTextRequirement(810, 15, 9, "Confirm"); hasReadCompletedNote = new ManualRequirement(); -// northWestChestOpened = new VarbitRequirement(11167, 1); +// northWestChestOpened = new VarbitRequirement(VarbitID.VMQ3_TOWER_TRIAL_1_DIRECTIONS_UNLOCKED, 1); NpcCondition emissaryIsPassive = new NpcCondition(NpcID.VMQ3_TOWER_TWILIGHT_MELEE_VARIANT_1A, new WorldPoint(1641, 3227, 2)); emissaryIsPassive.setAnimationIDRequired(-1); combatStarted = not(emissaryIsPassive); - startedInvestigation = new VarbitRequirement(11134, 1); + startedInvestigation = new VarbitRequirement(VarbitID.VMQ3_TOWER_TRIAL_3_ITZLA_CONSULTED, 1); // Accused Tenoch incorrectly // 11135 0->1 // 11140 0->1 @@ -492,14 +490,14 @@ private void setupConditions() bossRoom = new Zone(new WorldPoint(1359, 4505, 0), new WorldPoint(1385, 4520, 0)); inBossRoom = new ZoneRequirement(bossRoom); - pulledFirstLever = new VarbitRequirement(11138, 1); - pulledSecondLever = new VarbitRequirement(11139, 1); + pulledFirstLever = new VarbitRequirement(VarbitID.VMQ3_RUINS_LEVER_3, 1); + pulledSecondLever = new VarbitRequirement(VarbitID.VMQ3_RUINS_LEVER_4, 1); // on first frozen platform: // 11181 0->1 - pulledThirdLever = new VarbitRequirement(11137, 1); -// pulledFourthLever = new VarbitRequirement(11136, 1); + pulledThirdLever = new VarbitRequirement(VarbitID.VMQ3_RUINS_LEVER_2, 1); +// pulledFourthLever = new VarbitRequirement(VarbitID.VMQ3_RUINS_LEVER_1, 1); - unlockedShortcut = new VarbitRequirement(11174, 1); + unlockedShortcut = new VarbitRequirement(VarbitID.VMQ3_RUINS_SHORTCUT_UNLOCKED, 1); inspectedAirMarkings = new ManualRequirement(); inspectedEarthMarkings = new ManualRequirement(); @@ -516,10 +514,10 @@ private void setupConditions() takenOrUsedFireIcon = or(repairedFireStatue, fireIcon); takenOrUsedWaterIcon = or(repairedWaterStatue, waterIcon); - activatedFirstStatue = new VarbitRequirement(11161, -1); - activatedSecondStatue = new VarbitRequirement(11162, -1); - activatedThirdStatue = new VarbitRequirement(11163, -1); - activatedFourthStatue = new VarbitRequirement(11164, -1); + activatedFirstStatue = new VarbitRequirement(VarbitID.VMQ3_RUIN_STATUE_1_CHECK, -1); + activatedSecondStatue = new VarbitRequirement(VarbitID.VMQ3_RUIN_STATUE_2_CHECK, -1); + activatedThirdStatue = new VarbitRequirement(VarbitID.VMQ3_RUIN_STATUE_3_CHECK, -1); + activatedFourthStatue = new VarbitRequirement(VarbitID.VMQ3_RUIN_STATUE_4_CHECK, -1); activateStatueRequirements[0] = activatedFirstStatue; activateStatueRequirements[1] = activatedSecondStatue; @@ -787,10 +785,9 @@ private void setupSteps() // Ice dungeon section takePickaxe = new ObjectStep(this, ObjectID.VMQ3_PICKAXE_BARREL, new WorldPoint(1696, 9633, 2), "Take a pickaxe from the nearby barrel."); mineRocks = new ObjectStep(this, ObjectID.VMQ3_RUINS_BLOCKAGE_START, new WorldPoint(1690, 9634, 2), "Mine the nearby rocks.", pickaxe); - int LEVER_ID = 55367; // Decorative object - pullFirstLever = new ObjectStep(this, LEVER_ID, new WorldPoint(1695, 9604, 2), "Pull the lever in the south-east of the area. Make sure to avoid the " + + pullFirstLever = new ObjectStep(this, ObjectID.VMQ3_RUINS_WALL_LEVER_3, new WorldPoint(1695, 9604, 2), "Pull the lever in the south-east of the area. Make sure to avoid the " + "wall spikes."); - pullFirstLever.addTileMarkers(SpriteID.DEADMAN_EXCLAMATION_MARK_SKULLED_WARNING, + pullFirstLever.addTileMarkers(SpriteID.PvpwIcons.DEADMAN_EXCLAMATION_MARK_SKULLED_WARNING, new WorldPoint(1682, 9603, 2), new WorldPoint(1682, 9604, 2), new WorldPoint(1682, 9605, 2), new WorldPoint(1682, 9606, 2), new WorldPoint(1684, 9603, 2), new WorldPoint(1684, 9604, 2), new WorldPoint(1684, 9605, 2), new WorldPoint(1684, 9606, 2), new WorldPoint(1686, 9603, 2), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theknightssword/TheKnightsSword.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theknightssword/TheKnightsSword.java index e5c033ca2ee..905025d5640 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theknightssword/TheKnightsSword.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theknightssword/TheKnightsSword.java @@ -83,15 +83,15 @@ public Map loadSteps() steps.put(4, talkToSquire2); ConditionalStep getPortrait = new ConditionalStep(this, goUpCastle1); - getPortrait.addStep(portrait.alsoCheckBank(questBank), givePortraitToThurgo); + getPortrait.addStep(portrait.alsoCheckBank(), givePortraitToThurgo); getPortrait.addStep(inFaladorCastle2, searchCupboard); getPortrait.addStep(inFaladorCastle1, goUpCastle2); steps.put(5, getPortrait); ConditionalStep returnSwordToSquire = new ConditionalStep(this, enterDungeon); - returnSwordToSquire.addStep(bluriteSword.alsoCheckBank(questBank), finishQuest); - returnSwordToSquire.addStep(bluriteOre.alsoCheckBank(questBank), bringThurgoOre); + returnSwordToSquire.addStep(bluriteSword.alsoCheckBank(), finishQuest); + returnSwordToSquire.addStep(bluriteOre.alsoCheckBank(), bringThurgoOre); returnSwordToSquire.addStep(inDungeon, mineBlurite); steps.put(6, returnSwordToSquire); @@ -138,7 +138,7 @@ protected void setupZones() public void setupSteps() { - talkToSquire = new NpcStep(this, NpcID.PEST_SQUIRE_1, new WorldPoint(2978, 3341, 0), "Talk to the Squire in Falador Castle's courtyard."); + talkToSquire = new NpcStep(this, NpcID.SQUIRE, new WorldPoint(2978, 3341, 0), "Talk to the Squire in Falador Castle's courtyard."); talkToSquire.addDialogStep("And how is life as a squire?"); talkToSquire.addDialogStep("I can make a new sword if you like..."); talkToSquire.addDialogStep("So would these dwarves make another one?"); @@ -150,7 +150,7 @@ public void setupSteps() talkToThurgo.addDialogStep("Would you like a redberry pie?"); talkToThurgoAgain = new NpcStep(this, NpcID.THURGO, new WorldPoint(3000, 3145, 0), "Talk to Thurgo again."); talkToThurgoAgain.addDialogStep("Can you make a special sword for me?"); - talkToSquire2 = new NpcStep(this, NpcID.PEST_SQUIRE_1, new WorldPoint(2978, 3341, 0), "Talk to the Squire in Falador Castle's courtyard."); + talkToSquire2 = new NpcStep(this, NpcID.SQUIRE, new WorldPoint(2978, 3341, 0), "Talk to the Squire in Falador Castle's courtyard."); goUpCastle1 = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_LADDER_UP, new WorldPoint(2994, 3341, 0), "Climb up the east ladder in Falador Castle."); goUpCastle2 = new ObjectStep(this, ObjectID.FAI_FALADOR_CASTLE_STAIRS, new WorldPoint(2985, 3338, 1), "Go up the staircase west of the ladder on the 1st floor."); searchCupboard = new ObjectStep(this, ObjectID.VYVINCUPBOARDOPEN, new WorldPoint(2985, 3336, 2), "Search the cupboard in the room south of the staircase. You'll need Sir Vyvin to be in the other room.", searchCupboardReq); @@ -161,7 +161,7 @@ public void setupSteps() mineBlurite = new ObjectStep(this, ObjectID.BLURITE_ROCK_1, new WorldPoint(3049, 9566, 0), "Mine a blurite ore in the eastern cavern.", pickaxe); bringThurgoOre = new NpcStep(this, NpcID.THURGO, new WorldPoint(3000, 3145, 0), "Return to Thurgo with a blurite ore and two iron bars.", bluriteOre, ironBars); bringThurgoOre.addDialogStep("Can you make that replacement sword now?"); - finishQuest = new NpcStep(this, NpcID.PEST_SQUIRE_1, new WorldPoint(2978, 3341, 0), "Return to the Squire with the sword to finish the quest.", bluriteSword); + finishQuest = new NpcStep(this, NpcID.SQUIRE, new WorldPoint(2978, 3341, 0), "Return to the Squire with the sword to finish the quest.", bluriteSword); } @Override @@ -226,7 +226,7 @@ public List getPanels() allSteps.add(new PanelDetails("Starting off", Arrays.asList(talkToSquire, talkToReldo))); allSteps.add(new PanelDetails("Finding an Imcando", Arrays.asList(talkToThurgo, talkToThurgoAgain), redberryPie)); allSteps.add(new PanelDetails("Find the portrait", Arrays.asList(talkToSquire2, goUpCastle1, goUpCastle2, searchCupboard, givePortraitToThurgo))); - allSteps.add(new PanelDetails("Making the sword", Arrays.asList(enterDungeon, mineBlurite, bringThurgoOre), pickaxe, portrait, ironBars)); + allSteps.add(new PanelDetails("Making the sword", Arrays.asList(enterDungeon, mineBlurite, bringThurgoOre), pickaxe, ironBars)); allSteps.add(new PanelDetails("Return the sword", Collections.singletonList(finishQuest))); return allSteps; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thelosttribe/TheLostTribe.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thelosttribe/TheLostTribe.java index 9cf408bf761..2ea3c3713e6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thelosttribe/TheLostTribe.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thelosttribe/TheLostTribe.java @@ -108,7 +108,7 @@ public Map loadSteps() steps.put(8, goTalkToDukeAfterEmote); ConditionalStep revealSigmund = new ConditionalStep(this, goGetKey); - revealSigmund.addStep(silverware.alsoCheckBank(questBank), goToDukeWithSilverware); + revealSigmund.addStep(silverware.alsoCheckBank(), goToDukeWithSilverware); revealSigmund.addStep(foundRobes, goIntoHamLair); revealSigmund.addStep(key, goOpenRobeChest); steps.put(9, revealSigmund); @@ -163,8 +163,8 @@ public void setupConditions() foundRobes = new VarbitRequirement(VarbitID.LOST_TRIBE_HAM, 1, Operation.GREATER_EQUAL); foundSilverwareOrToldOnSigmund = new VarbitRequirement(VarbitID.LOST_TRIBE_HAM, 3, Operation.GREATER_EQUAL); - hansKnows = new VarbitRequirement(537, 0); - bobKnows = new VarbitRequirement(537, 1); + hansKnows = new VarbitRequirement(VarbitID.LOST_TRIBE_CONTACT, 0); + bobKnows = new VarbitRequirement(VarbitID.LOST_TRIBE_CONTACT, 1); // 537 0->2->0, Hans // 537 0->1, Bob @@ -188,7 +188,7 @@ public void setupSteps() talkToBob = new NpcStep(this, NpcID.TWOCATS_BOB_CUTSCENE, new WorldPoint(3231, 3203, 0), "Talk to Bob in the south of Lumbridge."); talkToBob.addDialogStep("Do you know what happened in the castle cellar?"); - talkToAllAboutCellar = new NpcStep(this, NpcID.POH_SERVANT_COOK_WOMAN, "Talk to the Cook, Hans, Father Aereck, and Bob in Lumbridge until one tells you about seeing a goblin."); + talkToAllAboutCellar = new NpcStep(this, NpcID.COOK, "Talk to the Cook, Hans, Father Aereck, and Bob in Lumbridge until one tells you about seeing a goblin."); ((NpcStep)(talkToAllAboutCellar)).addAlternateNpcs(NpcID.FATHER_AERECK); talkToAllAboutCellar.addDialogSteps("Do you know what happened in the castle cellar?"); talkToAllAboutCellar.addSubSteps(talkToHans, talkToBob); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/MonolithPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/MonolithPuzzle.java index 02d2229a866..0a293227d3a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/MonolithPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/MonolithPuzzle.java @@ -32,12 +32,12 @@ import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import net.runelite.api.InventoryID; import net.runelite.api.ItemContainer; import net.runelite.api.Tile; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.InventoryID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; @@ -205,7 +205,7 @@ public void onGameTick(final GameTick event) private int countShapes() { - ItemContainer itemContainer = client.getItemContainer(InventoryID.INVENTORY); + ItemContainer itemContainer = client.getItemContainer(InventoryID.INV); if (itemContainer == null) { return 0; @@ -227,7 +227,7 @@ private int countShapes() private boolean hasFirstChestKey() { - ItemContainer itemContainer = client.getItemContainer(InventoryID.INVENTORY); + ItemContainer itemContainer = client.getItemContainer(InventoryID.INV); if (itemContainer == null) { return false; @@ -238,7 +238,7 @@ private boolean hasFirstChestKey() private boolean hasMachineRoomKey() { - ItemContainer itemContainer = client.getItemContainer(InventoryID.INVENTORY); + ItemContainer itemContainer = client.getItemContainer(InventoryID.INV); if (itemContainer == null) { return false; @@ -250,6 +250,10 @@ private boolean hasMachineRoomKey() private boolean tileHasBigMonolith(Tile[][] tiles, int sceneX, int sceneY) { var tile = tiles[sceneX][sceneY]; + if (tile == null) { + // Tiles normally aren't null, but in tests they can be. + return false; + } for (var gameObject : tile.getGameObjects()) { if (gameObject != null && gameObject.getId() == BIG_MONOLITH) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/ThePathOfGlouphrie.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/ThePathOfGlouphrie.java index 9c53be6d328..5ba87899d0d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/ThePathOfGlouphrie.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/ThePathOfGlouphrie.java @@ -55,6 +55,7 @@ import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.ArrayList; import java.util.Arrays; @@ -225,13 +226,13 @@ private void setupConditions() nearLongramble = new ZoneRequirement(longrambleZone); inCutscene = new Conditions(LogicType.OR, - new VarbitRequirement(4606, 3), - new VarbitRequirement(12139, 1) + new VarbitRequirement(VarbitID.FOV_CLAMP, 3), + new VarbitRequirement(VarbitID.GRAVESTONE_TLI_HIDE, 1) ); - learnedAboutChapter1 = new VarbitRequirement(15291, 1); - learnedAboutChapter2 = new VarbitRequirement(15292, 1); - // learnedAboutChapter3 = new VarbitRequirement(15293, 1); + learnedAboutChapter1 = new VarbitRequirement(VarbitID.POG_BOLRIE_DIARY_1, 1); + learnedAboutChapter2 = new VarbitRequirement(VarbitID.POG_BOLRIE_DIARY_2, 1); + // learnedAboutChapter3 = new VarbitRequirement(VarbitID.POG_BOLRIE_DIARY_3, 1); inSewer1 = new ZoneRequirement(sewer1); inSewer2 = new ZoneRequirement(sewer2); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/YewnocksPuzzle.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/YewnocksPuzzle.java index 9483efff40e..3d2db996f8c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/YewnocksPuzzle.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thepathofglouphrie/YewnocksPuzzle.java @@ -30,14 +30,15 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.widget.WidgetPresenceRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; import lombok.extern.slf4j.Slf4j; -import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameTick; import net.runelite.api.events.ItemContainerChanged; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.InventoryID; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarPlayerID; import net.runelite.client.eventbus.Subscribe; import org.apache.commons.lang3.tuple.Pair; @@ -54,12 +55,6 @@ public class YewnocksPuzzle extends DetailedOwnerStep * Region ID of the storeroom this puzzle takes place in */ private static final int STOREROOM_REGION = 11074; - private static final int PUZZLE1_INSERTED_DISC_VARP_ID = 3994; - private static final int PUZZLE2_UPPER_INSERTED_DISC_VARP_ID = 3995; - private static final int PUZZLE2_LOWER_INSERTED_DISC_VARP_ID = 3996; - private static final int PUZZLE1_LEFT_VARP_ID = 3997; - private static final int PUZZLE1_RIGHT_VARP_ID = 3998; - private static final int PUZZLE2_VARP_ID = 3999; /** * ItemID to ItemRequirement map */ @@ -366,9 +361,9 @@ public static WorldPoint regionPoint(int regionX, int regionY) @Override public void startUp() { - puzzle1LeftItemID = client.getVarpValue(PUZZLE1_LEFT_VARP_ID); - puzzle1RightItemID = client.getVarpValue(PUZZLE1_RIGHT_VARP_ID); - puzzle2ItemID = client.getVarpValue(PUZZLE2_VARP_ID); + puzzle1LeftItemID = client.getVarpValue(VarPlayerID.POG_COIN_TARGET1_1_OBJ); + puzzle1RightItemID = client.getVarpValue(VarPlayerID.POG_COIN_TARGET1_2_OBJ); + puzzle2ItemID = client.getVarpValue(VarPlayerID.POG_COIN_TARGET2_OBJ); updateSteps(); } @@ -411,15 +406,15 @@ public void onVarbitChanged(VarbitChanged varbitChanged) { if (varbitChanged.getVarbitId() == -1) { - if (varbitChanged.getVarpId() == PUZZLE1_LEFT_VARP_ID) + if (varbitChanged.getVarpId() == VarPlayerID.POG_COIN_TARGET1_1_OBJ) { puzzle1LeftItemID = varbitChanged.getValue(); } - else if (varbitChanged.getVarpId() == PUZZLE1_RIGHT_VARP_ID) + else if (varbitChanged.getVarpId() == VarPlayerID.POG_COIN_TARGET1_2_OBJ) { puzzle1RightItemID = varbitChanged.getValue(); } - else if (varbitChanged.getVarpId() == PUZZLE2_VARP_ID) + else if (varbitChanged.getVarpId() == VarPlayerID.POG_COIN_TARGET2_OBJ) { puzzle2ItemID = varbitChanged.getValue(); } @@ -517,7 +512,7 @@ private boolean hasOpenedMachine() * @return a list of discs as Items, or an empty list if inventory wasn't found */ @Nonnull - private List getDiscs(InventoryID inventoryId) + private List getDiscs(int inventoryId) { var itemContainer = client.getItemContainer(inventoryId); if (itemContainer == null) @@ -557,7 +552,7 @@ private void refreshSolution() return; } - var items = getDiscs(InventoryID.INVENTORY); + var items = getDiscs(InventoryID.INV); var puzzle1SolutionValue = puzzle1SolutionValue1 + puzzle1SolutionValue2; // Try to figure out a solution @@ -568,7 +563,7 @@ private void refreshSolution() protected void updateSteps() { - var numDiscs = getDiscs(InventoryID.INVENTORY).stream().mapToInt(Item::getQuantity).sum(); + var numDiscs = getDiscs(InventoryID.INV).stream().mapToInt(Item::getQuantity).sum(); if (numDiscs < 3) { // Player has fewer than 3 discs, no solution is possible @@ -601,9 +596,9 @@ protected void updateSteps() return; } - var puzzle1InsertedDisc = client.getVarpValue(PUZZLE1_INSERTED_DISC_VARP_ID); - var puzzle2UpperInsertedDisc = client.getVarpValue(PUZZLE2_UPPER_INSERTED_DISC_VARP_ID); - var puzzle2LowerInsertedDisc = client.getVarpValue(PUZZLE2_LOWER_INSERTED_DISC_VARP_ID); + var puzzle1InsertedDisc = client.getVarpValue(VarPlayerID.POG_COIN_DISPLAY1_OBJ); + var puzzle2UpperInsertedDisc = client.getVarpValue(VarPlayerID.POG_COIN_DISPLAY2_1_OBJ); + var puzzle2LowerInsertedDisc = client.getVarpValue(VarPlayerID.POG_COIN_DISPLAY2_2_OBJ); if (!solution.puzzle1Requirement.getAllIds().contains(puzzle1InsertedDisc)) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/therestlessghost/TheRestlessGhost.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/therestlessghost/TheRestlessGhost.java index 534620bed0c..aa5fa847ba8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/therestlessghost/TheRestlessGhost.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/therestlessghost/TheRestlessGhost.java @@ -30,7 +30,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ObjectCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -41,10 +40,6 @@ import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; @@ -52,6 +47,13 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; + public class TheRestlessGhost extends BasicQuestHelper { // Recommended items diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theslugmenace/TheSlugMenace.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theslugmenace/TheSlugMenace.java index 477fc18c5f5..297c85242a8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theslugmenace/TheSlugMenace.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/theslugmenace/TheSlugMenace.java @@ -50,6 +50,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -167,7 +168,7 @@ protected void setupRequirements() pageFragment3 = new ItemRequirement("Fragment 3", ItemID.SLUG2_PAGE4C); pageFragment3.setHighlightInInventory(true); - receivedFragments = new VarbitRequirement(2619, 1); + receivedFragments = new VarbitRequirement(VarbitID.SLUG2_TORNPAGES, 1); glue = new ItemRequirement("Sea slug glue", ItemID.SLUG2_SLUG_PASTE); glue.setHighlightInInventory(true); @@ -179,11 +180,11 @@ protected void setupRequirements() chisel = new ItemRequirement("Chisel", ItemID.CHISEL).isNotConsumed(); - usedAirRune = new VarbitRequirement(2623, 1); - usedEarthRune = new VarbitRequirement(2622, 1); - usedWaterRune = new VarbitRequirement(2625, 1); - usedFireRune = new VarbitRequirement(2624, 1); - usedMindRune = new VarbitRequirement(2626, 1); + usedAirRune = new VarbitRequirement(VarbitID.SLUG2_USED_AIR_RUNE, 1); + usedEarthRune = new VarbitRequirement(VarbitID.SLUG2_USED_EARTH_RUNE, 1); + usedWaterRune = new VarbitRequirement(VarbitID.SLUG2_USED_WATER_RUNE, 1); + usedFireRune = new VarbitRequirement(VarbitID.SLUG2_USED_FIRE_RUNE, 1); + usedMindRune = new VarbitRequirement(VarbitID.SLUG2_USED_MIND_RUNE, 1); airRune = new ItemRequirement("Air rune", ItemID.SLUG2_RUNE_AIR).hideConditioned(usedAirRune); earthRune = new ItemRequirement("Earth rune", ItemID.SLUG2_RUNE_EARTH).hideConditioned(usedEarthRune); @@ -272,31 +273,31 @@ protected void setupZones() public void setupConditions() { - talkedToHolgart = new VarbitRequirement(2614, 1); - talkedToHobb = new VarbitRequirement(2615, 1); - talkedToMaledict = new VarbitRequirement(2616, 1); - talkedToAllImportantPeople = new VarbitRequirement(2617, 7); + talkedToHolgart = new VarbitRequirement(VarbitID.SLUG2_NPC_TRACK1, 1); + talkedToHobb = new VarbitRequirement(VarbitID.SLUG2_NPC_TRACK2, 1); + talkedToMaledict = new VarbitRequirement(VarbitID.SLUG2_NPC_TRACK3, 1); + talkedToAllImportantPeople = new VarbitRequirement(VarbitID.SLUG2_NPC_ALLTRACK, 7); inHobgoblinDungeon = new ZoneRequirement(hobgoblinDungeon); inSeaSlugDungeon = new ZoneRequirement(seaSlugDungeon); - openedWall = new VarbitRequirement(2618, 1); + openedWall = new VarbitRequirement(VarbitID.SLUG2_DOORBIT, 1); onPlatform = new ZoneRequirement(platform); puzzleUp = new WidgetPresenceRequirement(460, 8); - repairedPage = new VarbitRequirement(2611, 1); + repairedPage = new VarbitRequirement(VarbitID.SLUG2_FIXED_PAGE, 1); - pickedUpSlug = new VarbitRequirement(2631, 1); + pickedUpSlug = new VarbitRequirement(VarbitID.SLUG2_HAVESLUG, 1); - hasOrUsedAirRune = new Conditions(LogicType.OR, airRune.alsoCheckBank(questBank), usedAirRune); - hasOrUsedWaterRune = new Conditions(LogicType.OR, waterRune.alsoCheckBank(questBank), usedWaterRune); - hasOrUsedEarthRune = new Conditions(LogicType.OR, earthRune.alsoCheckBank(questBank), usedEarthRune); - hasOrUsedFireRune = new Conditions(LogicType.OR, fireRune.alsoCheckBank(questBank), usedFireRune); - hasOrUsedMindRune = new Conditions(LogicType.OR, mindRune.alsoCheckBank(questBank), usedMindRune); + hasOrUsedAirRune = new Conditions(LogicType.OR, airRune.alsoCheckBank(), usedAirRune); + hasOrUsedWaterRune = new Conditions(LogicType.OR, waterRune.alsoCheckBank(), usedWaterRune); + hasOrUsedEarthRune = new Conditions(LogicType.OR, earthRune.alsoCheckBank(), usedEarthRune); + hasOrUsedFireRune = new Conditions(LogicType.OR, fireRune.alsoCheckBank(), usedFireRune); + hasOrUsedMindRune = new Conditions(LogicType.OR, mindRune.alsoCheckBank(), usedMindRune); hasAllRunes = new Conditions(hasOrUsedAirRune, hasOrUsedEarthRune, hasOrUsedFireRune, hasOrUsedMindRune, hasOrUsedWaterRune); - usedAllRunes = new VarbitRequirement(2627, 31); + usedAllRunes = new VarbitRequirement(VarbitID.SLUG2_USED_RUNES, 31); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thetouristtrap/TheTouristTrap.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thetouristtrap/TheTouristTrap.java index 13219a38bb6..ee1bfac5698 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thetouristtrap/TheTouristTrap.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/thetouristtrap/TheTouristTrap.java @@ -273,13 +273,13 @@ public void setupConditions() searchedBookcase = new Conditions(true, new WidgetTextRequirement(InterfaceID.Objectbox.TEXT, "You notice several books on the subject of sailing.")); distractedSiad = new Conditions(true, new WidgetTextRequirement(229, 1, "The captain starts rambling on about his days as a salty sea dog. He
looks quite distracted...")); - anaPlacedOnCartOfLift = new VarbitRequirement(2805, 1); + anaPlacedOnCartOfLift = new VarbitRequirement(VarbitID.TOURTRAP_QIP_ANA_STATE, 1); // TODO: Better detection of if Ana is on the surface or in the underground barrel anaOnSurface = new VarplayerRequirement(VarPlayerID.DESERTRESCUE, 22, Operation.GREATER_EQUAL); // TODO: This only gets set the first time. If you somehow lose Ana between here and the cart it remains set. Need to add more logic around this - anaOnSurfaceInBarrel = new VarbitRequirement(2808, 1); - anaOnCart = new VarbitRequirement(2809, 1); - anaFree = new VarbitRequirement(3733, 1); + anaOnSurfaceInBarrel = new VarbitRequirement(VarbitID.TOURTRAP_QIP_ANA_WINCHSIDE_BARREL, 1); + anaOnCart = new VarbitRequirement(VarbitID.TOURTRAP_QIP_FLATBACK_CART_ANA, 1); + anaFree = new VarbitRequirement(VarbitID.TOURTRAP_ANA_VISIBLE_SHANTY_PASS, 1); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/throneofmiscellania/ThroneOfMiscellania.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/throneofmiscellania/ThroneOfMiscellania.java index 284a46fa1b9..100a526c8f8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/throneofmiscellania/ThroneOfMiscellania.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/throneofmiscellania/ThroneOfMiscellania.java @@ -45,10 +45,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarbitID; +import net.runelite.api.gameval.*; import java.util.*; @@ -280,34 +277,34 @@ public void setupConditions() inAstridRoom = new ZoneRequirement(astridRoom1, astridRoom2); // Chose Brand, 14607 0->1 - courtingBrand = new VarbitRequirement(14607, 1); + courtingBrand = new VarbitRequirement(VarbitID.MISC_PARTNER_MULTIVAR, 1); - talked1P1 = new VarbitRequirement(85, 1); - talked1P2 = new VarbitRequirement(86, 1); - talked1P3 = new VarbitRequirement(87, 1); - givenFlowers = new VarbitRequirement(94, 1); - doneEmote = new VarbitRequirement(96, 1); + talked1P1 = new VarbitRequirement(VarbitID.MISC_S1_D1, 1); + talked1P2 = new VarbitRequirement(VarbitID.MISC_S1_D2, 1); + talked1P3 = new VarbitRequirement(VarbitID.MISC_S1_D3, 1); + givenFlowers = new VarbitRequirement(VarbitID.MISC_S1_GIVE, 1); + doneEmote = new VarbitRequirement(VarbitID.MISC_S1_EMOTE, 1); talked1P4 = new VarbitRequirement(VarbitID.MISC_AFFECTION, 15, Operation.GREATER_EQUAL); - talked2P1 = new VarbitRequirement(88, 1); - talked2P2 = new VarbitRequirement(89, 1); - talked2P3 = new VarbitRequirement(90, 1); - givenBowOrCake = new VarbitRequirement(95, 1); + talked2P1 = new VarbitRequirement(VarbitID.MISC_S2_D1, 1); + talked2P2 = new VarbitRequirement(VarbitID.MISC_S2_D2, 1); + talked2P3 = new VarbitRequirement(VarbitID.MISC_S2_D3, 1); + givenBowOrCake = new VarbitRequirement(VarbitID.MISC_S2_GIVE, 1); talked2P4 = new VarbitRequirement(VarbitID.MISC_AFFECTION, 24, Operation.GREATER_EQUAL); - talked3P1 = new VarbitRequirement(91, 1); - talked3P2 = new VarbitRequirement(92, 1); - talked3P3 = new VarbitRequirement(93, 1); - blownKiss = new VarbitRequirement(97, 1); + talked3P1 = new VarbitRequirement(VarbitID.MISC_S3_D1, 1); + talked3P2 = new VarbitRequirement(VarbitID.MISC_S3_D2, 1); + talked3P3 = new VarbitRequirement(VarbitID.MISC_S3_D3, 1); + blownKiss = new VarbitRequirement(VarbitID.MISC_S3_EMOTE, 1); - hasCourted = new VarbitRequirement(14606, 1); + hasCourted = new VarbitRequirement(VarbitID.MISC_ACCEPTEDTORULE, 1); - diplomacyStep1 = new VarplayerRequirement(359, 20); - diplomacyStep2 = new VarplayerRequirement(359, 30); - diplomacyStep3 = new VarplayerRequirement(359, 40); - diplomacyStep4 = new VarplayerRequirement(359, 50); - diplomacyStep5 = new VarplayerRequirement(359, 60); - diplomacyStep6 = new VarplayerRequirement(359, 70); + diplomacyStep1 = new VarplayerRequirement(VarPlayerID.MISC_QUEST, 20); + diplomacyStep2 = new VarplayerRequirement(VarPlayerID.MISC_QUEST, 30); + diplomacyStep3 = new VarplayerRequirement(VarPlayerID.MISC_QUEST, 40); + diplomacyStep4 = new VarplayerRequirement(VarPlayerID.MISC_QUEST, 50); + diplomacyStep5 = new VarplayerRequirement(VarPlayerID.MISC_QUEST, 60); + diplomacyStep6 = new VarplayerRequirement(VarPlayerID.MISC_QUEST, 70); has75Support = new VarbitRequirement(VarbitID.MISC_APPROVAL, 96, Operation.GREATER_EQUAL); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/PuzzleSolver.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/PuzzleSolver.java index b15940e6e92..0a50496100c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/PuzzleSolver.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/PuzzleSolver.java @@ -26,6 +26,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetDetails; import net.runelite.api.Client; +import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import java.util.Arrays; @@ -56,17 +57,6 @@ public PuzzleSolver(Client client) private static final WidgetDetails PRSS_4_WHEEL_RIGHT = new WidgetDetails(510, 135, 0); private static final WidgetDetails PRSS_LEVER_LEFT = new WidgetDetails(510, 136, 0); private static final WidgetDetails PRSS_LEVER_RIGHT = new WidgetDetails(510, 141, 0); - //State Varbits - private static final int PRSS_VBIT_LL = 3356; - private static final int PRSS_VBIT_LR = 3357; - private static final int PRSS_VBIT_P1 = 3347; - private static final int PRSS_VBIT_B1 = 3351; - private static final int PRSS_VBIT_P2 = 3348; - private static final int PRSS_VBIT_B2 = 3352; - private static final int PRSS_VBIT_P3 = 3349; - private static final int PRSS_VBIT_B3 = 3353; - private static final int PRSS_VBIT_P4 = 3350; - private static final int PRSS_VBIT_B4 = 3355; //booleans private boolean prss_3_passed = false; private boolean prss_4_passed = false; @@ -76,9 +66,9 @@ public HashSet pressureSolver() { HashSet highlights = new HashSet<>(); - int ball1Pos = client.getVarbitValue(PRSS_VBIT_B1); - boolean prss_1_locked = client.getVarbitValue(PRSS_VBIT_LL) != 0; - boolean prss_1_plugged = client.getVarbitValue(PRSS_VBIT_P1) == 1; + int ball1Pos = client.getVarbitValue(VarbitID.TOL_PRES1_LEVEL); + boolean prss_1_locked = client.getVarbitValue(VarbitID.TOL_LEVER1) != 0; + boolean prss_1_plugged = client.getVarbitValue(VarbitID.TOL_PRES_SOLVED1) == 1; boolean prss_1_filled = (ball1Pos == 5); if (!prss_1_filled) { @@ -97,9 +87,9 @@ else if (!prss_1_plugged) return highlights; } - int ball2Pos = client.getVarbitValue(PRSS_VBIT_B2); - boolean prss_2_locked = client.getVarbitValue(PRSS_VBIT_LL) != 1; - boolean prss_2_plugged = client.getVarbitValue(PRSS_VBIT_P2) == 1; + int ball2Pos = client.getVarbitValue(VarbitID.TOL_PRES2_LEVEL); + boolean prss_2_locked = client.getVarbitValue(VarbitID.TOL_LEVER1) != 1; + boolean prss_2_plugged = client.getVarbitValue(VarbitID.TOL_PRES_SOLVED2) == 1; boolean prss_2_filled = (ball2Pos == 5); if (!prss_2_filled) { @@ -118,9 +108,9 @@ else if (!prss_2_plugged) return highlights; } - int ball3Pos = client.getVarbitValue(PRSS_VBIT_B3); - boolean prss_3_locked = client.getVarbitValue(PRSS_VBIT_LR) != 0; - boolean prss_3_plugged = client.getVarbitValue(PRSS_VBIT_P3) == 1; + int ball3Pos = client.getVarbitValue(VarbitID.TOL_PRES3_LEVEL); + boolean prss_3_locked = client.getVarbitValue(VarbitID.TOL_LEVER2) != 0; + boolean prss_3_plugged = client.getVarbitValue(VarbitID.TOL_PRES_SOLVED3) == 1; boolean prss_3_filled = (ball3Pos == 5); if (!prss_3_filled) { @@ -144,9 +134,9 @@ else if (!prss_3_plugged) return highlights; } - int ball4Pos = client.getVarbitValue(PRSS_VBIT_B4); - boolean prss_4_locked = client.getVarbitValue(PRSS_VBIT_LR) != 1; - boolean prss_4_plugged = client.getVarbitValue(PRSS_VBIT_P4) == 1; + int ball4Pos = client.getVarbitValue(VarbitID.TOL_PRES4_LEVEL); + boolean prss_4_locked = client.getVarbitValue(VarbitID.TOL_LEVER2) != 1; + boolean prss_4_plugged = client.getVarbitValue(VarbitID.TOL_PRES_SOLVED4) == 1; boolean prss_4_filled = (ball4Pos == 5); if (!prss_4_filled) { @@ -185,12 +175,7 @@ else if (!prss_4_plugged) private static final WidgetDetails PIPE_PCE_3 = new WidgetDetails(511, 11, 0); // T Piece private static final WidgetDetails PIPE_PCE_4 = new WidgetDetails(511, 12, 0); // Big bend private static final WidgetDetails PIPE_PCE_5 = new WidgetDetails(511, 13, 0); // Small bend - //Varbits - private static final int PIPE_VBIT_1_SELECT = 3343; - private static final int PIPE_VBIT_2_SELECT = 3341; - private static final int PIPE_VBIT_3_SELECT = 3344; - private static final int PIPE_VBIT_4_SELECT = 3345; - private static final int PIPE_VBIT_5_SELECT = 3342; + //Orientation private static final int PIPE_PCE_1_ORIENTATION = 22547; private static final int PIPE_PCE_2_ORIENTATION = 22531; private static final int PIPE_PCE_3_ORIENTATION = 22555; @@ -207,11 +192,11 @@ public HashSet pipeSolver() if (pipeSolverSolutions == null) { pipeSolverSolutions = Arrays.asList( - new PipeSolverSolution(PIPE_PCE_1, 159, 69, PIPE_PCE_1_ORIENTATION, PIPE_VBIT_1_SELECT), - new PipeSolverSolution(PIPE_PCE_2, 83, 80, PIPE_PCE_2_ORIENTATION, PIPE_VBIT_2_SELECT), - new PipeSolverSolution(PIPE_PCE_3, 256, 60, PIPE_PCE_3_ORIENTATION, PIPE_VBIT_3_SELECT), - new PipeSolverSolution(PIPE_PCE_4, 237, 155, PIPE_PCE_4_ORIENTATION, PIPE_VBIT_4_SELECT), - new PipeSolverSolution(PIPE_PCE_5, 126, 64, PIPE_PCE_5_ORIENTATION, PIPE_VBIT_5_SELECT) + new PipeSolverSolution(PIPE_PCE_1, 159, 69, PIPE_PCE_1_ORIENTATION, VarbitID.TOL_PIPE_PIECE3_ACTIVE), + new PipeSolverSolution(PIPE_PCE_2, 83, 80, PIPE_PCE_2_ORIENTATION, VarbitID.TOL_PIPE_PIECE1_ACTIVE), + new PipeSolverSolution(PIPE_PCE_3, 256, 60, PIPE_PCE_3_ORIENTATION, VarbitID.TOL_PIPE_PIECE4_ACTIVE), + new PipeSolverSolution(PIPE_PCE_4, 237, 155, PIPE_PCE_4_ORIENTATION, VarbitID.TOL_PIPE_PIECE5_ACTIVE), + new PipeSolverSolution(PIPE_PCE_5, 126, 64, PIPE_PCE_5_ORIENTATION, VarbitID.TOL_PIPE_PIECE2_ACTIVE) ); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/TowerOfLife.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/TowerOfLife.java index 3c4f08c9676..87eba9132ff 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/TowerOfLife.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/toweroflife/TowerOfLife.java @@ -44,6 +44,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -194,16 +195,16 @@ public void setupConditions() inTowerFloor2 = new ZoneRequirement(tower31, tower32, tower33, tower34); inTowerFloor3 = new ZoneRequirement(tower41, tower42, tower43, tower44); - isPressureMachineBuilt = new VarbitRequirement(3338, 1); - isPressureMachineFixed = new VarbitRequirement(3338, 2); + isPressureMachineBuilt = new VarbitRequirement(VarbitID.TOL_PRES_PROG, 1); + isPressureMachineFixed = new VarbitRequirement(VarbitID.TOL_PRES_PROG, 2); - isPipeMachineBuilt = new VarbitRequirement(3339, 1); - isPipeMachineFixed = new VarbitRequirement(3339, 2); + isPipeMachineBuilt = new VarbitRequirement(VarbitID.TOL_PIPE_PROG, 1); + isPipeMachineFixed = new VarbitRequirement(VarbitID.TOL_PIPE_PROG, 2); - isCageBuilt = new VarbitRequirement(3340, 1); - isCageFixed = new VarbitRequirement(3340, 2); + isCageBuilt = new VarbitRequirement(VarbitID.TOL_CAGE_PROG, 1); + isCageFixed = new VarbitRequirement(VarbitID.TOL_CAGE_PROG, 2); - isTowerFixed = new VarbitRequirement(3354, 1); + isTowerFixed = new VarbitRequirement(VarbitID.TOL_CAGE_STATE, 1); } public void setupSteps() @@ -330,7 +331,7 @@ private void setupFixTower() "Rivets."); Conditions hasAllPipeItems = new Conditions(pipeMachinePipes, pipeMachineRings, pipeMachineRivets); - buildPipeMachine = new ObjectStep(this, 21943, new WorldPoint(2650, 3214, 2), "Build the Pipe Machine."); + buildPipeMachine = new ObjectStep(this, ObjectID.TOL_PIPE_MACHINE_MULTI, new WorldPoint(2650, 3214, 2), "Build the Pipe Machine."); buildPipeMachine.addDialogStep("Yes"); buildPipeMachine.addSubSteps(fixPipeMachineGetPipes, fixPipeMachineGetRings, fixPipeMachineGetRivets, climbUpToFloor1, climbUpToFloor2, climbUpToFloor3, climbDownToGround, climbDownToFloor1, climbDownToFloor2); @@ -357,7 +358,7 @@ private void setupFixTower() "fluid."); Conditions hasAllCageItems = new Conditions(cageMetalBar, cageBindingFluid); - buildCage = new ObjectStep(this, 21941, new WorldPoint(2649, 3218, 3), "Build the cage."); + buildCage = new ObjectStep(this, ObjectID.TOL_CAGE_MULTI, new WorldPoint(2649, 3218, 3), "Build the cage."); buildCage.addDialogStep("Yes"); buildCage.addSubSteps(fixCageGetBars, fixCageGetFluid, climbUpToFloor1, climbUpToFloor2, climbUpToFloor3, climbDownToGround, climbDownToFloor1, climbDownToFloor2); @@ -398,7 +399,7 @@ private void setupGetBuildersCostume() talkToNoFingers = new NpcStep(this, NpcID.TOL_NPC_BUILDER02, new WorldPoint(2645, 3224, 0), "Talk to 'No fingers'."); pickpocketNoFingers = new NpcStep(this, NpcID.TOL_NPC_BUILDER02, new WorldPoint(2645, 3224, 0), "Pickpocket 'No " + "fingers'."); - hasSpokenToNoFingers = new VarbitRequirement(3376, 1); + hasSpokenToNoFingers = new VarbitRequirement(VarbitID.TOL_NOFINGERS_ASKED, 1); ConditionalStep getBoots = new ConditionalStep(this, talkToNoFingers); // "Get the Builder's Boots from 'No fingers'" getBoots.addStep(hasSpokenToNoFingers, pickpocketNoFingers); @@ -412,7 +413,7 @@ private void setupGetBuildersCostume() getTrousers.addText("(Hint: try the south-east bushes first)."); ((DetailedQuestStep) getTrousers).setHideWorldArrow(true); - talkToBonafidoWithOutfit = new NpcStep(this, NpcID.TOL_NPC_BARRY01, "Speak to Bonafido.", + talkToBonafidoWithOutfit = new NpcStep(this, NpcID.TOL_NPC_BARRY01, "Speak to Bonafido wearing the Builder's outfit.", buildersHatEquipped, buildersShirtEquipped, buildersTrousersEquipped, buildersBootsEquipped); talkToBonafidoWithOutfit.addDialogStep(2, "Tea"); talkToBonafidoWithOutfit.addDialogStep(3, "Whistle for attention"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/treegnomevillage/TreeGnomeVillage.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/treegnomevillage/TreeGnomeVillage.java index 9beea133524..a1954872842 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/treegnomevillage/TreeGnomeVillage.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/treegnomevillage/TreeGnomeVillage.java @@ -33,7 +33,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcHintArrowRequirement; -import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; @@ -43,16 +42,7 @@ import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; -import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; -import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ItemStep; -import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; -import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; -import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; @@ -60,6 +50,13 @@ import net.runelite.api.gameval.ObjectID; import net.runelite.api.gameval.VarbitID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; + public class TreeGnomeVillage extends BasicQuestHelper { // Required items diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tribaltotem/TribalTotem.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tribaltotem/TribalTotem.java index 9aa43400806..c0d3ea0310d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tribaltotem/TribalTotem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/tribaltotem/TribalTotem.java @@ -75,7 +75,7 @@ public Map loadSteps() useLabelOnCrate.addStep(addressLabel, useLabel); ConditionalStep navigateMansion = new ConditionalStep(this, talkToCromperty); - navigateMansion.addStep(totem.alsoCheckBank(questBank), talkToKangaiMauAgain); + navigateMansion.addStep(totem.alsoCheckBank(), talkToKangaiMauAgain); navigateMansion.addStep(new Conditions(openedLockWidget, inMiddleRoom), solvePassword); navigateMansion.addStep(inStairway, climbStairs); navigateMansion.addStep(isUpstairs, searchChest); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/trollstronghold/TrollStronghold.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/trollstronghold/TrollStronghold.java index 0b3f8d2ee37..234599667fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/trollstronghold/TrollStronghold.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/trollstronghold/TrollStronghold.java @@ -49,10 +49,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.*; @@ -173,8 +170,8 @@ public void setupConditions() prisonKeyNearby = new ItemOnTileRequirement(ItemID.TROLL_KEY_PRISON); cellKey1Nearby = new ItemOnTileRequirement(cellKey1); cellKey2Nearby = new ItemOnTileRequirement(cellKey2); - freedEadgar = new VarbitRequirement(0, 1); - freedGodric = new VarplayerRequirement(317, 40); + freedEadgar = new VarbitRequirement(VarbitID.TROLL_FREED_EADGAR, 1); + freedGodric = new VarplayerRequirement(VarPlayerID.TROLL_QUEST, 40); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/troubledtortugans/RepairTown.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/troubledtortugans/RepairTown.java new file mode 100644 index 00000000000..6fa67c894e2 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/troubledtortugans/RepairTown.java @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2025, pajlada + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.quests.troubledtortugans; + +import net.runelite.client.plugins.microbot.questhelper.managers.QuestContainerManager; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedOwnerStep; +import net.runelite.client.plugins.microbot.questhelper.steps.ItemStep; +import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.api.ItemContainer; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.GameTick; +import net.runelite.api.gameval.InventoryID; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; +import net.runelite.client.eventbus.Subscribe; + +import java.util.List; + +public class RepairTown extends DetailedOwnerStep +{ + // Required items + ItemRequirement anyAxe; + ItemRequirement hammer; + ItemRequirement saw; + + // Mid-quest requirements + ItemRequirement jatobaLogs; + ItemRequirement seaShells; + ItemRequirement tortuganScutes; + + // Miscellaneous requirements + VarbitRequirement repairedKrillStall; + VarbitRequirement repairedCocoStall; + VarbitRequirement repairedStromCrates; + VarbitRequirement repairedStromWall; + VarbitRequirement repairedCocoCrates; + VarbitRequirement repairedKrillWall; + FreeInventorySlotRequirement freeInvSlotRequirement; + + // Steps + ItemStep gatherShells; + ItemStep gatherScutes; + ObjectStep chopJatobaTrees; + ObjectStep repairKrillStall; + ObjectStep repairCocoStall; + ObjectStep repairStromCrates; + ObjectStep repairStromWall; + ObjectStep repairCocoCrates; + ObjectStep repairKrillWall; + + private boolean hasInitialized; + + public RepairTown(QuestHelper questHelper, ItemRequirement anyAxe, ItemRequirement hammer, ItemRequirement saw) + { + super(questHelper, "Gather materials and repair the objects around the town. Clear your inventory until you have 22 slots free for the material to speed up repairing."); + + this.anyAxe = anyAxe; + this.hammer = hammer; + this.saw = saw; + } + + void initializeRequirements() + { + if (hasInitialized) + { + return; + } + + freeInvSlotRequirement = new FreeInventorySlotRequirement(22); + + jatobaLogs = new ItemRequirement("Jatoba Logs", ItemID.JATOBA_LOGS, -1); + jatobaLogs.setTooltip("A big cluster of these trees can be found to the west of the town."); + seaShells = new ItemRequirement("Sea Shells", ItemID.SEA_SHELL, -1); + seaShells.setTooltip("Can be found to the south by the docks you entered from."); + tortuganScutes = new ItemRequirement("Tortugan scutes", ItemID.TORTUGAN_SCUTE, -1); + tortuganScutes.setTooltip("Found scattered around the town."); + + repairedKrillStall = new VarbitRequirement(VarbitID.TT_REPAIR_KRILL_STALL, 2); + repairedCocoStall = new VarbitRequirement(VarbitID.TT_REPAIR_COCO_STALL, 2); + repairedStromCrates = new VarbitRequirement(VarbitID.TT_REPAIR_STROM_CRATES, 2); + repairedStromWall = new VarbitRequirement(VarbitID.TT_REPAIR_STROM_WALL, 2); + repairedCocoCrates = new VarbitRequirement(VarbitID.TT_REPAIR_COCO_CRATES, 2); + repairedKrillWall = new VarbitRequirement(VarbitID.TT_REPAIR_KRILL_WALL, 2); + + hasInitialized = true; + } + + @Override + public void startUp() + { + updateSteps(); + } + + @Override + protected void setupSteps() + { + initializeRequirements(); + + gatherShells = new ItemStep(this.questHelper, new WorldPoint(3184, 2384, 0), "Gather sea shells on the beach south of The Summer Shore.", seaShells); + gatherScutes = new ItemStep(this.questHelper, new WorldPoint(3169, 2408, 0), "Gather Tortugan scutes around the town.", tortuganScutes); + chopJatobaTrees = new ObjectStep(this.questHelper, ObjectID.JATOBA_TREE, new WorldPoint(3111, 2412, 0), "Chop Jatoba trees for jatoba logs.", anyAxe, jatobaLogs); + + repairKrillStall = new ObjectStep(this.questHelper, ObjectID.TT_REPAIR_KRILL_STALL, new WorldPoint(3164, 2415, 0), "Repair Elder Krill's broken fish stall.", hammer, saw, seaShells.quantity(1), tortuganScutes.quantity(1), jatobaLogs.quantity(2)); + repairCocoStall = new ObjectStep(this.questHelper, ObjectID.TT_REPAIR_COCO_STALL, new WorldPoint(3170, 2406, 0), "Repair Elder Coco's broken crafting stall.", hammer, saw, seaShells.quantity(1), tortuganScutes.quantity(1), jatobaLogs.quantity(2)); + repairStromCrates = new ObjectStep(this.questHelper, ObjectID.TT_REPAIR_STROM_CRATES, new WorldPoint(3156, 2403, 0), "Repair Elder Strom's broken crate.", hammer, saw, seaShells.quantity(2), jatobaLogs.quantity(1)); + repairStromWall = new ObjectStep(this.questHelper, ObjectID.TT_REPAIR_STROM_WALL, new WorldPoint(3153, 2410, 0), "Repair Elder Strom's damaged wall.", hammer, saw, tortuganScutes.quantity(2), jatobaLogs.quantity(2)); + repairCocoCrates = new ObjectStep(this.questHelper, ObjectID.TT_REPAIR_COCO_CRATES, new WorldPoint(3168, 2402, 0), "Repair Elder Coco's broken coconut crate.", hammer, saw, seaShells.quantity(2), jatobaLogs.quantity(1)); + repairKrillWall = new ObjectStep(this.questHelper, ObjectID.TT_REPAIR_KRILL_WALL, new WorldPoint(3166, 2419, 0), "Repair Elder Krill's damaged wall.", hammer, saw, tortuganScutes.quantity(2), jatobaLogs.quantity(2)); + } + + @Subscribe + public void onGameTick(final GameTick event) + { + // TODO: optimize? + updateSteps(); + } + + protected void updateSteps() + { + var requiredLogs = 0; + var requiredShells = 0; + var requiredScutes = 0; + + ItemContainer container = client.getItemContainer(InventoryID.INV); + + var inv = QuestContainerManager.getInventoryData(); + var numLogs = jatobaLogs.checkTotalMatchesInContainers(inv); + var numShells = seaShells.checkTotalMatchesInContainers(inv); + var numScutes = tortuganScutes.checkTotalMatchesInContainers(inv); + + // NOTE: Is there a nicer way to get number of free slots from QuestContainerManager? + var numFreeSlots = 0; + if (container != null) + { + numFreeSlots = 28 - container.count(); + } + + + QuestStep task = null; + + if (!repairedKrillStall.check(client)) + { + requiredScutes += 1; + requiredShells += 1; + requiredLogs += 2; + task = repairKrillStall; + } + + if (!repairedKrillWall.check(client)) + { + requiredScutes += 2; + requiredShells += 0; + requiredLogs += 2; + if (task == null) + { + task = repairKrillWall; + } + } + + if (!repairedStromWall.check(client)) + { + requiredScutes += 2; + requiredShells += 0; + requiredLogs += 2; + if (task == null) + { + task = repairStromWall; + } + } + + if (!repairedStromCrates.check(client)) + { + requiredScutes += 0; + requiredShells += 2; + requiredLogs += 1; + if (task == null) + { + task = repairStromCrates; + } + } + + if (!repairedCocoStall.check(client)) + { + requiredScutes += 1; + requiredShells += 1; + requiredLogs += 2; + if (task == null) + { + task = repairCocoStall; + } + } + + if (!repairedCocoCrates.check(client)) + { + requiredScutes += 0; + requiredShells += 2; + requiredLogs += 1; + if (task == null) + { + task = repairCocoCrates; + } + } + + + var numFreeSlotsNeeded = 0; + if (requiredLogs > numLogs) + { + numFreeSlotsNeeded += requiredLogs - numLogs; + } + if (requiredShells > numShells) + { + numFreeSlotsNeeded += requiredShells - numShells; + } + if (requiredScutes > numScutes) + { + numFreeSlotsNeeded += requiredScutes - numScutes; + } + + freeInvSlotRequirement.setNumSlotsFree(numFreeSlotsNeeded); + + jatobaLogs.setQuantity(requiredLogs); + seaShells.setQuantity(requiredShells); + tortuganScutes.setQuantity(requiredScutes); + + // The following logic could probably be refactored a bit, but changing it without being at the quest spot with your + // brain intact is a dangerous task, so I'm leaving this as-is. + + this.setText(String.format("Gather materials and repair the objects around the town. You need %d jatoba logs, %d sea shells, and %d tortugan scutes.", requiredLogs, requiredShells, requiredScutes)); + + if (numFreeSlots == 0) + { + // The player's inventory is full, we should tell them to do the first available repair task. + // They will have to gather materials based off of the tooltips, rather than nicely highlighted objects. + // This is to accomodate UIM players, other players are prompted to clear their inventory for an + // easier path. + if (numFreeSlotsNeeded == 0) + { + // If the user is actually done gathering everything, but their inventory is full, make the messaging nicer. + this.setOverlayText("Repair the objects around the town."); + } + else + { + this.setOverlayText(String.format("Gather materials and repair the objects around the town. Clear your inventory until you have %d slots free for the material to speed up repairing.", numFreeSlotsNeeded)); + } + startUpStep(task); + return; + } + + if (numFreeSlots >= numFreeSlotsNeeded) + { + // User has enough free inventory slots to gather everything _then_ repair things. + if (numShells < requiredShells) + { + this.setOverlayText("Gather materials, then repair the objects around the town."); + startUpStep(gatherShells); + return; + } + + if (numScutes < requiredScutes) + { + this.setOverlayText("Gather materials, then repair the objects around the town."); + startUpStep(gatherScutes); + return; + } + + if (numLogs < requiredLogs) + { + this.setOverlayText("Gather materials, then repair the objects around the town."); + startUpStep(chopJatobaTrees); + return; + } + } + + this.setOverlayText(String.format("Gather materials and repair the objects around the town. Clear your inventory until you have %d slots free for the material to speed up repairing.", numFreeSlotsNeeded)); + startUpStep(task); + } + + @Override + public List getSteps() + { + return List.of( + gatherShells, + gatherScutes, + chopJatobaTrees, + repairKrillStall, + repairKrillWall, + repairStromWall, + repairStromCrates, + repairCocoStall, + repairCocoCrates + ); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/troubledtortugans/TroubledTortugans.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/troubledtortugans/TroubledTortugans.java new file mode 100644 index 00000000000..c7f7035eaf0 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/troubledtortugans/TroubledTortugans.java @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2025, pajlada + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.helpers.quests.troubledtortugans; + +import net.runelite.client.plugins.microbot.questhelper.bank.banktab.BankSlotIcons; +import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemOnTileRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.SkillRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; +import net.runelite.client.plugins.microbot.questhelper.rewards.ExperienceReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.rewards.UnlockReward; +import net.runelite.client.plugins.microbot.questhelper.steps.*; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; + +public class TroubledTortugans extends BasicQuestHelper +{ + // Required items + ItemRequirement anyAxe; + ItemRequirement hammer; + ItemRequirement saw; + ItemRequirement combatGear; + ItemRequirement food; + ItemRequirement prayer; + + // Mid-quest item requirements + ItemRequirement seaweed; + ItemRequirement palmLeaf; + ItemRequirement makeshiftBandages; + ItemRequirement tortuganShield; + + // Zones + Zone remoteIsland; + Zone gryphonCave; + Zone littlePearl; + + // Miscellaneous requirements + VarbitRequirement onBoat; + VarbitRequirement notOnBoat; + Conditions onRemoteIsland; + ZoneRequirement inGryphonCave; + ZoneRequirement onLittlePearl; + + // Steps + // 0 + NpcStep startQuest; + + // 2 + 4 + ObjectStep getPalmLeaf; + ItemStep pickUpPalmLeaf; + ItemStep getSeaweed; + DetailedQuestStep makeBandage; + NpcStep giveBandage; + ConditionalStep cMakeBandages; + + // 6 + 7 + DetailedQuestStep talkToInjuredTortuganAfterBandaging; + + // 8 + 10 + ObjectStep boardBoat; + ObjectStep sailToGreatConch; + ConditionalStep cSailToGreatConch; + + // 12 + 13 + NpcStep talkToElderKorelAtDocks; + + // 14 + 16 + NpcStep talkToElderRaley; + + // 18 + RepairTown repairTown; + + // 20 + NpcStep talkToElderAfterRepairs; + + // 22 + 24 + ObjectStep inspectMonument; + + // 24 + ObjectStep followTrailPlant1; + ObjectStep followTrailRockslide; + ObjectStep followTrailPlant2; + ObjectStep followTrailPlant3; + ConditionalStep cFollowTrail; + + // 26 + ObjectStep unblockCave; + + // 28 + ObjectStep enterGryphonCave; + + // 30 + NpcStep fightGryphon; + ConditionalStep cFightGryphon; + + // 32 + ObjectStep exitGryphonCave; + NpcStep returnToElder; + ConditionalStep cReturnToElder; + + // 34 + 36 + 38 + NpcStep getShield; + ObjectStep boardBoatAtConch; + DetailedQuestStep sailToLittlePearl; + NpcStep fightShellbane; + ConditionalStep cGetToTheLittlePearl; + + // 40 + NpcStep talkToElderKorelAfterBeatingShellbaneGryphon; + + // 42 + ObjectStep boardBoatFromLittlePearl; + ObjectStep dockAtTheGreatConch; + NpcStep finishQuest; + ConditionalStep cFinishQuest; + + @Override + protected void setupZones() + { + remoteIsland = new Zone(new WorldPoint(2946, 2619, 0), new WorldPoint(2974, 2598, 0)); + gryphonCave = new Zone(12682); + littlePearl = new Zone(13346); + } + + @Override + protected void setupRequirements() + { + anyAxe = new ItemRequirement("Any axe", ItemCollections.AXES).canBeObtainedDuringQuest(); + anyAxe.appendToTooltip("A bronze axe can be found to the west of The Summer Shore. You need to cut down multiple things, so bring the best woodcutting axe you can use."); + + // NOTE: Haven't tested other hammers + hammer = new ItemRequirement("Hammer", ItemCollections.HAMMER).canBeObtainedDuringQuest(); + hammer.appendToTooltip("Can be found inside the smith's house to the north-east."); + + // NOTE: Haven't tested other saws + saw = new ItemRequirement("Saw", ItemCollections.SAW).canBeObtainedDuringQuest(); + saw.appendToTooltip("Can be found inside Elder Raley's house to the south-east."); + + combatGear = new ItemRequirement("Combat gear", -1, -1).isNotConsumed(); + combatGear.setDisplayItemId(BankSlotIcons.getCombatGear()); + + food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); + + prayer = new ItemRequirement("Prayer restore", ItemCollections.PRAYER_POTIONS, -1); + + seaweed = new ItemRequirement("Seaweed", ItemID.SEAWEED); + palmLeaf = new ItemRequirement("Palm leaf", ItemID.PALM_LEAF); + makeshiftBandages = new ItemRequirement("Makeshift bandages", ItemID.TT_BANDAGES); + + tortuganShield = new ItemRequirement("Tortugan shield", ItemID.TORTUGAN_SHIELD); + + onBoat = new VarbitRequirement(VarbitID.SAILING_BOARDED_BOAT, 1); + notOnBoat = new VarbitRequirement(VarbitID.SAILING_BOARDED_BOAT, 0); + + onRemoteIsland = and(notOnBoat, new ZoneRequirement(remoteIsland)); + inGryphonCave = new ZoneRequirement(gryphonCave); + onLittlePearl = new ZoneRequirement(littlePearl); + } + + void setupSteps() + { + // 0 + startQuest = new NpcStep(this, NpcID.TT_FLOOPA_INJURED_VIS, new WorldPoint(2962, 2605, 0), "Talk to the Injured Tortugan on the small island north-west of The Great Conch to start the quest."); + startQuest.addDialogStep("Yes."); + + // 2 + 4 + getPalmLeaf = new ObjectStep(this, ObjectID.TT_PALM_1, new WorldPoint(2964, 2604, 0), "Shake a nearby palm for a palm leaf."); + getPalmLeaf.addAlternateObjects(ObjectID.TT_PALM_2, ObjectID.TT_PALM_3); + pickUpPalmLeaf = new ItemStep(this, "Pick up the palm leaf from the ground", palmLeaf); + getSeaweed = new ItemStep(this, "Pick up seaweed from the shore.", seaweed); + makeBandage = new DetailedQuestStep(this, "Use the seaweed on the palm leaf to create makeshift bandages.", seaweed.highlighted(), palmLeaf.highlighted()); + giveBandage = new NpcStep(this, NpcID.TT_FLOOPA_INJURED_VIS, new WorldPoint(2962, 2605, 0), "Talk to the Injured Tortugan and give her the makeshift bandages.", makeshiftBandages); + cMakeBandages = new ConditionalStep(this, giveBandage, "Help the Injured Tortugan with her wounds."); + cMakeBandages.addStep(and(not(makeshiftBandages), seaweed, palmLeaf), makeBandage); + cMakeBandages.addStep(and(not(makeshiftBandages), new ItemOnTileRequirement(palmLeaf)), pickUpPalmLeaf); + cMakeBandages.addStep(nor(makeshiftBandages, palmLeaf), getPalmLeaf); + cMakeBandages.addStep(nor(makeshiftBandages, seaweed), getSeaweed); + + // 6 + 7 + talkToInjuredTortuganAfterBandaging = new NpcStep(this, NpcID.TT_FLOOPA_ISLAND, new WorldPoint(2962, 2605, 0), "Talk to the Injured Tortugan again."); + + // 8 + 10 + // NOTE: We are assuming that the player has their boat here. I think there's no way this can be wrong + boardBoat = new ObjectStep(this, ObjectID.SAILING_MOORING_REMOTE_ISLAND, "Board your boat with Floopa."); + sailToGreatConch = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_DISEMBARK, new WorldPoint(3174, 2367, 0), "Sail to the docks at the southern edge of The Great Conch with Floopa."); + + cSailToGreatConch = new ConditionalStep(this, sailToGreatConch); + sailToGreatConch.addSubSteps(boardBoat); + cSailToGreatConch.addStep(onRemoteIsland, boardBoat); + + // 12 + 13 + talkToElderKorelAtDocks = new NpcStep(this, NpcID.TT_KOREL_CONCH_DOCKS, new WorldPoint(3185, 2371, 0), "Talk to Elder Korel at the docks of The Great Conch."); + + // 14 + 16 + talkToElderRaley = new NpcStep(this, NpcID.TT_RALEY_CONCH, new WorldPoint(3186, 2405, 0), "Head into The Summer Shore to the north and talk to Elder Raley in the south-east building."); + + // 18 + repairTown = new RepairTown(this, anyAxe, hammer, saw); + + // 20 + talkToElderAfterRepairs = new NpcStep(this, NpcID.TT_RALEY_CONCH, new WorldPoint(3186, 2405, 0), "Talk to Elder Raley after completing the town repairs."); + + // 22 + inspectMonument = new ObjectStep(this, ObjectID.TT_HUNTING_MONUMENT_OP, new WorldPoint(3167, 2411, 0), "Inspect the monument in the middle of town to pick up the Gryphon's trail.", anyAxe, combatGear, food, prayer); + + // 24 + followTrailPlant1 = new ObjectStep(this, ObjectID.TT_HUNTING_PLANT_03, new WorldPoint(3128, 2423, 0), "Follow the Gryphon tracks west of town and inspect the red plant.", anyAxe, combatGear, food, prayer); + followTrailRockslide = new ObjectStep(this, ObjectID.TT_HUNTING_ROCKS_01_OP, new WorldPoint(3127, 2448, 0), "Follow the Gryphon tracks north and inspect the rockslide.", anyAxe, combatGear, food, prayer); + followTrailPlant2 = new ObjectStep(this, ObjectID.TT_HUNTING_PLANT_05_OP, new WorldPoint(3138, 2469, 0), "Follow the Gryphon tracks north up the hill and inspect the plant on the east side.", anyAxe, combatGear, food, prayer); + followTrailPlant3 = new ObjectStep(this, ObjectID.TT_HUNTING_PLANT_05_OP, new WorldPoint(3151, 2474, 0), "Follow the Gryphon tracks east and inspect the plant to reveal the final set of tracks.", anyAxe, combatGear, food, prayer); + + cFollowTrail = new ConditionalStep(this, followTrailPlant3); + cFollowTrail.addStep(new VarbitRequirement(VarbitID.TT_HUNTING_TRAIL_1, 0), inspectMonument); + cFollowTrail.addStep(new VarbitRequirement(VarbitID.TT_HUNTING_TRAIL_2, 0), followTrailPlant1); + cFollowTrail.addStep(new VarbitRequirement(VarbitID.TT_HUNTING_TRAIL_3, 0), followTrailRockslide); + cFollowTrail.addStep(new VarbitRequirement(VarbitID.TT_HUNTING_TRAIL_4, 0), followTrailPlant2); + + // 26 + unblockCave = new ObjectStep(this, ObjectID.TT_LAIR_ENTRANCE_BLOCKED, new WorldPoint(3177, 2477, 0), "Follow the Gryphon tracks east and unblock the cave entrance.", anyAxe, combatGear, food, prayer); + + // 28 + enterGryphonCave = new ObjectStep(this, ObjectID.TT_LAIR_ENTRANCE_CLEAR, new WorldPoint(3177, 2477, 0), "Enter the Gryphon's cave, prepared for a fight.", combatGear, food, prayer); + enterGryphonCave.addDialogStep("Yes."); + + // 30 + // TODO: Confirm this Npc ID is correct + fightGryphon = new NpcStep(this, NpcID.TT_CONCH_GRYPHON, "Defeat the Gryphon. It hits with melee, and does a special attack if your worn weight is less than 45kg.", combatGear, food, prayer); + cFightGryphon = new ConditionalStep(this, enterGryphonCave); + cFightGryphon.addStep(inGryphonCave, fightGryphon); + + // 32 + exitGryphonCave = new ObjectStep(this, ObjectID.TT_LAIR_EXIT_FIGHT, new WorldPoint(3167, 8874, 0), "Return to Elder Raley with news about the Gryphon's defeat."); + returnToElder = new NpcStep(this, NpcID.TT_RALEY_CONCH, new WorldPoint(3186, 2405, 0), "Return to Elder Raley with news about the Gryphon's defeat."); + returnToElder.addSubSteps(exitGryphonCave); + cReturnToElder = new ConditionalStep(this, returnToElder); + cReturnToElder.addStep(inGryphonCave, exitGryphonCave); + + // 34 + 36 + 38 + getShield = new NpcStep(this, NpcID.TORTUGAN_BLUNN_1OP, new WorldPoint(3172, 2417, 0), "Get a Tortugan shield from Elder Blunn."); + boardBoatAtConch = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_EMBARK, new WorldPoint(3174, 2367, 0), "Sail to Little Pearl island, south-east of The Great Conch, to confront the Shellbane gryphon.", combatGear, food, prayer, tortuganShield); + sailToLittlePearl = new ObjectStep(this, ObjectID.SAILING_MOORING_DISEMBARK, new WorldPoint(3354, 2216, 0), "Sail to Little Pearl island, south-east of The Great Conch, to confront the Shellbane gryphon.", combatGear, food, prayer, tortuganShield.equipped()); + sailToLittlePearl.addSubSteps(boardBoatAtConch); + fightShellbane = new NpcStep(this, NpcID.TT_PEARL_GRYPHON, "Defeat the Shellbane gryphon. Have your worn weight be at least 45kg to avoid some damage. Protect from ranged if you're ranging it, and protect from melee when in melee range. Avoid tornadoes. Move when it spits a slow blob at you.", combatGear, food, prayer, tortuganShield.equipped()); + cGetToTheLittlePearl = new ConditionalStep(this, boardBoatAtConch); + cGetToTheLittlePearl.addStep(not(tortuganShield), getShield); + cGetToTheLittlePearl.addStep(onBoat, sailToLittlePearl); + cGetToTheLittlePearl.addStep(onLittlePearl, fightShellbane); + + // 40 + talkToElderKorelAfterBeatingShellbaneGryphon = new NpcStep(this, NpcID.TT_KOREL_PEARL_COMBAT_DONE, new WorldPoint(3352, 2211, 0), "Talk to Elder Korel after defeating the Shellbane gryphon."); + + // 42 + boardBoatFromLittlePearl = new ObjectStep(this, ObjectID.SAILING_MOORING_EMBARK, new WorldPoint(3355, 2218, 0), "Return to Elder Raley at The Great Conch to complete the quest."); + dockAtTheGreatConch = new ObjectStep(this, ObjectID.SAILING_GANGPLANK_DISEMBARK, new WorldPoint(3174, 2367, 0), "Return to Elder Raley at The Great Conch to complete the quest."); + finishQuest = new NpcStep(this, NpcID.TT_RALEY_CONCH, new WorldPoint(3186, 2405, 0), "Return to Elder Raley at The Great Conch to complete the quest."); + finishQuest.addSubSteps(boardBoatFromLittlePearl, dockAtTheGreatConch); + cFinishQuest = new ConditionalStep(this, finishQuest); + cFinishQuest.addStep(onBoat, dockAtTheGreatConch); + cFinishQuest.addStep(onLittlePearl, boardBoatFromLittlePearl); + } + + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, startQuest); + steps.put(2, startQuest); + steps.put(4, cMakeBandages); + steps.put(6, talkToInjuredTortuganAfterBandaging); + steps.put(7, talkToInjuredTortuganAfterBandaging); + steps.put(8, cSailToGreatConch); + steps.put(10, cSailToGreatConch); + // NOTE: If the user teleports away and resumes here, we assume they know how to make their way onto the island + // I don't think this is a bad assumption, since it's just a matter of sailing + steps.put(12, talkToElderKorelAtDocks); + steps.put(13, talkToElderKorelAtDocks); + steps.put(14, talkToElderRaley); + steps.put(16, talkToElderRaley); + steps.put(18, repairTown); + steps.put(20, talkToElderAfterRepairs); + // NOTE: 22 could maybe just be "inspectMonument" + steps.put(22, cFollowTrail); + steps.put(24, cFollowTrail); + steps.put(26, unblockCave); + steps.put(28, enterGryphonCave); + steps.put(30, cFightGryphon); + steps.put(32, cReturnToElder); + steps.put(34, cGetToTheLittlePearl); + steps.put(36, cGetToTheLittlePearl); + steps.put(38, cGetToTheLittlePearl); + steps.put(40, talkToElderKorelAfterBeatingShellbaneGryphon); + steps.put(42, cFinishQuest); + + return steps; + } + + @Override + public List getGeneralRequirements() + { + return List.of( + // TODO: Waiting for the Pandemonium helper to be merged in + // new QuestRequirement(QuestHelperQuest.PANDEMONIUM, QuestState.FINISHED), + + new SkillRequirement(Skill.SAILING, 45, false), + new SkillRequirement(Skill.SLAYER, 51, false), + new SkillRequirement(Skill.HUNTER, 45, false), + new SkillRequirement(Skill.CONSTRUCTION, 48, false), + new SkillRequirement(Skill.WOODCUTTING, 40, true), + new SkillRequirement(Skill.CRAFTING, 34, true) + ); + } + + @Override + public List getGeneralRecommended() + { + // TODO + return List.of(); + } + + @Override + public List getItemRequirements() + { + return List.of( + anyAxe, + hammer, + saw, + combatGear, + food, + prayer + ); + } + + @Override + public List getItemRecommended() + { + return List.of(); + } + + @Override + public List getCombatRequirements() + { + return List.of( + "Gryphon (lvl 95)", + "Shellbane gryphon (lvl 235)" + ); + } + + @Override + public QuestPointReward getQuestPointReward() + { + return new QuestPointReward(1); + } + + @Override + public List getExperienceRewards() + { + return List.of( + new ExperienceReward(Skill.SAILING, 10000), + new ExperienceReward(Skill.SLAYER, 8000) + ); + } + + @Override + public List getItemRewards() + { + return List.of(); + } + + @Override + public List getUnlockRewards() + { + return List.of( + new UnlockReward("Access to the Great Conch") + ); + } + + @Override + public List getPanels() + { + var sections = new ArrayList(); + + sections.add(new PanelDetails("Find the stranded Tortugan", List.of( + startQuest, + cMakeBandages, + talkToInjuredTortuganAfterBandaging + ))); + + sections.add(new PanelDetails("The Great Conch", List.of( + sailToGreatConch, + talkToElderKorelAtDocks, + talkToElderRaley + ))); + + sections.add(new PanelDetails("Making repairs", List.of( + repairTown, + talkToElderAfterRepairs + ), List.of( + repairTown.anyAxe, + repairTown.hammer, + repairTown.saw + ), List.of( + repairTown.freeInvSlotRequirement + ))); + + sections.add(new PanelDetails("Tracking the Gryphon", List.of( + inspectMonument, + followTrailPlant1, + followTrailRockslide, + followTrailPlant2, + followTrailPlant3, + unblockCave, + enterGryphonCave, + fightGryphon, + returnToElder + ), List.of( + anyAxe, + combatGear, + food, + prayer + ))); + + sections.add(new PanelDetails("Attack on the Little Pearl", List.of( + getShield, + sailToLittlePearl, + fightShellbane, + talkToElderKorelAfterBeatingShellbaneGryphon, + finishQuest + ))); + + return sections; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/twilightspromise/TwilightsPromise.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/twilightspromise/TwilightsPromise.java index 1c06e367ef3..21dc541dc1e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/twilightspromise/TwilightsPromise.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/twilightspromise/TwilightsPromise.java @@ -34,7 +34,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.npc.NpcRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.InInstanceRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; @@ -141,13 +140,13 @@ public Map loadSteps() findPubKnights.addStep(pubKnightFollowing, takePubKnightsToFountain); ConditionalStep findBazaarKnight = new ConditionalStep(this, talkToBazaarKnight); - findBazaarKnight.addStep(stolenAmulet.alsoCheckBank(questBank), returnAmulet); + findBazaarKnight.addStep(stolenAmulet.alsoCheckBank(), returnAmulet); findBazaarKnight.addStep(talkedToBazaarKnight, pickpocketCitizen); ConditionalStep findKnights = new ConditionalStep(this, findColosseumKnight); - findKnights.addStep(LogicHelper.nor(finishedBazaarKnight), findBazaarKnight); - findKnights.addStep(LogicHelper.nor(finishedCothonKnight), findCothonKnight); - findKnights.addStep(LogicHelper.nor(finishedPubKnights), findPubKnights); + findKnights.addStep(nor(finishedBazaarKnight), findBazaarKnight); + findKnights.addStep(nor(finishedCothonKnight), findCothonKnight); + findKnights.addStep(nor(finishedPubKnights), findPubKnights); steps.put(14, findKnights); steps.put(16, findKnights); @@ -160,7 +159,7 @@ public Map loadSteps() ConditionalStep goReadLetter = new ConditionalStep(this, goUpHQ); - goReadLetter.addStep(incriminatingLetter.alsoCheckBank(questBank), readLetter); + goReadLetter.addStep(incriminatingLetter.alsoCheckBank(), readLetter); goReadLetter.addStep(inHQ2, searchHQChest); goReadLetter.addStep(inHQ1, goUpHQ2); steps.put(24, goReadLetter); @@ -222,7 +221,7 @@ protected void setupRequirements() private void setupConditions() { - beenToVarlamore = new VarbitRequirement(9650, 1); + beenToVarlamore = new VarbitRequirement(VarbitID.VARLAMORE_VISITED, 1); inCrypt = new ZoneRequirement(crypt); inColosseumUnderground = new ZoneRequirement(colosseumUnderground); inColosseum = new ZoneRequirement(colosseum); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/undergroundpass/UndergroundPass.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/undergroundpass/UndergroundPass.java index 042b69942bd..86847245226 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/undergroundpass/UndergroundPass.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/undergroundpass/UndergroundPass.java @@ -51,6 +51,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -253,7 +254,7 @@ protected void setupZones() private void setupConditions() { - clothInBag = new VarbitRequirement(9138, 1); + clothInBag = new VarbitRequirement(VarbitID.UPASS_KOFTIK_OUTSIDE, 1); inCastleFloor2 = new ZoneRequirement(castleFloor2); inWestArdougne = new ZoneRequirement(westArdougne); @@ -273,10 +274,10 @@ private void setupConditions() isBeforeTrap3 = new ZoneRequirement(beforeTrap3); isBeforeTrap4 = new ZoneRequirement(beforeTrap4); isBeforeTrap5 = new ZoneRequirement(beforeTrap5); - usedOrb1 = new VarbitRequirement(9122, 1); - usedOrb2 = new VarbitRequirement(9121, 1); - usedOrb3 = new VarbitRequirement(9120, 1); - usedOrb4 = new VarbitRequirement(9119, 1); + usedOrb1 = new VarbitRequirement(VarbitID.UPASS_CAVEORB_4, 1); + usedOrb2 = new VarbitRequirement(VarbitID.UPASS_CAVEORB_3, 1); + usedOrb3 = new VarbitRequirement(VarbitID.UPASS_CAVEORB_2, 1); + usedOrb4 = new VarbitRequirement(VarbitID.UPASS_CAVEORB_1, 1); destroyedAllOrbs = new Conditions(usedOrb1, usedOrb2, usedOrb3, usedOrb4); haveOrb1 = new Conditions(LogicType.OR, usedOrb1, orb1); @@ -295,13 +296,13 @@ private void setupConditions() isAfterMaze = new ZoneRequirement(afterMaze, afterMazeShortcut); isInUnicornArea = new ZoneRequirement(inUnicornArea); isInUnicornArea2 = new ZoneRequirement(inUnicornArea2); - usedHorn = new VarbitRequirement(9136, 1); + usedHorn = new VarbitRequirement(VarbitID.UPASS_CAVE_UNICORN, 1); haveUnicornHorn = new Conditions(LogicType.OR, unicornHorn, usedHorn); isInKnightsArea = new ZoneRequirement(inKnightsArea1, inKnightsArea2, inKnightsArea3); - usedBadgeJerro = new VarbitRequirement(9128, 1); - usedBadgeCarl = new VarbitRequirement(9129, 1); - usedBadgeHarry = new VarbitRequirement(9130, 1); + usedBadgeJerro = new VarbitRequirement(VarbitID.UPASS_PALADINBADGE_1, 1); + usedBadgeCarl = new VarbitRequirement(VarbitID.UPASS_PALADINBADGE_2, 1); + usedBadgeHarry = new VarbitRequirement(VarbitID.UPASS_PALADINBADGE_3, 1); haveBadgeCarl = new Conditions(LogicType.OR, badgeCarl, usedBadgeCarl); haveBadgeHarry = new Conditions(LogicType.OR, badgeHarry, usedBadgeHarry); @@ -310,12 +311,12 @@ private void setupConditions() isInFinalArea = new ZoneRequirement(inFinalArea); isInDwarfCavern = new ZoneRequirement(inDwarfCavern); haveKlanksGauntlets = klanksGauntlets; - givenWitchCat = new VarbitRequirement(9123, 1); - dollImbued = new VarbitRequirement(9118, 1); - pouredBrew = new VarbitRequirement(9134, 1); - dollAshed = new VarbitRequirement(9117, 1); - kalragKilled = new VarbitRequirement(9115, 1); - doveSmeared = new VarbitRequirement(9116, 1); + givenWitchCat = new VarbitRequirement(VarbitID.UPASS_GAVECAT, 1); + dollImbued = new VarbitRequirement(VarbitID.UPASS_SHADOW_ON_DOLL, 1); + pouredBrew = new VarbitRequirement(VarbitID.UPASS_BREW_TOMB, 1); + dollAshed = new VarbitRequirement(VarbitID.UPASS_ASHES_ON_DOLL, 1); + kalragKilled = new VarbitRequirement(VarbitID.UPASS_VENOM_ON_DOLL, 1); + doveSmeared = new VarbitRequirement(VarbitID.UPASS_DOVE_ON_DOLL, 1); isInTemple = new ZoneRequirement(inTemple); isInPostIbanArea = new ZoneRequirement(inPostIbanArea); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/wanted/Wanted.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/wanted/Wanted.java index abc61ecb8f3..6d70f71b89e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/wanted/Wanted.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/wanted/Wanted.java @@ -52,10 +52,7 @@ import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; -import net.runelite.api.gameval.VarPlayerID; +import net.runelite.api.gameval.*; import java.util.*; @@ -350,33 +347,33 @@ public void setupOtherRequirements() isInRellekka = new ZoneRequirement(rellekka); isInWizardsTower = new ZoneRequirement(wizardsTower); - becameSquire = new VarbitRequirement(1052, 1); - gotAssignmentDetailsFromSavant = new VarbitRequirement(1053, 1); - talkedToLordDaquarius = new VarbitRequirement(1055, 1); - hasKilledBlackKnight = new VarbitRequirement(1055, 2); - investigatedLordDaquarius = new VarbitRequirement(1058, 1); - talkedToMageOfZamorak = new VarbitRequirement(1056, 1); - talkedToSavantNearCanifis = new VarbitRequirement(1065, 1); - mustChaseToChampionsGuild = new VarbitRequirement(1067, 1); - mustChaseToDorgeshKaan = new VarbitRequirement(1069, 1); - mustChaseToEssenceMine = new VarbitRequirement(1071, 1); - mustChaseToMusaPoint = new VarbitRequirement(1073, 1); - mustChaseToDraynorMarket = new VarbitRequirement(1075, 1); - mustChaseToGoblinVillage = new VarbitRequirement(1077, 1); - mustChaseToArdougneMarket = new VarbitRequirement(1079, 1); - mustChaseToGrandTree = new VarbitRequirement(1081, 1); - mustChaseToScorpiusShrine = new VarbitRequirement(1083, 1); - mustChaseToAliMorrisane = new VarbitRequirement(1085, 1); - mustChaseToWizardsTower = new VarbitRequirement(1087, 1); - mustChaseToBrimhavenPub = new VarbitRequirement(1089, 1); - mustChaseToCastleWars = new VarbitRequirement(1091, 1); - mustChaseToRellekka = new VarbitRequirement(1093, 1); - mustChaseToMcGruborsWood = new VarbitRequirement(1095, 1); - mustChaseToSlayerTower = new VarbitRequirement(1097, 1); - mustChaseToYanillePub = new VarbitRequirement(1099, 1); - mustChaseToLumbridgeSwamp = new VarbitRequirement(1101, 1); - - placedRope = new VarbitRequirement(279, 1); + becameSquire = new VarbitRequirement(VarbitID.WANTED_JOKE_OPTION, 1); + gotAssignmentDetailsFromSavant = new VarbitRequirement(VarbitID.WANTED_COMMORB_INTEL, 1); + talkedToLordDaquarius = new VarbitRequirement(VarbitID.WANTED_DAQUARIUS_HINT, 1); + hasKilledBlackKnight = new VarbitRequirement(VarbitID.WANTED_DAQUARIUS_HINT, 2); + investigatedLordDaquarius = new VarbitRequirement(VarbitID.WANTED_LORD_D_EXPOSITION, 1); + talkedToMageOfZamorak = new VarbitRequirement(VarbitID.WANTED_ZAMMY_MAGE_HINT, 1); + talkedToSavantNearCanifis = new VarbitRequirement(VarbitID.WANTED_MISSION1, 1); + mustChaseToChampionsGuild = new VarbitRequirement(VarbitID.WANTED_MISSION2, 1); + mustChaseToDorgeshKaan = new VarbitRequirement(VarbitID.WANTED_MISSION3, 1); + mustChaseToEssenceMine = new VarbitRequirement(VarbitID.WANTED_MISSION4, 1); + mustChaseToMusaPoint = new VarbitRequirement(VarbitID.WANTED_MISSION5, 1); + mustChaseToDraynorMarket = new VarbitRequirement(VarbitID.WANTED_MISSION6, 1); + mustChaseToGoblinVillage = new VarbitRequirement(VarbitID.WANTED_MISSION7, 1); + mustChaseToArdougneMarket = new VarbitRequirement(VarbitID.WANTED_MISSION8, 1); + mustChaseToGrandTree = new VarbitRequirement(VarbitID.WANTED_MISSION9, 1); + mustChaseToScorpiusShrine = new VarbitRequirement(VarbitID.WANTED_MISSION10, 1); + mustChaseToAliMorrisane = new VarbitRequirement(VarbitID.WANTED_MISSION11, 1); + mustChaseToWizardsTower = new VarbitRequirement(VarbitID.WANTED_MISSION12, 1); + mustChaseToBrimhavenPub = new VarbitRequirement(VarbitID.WANTED_MISSION13, 1); + mustChaseToCastleWars = new VarbitRequirement(VarbitID.WANTED_MISSION14, 1); + mustChaseToRellekka = new VarbitRequirement(VarbitID.WANTED_MISSION15, 1); + mustChaseToMcGruborsWood = new VarbitRequirement(VarbitID.WANTED_MISSION16, 1); + mustChaseToSlayerTower = new VarbitRequirement(VarbitID.WANTED_MISSION17, 1); + mustChaseToYanillePub = new VarbitRequirement(VarbitID.WANTED_MISSION18, 1); + mustChaseToLumbridgeSwamp = new VarbitRequirement(VarbitID.WANTED_MISSION19, 1); + + placedRope = new VarbitRequirement(VarbitID.SWAMP_CAVES_ROPED_ENTRANCE, 1); blackKnightNearby = new NpcHintArrowRequirement(NpcID.WANTED_SUMMONED_BLACK_KNIGHT); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/watchtower/Watchtower.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/watchtower/Watchtower.java index d3b9fc3e843..7e2e1bcda4e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/watchtower/Watchtower.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/watchtower/Watchtower.java @@ -45,10 +45,7 @@ import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.InterfaceID; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.*; import java.util.*; @@ -367,7 +364,7 @@ public void setupConditions() hasRelic3 = new Conditions(true, LogicType.OR, relic3, new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "I gave the dragon bones to Toban.")); - gettingOgreRockCake = new VarbitRequirement(3120, 1); + gettingOgreRockCake = new VarbitRequirement(VarbitID.WATCHTOWER_GATE_CHAT_3, 1); gaveCake = new Conditions(true, LogicType.OR, new DialogRequirement("This time we will let it go."), new DialogRequirement("Well, well, look at this."), @@ -375,7 +372,7 @@ public void setupConditions() inAreaBeforeBridgeJump ); // 3319, 1, tried to enter city - knowsRiddle = new VarbitRequirement(3121, 1); + knowsRiddle = new VarbitRequirement(VarbitID.WATCHTOWER_PUZZLE_CHAT, 1); talkedToScaredSkavid = new Conditions(true, LogicType.OR, new DialogRequirement("Master, how are you doing", "Those will gets you started."), new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "ar, nod, gor, ig, cur")); @@ -389,23 +386,23 @@ public void setupConditions() talkedToSkavid4 = new Conditions(true, LogicType.OR, new ChatMessageRequirement(inSkavidRoom4, "It seems the skavid understood you.", "You have already talked to this skavid."), new WidgetTextRequirement(InterfaceID.Questjournal.TEXTLAYER, true, "'Gor nod'")); - seenShamans = new VarbitRequirement(3125, 1); + seenShamans = new VarbitRequirement(VarbitID.WATCHTOWER_NIGHTSHADE_USED, 1); - killedOgre1 = new VarbitRequirement(3131, 1); - killedOgre2 = new VarbitRequirement(3132, 1); - killedOgre3 = new VarbitRequirement(3133, 1); - killedOgre4 = new VarbitRequirement(3134, 1); - killedOgre5 = new VarbitRequirement(3135, 1); - killedOgre6 = new VarbitRequirement(3136, 1); + killedOgre1 = new VarbitRequirement(VarbitID.WATCHTOWER_SHAMAN_1, 1); + killedOgre2 = new VarbitRequirement(VarbitID.WATCHTOWER_SHAMAN_2, 1); + killedOgre3 = new VarbitRequirement(VarbitID.WATCHTOWER_SHAMAN_3, 1); + killedOgre4 = new VarbitRequirement(VarbitID.WATCHTOWER_SHAMAN_4, 1); + killedOgre5 = new VarbitRequirement(VarbitID.WATCHTOWER_SHAMAN_5, 1); + killedOgre6 = new VarbitRequirement(VarbitID.WATCHTOWER_SHAMAN_6, 1); killedAllOgres = new Conditions(killedOgre1, killedOgre2, killedOgre3, killedOgre4, killedOgre5, killedOgre6); - gotCrystal4 = new VarbitRequirement(3124, 1); + gotCrystal4 = new VarbitRequirement(VarbitID.WATCHTOWER_ROCK_MINED, 1); - placedCrystal1 = new VarbitRequirement(3128, 1); - placedCrystal2 = new VarbitRequirement(3129, 1); - placedCrystal3 = new VarbitRequirement(3127, 1); - placedCrystal4 = new VarbitRequirement(3130, 1); + placedCrystal1 = new VarbitRequirement(VarbitID.WATCHTOWER_PILLAR_2, 1); + placedCrystal2 = new VarbitRequirement(VarbitID.WATCHTOWER_PILLAR_3, 1); + placedCrystal3 = new VarbitRequirement(VarbitID.WATCHTOWER_PILLAR_1, 1); + placedCrystal4 = new VarbitRequirement(VarbitID.WATCHTOWER_PILLAR_4, 1); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/waterfallquest/WaterfallQuest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/waterfallquest/WaterfallQuest.java index a61dffd8cab..53a9e9909ea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/waterfallquest/WaterfallQuest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/waterfallquest/WaterfallQuest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, Zoinkwiz + * Copyright (c) 2025, pajlada * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,8 +28,6 @@ import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; -import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; @@ -42,105 +41,127 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; + public class WaterfallQuest extends BasicQuestHelper { - //Items Required - ItemRequirement rope, highlightRope, glarialsPebble, glarialsUrn, glarialsAmulet, unequippedAmulet, book, key, baxKey, airRunes, waterRunes, earthRunes, airRune, waterRune, - earthRune; - - //Items Recommended - ItemRequirement gamesNecklace, food; - - Requirement inGnomeBasement, inGlarialTomb, inFalls, onHudonIsland, onDeadTreeIsland, onLedge, inUpstairsInHouse, - inGolrieRoom, gotPebble, inEndRoom, inEnd2; - - QuestStep talkToAlmera, boardRaft, talkToHudon, useRopeOnRock, useRopeOnTree, getInBarrel, goUpstairsHadley, searchBookcase, - readBook, enterGnomeDungeon, searchGnomeCrate, enterGnomeDoor, talkToGolrie, usePebble, searchGlarialCoffin, - getFinalItems, boardRaftFinal, useRopeOnRockFinal, useRopeOnTreeFinal, enterFalls, searchFallsCrate, useKeyOnFallsDoor, - useRunes, useAmuletOnStatue, useUrnOnChalice; - + // Required items + ItemRequirement rope; + ItemRequirement airRunes; + ItemRequirement waterRunes; + ItemRequirement earthRunes; + + // Recommended items + ItemRequirement gamesNecklace; + ItemRequirement food; + + // Mid-quest requirements + ItemRequirement highlightRope; + ItemRequirement glarialsPebble; + ItemRequirement glarialsPebbleWithBank; + ItemRequirement glarialsUrn; + ItemRequirement glarialsAmulet; + ItemRequirement unequippedAmulet; + ItemRequirement book; + ItemRequirement key; + ItemRequirement baxKey; + ItemRequirement airRune; + ItemRequirement waterRune; + ItemRequirement earthRune; + + // Zones + Zone gnomeBasement; + Zone glarialTomb; + Zone falls; + Zone endRoom; + Zone end2; + Zone hudonIsland; + Zone deadTreeIsland; + Zone ledge; + Zone upstairsInHouse; + Zone golrieRoom; + + // Miscellaneous requirements + ZoneRequirement inGnomeBasement; + ZoneRequirement inGlarialTomb; + ZoneRequirement inFalls; + ZoneRequirement onHudonIsland; + ZoneRequirement onDeadTreeIsland; + ZoneRequirement onLedge; + ZoneRequirement inUpstairsInHouse; + ZoneRequirement inGolrieRoom; + VarbitRequirement gotPebble; + ZoneRequirement inEndRoom; + ZoneRequirement inEnd2; + + // Steps + NpcStep talkToAlmera; + + ObjectStep boardRaft; + NpcStep talkToHudon; + + ObjectStep useRopeOnRock; + ObjectStep useRopeOnTree; + ObjectStep getInBarrel; + ObjectStep goUpstairsHadley; + ObjectStep searchBookcase; + DetailedQuestStep readBook; + + ConditionalStep goGetPebble; + ObjectStep leaveHouse; + ObjectStep enterGnomeDungeon; + ObjectStep searchGnomeCrate; + ObjectStep enterGnomeDoor; + NpcStep talkToGolrie; + + ConditionalStep getGlarialStuff; + ObjectStep usePebble; + ObjectStep searchGlarialCoffin; ObjectStep searchGlarialChest; - ConditionalStep goGetPebble, getGlarialStuff; - - //Zones - Zone gnomeBasement, glarialTomb, falls, endRoom, end2, hudonIsland, deadTreeIsland, ledge, upstairsInHouse, golrieRoom; + DetailedQuestStep getFinalItems; + ObjectStep boardRaftFinal; + ObjectStep useRopeOnRockFinal; + ObjectStep useRopeOnTreeFinal; + DetailedQuestStep equipAmulet; + ObjectStep enterFalls; + ObjectStep searchFallsCrate; + ObjectStep useKeyOnFallsDoor; + DetailedQuestStep useRunes; + ObjectStep useAmuletOnStatue; + ObjectStep useUrnOnChalice; @Override - public Map loadSteps() + protected void setupZones() { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); - - steps.put(0, talkToAlmera); - - ConditionalStep goTalkToHudon = new ConditionalStep(this, boardRaft); - goTalkToHudon.addStep(onHudonIsland, talkToHudon); - - steps.put(1, goTalkToHudon); - - ConditionalStep goReadBook = new ConditionalStep(this, goUpstairsHadley); - goReadBook.addStep(book, readBook); - goReadBook.addStep(inUpstairsInHouse, searchBookcase); - goReadBook.addStep(onLedge, getInBarrel); - goReadBook.addStep(onDeadTreeIsland, useRopeOnTree); - goReadBook.addStep(onHudonIsland, useRopeOnRock); - - steps.put(2, goReadBook); - - // TODO: Add lines to guide through maze - goGetPebble = new ConditionalStep(this, enterGnomeDungeon); - goGetPebble.addStep(inGolrieRoom, talkToGolrie); - goGetPebble.addStep(new Conditions(inGnomeBasement, key), enterGnomeDoor); - goGetPebble.addStep(inGnomeBasement, searchGnomeCrate); - goGetPebble.setLockingCondition(gotPebble); - - getGlarialStuff = new ConditionalStep(this, usePebble); - getGlarialStuff.addStep(new Conditions(glarialsAmulet.alsoCheckBank(questBank), inGlarialTomb), searchGlarialCoffin); - getGlarialStuff.addStep(inGlarialTomb, searchGlarialChest); - getGlarialStuff.setLockingCondition(new Conditions(new Conditions(glarialsAmulet.alsoCheckBank(questBank), glarialsUrn.alsoCheckBank(questBank)))); - - ConditionalStep puttingToRest = new ConditionalStep(this, getFinalItems); - puttingToRest.addStep(inEnd2, useUrnOnChalice); - puttingToRest.addStep(inEndRoom, useRunes); - puttingToRest.addStep(new Conditions(inFalls, baxKey), useKeyOnFallsDoor); - puttingToRest.addStep(inFalls, searchFallsCrate); - puttingToRest.addStep(onLedge, enterFalls); - puttingToRest.addStep(onDeadTreeIsland, useRopeOnTreeFinal); - puttingToRest.addStep(onHudonIsland, useRopeOnRockFinal); - puttingToRest.addStep(new Conditions(glarialsUrn, glarialsAmulet, airRunes, earthRunes, waterRunes, rope), boardRaftFinal); - - ConditionalStep finishingSteps = new ConditionalStep(this, goGetPebble); - finishingSteps.addStep(new Conditions(glarialsUrn.alsoCheckBank(questBank), glarialsAmulet.alsoCheckBank(questBank)), puttingToRest); - finishingSteps.addStep(gotPebble, getGlarialStuff); - - steps.put(3, finishingSteps); - steps.put(4, finishingSteps); - steps.put(5, puttingToRest); - steps.put(6, puttingToRest); - steps.put(7, puttingToRest); // 7 didn't occur during testing - steps.put(8, puttingToRest); - - return steps; + gnomeBasement = new Zone(new WorldPoint(2497, 9552, 0), new WorldPoint(2559, 9593, 0)); + glarialTomb = new Zone(new WorldPoint(2524, 9801, 0), new WorldPoint(2557, 9849, 0)); + golrieRoom = new Zone(new WorldPoint(2502, 9576, 0), new WorldPoint(2523, 9593, 0)); + hudonIsland = new Zone(new WorldPoint(2510, 3476, 0), new WorldPoint(2515, 3482, 0)); + deadTreeIsland = new Zone(new WorldPoint(2512, 3465, 0), new WorldPoint(2513, 3475, 0)); + ledge = new Zone(new WorldPoint(2510, 3462, 0), new WorldPoint(2513, 3464, 0)); + upstairsInHouse = new Zone(new WorldPoint(2516, 3424, 1), new WorldPoint(2520, 3431, 1)); + falls = new Zone(new WorldPoint(2556, 9861, 0), new WorldPoint(2595, 9920, 0)); + endRoom = new Zone(new WorldPoint(2561, 9902, 0), new WorldPoint(2570, 9917, 0)); + end2 = new Zone(new WorldPoint(2599, 9890, 0), new WorldPoint(2608, 9916, 0)); } @Override protected void setupRequirements() { - highlightRope = new ItemRequirement("Rope", ItemID.ROPE).isNotConsumed(); - highlightRope.setHighlightInInventory(true); rope = new ItemRequirement("Rope", ItemID.ROPE).isNotConsumed(); + highlightRope = rope.highlighted(); book = new ItemRequirement("Book on baxtorian", ItemID.BAXTORIAN_BOOK_WATERFALL_QUEST); book.setHighlightInInventory(true); glarialsPebble = new ItemRequirement("Glarial's pebble", ItemID.GLARIALS_PEBBLE_WATERFALL_QUEST); glarialsPebble.setHighlightInInventory(true); glarialsPebble.setTooltip("You can get another from Golrie under the Tree Gnome Village"); + glarialsPebbleWithBank = glarialsPebble.alsoCheckBank(); glarialsUrn = new ItemRequirement("Glarial's urn", ItemID.GLARIALS_URN_FULL_WATERFALL_QUEST); glarialsUrn.setTooltip("You can get another from the chest in Glarial's tomb"); glarialsAmulet = new ItemRequirement("Glarial's amulet", ItemID.GLARIALS_AMULET_WATERFALL_QUEST, 1, true); @@ -158,25 +179,7 @@ protected void setupRequirements() gamesNecklace = new ItemRequirement("Games necklace", ItemCollections.GAMES_NECKLACES); food = new ItemRequirement("Food", ItemCollections.GOOD_EATING_FOOD, -1); - } - @Override - protected void setupZones() - { - gnomeBasement = new Zone(new WorldPoint(2497, 9552, 0), new WorldPoint(2559, 9593, 0)); - glarialTomb = new Zone(new WorldPoint(2524, 9801, 0), new WorldPoint(2557, 9849, 0)); - golrieRoom = new Zone(new WorldPoint(2502, 9576, 0), new WorldPoint(2523, 9593, 0)); - hudonIsland = new Zone(new WorldPoint(2510, 3476, 0), new WorldPoint(2515, 3482, 0)); - deadTreeIsland = new Zone(new WorldPoint(2512, 3465, 0), new WorldPoint(2513, 3475, 0)); - ledge = new Zone(new WorldPoint(2510, 3462, 0), new WorldPoint(2513, 3464, 0)); - upstairsInHouse = new Zone(new WorldPoint(2516, 3424, 1), new WorldPoint(2520, 3431, 1)); - falls = new Zone(new WorldPoint(2556, 9861, 0), new WorldPoint(2595, 9920, 0)); - endRoom = new Zone(new WorldPoint(2561, 9902, 0), new WorldPoint(2570, 9917, 0)); - end2 = new Zone(new WorldPoint(2599, 9890, 0), new WorldPoint(2608, 9916, 0)); - } - - public void setupConditions() - { onDeadTreeIsland = new ZoneRequirement(deadTreeIsland); onHudonIsland = new ZoneRequirement(hudonIsland); onLedge = new ZoneRequirement(ledge); @@ -187,15 +190,16 @@ public void setupConditions() inFalls = new ZoneRequirement(falls); inEndRoom = new ZoneRequirement(endRoom); inEnd2 = new ZoneRequirement(end2); - gotPebble = new VarbitRequirement(9110, 1); + gotPebble = new VarbitRequirement(VarbitID.WATERFALL_GOLRIE_CHAT, 1); } public void setupSteps() { - talkToAlmera = new NpcStep(this, NpcID.ALMERA_WATERFALL_QUEST, new WorldPoint(2521, 3495, 0), "Talk to Almera on top of Baxtorian Falls."); - talkToAlmera.addDialogStep("How can I help?"); - boardRaft = new ObjectStep(this, ObjectID.LOGRAFT_WATERFALL_QUEST, new WorldPoint(2509, 3494, 0), "Board the log raft west of Almera."); - talkToHudon = new NpcStep(this, NpcID.HUDON_WATERFALL_QUEST, new WorldPoint(2511, 3484, 0), "Talk to Hudon."); + talkToAlmera = new NpcStep(this, NpcID.ALMERA_WATERFALL_QUEST, new WorldPoint(2521, 3495, 0), "Talk to Almera on top of Baxtorian Falls, south of Barbarian Outpost."); + talkToAlmera.addDialogStep("Yes."); + + boardRaft = new ObjectStep(this, ObjectID.LOGRAFT_WATERFALL_QUEST, new WorldPoint(2509, 3494, 0), "Board the log raft west of Almera.", rope); + talkToHudon = new NpcStep(this, NpcID.HUDON_WATERFALL_QUEST, new WorldPoint(2511, 3484, 0), "Talk to Hudon.", rope); useRopeOnRock = new ObjectStep(this, ObjectID.CROSSING_ROCK_WATERFALL_QUEST, new WorldPoint(2512, 3468, 0), "Use a rope on the rock to" + " the south.", highlightRope); useRopeOnRock.addIcon(ItemID.ROPE); @@ -207,9 +211,9 @@ public void setupSteps() searchBookcase = new ObjectStep(this, ObjectID.BOOKCASE_WATERFALL_QUEST, new WorldPoint(2520, 3427, 1), "Search the south east bookcase."); readBook = new DetailedQuestStep(this, "Read the book.", book); - enterGnomeDungeon = new ObjectStep(this, ObjectID.ROVING_GOLRIE_LADDER_TO_CELLAR, new WorldPoint(2533, 3155, 0), + enterGnomeDungeon = new ObjectStep(this, ObjectID.ROVING_GOLRIE_LADDER_TO_CELLAR, new WorldPoint(2533, 3155, 0), "Go to the centre of the Tree Gnome Village and go down the ladder at the entrance."); - ((ObjectStep) enterGnomeDungeon).setLinePoints(Arrays.asList( + enterGnomeDungeon.setLinePoints(Arrays.asList( new WorldPoint(2505, 3190, 0), new WorldPoint(2512, 3190, 0), new WorldPoint(2512, 3188, 0), @@ -248,16 +252,18 @@ public void setupSteps() new WorldPoint(2545, 3150, 0), new WorldPoint(2545, 3155, 0), new WorldPoint(2533, 3155, 0) - )); + )); + leaveHouse = new ObjectStep(this, ObjectID.SPIRALSTAIRSTOP, new WorldPoint(2518, 3430, 1), "Go to the centre of the Tree Gnome Village and go down the ladder at the entrance."); + enterGnomeDungeon.addSubSteps(leaveHouse); searchGnomeCrate = new ObjectStep(this, ObjectID.GOLRIE_CRATE_WATERFALL_QUEST, new WorldPoint(2548, 9565, 0), "Search the off-coloured crate in the east room."); enterGnomeDoor = new ObjectStep(this, ObjectID.GOLRIE_GATE_WATERFALL_QUEST, new WorldPoint(2515, 9575, 0), "Go through the gate in the west room.", key); talkToGolrie = new NpcStep(this, NpcID.GOLRIE_WATERFALL_QUEST, new WorldPoint(2514, 9580, 0), "Talk to Golrie."); - usePebble = new ObjectStep(this, ObjectID.GLARIALS_TOMBSTONE_WATERFALL_QUEST, new WorldPoint(2559, 3445, 0), "Bank everything besides the pebble and some food. After, go use Glarial's pebble to Glarial's Tombstone east of Baxtorian Falls.", glarialsPebble); + usePebble = new ObjectStep(this, ObjectID.GLARIALS_TOMBSTONE_WATERFALL_QUEST, new WorldPoint(2559, 3445, 0), "Bank everything besides the pebble and some food. Then use Glarial's pebble on Glarial's Tombstone east of Baxtorian Falls.", glarialsPebble); usePebble.addIcon(ItemID.GLARIALS_PEBBLE_WATERFALL_QUEST); - searchGlarialChest = new ObjectStep(this, ObjectID.GLARIALS_CHEST_CLOSED_WATERFALL_QUEST, new WorldPoint(2530, 9844, 0), "Search the chest in the western room."); + searchGlarialChest = new ObjectStep(this, ObjectID.GLARIALS_CHEST_CLOSED_WATERFALL_QUEST, new WorldPoint(2530, 9844, 0), "Search the chest in the western room for Glarial's amulet."); searchGlarialChest.addAlternateObjects(ObjectID.GLARIALS_CHEST_OPEN_WATERFALL_QUEST); - searchGlarialCoffin = new ObjectStep(this, ObjectID.GLARIALS_TOMB_WATERFALL_QUEST, new WorldPoint(2542, 9812, 0), "Search Glarial's Tomb in the south room."); + searchGlarialCoffin = new ObjectStep(this, ObjectID.GLARIALS_TOMB_WATERFALL_QUEST, new WorldPoint(2542, 9812, 0), "Search Glarial's Tomb in the south room for Glarial's urn."); getFinalItems = new DetailedQuestStep(this, "Leave Glarial's Tomb and get 6 air, water, and earth runes, a rope, glarial's amulet, glarial's urn, and some food.", airRunes, earthRunes, waterRunes, glarialsAmulet, glarialsUrn, rope); boardRaftFinal = new ObjectStep(this, ObjectID.LOGRAFT_WATERFALL_QUEST, new WorldPoint(2509, 3494, 0), "Board the log raft west of Almera."); @@ -266,46 +272,108 @@ public void setupSteps() useRopeOnRockFinal.addIcon(ItemID.ROPE); useRopeOnTreeFinal = new ObjectStep(this, ObjectID.OVERHANGING_TREE1_WATERFALL_QUEST, new WorldPoint(2512, 3465, 0), "Use a rope on the dead tree.", highlightRope); useRopeOnTreeFinal.addIcon(ItemID.ROPE); - enterFalls = new ObjectStep(this, ObjectID.WATERFALL_LEDGE_DOOR, new WorldPoint(2511, 3464, 0), "EQUIP Glarial's amulet, then enter the falls.", glarialsAmulet); + equipAmulet = new DetailedQuestStep(this, "Equip Glarial's amulet.", glarialsAmulet.highlighted()); + enterFalls = new ObjectStep(this, ObjectID.WATERFALL_LEDGE_DOOR, new WorldPoint(2511, 3464, 0), "Enter the falls with Glarial's amulet equipped.", glarialsAmulet); searchFallsCrate = new ObjectStep(this, ObjectID.BAXTORIAN_CRATE_WATERFALL_QUEST, new WorldPoint(2589, 9888, 0), "Search the crate in the east room for a key."); - useKeyOnFallsDoor = new ObjectStep(this, ObjectID.BAXTORIAN_DOOR_2_WATERFALL_QUEST, new WorldPoint(2566, 9901, 0), "Go through the doors from the west room.", baxKey); + useKeyOnFallsDoor = new ObjectStep(this, ObjectID.BAXTORIAN_DOOR_2_WATERFALL_QUEST, new WorldPoint(2566, 9901, 0), "Enter the west room with the key.", baxKey); useRunes = new DetailedQuestStep(this, "Use 1 earth, water and air rune on each of the 6 pillars in the room. Afterwards, use Glarial's amulet on the statue of Glarial.", airRune, waterRune, earthRune); useAmuletOnStatue = new ObjectStep(this, ObjectID.STATUE_QUEEN_WATERFALL_QUEST, new WorldPoint(2603, 9915, 0), "Use Glarial's amulet on the Statue of Glarial", unequippedAmulet); useAmuletOnStatue.addIcon(ItemID.GLARIALS_AMULET_WATERFALL_QUEST); - useUrnOnChalice = new ObjectStep(this, ObjectID.BAXTORIAN_CHALICE_WATERFALL_QUEST, new WorldPoint(2604, 9911, 0), "DO NOT LEFT-CLICK THE CHALICE! Use Glarial's urn on the Chalice to finish the quest.", glarialsUrn); + useUrnOnChalice = new ObjectStep(this, ObjectID.BAXTORIAN_CHALICE_WATERFALL_QUEST, new WorldPoint(2604, 9911, 0), "DO NOT LEFT-CLICK THE CHALICE! Use Glarial's urn on the Chalice to finish the quest.", glarialsUrn.highlighted()); useUrnOnChalice.addIcon(ItemID.GLARIALS_URN_FULL_WATERFALL_QUEST); } @Override - public List getItemRequirements() + public Map loadSteps() { - ArrayList reqs = new ArrayList<>(); - reqs.add(highlightRope); - reqs.add(airRunes); - reqs.add(earthRunes); - reqs.add(waterRunes); - return reqs; + initializeRequirements(); + setupSteps(); + + Map steps = new HashMap<>(); + + steps.put(0, talkToAlmera); + + var goTalkToHudon = new ConditionalStep(this, boardRaft); + goTalkToHudon.addStep(onHudonIsland, talkToHudon); + + steps.put(1, goTalkToHudon); + + var goReadBook = new ConditionalStep(this, goUpstairsHadley); + goReadBook.addStep(book, readBook); + goReadBook.addStep(inUpstairsInHouse, searchBookcase); + goReadBook.addStep(onLedge, getInBarrel); + goReadBook.addStep(onDeadTreeIsland, useRopeOnTree); + goReadBook.addStep(onHudonIsland, useRopeOnRock); + + steps.put(2, goReadBook); + + goGetPebble = new ConditionalStep(this, enterGnomeDungeon); + goGetPebble.addStep(inGolrieRoom, talkToGolrie); + goGetPebble.addStep(and(inGnomeBasement, key), enterGnomeDoor); + goGetPebble.addStep(inGnomeBasement, searchGnomeCrate); + goGetPebble.addStep(inUpstairsInHouse, leaveHouse); + goGetPebble.setLockingCondition(glarialsPebbleWithBank); + + getGlarialStuff = new ConditionalStep(this, usePebble); + getGlarialStuff.addStep(and(unequippedAmulet.alsoCheckBank(), inGlarialTomb), searchGlarialCoffin); + getGlarialStuff.addStep(inGlarialTomb, searchGlarialChest); + getGlarialStuff.setLockingCondition(and(unequippedAmulet.alsoCheckBank(), glarialsUrn.alsoCheckBank())); + + var puttingToRest = new ConditionalStep(this, getFinalItems); + puttingToRest.addStep(inEnd2, useUrnOnChalice); + puttingToRest.addStep(inEndRoom, useRunes); + puttingToRest.addStep(and(inFalls, baxKey), useKeyOnFallsDoor); + puttingToRest.addStep(inFalls, searchFallsCrate); + puttingToRest.addStep(and(onLedge, glarialsAmulet), enterFalls); + puttingToRest.addStep(onLedge, equipAmulet); + puttingToRest.addStep(onDeadTreeIsland, useRopeOnTreeFinal); + puttingToRest.addStep(onHudonIsland, useRopeOnRockFinal); + puttingToRest.addStep(and(glarialsUrn, glarialsAmulet, airRunes, earthRunes, waterRunes, rope), boardRaftFinal); + + var finishingSteps = new ConditionalStep(this, goGetPebble); + finishingSteps.addStep(and(glarialsUrn.alsoCheckBank(), glarialsAmulet.alsoCheckBank()), puttingToRest); + finishingSteps.addStep(gotPebble, getGlarialStuff); + + steps.put(3, finishingSteps); + steps.put(4, finishingSteps); + steps.put(5, puttingToRest); + steps.put(6, puttingToRest); + steps.put(7, puttingToRest); // 7 didn't occur during testing + steps.put(8, puttingToRest); + + return steps; } @Override - public List getCombatRequirements() + public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add("Able to survive enemies up to level 86 attacking you"); - return reqs; + return List.of( + highlightRope, + airRunes, + earthRunes, + waterRunes + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(gamesNecklace); - reqs.add(food); - return reqs; + return List.of( + gamesNecklace, + food + ); + } + + @Override + public List getCombatRequirements() + { + return List.of( + "Able to survive enemies up to level 86 attacking you" + ); } @Override @@ -317,38 +385,83 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Arrays.asList( - new ExperienceReward(Skill.STRENGTH, 13750), - new ExperienceReward(Skill.ATTACK, 13750)); + return List.of( + new ExperienceReward(Skill.STRENGTH, 13750), + new ExperienceReward(Skill.ATTACK, 13750) + ); } @Override public List getItemRewards() { - return Arrays.asList( - new ItemReward("Diamonds", ItemID.DIAMOND, 2), - new ItemReward("Gold Bars", ItemID.GOLD_BAR, 2), - new ItemReward("Mithril Seeds", ItemID.MITHRIL_SEED, 40)); + return List.of( + new ItemReward("Diamonds", ItemID.DIAMOND, 2), + new ItemReward("Gold Bars", ItemID.GOLD_BAR, 2), + new ItemReward("Mithril Seeds", ItemID.MITHRIL_SEED, 40) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Starting off", Collections.singletonList(talkToAlmera))); - allSteps.add(new PanelDetails("Investigate", Arrays.asList(boardRaft, talkToHudon, useRopeOnRock, useRopeOnTree, getInBarrel, goUpstairsHadley, searchBookcase, readBook), rope)); - - PanelDetails getPebblePanel = new PanelDetails("Get Glarial's Pebble", Arrays.asList(enterGnomeDungeon, searchGnomeCrate, enterGnomeDoor, talkToGolrie)); + var sections = new ArrayList(); + + sections.add(new PanelDetails("Starting off", List.of( + talkToAlmera + ), List.of( + rope + ))); + + sections.add(new PanelDetails("Investigate", List.of( + boardRaft, + talkToHudon, + useRopeOnRock, + useRopeOnTree, + getInBarrel, + goUpstairsHadley, + searchBookcase, + readBook + ), List.of( + rope + ))); + + var getPebblePanel = new PanelDetails("Get Glarial's Pebble", List.of( + enterGnomeDungeon, + searchGnomeCrate, + enterGnomeDoor, + talkToGolrie + )); getPebblePanel.setLockingStep(goGetPebble); - allSteps.add(getPebblePanel); + sections.add(getPebblePanel); - PanelDetails getGlarialStuffPanel = new PanelDetails("Loot Glarial's tomb", Arrays.asList(usePebble, searchGlarialChest, searchGlarialCoffin)); + var getGlarialStuffPanel = new PanelDetails("Loot Glarial's tomb", List.of( + usePebble, + searchGlarialChest, + searchGlarialCoffin + )); getGlarialStuffPanel.setLockingStep(getGlarialStuff); - - allSteps.add(getGlarialStuffPanel); - - PanelDetails finishOffPanel = new PanelDetails("Put Glarial to rest", Arrays.asList(getFinalItems, boardRaftFinal, useRopeOnRockFinal, useRopeOnTreeFinal, enterFalls, searchFallsCrate, useKeyOnFallsDoor, useRunes, useUrnOnChalice), rope, airRunes, earthRunes, waterRunes, glarialsUrn, glarialsAmulet); - allSteps.add(finishOffPanel); - return allSteps; + sections.add(getGlarialStuffPanel); + + sections.add(new PanelDetails("Put Glarial to rest", List.of( + getFinalItems, + boardRaftFinal, + useRopeOnRockFinal, + useRopeOnTreeFinal, + equipAmulet, + enterFalls, + searchFallsCrate, + useKeyOnFallsDoor, + useRunes, + useUrnOnChalice + ), List.of( + rope, + airRunes, + earthRunes, + waterRunes, + glarialsUrn, + glarialsAmulet + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whatliesbelow/WhatLiesBelow.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whatliesbelow/WhatLiesBelow.java index 52c92d232b1..cd5151d3ea1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whatliesbelow/WhatLiesBelow.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whatliesbelow/WhatLiesBelow.java @@ -46,6 +46,7 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; import java.util.*; @@ -168,7 +169,7 @@ protected void setupZones() public void setupConditions() { inChaosAltar = new ZoneRequirement(chaosAltar); - inBattle = new VarbitRequirement(6719, 2); + inBattle = new VarbitRequirement(VarbitID.MINIMAP_STATE, 2); } public void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whileguthixsleeps/WhileGuthixSleeps.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whileguthixsleeps/WhileGuthixSleeps.java index 9ff15070da0..777c1b452d6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whileguthixsleeps/WhileGuthixSleeps.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/whileguthixsleeps/WhileGuthixSleeps.java @@ -40,7 +40,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestPointRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.quest.QuestRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.util.ItemSlots; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Spellbook; @@ -85,16 +84,15 @@ public class WhileGuthixSleeps extends BasicQuestHelper roseTintedLens, enrichedSnapdragonSeed, enrichedSnapdragon, truthSerum, superTruthSerum, sketch, eliteHelm, eliteBody, eliteLegs, eliteBlackKnightOrSquallOutfit, cellKey, silifTeleorb, strangeTeleorb, darkSquallHood, darkSquallBody, darkSquallLegs, fireOrb, waterOrb, airOrb, earthOrb, airBlock, waterBlock, earthBlock, fireBlock; - ItemRequirement toadflax, toadsLegs, guamLeaf, eyeOfNewt, iritLeaf, harralander, redSpidersEggs, garlic, silverDust, goatHorn, ranarrWeed, whiteBerries, cadantine, avantoe, moryMyreFungus, - chocolateDust, snapeGrass, kebbitTeethdust, lantadyme, potatoCactus, dwarfWeed, wineOfZamorak, snapdragon, tarromin, limpwurt, kwuarm, emptyDruidPouch, fullDruidPouch, silverSickleB; + ItemRequirement emptyDruidPouch; + ItemRequirement fullDruidPouch; + ItemRequirement silverSickleB; FreeInventorySlotRequirement emptySlots9, emptySlots16; Requirement doorNeedsEarthRune, doorNeedsMindRune, doorNeedsAirRune, doorNeedsFireRune, doorNeedsWaterRune, isElectricBookcase1, isElectricBookcase2, isElectricBookcase3, isElectricBookcase4, isElectricBookcase5, isElectricBookcase6, isElectricBookcase7; - Requirement hadToadflax, hadToadsLegs, hadGuamLeaf, hadEyeOfNewt, hadIritLeaf, hadHarralander, hadRedSpidersEggs, hadGarlic, hadSilverDust, hadGoatHorn, hadRanarrWeed, hadWhiteBerries, hadCadantine, hadAvantoeForHunterPotion, hadMortMyreFungus, - hadChocolateDust, hadSnapeGrass, hadKebbitTeethdustForHunterPotion, hadLantadyme, hadPotatoCactus, hadDwarfWeed, hadWineOfZamorak, hadSnapdragon, hadTarromin, hadLimpwurt, hadKwuarm, hadEmptyDruidPouch, hadFullDruidPouch, hadSilverSickleB; Requirement isUpstairsNearThaerisk, assassinsNearby, paidLaunderer, talkedToLaunderer, trapSetUp, trapBaited, broavTrapped, broavNearby, isNearTable, claimedRunes, hasBroav, inMovarioFirstRoom, inMovarioDoorRoom, inLibrary, isNextToSpiralStaircase, disarmedStaircase, inMovarioBaseF1, inMovarioBaseF2, hadRubyKey, searchedBedForTraps, pulledPaintingLever, inWeightRoom, teleportedToDraynor, inPortSarim, inDoorway, purchasedSnapdragon, teleportedToPortSarim, talkedToThaeriskWithSeed, @@ -183,16 +181,16 @@ public Map loadSteps() steps.put(4, goGetBroav); ConditionalStep goTrapBroav = new ConditionalStep(this, setupTrap); - goTrapBroav.addStep(unconsciousBroav.alsoCheckBank(questBank), returnBroavToHuntingExpert); + goTrapBroav.addStep(unconsciousBroav.alsoCheckBank(), returnBroavToHuntingExpert); goTrapBroav.addStep(broavTrapped, retrieveBroav); goTrapBroav.addStep(trapBaited, waitForBroavToGetTrapped); goTrapBroav.addStep(trapSetUp, useFungusOnTrap); steps.put(5, goTrapBroav); ConditionalStep goTrackMovario = new ConditionalStep(this, goTrapBroav); - goTrackMovario.addStep(and(broavNearby, dirtyShirt.alsoCheckBank(questBank), isNearTable), useDirtyShirtOnBroav); - goTrackMovario.addStep(and(hasBroav, dirtyShirt.alsoCheckBank(questBank), isNearTable), dropBroav); - goTrackMovario.addStep(and(hasBroav, dirtyShirt.alsoCheckBank(questBank)), goToBrokenTable); + goTrackMovario.addStep(and(broavNearby, dirtyShirt.alsoCheckBank(), isNearTable), useDirtyShirtOnBroav); + goTrackMovario.addStep(and(hasBroav, dirtyShirt.alsoCheckBank(), isNearTable), dropBroav); + goTrackMovario.addStep(and(hasBroav, dirtyShirt.alsoCheckBank()), goToBrokenTable); goTrackMovario.addStep(hasBroav, talkToLaunderer); steps.put(6, goTrackMovario); steps.put(7, goTrackMovario); @@ -247,28 +245,28 @@ public Map loadSteps() ConditionalStep goUpToF2Movario = new ConditionalStep(this, goUpToF1Movario); goUpToF2Movario.addStep(and(inMovarioBaseF1, hadRubyKey), climbUpHiddenStaircase); goUpToF2Movario.addStep(and(inMovarioBaseF1, wastePaperBasket), searchWasteBasket); - goUpToF2Movario.addStep(LogicHelper.and(inMovarioBaseF1), pickupWasteBasket); + goUpToF2Movario.addStep(and(inMovarioBaseF1), pickupWasteBasket); ConditionalStep goSearchBed = new ConditionalStep(this, goUpToF2Movario); goSearchBed.addStep(and(inMovarioBaseF2, hadRubyKey), searchBed); - goSearchBed.addStep(LogicHelper.and(inMovarioBaseF2), goDownToF1MovarioBase); + goSearchBed.addStep(and(inMovarioBaseF2), goDownToF1MovarioBase); steps.put(16, goSearchBed); steps.put(17, goSearchBed); ConditionalStep goUseKeyOnBedChest = new ConditionalStep(this, goUpToF2Movario); goUseKeyOnBedChest.addStep(and(inMovarioBaseF2, hadRubyKey), useKeyOnChest); - goUseKeyOnBedChest.addStep(LogicHelper.and(inMovarioBaseF2), goDownToF1MovarioBase); + goUseKeyOnBedChest.addStep(and(inMovarioBaseF2), goDownToF1MovarioBase); steps.put(18, goUseKeyOnBedChest); ConditionalStep goSearchChestForTraps = new ConditionalStep(this, goUpToF2Movario); goSearchChestForTraps.addStep(and(inMovarioBaseF2, searchedBedForTraps), getNotesFromChest); - goSearchChestForTraps.addStep(LogicHelper.and(inMovarioBaseF2), searchChestForTraps); - goSearchChestForTraps.addStep(LogicHelper.and(inMovarioBaseF2), goDownToF1MovarioBase); + goSearchChestForTraps.addStep(and(inMovarioBaseF2), searchChestForTraps); + goSearchChestForTraps.addStep(and(inMovarioBaseF2), goDownToF1MovarioBase); steps.put(19, goSearchChestForTraps); ConditionalStep goSearchChestForNotes2 = new ConditionalStep(this, goUpToF2Movario); - goSearchChestForNotes2.addStep(LogicHelper.and(inMovarioBaseF2), getNotesFromChest); + goSearchChestForNotes2.addStep(and(inMovarioBaseF2), getNotesFromChest); steps.put(20, goSearchChestForNotes2); ConditionalStep goToPainting = new ConditionalStep(this, goUpFromLibrary); @@ -277,8 +275,8 @@ public Map loadSteps() goToPainting.addStep(and(inMovarioBaseF2, movariosNotesV2InBank), goDownFromHiddenRoom); goToPainting.addStep(and(inMovarioBaseF1, movariosNotesV1InBank, movariosNotesV2InBank), inspectPainting); goToPainting.addStep(and(inMovarioBaseF1, movariosNotesV2InBank), searchDesk); - goToPainting.addStep(LogicHelper.and(inMovarioBaseF2), getNotesFromChest); - goToPainting.addStep(LogicHelper.and(inMovarioBaseF1), climbUpHiddenStaircase); + goToPainting.addStep(and(inMovarioBaseF2), getNotesFromChest); + goToPainting.addStep(and(inMovarioBaseF1), climbUpHiddenStaircase); goToPainting.addStep(and(movariosNotesV1InBank, movariosNotesV2InBank), goUpToThaeriskWithNotes); steps.put(21, goToPainting); @@ -435,15 +433,15 @@ public Map loadSteps() steps.put(620, goEnterCellWithRobesOn); ConditionalStep goWitnessTrueTerror = new ConditionalStep(this, enterBlackKnightFortress); - goWitnessTrueTerror.addStep(LogicHelper.and(onChaosTempleF1), jumpToLedge); - goWitnessTrueTerror.addStep(LogicHelper.and(inLucienCamp), climbIceWall); + goWitnessTrueTerror.addStep(and(onChaosTempleF1), jumpToLedge); + goWitnessTrueTerror.addStep(and(inLucienCamp), climbIceWall); goWitnessTrueTerror.addStep(and(inTeleportSpot, strangeTeleorb, deathRune, lawRune), activateStrangeTeleorb); goWitnessTrueTerror.addStep(and(inSquallFightRoom, strangeTeleorb, deathRune, lawRune), standAtTeleportSpot); goWitnessTrueTerror.addStep(and(inSquallFightRoom, strangeTeleorb, not(notSearchedTableForRunes)), getRunes); - goWitnessTrueTerror.addStep(LogicHelper.and(inSquallFightRoom), goDownForOrbAndRunes); + goWitnessTrueTerror.addStep(and(inSquallFightRoom), goDownForOrbAndRunes); goWitnessTrueTerror.addStep(and(inCatacombHQ, isSafeInCatacombs, notSearchedTableForTeleorb), takeStrangeTeleorb); goWitnessTrueTerror.addStep(and(inCatacombHQ, isSafeInCatacombs, notSearchedTableForRunes), takeRunes); - goWitnessTrueTerror.addStep(LogicHelper.and(inCatacombHQ), goUpToUseTeleorb); + goWitnessTrueTerror.addStep(and(inCatacombHQ), goUpToUseTeleorb); goWitnessTrueTerror.addStep(and(inCatacombF2, openedCatacombShortcut), enterNorthernSolidDoor); goWitnessTrueTerror.addStep(and(inCatacombSouth, openedCatacombShortcut), enterCatacombShortcut); goWitnessTrueTerror.addStep(inCatacombF2, useWesternSolidDoor); @@ -496,9 +494,9 @@ public Map loadSteps() goDoSkullPuzzle.addStep(and(inWaterCavity, placedAllOrbs), useWaterBlockOnRecess); goDoSkullPuzzle.addStep(and(inAbyssEntry, placedAllOrbs, not(placedWaterBlock)), enterEastCavity); - goDoSkullPuzzle.addStep(LogicHelper.and(inAirCavity), leaveAirRecess); - goDoSkullPuzzle.addStep(LogicHelper.and(inEarthCavity), leaveEarthRecess); - goDoSkullPuzzle.addStep(LogicHelper.and(inWaterCavity), leaveWaterRecess); + goDoSkullPuzzle.addStep(and(inAirCavity), leaveAirRecess); + goDoSkullPuzzle.addStep(and(inEarthCavity), leaveEarthRecess); + goDoSkullPuzzle.addStep(and(inWaterCavity), leaveWaterRecess); goDoSkullPuzzle.addStep(and(inAbyssEntryF2, usedChiselOnAllBraziers, or(notPlacedAirOrb, notPlacedFireOrb, notPlacedEarthOrb)), climbDownFromSkullF2ToF1); goDoSkullPuzzle.addStep(and(inAbyssEntryF1, usedChiselOnAllBraziers, or(notPlacedAirOrb, notPlacedFireOrb, notPlacedEarthOrb)), climbDownFromSkullF1ToF0); @@ -722,8 +720,8 @@ protected void setupRequirements() broav = new ItemRequirement("Broav", ItemID.WGS_BROAV); movariosNotesV1 = new ItemRequirement("Movario's notes (volume 1)", ItemID.WGS_RESEARCHNOTES_1); movariosNotesV2 = new ItemRequirement("Movario's notes (volume 2)", ItemID.WGS_RESEARCHNOTES_2); - movariosNotesV1InBank = new ItemRequirement("Movario's notes (volume 1)", ItemID.WGS_RESEARCHNOTES_1).alsoCheckBank(questBank); - movariosNotesV2InBank = new ItemRequirement("Movario's notes (volume 2)", ItemID.WGS_RESEARCHNOTES_2).alsoCheckBank(questBank); + movariosNotesV1InBank = new ItemRequirement("Movario's notes (volume 1)", ItemID.WGS_RESEARCHNOTES_1).alsoCheckBank(); + movariosNotesV2InBank = new ItemRequirement("Movario's notes (volume 2)", ItemID.WGS_RESEARCHNOTES_2).alsoCheckBank(); wastePaperBasket = new ItemRequirement("Waste-paper basket", ItemID.WGS_WASTEPAPERBASKET_INV); rubyKey = new ItemRequirement("Ruby key", ItemID.WGS_KEY_RUBY); teleorb = new ItemRequirement("Teleorb", ItemID.WGS_COM_TELE_ORB); @@ -774,64 +772,6 @@ protected void setupRequirements() fireBlock = new ItemRequirement("Fire block", ItemID.WGS_GUTHIX_TEMPLE_ELEMENTAL_KEY_FIRE); fireBlock.setTooltip("You can get another by searching the recess near the middle cavity"); - toadflax = new ItemRequirement("Toadflax", ItemID.TOADFLAX); - toadsLegs = new ItemRequirement("Toad's legs", ItemID.TOADS_LEGS); - guamLeaf = new ItemRequirement("Guam leaf", ItemID.GUAM_LEAF); - eyeOfNewt = new ItemRequirement("Eye of newt", ItemID.EYE_OF_NEWT); - iritLeaf = new ItemRequirement("Irit leaf", ItemID.IRIT_LEAF); - harralander = new ItemRequirement("Harralander", ItemID.HARRALANDER); - redSpidersEggs = new ItemRequirement("Red spider's eggs", ItemID.RED_SPIDERS_EGGS); - garlic = new ItemRequirement("Garlic", ItemID.GARLIC); - silverDust = new ItemRequirement("Silver dust", ItemID.SILVER_DUST); - goatHorn = new ItemRequirement("Goat horn dust", ItemID.GROUND_DESERT_GOAT_HORN); - ranarrWeed = new ItemRequirement("Ranarr weed", ItemID.RANARR_WEED); - whiteBerries = new ItemRequirement("White berries", ItemID.WHITE_BERRIES); - cadantine = new ItemRequirement("Cadantine", ItemID.CADANTINE); - avantoe = new ItemRequirement("Avantoe", ItemID.AVANTOE); - moryMyreFungus = new ItemRequirement("Mory myre fungus", ItemID.MORTMYREMUSHROOM); - chocolateDust = new ItemRequirement("Chocolate dust", ItemID.CHOCOLATE_DUST); - snapeGrass = new ItemRequirement("Snape grass", ItemID.SNAPE_GRASS); - kebbitTeethdust = new ItemRequirement("Kebbit teeth dust", ItemID.HUNTINGBEAST_SABRETEETH_DUST); - lantadyme = new ItemRequirement("Lantadyme", ItemID.LANTADYME); - potatoCactus = new ItemRequirement("Potato cactus", ItemID.CACTUS_POTATO); - dwarfWeed = new ItemRequirement("Dwarf weed", ItemID.DWARF_WEED); - wineOfZamorak = new ItemRequirement("Wine of zamorak", ItemID.WINE_OF_ZAMORAK); - snapdragon = new ItemRequirement("Snapdragon", ItemID.SNAPDRAGON); - tarromin = new ItemRequirement("Tarromin", ItemID.TARROMIN); - limpwurt = new ItemRequirement("Limpwurt root", ItemID.LIMPWURT_ROOT); - kwuarm = new ItemRequirement("Kwuarm", ItemID.KWUARM); - - // None used! - hadToadflax = or(toadflax, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadToadsLegs = or(toadsLegs, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadGuamLeaf = or(guamLeaf, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadEyeOfNewt = or(eyeOfNewt, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadIritLeaf = or(iritLeaf, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadHarralander = or(harralander, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadRedSpidersEggs = or(redSpidersEggs, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadGarlic = or(garlic, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadSilverDust = or(silverDust, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadGoatHorn = or(goatHorn, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadRanarrWeed = or(ranarrWeed, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadWhiteBerries = or(whiteBerries, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadCadantine = or(cadantine, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadAvantoeForHunterPotion = or(avantoe, new VarbitRequirement(10924, 1), new VarbitRequirement(10924, 3)); - hadMortMyreFungus = or(mortMyreFungus, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadChocolateDust = or(chocolateDust, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadSnapeGrass = or(snapeGrass, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadKebbitTeethdustForHunterPotion = or(kebbitTeethdust, new VarbitRequirement(10924, 2), new VarbitRequirement(10924, 3)); - hadLantadyme = or(lantadyme, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadPotatoCactus = or(potatoCactus, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadDwarfWeed = or(dwarfWeed, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadWineOfZamorak = or(wineOfZamorak, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadSnapdragon = or(snapdragon, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadTarromin = or(tarromin, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadLimpwurt = or(limpwurt, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadKwuarm = or(kwuarm, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadEmptyDruidPouch = or(emptyDruidPouch, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadFullDruidPouch = or(fullDruidPouch, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - hadSilverSickleB = or(silverSickleB, new VarbitRequirement(0, 1), new VarbitRequirement(0, 1)); - // Requirements upstairsNearThaeriskZone = new Zone(new WorldPoint(2898, 3448, 1), new WorldPoint(2917, 3452, 1)); isUpstairsNearThaerisk = new ZoneRequirement(upstairsNearThaeriskZone); @@ -842,8 +782,8 @@ protected void setupRequirements() trapSetUp = new VarbitRequirement(VarbitID.WGS_PIT_TRAP_BROAV, 1); trapBaited = new VarbitRequirement(VarbitID.WGS_PIT_TRAP_BROAV, 2, Operation.GREATER_EQUAL); broavTrapped = new VarbitRequirement(VarbitID.WGS_PIT_TRAP_BROAV, 4); - broavNearby = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, List.of(NpcID.WGS_BROAV, 13516), 16); - hasBroav = or(broavNearby, broav.alsoCheckBank(questBank)); + broavNearby = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, List.of(NpcID.WGS_BROAV, NpcID.WGS_WASHERMAN), 16); + hasBroav = or(broavNearby, broav.alsoCheckBank()); nearTable = new Zone(new WorldPoint(2516, 3246, 0), new WorldPoint(2522, 3252, 0)); isNearTable = new ZoneRequirement(nearTable); @@ -865,18 +805,18 @@ protected void setupRequirements() library = new Zone(new WorldPoint(4166, 4946, 0), new WorldPoint(4190, 4968, 0)); inLibrary = new ZoneRequirement(library); - isElectricBookcase1 = new VarbitRequirement(10763, 1); - isElectricBookcase2 = new VarbitRequirement(10764, 1); - isElectricBookcase3 = new VarbitRequirement(10765, 1); - isElectricBookcase4 = new VarbitRequirement(10766, 1); - isElectricBookcase5 = new VarbitRequirement(10767, 1); - isElectricBookcase6 = new VarbitRequirement(10768, 1); - isElectricBookcase7 = new VarbitRequirement(10769, 1); + isElectricBookcase1 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_1, 1); + isElectricBookcase2 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_2, 1); + isElectricBookcase3 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_3, 1); + isElectricBookcase4 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_4, 1); + isElectricBookcase5 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_5, 1); + isElectricBookcase6 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_6, 1); + isElectricBookcase7 = new VarbitRequirement(VarbitID.WGS_WIRE_FLOOR_SECTION_7, 1); nextToSpiralStaircase = new Zone(new WorldPoint(4180, 4949, 0), new WorldPoint(4183, 4952, 0)); isNextToSpiralStaircase = new ZoneRequirement(nextToSpiralStaircase); - disarmedStaircase = new VarbitRequirement(10799, 1); + disarmedStaircase = new VarbitRequirement(VarbitID.WGS_STAIR_TRAP_DEAD, 1); movarioBaseF1 = new Zone(new WorldPoint(4169, 4942, 1), new WorldPoint(4189, 4962, 1)); inMovarioBaseF1 = new ZoneRequirement(movarioBaseF1); @@ -885,9 +825,9 @@ protected void setupRequirements() inMovarioBaseF2 = new ZoneRequirement(movarioBaseF2); hadRubyKey = or(rubyKey, new VarbitRequirement(VarbitID.WGS, 19, Operation.GREATER_EQUAL)); - searchedBedForTraps = new VarbitRequirement(10798, 1); + searchedBedForTraps = new VarbitRequirement(VarbitID.WGS_BEDCHEST_TRAP_DISABLED, 1); - pulledPaintingLever = new VarbitRequirement(10758, 1); + pulledPaintingLever = new VarbitRequirement(VarbitID.WGS_MOVED_PAINTING, 1); weightRoom = new Zone(new WorldPoint(4177, 4944, 1), new WorldPoint(4181, 4947, 1)); inWeightRoom = new ZoneRequirement(weightRoom); @@ -914,13 +854,13 @@ protected void setupRequirements() onLunarSpellbook = new SpellbookRequirement(Spellbook.LUNAR); - notContactedTurael = new VarbitRequirement(10785, 0); - notContactedDuradel = new VarbitRequirement(10786, 0); - notContactedMazchna = new VarbitRequirement(10787, 0); - notRecruitedGhommal = new VarbitRequirement(10788, 0); - notRecruitedHarrallak = new VarbitRequirement(10789, 0); - notRecruitedSloane = new VarbitRequirement(10790, 0); - notContactedCyrisus = new VarbitRequirement(10791, 0); + notContactedTurael = new VarbitRequirement(VarbitID.WGS_TURAEL_RECRUIT, 0); + notContactedDuradel = new VarbitRequirement(VarbitID.WGS_DURADEL_RECRUIT, 0); + notContactedMazchna = new VarbitRequirement(VarbitID.WGS_MAZCHNA_RECRUIT, 0); + notRecruitedGhommal = new VarbitRequirement(VarbitID.WGS_GHOMMAL_RECRUIT, 0); + notRecruitedHarrallak = new VarbitRequirement(VarbitID.WGS_HARRALLAK_RECRUIT, 0); + notRecruitedSloane = new VarbitRequirement(VarbitID.WGS_SLOANE_RECRUIT, 0); + notContactedCyrisus = new VarbitRequirement(VarbitID.WGS_CYRISUS_RECRUIT, 0); f1WarriorsGuild = new Zone(new WorldPoint(2835, 3531, 1), new WorldPoint(3878, 3558, 1)); onF1WarriorsGuild = new ZoneRequirement(f1WarriorsGuild); @@ -979,7 +919,7 @@ protected void setupRequirements() // 10780 2->3 represents state of Silif givenArmourToSilif = new VarbitRequirement(VarbitID.WGS, 550, Operation.GREATER_EQUAL); - silifIsFollowing = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, 13522, 16); + silifIsFollowing = new VarplayerRequirement(VarPlayerID.FOLLOWER_NPC, NpcID.WGS_SILIF_FOLLOWER_ARMOUR, 16); seenMap = new VarbitRequirement(VarbitID.WGS, 580, Operation.GREATER_EQUAL); squallFightRoom = new Zone(new WorldPoint(4126, 4840, 2), new WorldPoint(4151, 4861, 2)); @@ -1097,7 +1037,7 @@ public void setupSteps() // 3->4 told to go to hunter expert talkToHuntingExpert = new NpcStep(this, NpcID.HUNTING_JUNGLE_INFORMATION, new WorldPoint(2525, 2916, 0), - "Talk to the Hunting Expert in his hut in the middle of the Feldip Hills hunting area.", knife, logs); + "Talk to the Hunting Expert in her hut in the middle of the Feldip Hills hunting area.", knife, logs); talkToHuntingExpert.addTeleport(feldipHillsTeleport); talkToHuntingExpert.addDialogSteps("Do you think you could help me with broavs?", "A creature to help track down a person."); @@ -1112,7 +1052,7 @@ public void setupSteps() goToBrokenTable = new DetailedQuestStep(this, new WorldPoint(2519, 3248, 0), "Go to the broken table in the middle of the Khazard side of the Khazard-Gnome battlefield.", broav); goToBrokenTable.addTeleport(khazardTeleport); - goToBrokenTable.setHighlightZone(nearTable); + goToBrokenTable.addHighlightZone(nearTable); dropBroav = new DetailedQuestStep(this, "Drop your broav.", broav.highlighted()); @@ -1123,8 +1063,7 @@ public void setupSteps() enterMovarioBase = new ObjectStep(this, ObjectID.WGS_BF_TABLE_BROKEN2_OPEN, new WorldPoint(2519, 3249, 0), "Enter Movario's base under the broken table in the Khazard Battlefield."); - // TODO: Update hardcoded 54117 to CHEST_54117 - claimRunes = new ObjectStep(this, 54117, new WorldPoint(4124, 4984, 0), "Search the open chest in the far north of the area for some runes."); + claimRunes = new ObjectStep(this, ObjectID.WGS_MOVARIO_RUNE_CHEST, new WorldPoint(4124, 4984, 0), "Search the open chest in the far north of the area for some runes."); // 4066 122878 -> 385022 // 15064 0->100 @@ -1372,13 +1311,13 @@ public void setupSteps() talkToAkrisaeAfterRecruitment = new NpcStep(this, NpcID.WGS_AKRISAE, new WorldPoint(2989, 3342, 0), "Return to Akrisae in the White Knights' Castle, on the ground floor on the east side.", normalSpellbook, emptySlots9, - ironChainbody.equipped().hideConditioned(squallOutfit.alsoCheckBank(questBank)), bronzeMedHelm.equipped().hideConditioned(squallOutfit.alsoCheckBank(questBank)), - squallOutfit.equipped().showConditioned(squallOutfit.alsoCheckBank(questBank)), unpoweredOrb.hideConditioned(hasCastChargeOrb), chargeOrbSpell.hideConditioned(hasCastChargeOrb)); + ironChainbody.equipped().hideConditioned(squallOutfit.alsoCheckBank()), bronzeMedHelm.equipped().hideConditioned(squallOutfit.alsoCheckBank()), + squallOutfit.equipped().showConditioned(squallOutfit.alsoCheckBank()), unpoweredOrb.hideConditioned(hasCastChargeOrb), chargeOrbSpell.hideConditioned(hasCastChargeOrb)); // 10838 0->1 // 10826 0->1 enterBlackKnightFortress = new ObjectStep(this, ObjectID.BKFORTRESSDOOR1, new WorldPoint(3016, 3514, 0), "Enter the Black Knights' Fortress. Akrisae will give you a one-off teleport there.", - normalSpellbook, emptySlots9, ironChainbody.equipped().hideConditioned(squallOutfit.alsoCheckBank(questBank)), bronzeMedHelm.equipped().hideConditioned(squallOutfit.alsoCheckBank(questBank)), - squallOutfit.equipped().showConditioned(squallOutfit.alsoCheckBank(questBank)), unpoweredOrb.hideConditioned(hasCastChargeOrb), chargeOrbSpell.hideConditioned(hasCastChargeOrb)); + normalSpellbook, emptySlots9, ironChainbody.equipped().hideConditioned(squallOutfit.alsoCheckBank()), bronzeMedHelm.equipped().hideConditioned(squallOutfit.alsoCheckBank()), + squallOutfit.equipped().showConditioned(squallOutfit.alsoCheckBank()), unpoweredOrb.hideConditioned(hasCastChargeOrb), chargeOrbSpell.hideConditioned(hasCastChargeOrb)); // 10962 0->1 when teleported enterBlackKnightFortress.addDialogStep("Yes."); pushHiddenWall = new ObjectStep(this, ObjectID.BKSECRETDOOR, new WorldPoint(3016, 3517, 0), "Push the wall to enter a secret room."); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchshouse/WitchsHouse.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchshouse/WitchsHouse.java index e036b4cec79..e88fb2908ae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchshouse/WitchsHouse.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchshouse/WitchsHouse.java @@ -28,12 +28,11 @@ import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.NpcCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ObjectCondition; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.player.FreeInventorySlotRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarplayerRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; @@ -45,94 +44,79 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarPlayerID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.*; public class WitchsHouse extends BasicQuestHelper { - //Items Required - ItemRequirement cheese, leatherGloves, houseKey, magnet, shedKey, ball; - - //Items Recommended + // Required items + ItemRequirement cheese; + ItemRequirement leatherGloves; ItemRequirement armourAndWeapon; - Requirement inHouse, inUpstairsHouse, inDownstairsHouseWest, inDownstairsHouseEast, inDownstairsHouse, inHouseOrGarden, - ratHasMagnet, inShed, experimentNearby; + // Mid-quest item requirements + ItemRequirement houseKey; + ItemRequirement magnet; + ItemRequirement witchesDiary; + ItemRequirement shedKey; + ItemRequirement ball; - QuestStep talkToBoy, getKey, goDownstairs, enterGate, goDownstairsFromTop, openCupboardAndLoot, openCupboardAndLoot2, goBackUpstairs, useCheeseOnHole, - enterHouse, searchFountain, enterShed, enterShedWithoutKey, killWitchsExperiment, returnToBoy, pickupBall, grabBall; + // Zones + Zone house; + Zone upstairsHouse; + Zone downstairsHouseEast; + Zone downstairsHouseWest; + Zone garden1; + Zone garden2; + Zone garden3; + Zone shed; - //Zones - Zone house, upstairsHouse, downstairsHouseEast, downstairsHouseWest, garden1, garden2, garden3, shed; + // Miscellaneous requirements + Requirement inHouse; + Requirement inUpstairsHouse; + Requirement inDownstairsHouseWest; + Requirement inDownstairsHouseEast; + Requirement inDownstairsHouse; + Requirement inHouseOrGarden; + Requirement ratHasMagnet; + Requirement inShed; + Requirement experimentNearby; + VarplayerRequirement hasReadDiary; - @Override - public Map loadSteps() - { - initializeRequirements(); - setupConditions(); - setupSteps(); - Map steps = new HashMap<>(); + // Steps + NpcStep talkToBoy; - steps.put(0, talkToBoy); + ObjectStep getKey; - ConditionalStep getTheMagnet = new ConditionalStep(this, getKey); - getTheMagnet.addStep(new Conditions(inHouse, magnet), useCheeseOnHole); - getTheMagnet.addStep(new Conditions(inDownstairsHouse, magnet), goBackUpstairs); - getTheMagnet.addStep(new Conditions(inDownstairsHouseWest, new ObjectCondition(ObjectID.MAGNETCBOPEN)), openCupboardAndLoot2); - getTheMagnet.addStep(inDownstairsHouseWest, openCupboardAndLoot); - getTheMagnet.addStep(inDownstairsHouseEast, enterGate); - getTheMagnet.addStep(inHouse, goDownstairs); - getTheMagnet.addStep(inUpstairsHouse, goDownstairsFromTop); - getTheMagnet.addStep(houseKey.alsoCheckBank(questBank), enterHouse); + ObjectStep enterHouse; + ObjectStep goDownstairsFromTop; - steps.put(1, getTheMagnet); - steps.put(2, getTheMagnet); + ObjectStep goDownstairs; - ConditionalStep killExperiment = new ConditionalStep(this, getKey); - killExperiment.addStep(new Conditions(inShed, experimentNearby), killWitchsExperiment); - killExperiment.addStep(inShed, grabBall); - killExperiment.addStep(new Conditions(ratHasMagnet, inHouseOrGarden, shedKey), enterShed); - killExperiment.addStep(new Conditions(ratHasMagnet, inHouseOrGarden), searchFountain); - killExperiment.addStep(new Conditions(ratHasMagnet, inDownstairsHouse), goBackUpstairs); - killExperiment.addStep(new Conditions(inHouse, magnet), useCheeseOnHole); - killExperiment.addStep(new Conditions(inDownstairsHouse, magnet), goBackUpstairs); - killExperiment.addStep(new Conditions(inDownstairsHouseWest, new ObjectCondition(ObjectID.MAGNETCBOPEN)), openCupboardAndLoot2); - killExperiment.addStep(inDownstairsHouseWest, openCupboardAndLoot); - killExperiment.addStep(inDownstairsHouseEast, enterGate); - killExperiment.addStep(inHouse, goDownstairs); - killExperiment.addStep(inUpstairsHouse, goDownstairsFromTop); - killExperiment.addStep(houseKey.alsoCheckBank(questBank), enterHouse); + ObjectStep enterGate; - steps.put(3, killExperiment); - // TODO: Add 'pick up diary', 'read diary' after step 3 - steps.put(5, killExperiment); + ObjectStep openCupboardAndLoot; + ObjectStep openCupboardAndLoot2; - ConditionalStep returnBall = new ConditionalStep(this, getKey); - returnBall.addStep(ball.alsoCheckBank(questBank), returnToBoy); - returnBall.addStep(inShed, pickupBall); - returnBall.addStep(inHouseOrGarden, enterShedWithoutKey); - returnBall.addStep(houseKey.alsoCheckBank(questBank), enterHouse); - returnBall.addStep(inDownstairsHouse, goBackUpstairs); - returnBall.addStep(inUpstairsHouse, goDownstairsFromTop); + ObjectStep goBackUpstairs; - steps.put(6, returnBall); - return steps; - } + ObjectStep useCheeseOnHole; - @Override - protected void setupRequirements() - { - cheese = new ItemRequirement("Cheese (multiple if you mess up)", ItemID.CHEESE); - leatherGloves = new ItemRequirement("Leather gloves", ItemID.LEATHER_GLOVES, 1, true).isNotConsumed(); - leatherGloves.canBeObtainedDuringQuest(); - houseKey = new ItemRequirement("Door key", ItemID.WITCHES_DOORKEY); - magnet = new ItemRequirement("Magnet", ItemID.MAGNET); - shedKey = new ItemRequirement("Key", ItemID.WITCHES_SHEDKEY); - shedKey.setHighlightInInventory(true); - ball = new ItemRequirement("Ball", ItemID.BALL); - armourAndWeapon = new ItemRequirement("Combat gear and food for monsters up to level 53", -1, -1).isNotConsumed(); - armourAndWeapon.setDisplayItemId(BankSlotIcons.getCombatGear()); - } + ItemStep readDiary; + + ObjectStep searchFountain; + ObjectStep enterShed; + ObjectStep enterShedWithoutKey; + DetailedQuestStep grabBall; + DetailedQuestStep pickupBall; + NpcStep killWitchsExperiment; + NpcStep returnToBoy; @Override protected void setupZones() @@ -147,81 +131,160 @@ protected void setupZones() shed = new Zone(new WorldPoint(2934, 3459, 0), new WorldPoint(2937, 3467, 0)); } - public void setupConditions() + @Override + protected void setupRequirements() { + cheese = new ItemRequirement("Cheese (multiple if you mess up)", ItemID.CHEESE); + leatherGloves = new ItemRequirement("Leather gloves", ItemID.LEATHER_GLOVES, 1, true).isNotConsumed(); + leatherGloves.setHighlightInInventory(true); + leatherGloves.canBeObtainedDuringQuest(); + houseKey = new ItemRequirement("Door key", ItemID.WITCHES_DOORKEY); + magnet = new ItemRequirement("Magnet", ItemID.MAGNET); + shedKey = new ItemRequirement("Key", ItemID.WITCHES_SHEDKEY); + shedKey.setHighlightInInventory(true); + ball = new ItemRequirement("Ball", ItemID.BALL); + armourAndWeapon = new ItemRequirement("Combat gear and food for monsters up to level 53", -1, -1).isNotConsumed(); + armourAndWeapon.setDisplayItemId(BankSlotIcons.getCombatGear()); + inHouse = new ZoneRequirement(house); inUpstairsHouse = new ZoneRequirement(upstairsHouse); inDownstairsHouseWest = new ZoneRequirement(downstairsHouseWest); inDownstairsHouseEast = new ZoneRequirement(downstairsHouseEast); inDownstairsHouse = new ZoneRequirement(downstairsHouseEast, downstairsHouseWest); inHouseOrGarden = new ZoneRequirement(house, garden1, garden2, garden3); - ratHasMagnet = new VarplayerRequirement(226, 3); + ratHasMagnet = new VarplayerRequirement(VarPlayerID.BALLQUEST, 3, Operation.GREATER_EQUAL); inShed = new ZoneRequirement(shed); - experimentNearby = new Conditions(LogicType.OR, + experimentNearby = or( new NpcCondition(NpcID.SHAPESHIFTERGLOB), new NpcCondition(NpcID.SHAPESHIFTERSPIDER), new NpcCondition(NpcID.SHAPESHIFTERBEAR), - new NpcCondition(NpcID.SHAPESHIFTERWOLF)); + new NpcCondition(NpcID.SHAPESHIFTERWOLF) + ); + + hasReadDiary = new VarplayerRequirement(VarPlayerID.BALLQUEST, 5, Operation.GREATER_EQUAL); } public void setupSteps() { - talkToBoy = new NpcStep(this, NpcID.BALLBOY, new WorldPoint(2928, 3456, 0), "Talk to the Boy in Taverley to start."); + talkToBoy = new NpcStep(this, NpcID.BALLBOY, new WorldPoint(2928, 3456, 0), "Talk to the Boy in Taverley to start the quest."); talkToBoy.addDialogSteps("What's the matter?", "Ok, I'll see what I can do.", "Yes."); - getKey = new ObjectStep(this, ObjectID.WITCHPOT, new WorldPoint(2900, 3474, 0), "Look under the potted plant just outside the witch's house."); + + getKey = new ObjectStep(this, ObjectID.WITCHPOT, new WorldPoint(2900, 3474, 0), "Look under the potted plant just outside the witch's house for the house key."); + enterHouse = new ObjectStep(this, ObjectID.WITCHHOUSEDOOR, new WorldPoint(2900, 3473, 0), "Enter the witch's house.", houseKey); + goDownstairsFromTop = new ObjectStep(this, ObjectID.GRIM_WITCH_HOUSE_SPOOKYSTAIRSTOP, new WorldPoint(2907, 3471, 1), "Go back downstairs."); + enterHouse.addSubSteps(goDownstairsFromTop); + goDownstairs = new ObjectStep(this, ObjectID.GRIM_WITCH_LADDER_DOWN, new WorldPoint(2907, 3476, 0), "Go down the ladder to the basement."); - enterGate = new ObjectStep(this, ObjectID.SHOCKGATER, new WorldPoint(2902, 9873, 0), "Go through the gate " + - "whilst wearing gloves. Search the nearby boxes if you don't have gloves.", leatherGloves); + + enterGate = new ObjectStep(this, ObjectID.SHOCKGATER, new WorldPoint(2902, 9873, 0), "Go through the gate whilst wearing gloves. If you don't have gloves, search the nearby boxes until you get a pair.", leatherGloves); + openCupboardAndLoot = new ObjectStep(this, ObjectID.MAGNETCBSHUT, new WorldPoint(2898, 9874, 0), "Open the cupboard and get a magnet from it"); openCupboardAndLoot2 = new ObjectStep(this, ObjectID.MAGNETCBOPEN, new WorldPoint(2898, 9874, 0), "Open the cupboard and get a magnet from it"); openCupboardAndLoot.addSubSteps(openCupboardAndLoot2); goBackUpstairs = new ObjectStep(this, ObjectID.GRIM_WITCH_LADDER_UP, new WorldPoint(2907, 9876, 0), "Climb back up the ladder."); - goDownstairsFromTop = new ObjectStep(this, ObjectID.GRIM_WITCH_HOUSE_SPOOKYSTAIRSTOP, new WorldPoint(2907, 3471, 1), "Go back downstairs."); useCheeseOnHole = new ObjectStep(this, ObjectID.WITCHMOUSEHOLE, new WorldPoint(2903, 3466, 0), "Use the cheese on the mouse hole in the south room, then use the magnet on the mouse which emerges.", cheese, magnet); - searchFountain = new ObjectStep(this, ObjectID.WITCHFOUNTAIN, new WorldPoint(2910, 3471, 0), "Enter the garden and sneak around the perimeter to search the fountain. If the witch spots you you'll be teleported outside."); + + witchesDiary = new ItemRequirement("Witch's diary", ItemID.WITCHES_DIARY); + + readDiary = new ItemStep(this, "Pick up the witch's diary from the table and read it to ensure the door stays unlocked. Check the \"Checkpoint\" section if you want to skip this step.", witchesDiary); + + searchFountain = new ObjectStep(this, ObjectID.WITCHFOUNTAIN, new WorldPoint(2910, 3471, 0), "Enter the garden and sneak around the perimeter to search the fountain. If the witch spots you, you'll be teleported outside."); enterShed = new ObjectStep(this, ObjectID.WITCHSHEDDOOR, new WorldPoint(2934, 3463, 0), "Use the shed key on the shed door to enter.", shedKey); - enterShedWithoutKey = new ObjectStep(this, ObjectID.WITCHSHEDDOOR, new WorldPoint(2934, 3463, 0), "Enter the shed."); + // NOTE: Testing 2025-09-20, it seems like the door does _not_ stay unlocked. I'm not sure if this is a temporary bug, so I'm leaving this state checking as is, and just adding text that makes sure the user knows to get the shed key from the fountain. + enterShedWithoutKey = new ObjectStep(this, ObjectID.WITCHSHEDDOOR, new WorldPoint(2934, 3463, 0), "Enter the shed. If the door doesn't open, you need to get the shed key from the fountain again."); enterShed.addSubSteps(enterShedWithoutKey); enterShed.addIcon(ItemID.WITCHES_SHEDKEY); grabBall = new DetailedQuestStep(this, new WorldPoint(2936, 3470, 0), "If an experiment hasn't spawned, attempt to pick up the ball once.", ball); killWitchsExperiment = new NpcStep(this, NpcID.SHAPESHIFTERGLOB, new WorldPoint(2935, 3463, 0), "Kill all four forms of the Witch's experiment (levels 19, 30, 42, and 53). You can safe spot the last two forms from the crate in the south of the room."); - ((NpcStep) killWitchsExperiment).addAlternateNpcs(NpcID.SHAPESHIFTERSPIDER, NpcID.SHAPESHIFTERBEAR, NpcID.SHAPESHIFTERWOLF); + killWitchsExperiment.addAlternateNpcs(NpcID.SHAPESHIFTERSPIDER, NpcID.SHAPESHIFTERBEAR, NpcID.SHAPESHIFTERWOLF); killWitchsExperiment.addSubSteps(grabBall); + killWitchsExperiment.addSafeSpots(new WorldPoint(2936, 3459, 0)); - pickupBall = new DetailedQuestStep(this, new WorldPoint(2936, 3470, 0), "Pick up the ball.", ball); + pickupBall = new ItemStep(this, new WorldPoint(2935, 3460, 0), "Pick up the ball.", ball); returnToBoy = new NpcStep(this, NpcID.BALLBOY, new WorldPoint(2928, 3456, 0), "Return the ball to the boy. Make sure the witch doesn't spot you or you'll have to get the ball back again.."); } @Override - public List getItemRequirements() + public Map loadSteps() { - ArrayList reqs = new ArrayList<>(); - reqs.add(cheese); - reqs.add(leatherGloves); - return reqs; + initializeRequirements(); + setupSteps(); + Map steps = new HashMap<>(); + + steps.put(0, talkToBoy); + + var getTheMagnet = new ConditionalStep(this, getKey); + getTheMagnet.addStep(and(inHouse, magnet), useCheeseOnHole); + getTheMagnet.addStep(and(inDownstairsHouse, magnet), goBackUpstairs); + getTheMagnet.addStep(and(inDownstairsHouseWest, new ObjectCondition(ObjectID.MAGNETCBOPEN)), openCupboardAndLoot2); + getTheMagnet.addStep(inDownstairsHouseWest, openCupboardAndLoot); + getTheMagnet.addStep(inDownstairsHouseEast, enterGate); + getTheMagnet.addStep(inHouse, goDownstairs); + getTheMagnet.addStep(inUpstairsHouse, goDownstairsFromTop); + getTheMagnet.addStep(houseKey.alsoCheckBank(), enterHouse); + + steps.put(1, getTheMagnet); + steps.put(2, getTheMagnet); + + var killExperiment = new ConditionalStep(this, getKey); + killExperiment.addStep(not(hasReadDiary), readDiary); + killExperiment.addStep(and(inShed, experimentNearby), killWitchsExperiment); + killExperiment.addStep(inShed, grabBall); + killExperiment.addStep(and(ratHasMagnet, inHouseOrGarden, shedKey), enterShed); + killExperiment.addStep(and(ratHasMagnet, inHouseOrGarden), searchFountain); + killExperiment.addStep(and(ratHasMagnet, inDownstairsHouse), goBackUpstairs); + killExperiment.addStep(and(inHouse, magnet), useCheeseOnHole); + killExperiment.addStep(and(inDownstairsHouse, magnet), goBackUpstairs); + killExperiment.addStep(and(inDownstairsHouseWest, new ObjectCondition(ObjectID.MAGNETCBOPEN)), openCupboardAndLoot2); + killExperiment.addStep(inDownstairsHouseWest, openCupboardAndLoot); + killExperiment.addStep(inDownstairsHouseEast, enterGate); + killExperiment.addStep(inHouse, goDownstairs); + killExperiment.addStep(inUpstairsHouse, goDownstairsFromTop); + killExperiment.addStep(houseKey.alsoCheckBank(), enterHouse); + + steps.put(3, killExperiment); + // TODO: Add 'pick up diary', 'read diary' after step 3 + steps.put(5, killExperiment); + + var returnBall = new ConditionalStep(this, getKey); + returnBall.addStep(ball.alsoCheckBank(), returnToBoy); + returnBall.addStep(inShed, pickupBall); + returnBall.addStep(inHouseOrGarden, enterShedWithoutKey); + returnBall.addStep(houseKey.alsoCheckBank(), enterHouse); + returnBall.addStep(inDownstairsHouse, goBackUpstairs); + returnBall.addStep(inUpstairsHouse, goDownstairsFromTop); + + steps.put(6, returnBall); + return steps; } @Override - public List getItemRecommended() + public List getGeneralRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(armourAndWeapon); - return reqs; + return List.of( + new FreeInventorySlotRequirement(2) + ); } @Override - public List getCombatRequirements() + public List getItemRequirements() { - return Collections.singletonList("Witch's experiment (level 19, 30, 42 and 53)"); + return List.of( + cheese, + leatherGloves, + armourAndWeapon + ); } @Override - public List getGeneralRecommended() + public List getCombatRequirements() { - return Collections.singletonList(new FreeInventorySlotRequirement(2)); + return List.of( + "Witch's experiment (level 19, 30, 42 and 53)" + ); } @Override @@ -233,17 +296,50 @@ public QuestPointReward getQuestPointReward() @Override public List getExperienceRewards() { - return Collections.singletonList(new ExperienceReward(Skill.HITPOINTS, 6325)); + return List.of( + new ExperienceReward(Skill.HITPOINTS, 6325) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Start the quest", Collections.singletonList(talkToBoy), cheese, leatherGloves, armourAndWeapon)); - allSteps.add(new PanelDetails("Accessing the garden", Arrays.asList(getKey, enterHouse, goDownstairs, enterGate, - openCupboardAndLoot, goBackUpstairs, useCheeseOnHole))); - allSteps.add(new PanelDetails("Defeat the witch's experiment", Arrays.asList(searchFountain, enterShed, killWitchsExperiment, pickupBall, returnToBoy))); - return allSteps; + var sections = new ArrayList(); + + sections.add(new PanelDetails("Start the quest", List.of( + talkToBoy + ), List.of( + cheese, + leatherGloves, + armourAndWeapon + ))); + + sections.add(new PanelDetails("Accessing the garden", List.of( + getKey, + enterHouse, + goDownstairs, + enterGate, + openCupboardAndLoot, + goBackUpstairs, + useCheeseOnHole + ))); + + var checkpoint = new PanelDetails("Checkpoint", List.of( + readDiary + )); + checkpoint.setLockingStep(readDiary); + // It's not relevant for the user to be able to check off the step if they've already reached beyond quest state 3 + checkpoint.setVars(0, 1, 2, 3, 4); + sections.add(checkpoint); + + sections.add(new PanelDetails("Defeat the witch's experiment", List.of( + searchFountain, + enterShed, + killWitchsExperiment, + pickupBall, + returnToBoy + ))); + + return sections; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchspotion/WitchsPotion.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchspotion/WitchsPotion.java index 3342851ab88..e33a50f6de6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchspotion/WitchsPotion.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/witchspotion/WitchsPotion.java @@ -33,16 +33,17 @@ import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import net.runelite.api.Skill; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; import net.runelite.api.gameval.ObjectID; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class WitchsPotion extends BasicQuestHelper { // Required items @@ -94,7 +95,7 @@ public Map loadSteps() steps.put(0, talkToWitch); var getIngredients = new ConditionalStep(this, killRat); - getIngredients.addStep(ratTail.alsoCheckBank(questBank), returnToWitch); + getIngredients.addStep(ratTail.alsoCheckBank(), returnToWitch); steps.put(1, getIngredients); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/xmarksthespot/XMarksTheSpot.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/xmarksthespot/XMarksTheSpot.java index fd8f7a28193..cc33e64f752 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/xmarksthespot/XMarksTheSpot.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/xmarksthespot/XMarksTheSpot.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, Trevor + * Copyright (c) 2025, pajlada * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +31,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.ItemReward; import net.runelite.client.plugins.microbot.questhelper.rewards.QuestPointReward; +import net.runelite.client.plugins.microbot.questhelper.steps.ConditionalStep; import net.runelite.client.plugins.microbot.questhelper.steps.DigStep; import net.runelite.client.plugins.microbot.questhelper.steps.NpcStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; @@ -37,97 +39,126 @@ import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.NpcID; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.not; public class XMarksTheSpot extends BasicQuestHelper { - //Items Required + // Required items ItemRequirement spade; - // Items recommended + // Recommended items ItemRequirement glory; - QuestStep speakVeosLumbridge, digOutsideBob, digCastle, digDraynor, digMartin, speakVeosSarim, speakVeosSarimWithoutCasket; - - @Override - public Map loadSteps() - { - initializeRequirements(); - setupSteps(); - - Map steps = new HashMap<>(); - - steps.put(0, speakVeosLumbridge); - steps.put(1, steps.get(0)); - steps.put(2, digOutsideBob); - steps.put(3, digCastle); - steps.put(4, digDraynor); - steps.put(5, digMartin); - steps.put(6, speakVeosSarim); - steps.put(7, speakVeosSarimWithoutCasket); + // Miscellaneous requirements + ItemRequirement ancientCasket; - return steps; - } + // Steps + NpcStep startQuest; + DigStep digOutsideBob; + DigStep digCastle; + DigStep digDraynor; + DigStep digMartin; + NpcStep speakVeosSarim; + DigStep digMartinAgain; + NpcStep speakVeosSarimWithoutCasket; @Override protected void setupRequirements() { spade = new ItemRequirement("Spade", ItemID.SPADE).isNotConsumed(); + spade.setTooltip("Can be bought from the Lumbridge General Store."); glory = new ItemRequirement("Amulet of Glory for faster teleport to Draynor Village.", ItemCollections.AMULET_OF_GLORIES).isNotConsumed(); + + ancientCasket = new ItemRequirement("Ancient casket", ItemID.CLUEQUEST_CASKET); } private void setupSteps() { // TODO: Worth adding PuzzleWrapperStep at all given the Clue Plugin also does this? - speakVeosLumbridge = new NpcStep(this, NpcID.VEOS_VISIBLE, new WorldPoint(3228, 3242, 0), + startQuest = new NpcStep(this, NpcID.VEOS_VISIBLE, new WorldPoint(3228, 3242, 0), "Talk to Veos in The Sheared Ram pub in Lumbridge to start the quest."); - speakVeosLumbridge.addDialogStep("I'm looking for a quest."); - speakVeosLumbridge.addDialogStep("Sounds good, what should I do?"); - speakVeosLumbridge.addDialogSteps("Can I help?", "Yes."); + startQuest.addDialogStep("I'm looking for a quest."); + startQuest.addDialogStep("Sounds good, what should I do?"); + startQuest.addDialogSteps("Can I help?", "Yes."); - digOutsideBob = new DigStep(this, new WorldPoint(3230, 3209, 0), - "Dig north of Bob's Brilliant Axes, on the west side of the plant against the wall of his house."); + digOutsideBob = DigStep.withCustomSpadeRequirement(this, new WorldPoint(3230, 3209, 0), + "Dig north of Bob's Brilliant Axes, on the west side of the plant against the wall of his house.", spade); digOutsideBob.addDialogStep("Okay, thanks Veos."); + digOutsideBob.setWhenToHighlight(DigStep.WhenToHighlight.OnTile); - digCastle = new DigStep(this, new WorldPoint(3203, 3212, 0), - "Dig behind Lumbridge Castle, just outside the kitchen door."); - - digDraynor = new DigStep(this, new WorldPoint(3109, 3264, 0), - "Dig north-west of the Draynor Village jail, just by the wheat farm."); + digCastle = DigStep.withCustomSpadeRequirement(this, new WorldPoint(3203, 3212, 0), + "Dig behind Lumbridge Castle, just outside the kitchen door.", spade); + digCastle.setWhenToHighlight(DigStep.WhenToHighlight.OnTile); - digMartin = new DigStep(this, new WorldPoint(3078, 3259, 0), - "Dig in the pig pen just west where Martin the Master Gardener is.", - new ItemRequirement("Treasure scroll", ItemID.CLUEQUEST_CLUE4)); + digDraynor = DigStep.withCustomSpadeRequirement(this, new WorldPoint(3109, 3264, 0), + "Dig north-west of the Draynor Village jail, just by the wheat farm.", spade); + digDraynor.addTeleport(glory); + digDraynor.setWhenToHighlight(DigStep.WhenToHighlight.OnTile); - ItemRequirement ancientCasket = new ItemRequirement("Ancient casket", ItemID.CLUEQUEST_CASKET); - ancientCasket.setTooltip("If you've lost this you can get another by digging in the pig pen in Draynor Village."); + digMartin = DigStep.withCustomSpadeRequirement(this, new WorldPoint(3078, 3259, 0), + "Dig just inside the pig pen in the Draynor Market.", spade); + digMartin.setWhenToHighlight(DigStep.WhenToHighlight.OnTile); speakVeosSarim = new NpcStep(this, NpcID.VEOS_VISIBLE, new WorldPoint(3054, 3245, 0), "Talk to Veos directly south of the Rusty Anchor Inn in Port Sarim to finish the quest.", ancientCasket); - ((NpcStep) speakVeosSarim).addAlternateNpcs(NpcID.VEOS_VISIBLE_TRAVEL); + speakVeosSarim.addAlternateNpcs(NpcID.VEOS_VISIBLE_TRAVEL); + + digMartinAgain = DigStep.withCustomSpadeRequirement(this, new WorldPoint(3078, 3259, 0), + "Dig just inside the pig pen in the Draynor Market to get the Ancient casket back.", spade, ancientCasket); + digMartinAgain.setWhenToHighlight(DigStep.WhenToHighlight.OnTile); + + speakVeosSarim.addSubSteps(digMartinAgain); speakVeosSarimWithoutCasket = new NpcStep(this, NpcID.VEOS_VISIBLE, new WorldPoint(3054, 3245, 0), "Talk to Veos directly south of the Rusty Anchor Inn in Port Sarim to finish the quest."); - ((NpcStep) speakVeosSarimWithoutCasket).addAlternateNpcs(NpcID.VEOS_VISIBLE_TRAVEL); + speakVeosSarimWithoutCasket.addAlternateNpcs(NpcID.VEOS_VISIBLE_TRAVEL); speakVeosSarim.addSubSteps(speakVeosSarimWithoutCasket); } + @Override + public Map loadSteps() + { + initializeRequirements(); + setupSteps(); + + var steps = new HashMap(); + + steps.put(0, startQuest); + steps.put(1, startQuest); + steps.put(2, digOutsideBob); + steps.put(3, digCastle); + steps.put(4, digDraynor); + steps.put(5, digMartin); + + var bringVeosAncientCasket = new ConditionalStep(this, speakVeosSarim); + bringVeosAncientCasket.addStep(not(ancientCasket), digMartinAgain); + steps.put(6, bringVeosAncientCasket); + steps.put(7, speakVeosSarimWithoutCasket); + + return steps; + } + @Override public List getItemRequirements() { - ArrayList reqs = new ArrayList<>(); - reqs.add(spade); - return reqs; + return List.of( + spade + ); } @Override public List getItemRecommended() { - ArrayList reqs = new ArrayList<>(); - reqs.add(glory); - return reqs; + return List.of( + glory + ); } @Override @@ -139,19 +170,37 @@ public QuestPointReward getQuestPointReward() @Override public List getItemRewards() { - return Arrays.asList( + return List.of( new ItemReward("300 Exp. Lamp (Any Skill)", ItemID.THOSF_REWARD_LAMP, 1), new ItemReward("Coins", ItemID.COINS, 200), - new ItemReward("A Beginner Clue Scroll", ItemID.TRAIL_CLUE_BEGINNER, 1)); + new ItemReward("A Beginner Clue Scroll", ItemID.TRAIL_CLUE_BEGINNER, 1) + ); } @Override public List getPanels() { - List allSteps = new ArrayList<>(); - allSteps.add(new PanelDetails("Speak to Veos", Collections.singletonList(speakVeosLumbridge), spade)); - allSteps.add(new PanelDetails("Solve the clue scroll", Arrays.asList(digOutsideBob, digCastle, digDraynor, digMartin))); - allSteps.add(new PanelDetails("Bring the casket to Veos", Collections.singletonList(speakVeosSarim))); - return allSteps; + var steps = new ArrayList(); + + steps.add(new PanelDetails("Speak to Veos", List.of( + startQuest + ), List.of( + spade + ))); + + steps.add(new PanelDetails("Solve the clue scroll", List.of( + digOutsideBob, + digCastle, + digDraynor, + digMartin + ), List.of( + spade + ))); + + steps.add(new PanelDetails("Bring the casket to Veos", List.of( + speakVeosSarim + ))); + + return steps; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/zogreflesheaters/ZogreFleshEaters.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/zogreflesheaters/ZogreFleshEaters.java index 41bd39a3aa1..230e6af50f3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/zogreflesheaters/ZogreFleshEaters.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/quests/zogreflesheaters/ZogreFleshEaters.java @@ -203,32 +203,32 @@ public void setupConditions() inTombF2 = new ZoneRequirement(tombF2); inTombF0 = new ZoneRequirement(tombF0); inTombF2ToBoss = new ZoneRequirement(tombF2ToBoss); - killedZombie = new VarbitRequirement(503, 2); + killedZombie = new VarbitRequirement(VarbitID.THZFE_BRENTLE_SKELE, 2); hasBackpackOrTankard = new Conditions(LogicType.OR, backpack, tankard); - searchedCoffin = new VarbitRequirement(488, 1); - usedKnife = new VarbitRequirement(488, 2); - openedCoffin = new VarbitRequirement(488, 3); + searchedCoffin = new VarbitRequirement(VarbitID.THZFE_PRISMSEARCH, 1); + usedKnife = new VarbitRequirement(VarbitID.THZFE_PRISMSEARCH, 2); + openedCoffin = new VarbitRequirement(VarbitID.THZFE_PRISMSEARCH, 3); talkedToZavistic = new VarbitRequirement(VarbitID.THZFE_PRISMSEARCH, 4, Operation.GREATER_EQUAL); - askedSithToLookAround = new VarbitRequirement(488, 5); + askedSithToLookAround = new VarbitRequirement(VarbitID.THZFE_PRISMSEARCH, 5); atSith = new ZoneRequirement(sith); - usedTankardOnBartender = new VarbitRequirement(489, 1); - usedPortraitOnBartender = new VarbitRequirement(490, 1); - shownNecroBook = new VarbitRequirement(491, 1); - shownHamBook = new VarbitRequirement(492, 1); - shownTankard = new VarbitRequirement(493, 1); - shownSignedPortrait = new VarbitRequirement(494, 1); + usedTankardOnBartender = new VarbitRequirement(VarbitID.THZFE_INNKEEPERMUGSHOWN, 1); + usedPortraitOnBartender = new VarbitRequirement(VarbitID.THZFE_INNKEEPERPORTRAITSHOWN, 1); + shownNecroBook = new VarbitRequirement(VarbitID.THZFE_SHOWNNECROBOOK, 1); + shownHamBook = new VarbitRequirement(VarbitID.THZFE_SHOWNHAMBOOK, 1); + shownTankard = new VarbitRequirement(VarbitID.THZFE_SHOWNTANKARD, 1); + shownSignedPortrait = new VarbitRequirement(VarbitID.THZFE_SHOWNSIGNEDPORTRAIT, 1); hasOrShownHamBook = new Conditions(LogicType.OR, shownHamBook, hamBook); hasOrShownNecroBook = new Conditions(LogicType.OR, shownNecroBook, necroBook); hasOrShownSignedPortrait = new Conditions(LogicType.OR, shownSignedPortrait, signedPort); - sithTransformed = new VarbitRequirement(495, 1); + sithTransformed = new VarbitRequirement(VarbitID.THZFE_SITHIK_TRANSFORMED, 1); - askedAboutDisease = new VarbitRequirement(498, 1); - askedAboutGettingRidOfUndead = new VarbitRequirement(499, 1); - askedAboutBow = new VarbitRequirement(500, 1); + askedAboutDisease = new VarbitRequirement(VarbitID.THZFE_MAKECUREDISEASE, 1); + askedAboutGettingRidOfUndead = new VarbitRequirement(VarbitID.THZFE_MAKEBRUTALARROW, 1); + askedAboutBow = new VarbitRequirement(VarbitID.THZFE_MAKECOMPOZOGREBOW, 1); ogreRelicNearby = new ItemOnTileRequirement(ogreRelic); // 507 1 when are ya sure? diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/mining/Mining.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/mining/Mining.java index 0acbd355a67..76c3d25b2f4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/mining/Mining.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/mining/Mining.java @@ -39,10 +39,10 @@ import net.runelite.client.plugins.microbot.questhelper.steps.ObjectStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.api.Skill; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.ItemID; import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.SpriteID; import java.util.ArrayList; import java.util.Arrays; @@ -149,13 +149,13 @@ private void setupSteps() "Mine Copper- and Tin ore at South-east Varrock mine until 15 Mining. You can choose to drop " + "the ores as you go or bank them in the eastern Varrock bank.", ironPickaxe, steelPickaxe, blackPickaxe); - copperStep.addTileMarker(COPPER_POINT, SpriteID.SKILL_MINING); + copperStep.addTileMarker(COPPER_POINT, SpriteID.Staticons.MINING); ironStep = new DetailedQuestStep(this, IRON_POINT, "Mine Iron ore at Al Kharid Mine until 99 Mining. You can choose to drop the ores as you go," + " smelt them on the way to the Al Kharid bank or bank the ores as they are.", steelPickaxe, blackPickaxe, mithrilPickaxe, adamantPickaxe, runePickaxe); - ironStep.addTileMarker(IRON_POINT, SpriteID.SKILL_MINING); + ironStep.addTileMarker(IRON_POINT, SpriteID.Staticons.MINING); mineCopper = new ObjectStep(this, ObjectID.TINROCK1, COPPER_POINT, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/woodcutting/WoodcuttingMember.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/woodcutting/WoodcuttingMember.java index e2432509ff0..6ab93783e9f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/woodcutting/WoodcuttingMember.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/helpers/skills/woodcutting/WoodcuttingMember.java @@ -108,16 +108,16 @@ protected void setupRequirements() lumberjackBody = new ItemRequirement("Lumberjack top", ItemID.RAMBLE_LUMBERJACK_TOP); - lumberjackBody = lumberjackBody.showConditioned(lumberjackBody.alsoCheckBank(questBank)); + lumberjackBody = lumberjackBody.showConditioned(lumberjackBody.alsoCheckBank()); lumberjackHat = new ItemRequirement("Lumberjack hat", ItemID.RAMBLE_LUMBERJACK_HAT); - lumberjackHat = lumberjackHat.showConditioned(lumberjackHat.alsoCheckBank(questBank)); + lumberjackHat = lumberjackHat.showConditioned(lumberjackHat.alsoCheckBank()); lumberjackLegs = new ItemRequirement("Lumberjack legs", ItemID.RAMBLE_LUMBERJACK_LEGS); - lumberjackLegs = lumberjackLegs.showConditioned(lumberjackLegs.alsoCheckBank(questBank)); + lumberjackLegs = lumberjackLegs.showConditioned(lumberjackLegs.alsoCheckBank()); lumberjackBoots = new ItemRequirement("Lumberjack boots", ItemID.RAMBLE_LUMBERJACK_BOOTS); - lumberjackBoots = lumberjackBoots.showConditioned(lumberjackBoots.alsoCheckBank(questBank)); + lumberjackBoots = lumberjackBoots.showConditioned(lumberjackBoots.alsoCheckBank()); } private void setupSteps() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/ItemAndLastUpdated.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/ItemAndLastUpdated.java index 88811e34f05..c1a357b1715 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/ItemAndLastUpdated.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/ItemAndLastUpdated.java @@ -31,7 +31,6 @@ import net.runelite.api.Item; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.concurrent.Callable; @Slf4j diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/NewVersionManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/NewVersionManager.java index 10e4c31d38c..7b423627391 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/NewVersionManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/NewVersionManager.java @@ -44,8 +44,7 @@ public class NewVersionManager private final String LAST_VERSION_SEEN_CONFIG_KEY = "lastversionchecked"; - private final String UPDATE_CHAT_TEXT = "Quest Helper has been updated to 4.7.0! This adds the new Varlamore quests! This also adds an " + - "integration with the Shortest Path plugin, which can be enabled in the config settings."; + private final String UPDATE_CHAT_TEXT = "Quest Helper has been updated to 4.12.1! This improves the default order for Sea Charting, and adds a proximity mode you can toggle at the top of it!"; public void updateChatWithNotificationIfNewVersion() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestBankManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestBankManager.java index 3a1958a5be1..739501f7d20 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestBankManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestBankManager.java @@ -34,6 +34,7 @@ import net.runelite.api.Item; import net.runelite.api.ItemContainer; import net.runelite.api.Player; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.eventbus.EventBus; import javax.inject.Inject; @@ -127,7 +128,7 @@ public void updateLocalBank(ItemContainer itemContainer) public void updateLocalGroupBank(Client client, ItemContainer itemContainer) { - boolean hasChangedGroupStorage = client.getVarbitValue(4602) == 1; + boolean hasChangedGroupStorage = client.getVarbitValue(VarbitID.GIM_SHARED_BANK_HASEDITED) == 1; if (hasChangedGroupStorage) { // If editing, group bank not actually 'saved', so don't update yet diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestManager.java index 36dafc24eb6..85864b9f0f7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/managers/QuestManager.java @@ -194,7 +194,7 @@ public void handleVarbitChanged() } clientThread.invokeLater(() -> { - if ((selectedQuest != null) && selectedQuest.isCompleted()) + if (selectedQuest != null && selectedQuest.hasQuestStateBecomeFinished()) { shutDownQuest(true); } @@ -208,7 +208,7 @@ public void handleVarbitChanged() public void handleConfigChanged() { clientThread.invokeLater(() -> { - if ((selectedQuest != null) && selectedQuest.isCompleted()) + if (selectedQuest != null && selectedQuest.hasQuestStateBecomeFinished()) { shutDownQuest(true); } @@ -264,9 +264,12 @@ private void doStartUpQuest(QuestHelper questHelper, boolean shouldOpenSidebarIf */ public void startUpQuest(QuestHelper questHelper, boolean shouldOpenSidebarIfConfig) { - if (client.isClientThread()) { + if (client.isClientThread()) + { this.doStartUpQuest(questHelper, shouldOpenSidebarIfConfig); - } else { + } + else + { clientThread.invokeLater(() -> { this.doStartUpQuest(questHelper, shouldOpenSidebarIfConfig); }); @@ -275,44 +278,37 @@ public void startUpQuest(QuestHelper questHelper, boolean shouldOpenSidebarIfCon private void initializeNewQuest(QuestHelper questHelper, boolean shouldOpenSidebarIfConfig) { - if (!questHelper.isCompleted()) + if (backgroundHelpers.containsValue(questHelper)) { - if (backgroundHelpers.containsValue(questHelper)) - { - shutDownBackgroundQuest(questHelper); - } + shutDownBackgroundQuest(questHelper); + } - if (shouldOpenSidebarIfConfig && config.autoOpenSidebar()) - { - questHelperPlugin.displayPanel(); - } - selectedQuest = questHelper; - registerQuestToEventBus(selectedQuest); - if (isDeveloperMode()) - { - selectedQuest.debugStartup(config); - } - selectedQuest.startUp(config); - if (selectedQuest.getCurrentStep() == null) - { - shutDownQuest(false); - return; - } - questBankManager.startUpQuest(); - SwingUtilities.invokeLater(() -> - { - panel.removeQuest(); - panel.addQuest(questHelper, true); + if (shouldOpenSidebarIfConfig && config.autoOpenSidebar()) + { + questHelperPlugin.displayPanel(); + } + selectedQuest = questHelper; + registerQuestToEventBus(selectedQuest); + if (isDeveloperMode()) + { + selectedQuest.debugStartup(config); + } + selectedQuest.startUp(config); - // Force an extra update immediately after starting a quest - clientThread.invokeLater(() -> panel.updateItemRequirements(client)); - }); + if (selectedQuest.getCurrentStep() == null) + { + shutDownQuest(false); + return; } - else + questBankManager.startUpQuest(); + SwingUtilities.invokeLater(() -> { panel.removeQuest(); - selectedQuest = null; - } + panel.addQuest(questHelper, true); + + // Force an extra update immediately after starting a quest + clientThread.invokeLater(() -> panel.updateItemRequirements(client)); + }); } private void shutDownPreviousQuest() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/overlays/QuestHelperOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/overlays/QuestHelperOverlay.java index c37ee6b597e..9be7416147a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/overlays/QuestHelperOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/overlays/QuestHelperOverlay.java @@ -31,7 +31,6 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.ui.overlay.OverlayLayer; import net.runelite.client.ui.overlay.OverlayPanel; -import net.runelite.client.ui.overlay.OverlayPriority; import javax.inject.Inject; import java.awt.*; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/JGenerator.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/JGenerator.java index 53a0f7f66ae..f79c75fb306 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/JGenerator.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/JGenerator.java @@ -72,7 +72,7 @@ public static JTextArea makeJTextArea() jTextArea.setOpaque(false); jTextArea.setEditable(false); jTextArea.setFocusable(false); - jTextArea.setBackground(javax.swing.UIManager.getColor("Label.background")); + jTextArea.setBackground(UIManager.getColor("Label.background")); jTextArea.setBorder(new EmptyBorder(0, 0, 0, 0)); return jTextArea; @@ -86,7 +86,7 @@ public static JTextArea makeJTextArea(String text) jTextArea.setOpaque(false); jTextArea.setEditable(false); jTextArea.setFocusable(false); - jTextArea.setBackground(javax.swing.UIManager.getColor("Label.background")); + jTextArea.setBackground(UIManager.getColor("Label.background")); jTextArea.setBorder(new EmptyBorder(0, 0, 0, 0)); return jTextArea; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/PanelDetails.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/PanelDetails.java index c433e44cfc0..b1bfcc9590c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/PanelDetails.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/PanelDetails.java @@ -37,7 +37,7 @@ public class PanelDetails { @Getter - int id; + int id = -1; @Getter String header; @@ -95,6 +95,10 @@ public PanelDetails(String header, List steps, List requ public PanelDetails withId(int id) { this.id = id; + for (QuestStep step : steps) + { + step.withId(id); + } return this; } @@ -113,6 +117,12 @@ public void setDisplayCondition(Requirement req) setHideCondition(new Conditions(LogicType.NOR, req)); } + public PanelDetails withHideCondition(Requirement requirement) + { + setHideCondition(requirement); + return this; + } + /* Set the states of the quest the steps in the sidebar should be active */ public void setVars(Integer... vars) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestHelperPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestHelperPanel.java index f4221958012..2c840fa1f7b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestHelperPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestHelperPanel.java @@ -28,6 +28,7 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; import net.runelite.client.plugins.microbot.questhelper.managers.QuestManager; import net.runelite.client.plugins.microbot.questhelper.panel.skillfiltering.SkillFilterPanel; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.BasicQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; @@ -54,10 +55,11 @@ import javax.swing.plaf.basic.BasicButtonUI; import java.awt.*; import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.List; import java.util.*; +import java.util.List; import java.util.stream.Collectors; @Slf4j @@ -73,6 +75,8 @@ public class QuestHelperPanel extends PluginPanel private final JPanel allDropdownSections = new JPanel(); private final JComboBox filterDropdown, difficultyDropdown, orderDropdown; + private final JComboBox stateDropdown = new JComboBox<>(); + private JPanel statePanel; private final JButton skillExpandButton = new JButton(); private final IconTextField searchBar = new IconTextField(); @@ -156,14 +160,14 @@ public QuestHelperPanel(QuestHelperPlugin questHelperPlugin, QuestManager questM onSearchBarChanged(); }); - settingsBtn.addMouseListener(new java.awt.event.MouseAdapter() + settingsBtn.addMouseListener(new MouseAdapter() { - public void mouseEntered(java.awt.event.MouseEvent evt) + public void mouseEntered(MouseEvent evt) { settingsBtn.setBackground(ColorScheme.DARK_GRAY_HOVER_COLOR); } - public void mouseExited(java.awt.event.MouseEvent evt) + public void mouseExited(MouseEvent evt) { if (settingsPanelActive()) { @@ -185,14 +189,14 @@ public void mouseExited(java.awt.event.MouseEvent evt) discordBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); discordBtn.setUI(new BasicButtonUI()); discordBtn.addActionListener((ev) -> LinkBrowser.browse("https://discord.gg/XCfwNnz6RB")); - discordBtn.addMouseListener(new java.awt.event.MouseAdapter() + discordBtn.addMouseListener(new MouseAdapter() { - public void mouseEntered(java.awt.event.MouseEvent evt) + public void mouseEntered(MouseEvent evt) { discordBtn.setBackground(ColorScheme.DARK_GRAY_HOVER_COLOR); } - public void mouseExited(java.awt.event.MouseEvent evt) + public void mouseExited(MouseEvent evt) { discordBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); } @@ -207,14 +211,14 @@ public void mouseExited(java.awt.event.MouseEvent evt) githubBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); githubBtn.setUI(new BasicButtonUI()); githubBtn.addActionListener((ev) -> LinkBrowser.browse("https://github.com/Zoinkwiz/quest-helper")); - githubBtn.addMouseListener(new java.awt.event.MouseAdapter() + githubBtn.addMouseListener(new MouseAdapter() { - public void mouseEntered(java.awt.event.MouseEvent evt) + public void mouseEntered(MouseEvent evt) { githubBtn.setBackground(ColorScheme.DARK_GRAY_HOVER_COLOR); } - public void mouseExited(java.awt.event.MouseEvent evt) + public void mouseExited(MouseEvent evt) { githubBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); } @@ -229,14 +233,14 @@ public void mouseExited(java.awt.event.MouseEvent evt) patreonBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); patreonBtn.setUI(new BasicButtonUI()); patreonBtn.addActionListener((ev) -> LinkBrowser.browse("https://www.patreon.com/zoinkwiz")); - patreonBtn.addMouseListener(new java.awt.event.MouseAdapter() + patreonBtn.addMouseListener(new MouseAdapter() { - public void mouseEntered(java.awt.event.MouseEvent evt) + public void mouseEntered(MouseEvent evt) { patreonBtn.setBackground(ColorScheme.DARK_GRAY_HOVER_COLOR); } - public void mouseExited(java.awt.event.MouseEvent evt) + public void mouseExited(MouseEvent evt) { patreonBtn.setBackground(ColorScheme.DARK_GRAY_COLOR); } @@ -396,16 +400,57 @@ public void mousePressed(MouseEvent mouseEvent) // If in developer mode, add this "reload quest" button. // It's always visible under the search bar, and reloads the currently // active quest, and ensures you're scrolled back to where you were. + + var devModePanel = new JPanel(); + devModePanel.setLayout(new BorderLayout()); + + var reloadQuest = new JButton("reload quest"); reloadQuest.addActionListener((ev) -> { nextDesiredScrollValue = scrollableContainer.getVerticalScrollBar().getValue(); var currentQuest = questHelperPlugin.getSelectedQuest(); - if (currentQuest != null) { + if (currentQuest != null) + { currentQuest.uninitializeRequirements(); } setSelectedQuest(questHelperPlugin.getSelectedQuest()); }); - searchQuestsPanel.add(reloadQuest, BorderLayout.SOUTH); + devModePanel.add(reloadQuest, BorderLayout.SOUTH); + + // State dropdown for BasicQuestHelper + stateDropdown.setFocusable(false); + stateDropdown.addItemListener((ev) -> { + if (ev.getStateChange() == ItemEvent.SELECTED) + { + var currentQuest = questHelperPlugin.getSelectedQuest(); + if (currentQuest instanceof BasicQuestHelper) + { + BasicQuestHelper basicQuest = (BasicQuestHelper) currentQuest; + String selectedItem = (String) stateDropdown.getSelectedItem(); + if ("none".equals(selectedItem)) + { + basicQuest.setSelectedStateOverride(null); + } + else if (selectedItem != null) + { + try + { + Integer stateValue = Integer.parseInt(selectedItem); + basicQuest.setSelectedStateOverride(stateValue); + } + catch (NumberFormatException ignored) {} + } + } + } + }); + + // Create a panel with label for the state dropdown + statePanel = makeDropdownPanel(stateDropdown, "Quest State"); + statePanel.setPreferredSize(new Dimension(PANEL_WIDTH, DROPDOWN_HEIGHT)); + statePanel.setVisible(false); + devModePanel.add(statePanel, BorderLayout.NORTH); + + searchQuestsPanel.add(devModePanel, BorderLayout.SOUTH); } refreshSkillFiltering(); @@ -452,7 +497,7 @@ private JComboBox makeNewDropdown(Enum[] values, String key) return dropdown; } - private JPanel makeDropdownPanel(JComboBox dropdown, String name) + private JPanel makeDropdownPanel(JComboBox dropdown, String name) { // Filters JTextArea filterName = JGenerator.makeJTextArea(name); @@ -551,6 +596,7 @@ public void addQuest(QuestHelper quest, boolean isActive) scrollableContainer.setViewportView(questOverviewWrapper); questOverviewPanel.addQuest(quest, isActive); + updateStateDropdown(quest); questActive = true; SwingUtilities.invokeLater(() -> { @@ -585,6 +631,7 @@ public void removeQuest() questActive = false; questOverviewPanel.removeQuest(); activateQuestList(); + updateStateDropdown(null); repaint(); revalidate(); @@ -630,6 +677,59 @@ private void activateQuestList() revalidate(); } + private void updateStateDropdown(QuestHelper questHelper) + { + if (!questHelperPlugin.isDeveloperMode()) return; + + ItemListener[] listeners = stateDropdown.getItemListeners(); + for (ItemListener listener : listeners) + { + stateDropdown.removeItemListener(listener); + } + + stateDropdown.removeAllItems(); + + if (questHelper instanceof BasicQuestHelper) + { + BasicQuestHelper basicQuest = (BasicQuestHelper) questHelper; + Map steps = basicQuest.getStepList(); + + if (steps != null && !steps.isEmpty()) + { + stateDropdown.addItem("none"); + + steps.keySet().stream() + .sorted() + .forEach(state -> stateDropdown.addItem(state.toString())); + + Integer currentOverride = basicQuest.getSelectedStateOverride(); + if (currentOverride != null) + { + stateDropdown.setSelectedItem(currentOverride.toString()); + } + else + { + stateDropdown.setSelectedItem("none"); + } + + statePanel.setVisible(true); + } + else + { + statePanel.setVisible(false); + } + } + else + { + statePanel.setVisible(false); + } + + for (ItemListener listener : listeners) + { + stateDropdown.addItemListener(listener); + } + } + public void setSelectedQuest(QuestHelper questHelper) { if (questHelperPlugin.getClient().getGameState() != GameState.LOGGED_IN || questHelper == null) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestOverviewPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestOverviewPanel.java index fe8f83510ef..d2d63233d3b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestOverviewPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestOverviewPanel.java @@ -27,6 +27,9 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; import net.runelite.client.plugins.microbot.questhelper.managers.QuestManager; +import net.runelite.client.plugins.microbot.questhelper.panel.queststepsection.AbstractQuestSection; +import net.runelite.client.plugins.microbot.questhelper.panel.queststepsection.QuestSectionSection; +import net.runelite.client.plugins.microbot.questhelper.panel.queststepsection.QuestStepPanel; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.ExternalQuestResources; import net.runelite.client.plugins.microbot.questhelper.questinfo.HelperConfig; @@ -51,13 +54,10 @@ import javax.swing.plaf.basic.BasicButtonUI; import java.awt.*; import java.awt.event.ItemEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionListener; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.List; import java.util.*; +import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; @@ -90,11 +90,7 @@ public class QuestOverviewPanel extends JPanel private final JLabel questNameLabel = JGenerator.makeJLabel(); private static final ImageIcon CLOSE_ICON = Icon.CLOSE.getIcon(); - - private final List questStepPanelList = new CopyOnWriteArrayList<>(); - - private QuestStepPanel draggingPanel = null; - + private final List allQuestStepPanelList = new CopyOnWriteArrayList<>(); public QuestOverviewPanel(QuestHelperPlugin questHelperPlugin, QuestManager questManager) { @@ -243,6 +239,7 @@ private JPanel makeDropdownPanel(JComboBox dropdown, String name) JPanel filtersPanel = new JPanel(); filtersPanel.setLayout(new BorderLayout()); + filtersPanel.setBorder(new EmptyBorder(5, 0, 0, 0)); filtersPanel.setMinimumSize(new Dimension(PANEL_WIDTH, 0)); filtersPanel.add(filterName, BorderLayout.CENTER); filtersPanel.add(dropdown, BorderLayout.EAST); @@ -253,7 +250,7 @@ private JPanel makeDropdownPanel(JComboBox dropdown, String name) public void addQuest(QuestHelper quest, boolean isActive) { currentQuest = quest; - questStepPanelList.clear(); + allQuestStepPanelList.clear(); List steps = quest.getPanels(); QuestStep currentStep; @@ -278,66 +275,37 @@ public void addQuest(QuestHelper quest, boolean isActive) setupQuestRequirements(quest); introPanel.setVisible(true); - boolean draggable = steps.stream().anyMatch((panelDetails -> panelDetails.id != 0)); - List order = questHelperPlugin.loadSidebarOrder(currentQuest); - if (draggable && order != null) - { - Map idx = new HashMap<>(); - for (int i = 0; i < order.size(); i++) - idx.put(order.get(i), i); - - steps.sort(Comparator.comparingInt( - pd -> idx.getOrDefault(pd.id, Integer.MAX_VALUE) - )); - } for (PanelDetails panelDetail : steps) { - var newStep = new QuestStepPanel(panelDetail, currentStep, questManager, questHelperPlugin); - if (draggable) makeDraggable(newStep); - - if (panelDetail.getLockingQuestSteps() != null && - (panelDetail.getVars() == null - || panelDetail.getVars().contains(currentQuest.getVar()))) + if (panelDetail instanceof TopLevelPanelDetails) + { + TopLevelPanelDetails topLevelPanelDetails = ((TopLevelPanelDetails) panelDetail); + QuestSectionSection questStepPanel = new QuestSectionSection(this, topLevelPanelDetails, currentStep, questManager, questHelperPlugin); + questStepsContainer.add(questStepPanel); + allQuestStepPanelList.add(questStepPanel); + } + else { - newStep.setLockable(true); + QuestStepPanel questStepPanel = new QuestStepPanel(panelDetail, currentStep, questManager, questHelperPlugin); + questStepsContainer.add(questStepPanel); + allQuestStepPanelList.add(questStepPanel); } - questStepPanelList.add(newStep); - questStepsContainer.add(newStep); - repaint(); - revalidate(); } + questStepsContainer.revalidate(); + questStepsContainer.repaint(); } } public void updateStepsTexts() { - questStepPanelList.forEach(panel -> { - for (QuestStep step : panel.getSteps()) - { - JTextPane label = panel.getStepsLabels().get(step); - if (label != null) - { - var newText = panel.generateText(step); - var oldText = label.getText(); - if (newText == null) - { - continue; - } - - if (!newText.equals(oldText)) - { - label.setText(panel.generateText(step)); - } - } - } - }); + allQuestStepPanelList.forEach(AbstractQuestSection::updateAllText); } public void updateHighlight(Client client, QuestStep newStep) { if (currentQuest == null) return; - questStepPanelList.forEach(panel -> { + allQuestStepPanelList.forEach(panel -> { panel.updateHighlightCheck(client, newStep, currentQuest); }); @@ -347,7 +315,7 @@ public void updateHighlight(Client client, QuestStep newStep) public void updateLocks() { - questStepPanelList.forEach(QuestStepPanel::updateLock); + allQuestStepPanelList.forEach(AbstractQuestSection::updateLock); } public void removeQuest() @@ -377,9 +345,9 @@ private void closeHelper() public boolean isAllCollapsed() { - return questStepPanelList.stream() - .filter(QuestStepPanel::isCollapsed) - .count() == questStepPanelList.size(); + return allQuestStepPanelList.stream() + .filter(AbstractQuestSection::isCollapsed) + .count() == allQuestStepPanelList.size(); } public void setupQuestRequirements(QuestHelper quest) @@ -642,111 +610,19 @@ public void updateRequirements(Client client) questItemRequirementsPanel.update(client, questHelperPlugin); questItemRecommendedPanel.update(client, questHelperPlugin); - questStepPanelList.forEach((questStepPanel) -> { + allQuestStepPanelList.forEach((questStepPanel) -> { questStepPanel.updateRequirements(client); }); revalidate(); } - private void makeDraggable(QuestStepPanel newStep) - { - JLabel grip = new JLabel("\u2630"); - grip.setBorder(new EmptyBorder(0, 0, 3, 0)); - grip.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); - - GripDragListener listener = new GripDragListener(newStep); - grip.addMouseListener(listener); - grip.addMouseMotionListener(listener); - - newStep.getLeftTitleContainer().add(grip, java.awt.BorderLayout.WEST); - } - - private void swapPanels(QuestStepPanel a, QuestStepPanel b) + public void saveSidebar() { - List list = questStepPanelList; - int ia = list.indexOf(a); - int ib = list.indexOf(b); - if (ia < 0 || ib < 0) return; - - Collections.swap(list, ia, ib); - - // Create again in new order - questStepsContainer.removeAll(); - for (QuestStepPanel p : list) - { - questStepsContainer.add(p); - } - questStepsContainer.revalidate(); - questStepsContainer.repaint(); - } - - private class GripDragListener extends MouseAdapter implements MouseMotionListener - { - private final QuestStepPanel panel; - private int startY; - - GripDragListener(QuestStepPanel panel) - { - this.panel = panel; - } - - @Override - public void mousePressed(MouseEvent e) - { - if (e.getButton() != MouseEvent.BUTTON1) - { - return; - } - draggingPanel = panel; - startY = e.getYOnScreen(); - } - - @Override - public void mouseDragged(MouseEvent e) - { - if (draggingPanel == null) return; - - int currentY = e.getYOnScreen(); - // We only need the absolute screen‐Y to compare midpoints: - for (QuestStepPanel other : questStepPanelList) - { - if (other == draggingPanel) continue; - - Rectangle r = other.getBounds(); - int midY = other.getLocationOnScreen().y + r.height / 2; - - int fromIndex = questStepPanelList.indexOf(draggingPanel); - int toIndex = questStepPanelList.indexOf(other); - - // dragged down - if (fromIndex < toIndex && currentY > midY) - { - swapPanels(draggingPanel, other); - break; - } - // dragged up - else if (fromIndex > toIndex && currentY < midY) - { - swapPanels(draggingPanel, other); - break; - } - } - } - - @Override - public void mouseReleased(MouseEvent e) - { - if (e.getButton() != MouseEvent.BUTTON1) - { - return; - } - draggingPanel = null; - List newOrderIds = questStepPanelList.stream() - .map(p -> p.getPanelDetails().getId()) - .collect(Collectors.toList()); - questHelperPlugin.saveSidebarOrder(currentQuest, newOrderIds); - } + List newOrderIds = allQuestStepPanelList.stream() + .map(AbstractQuestSection::getIds) + .flatMap(Collection::stream) + .collect(Collectors.toList()); - @Override public void mouseMoved(MouseEvent e) { } + questHelperPlugin.saveSidebarOrder(currentQuest, newOrderIds); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRequirementsPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRequirementsPanel.java index 91ff97ed0bf..27e547a1705 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRequirementsPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRequirementsPanel.java @@ -50,11 +50,8 @@ import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; +import java.util.*; import java.util.List; -import java.util.Map; public class QuestRequirementsPanel extends JPanel { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRewardsPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRewardsPanel.java index dbef8c712aa..42f5beab26d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRewardsPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestRewardsPanel.java @@ -58,7 +58,7 @@ public QuestRewardsPanel() rewardsText.setOpaque(false); rewardsText.setEditable(false); rewardsText.setFocusable(false); - rewardsText.setBackground(javax.swing.UIManager.getColor("Label.background")); + rewardsText.setBackground(UIManager.getColor("Label.background")); rewardsText.setFont(Fonts.getOriginalFont()); rewardsText.setBorder(new EmptyBorder(0, 0, 0, 0)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestSelectPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestSelectPanel.java index 0108e040a79..4ddfe98f472 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestSelectPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestSelectPanel.java @@ -58,21 +58,18 @@ public QuestSelectPanel(QuestHelperPlugin questHelperPlugin, QuestHelperPanel qu JLabel nameLabel = JGenerator.makeJLabel(questHelper.getQuest().getName()); Color color = questState == QuestState.FINISHED ? questHelperPlugin.getConfig().passColour() : (questState == QuestState.IN_PROGRESS ? - new Color(240,207, 123) : Color.WHITE); + new Color(240, 207, 123) : Color.WHITE); nameLabel.setForeground(color); add(nameLabel, BorderLayout.CENTER); - if (questState != QuestState.FINISHED) + JButton startButton = new JButton(); + startButton.setIcon(START_ICON); + startButton.addActionListener(e -> { - JButton startButton = new JButton(); - startButton.setIcon(START_ICON); - startButton.addActionListener(e -> - { - questHelperPanel.setSelectedQuest(questHelper); - questHelperPanel.emptyBar(); - }); - add(startButton, BorderLayout.LINE_END); - } + questHelperPanel.setSelectedQuest(questHelper); + questHelperPanel.emptyBar(); + }); + add(startButton, BorderLayout.LINE_END); } public QuestSelectPanel(String text) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestStepPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestStepPanel.java index 9e7ab9efdb9..290e67db96b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestStepPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/QuestStepPanel.java @@ -24,12 +24,12 @@ */ package net.runelite.client.plugins.microbot.questhelper.panel; +import lombok.Getter; +import net.runelite.api.Client; import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; import net.runelite.client.plugins.microbot.questhelper.managers.QuestManager; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; -import lombok.Getter; -import net.runelite.api.Client; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.FontManager; import net.runelite.client.util.SwingUtil; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/TopLevelPanelDetails.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/TopLevelPanelDetails.java new file mode 100644 index 00000000000..6945285280d --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/TopLevelPanelDetails.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.panel; + +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; + +// The intention is to contain a set of PanelDetails. +// This is intended to be the structure used for containing a reorderable set of PanelDetails +public class TopLevelPanelDetails extends PanelDetails +{ + @Getter + private final List panelDetails; + + public TopLevelPanelDetails(String header, PanelDetails... panelDetails) + { + super(header); + this.panelDetails = new ArrayList<>(List.of(panelDetails)); + } + + public void addPanelDetails(PanelDetails panelDetail) + { + panelDetails.add(panelDetail); + } + + @Override + public boolean contains(QuestStep questStep) + { + for (PanelDetails panelDetail : panelDetails) + { + if (panelDetail.contains(questStep)) return true; + } + + return false; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/IronmanOptimalQuestGuide.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/IronmanOptimalQuestGuide.java index 7906f898f78..b24beed088f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/IronmanOptimalQuestGuide.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/IronmanOptimalQuestGuide.java @@ -44,42 +44,46 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.THE_RESTLESS_GHOST, QuestHelperQuest.X_MARKS_THE_SPOT, QuestHelperQuest.WITCHS_POTION, - QuestHelperQuest.IMP_CATCHER, QuestHelperQuest.CLIENT_OF_KOUREND, - QuestHelperQuest.ROMEO__JULIET, + QuestHelperQuest.PANDEMONIUM, QuestHelperQuest.STRONGHOLD_OF_SECURITY, + QuestHelperQuest.CHILDREN_OF_THE_SUN, + QuestHelperQuest.ROMEO__JULIET, QuestHelperQuest.GERTRUDES_CAT, QuestHelperQuest.DADDYS_HOME, QuestHelperQuest.RUNE_MYSTERIES, QuestHelperQuest.TREE_GNOME_VILLAGE, - QuestHelperQuest.MONKS_FRIEND, QuestHelperQuest.HAZEEL_CULT, + QuestHelperQuest.CLOCK_TOWER, + QuestHelperQuest.MONKS_FRIEND, QuestHelperQuest.PLAGUE_CITY, QuestHelperQuest.BIOHAZARD, + QuestHelperQuest.DEMON_SLAYER, + QuestHelperQuest.ARDOUGNE_EASY, QuestHelperQuest.FIGHT_ARENA, - QuestHelperQuest.CLOCK_TOWER, QuestHelperQuest.SHEEP_HERDER, QuestHelperQuest.DWARF_CANNON, QuestHelperQuest.WATERFALL_QUEST, QuestHelperQuest.MURDER_MYSTERY, QuestHelperQuest.MERLINS_CRYSTAL, QuestHelperQuest.HOLY_GRAIL, + QuestHelperQuest.DORICS_QUEST, QuestHelperQuest.DRUIDIC_RITUAL, QuestHelperQuest.WITCHS_HOUSE, QuestHelperQuest.BELOW_ICE_MOUNTAIN, QuestHelperQuest.BLACK_KNIGHTS_FORTRESS, - QuestHelperQuest.RECRUITMENT_DRIVE, + QuestHelperQuest.PIRATES_TREASURE, QuestHelperQuest.OBSERVATORY_QUEST, QuestHelperQuest.PRIEST_IN_PERIL, - QuestHelperQuest.RAG_AND_BONE_MAN_I, QuestHelperQuest.NATURE_SPIRIT, + QuestHelperQuest.RECRUITMENT_DRIVE, QuestHelperQuest.ALFRED_GRIMHANDS_BARCRAWL, QuestHelperQuest.SCORPION_CATCHER, QuestHelperQuest.JUNGLE_POTION, QuestHelperQuest.VAMPYRE_SLAYER, QuestHelperQuest.A_PORCINE_OF_INTEREST, + QuestHelperQuest.RAG_AND_BONE_MAN_I, QuestHelperQuest.DEATH_PLATEAU, - QuestHelperQuest.GOBLIN_DIPLOMACY, QuestHelperQuest.THE_QUEEN_OF_THIEVES, QuestHelperQuest.THE_DEPTHS_OF_DESPAIR, QuestHelperQuest.MOUNTAIN_DAUGHTER, @@ -87,18 +91,19 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.TRIBAL_TOTEM, QuestHelperQuest.THE_DIG_SITE, QuestHelperQuest.THE_GOLEM, + QuestHelperQuest.RECIPE_FOR_DISASTER_START, QuestHelperQuest.THE_KNIGHTS_SWORD, - QuestHelperQuest.SLEEPING_GIANTS, QuestHelperQuest.ELEMENTAL_WORKSHOP_I, - QuestHelperQuest.RECIPE_FOR_DISASTER_START, - QuestHelperQuest.RECIPE_FOR_DISASTER_WARTFACE_AND_BENTNOZE, - QuestHelperQuest.DEMON_SLAYER, QuestHelperQuest.SHADOW_OF_THE_STORM, + QuestHelperQuest.PRYING_TIMES, + QuestHelperQuest.IMP_CATCHER, QuestHelperQuest.ELEMENTAL_WORKSHOP_II, - QuestHelperQuest.CHILDREN_OF_THE_SUN, QuestHelperQuest.THE_RIBBITING_TALE_OF_A_LILY_PAD_LABOUR_DISPUTE, QuestHelperQuest.LOST_CITY, QuestHelperQuest.FAIRYTALE_I__GROWING_PAINS, + QuestHelperQuest.GOBLIN_DIPLOMACY, + QuestHelperQuest.RECIPE_FOR_DISASTER_WARTFACE_AND_BENTNOZE, + QuestHelperQuest.SLEEPING_GIANTS, QuestHelperQuest.SHIELD_OF_ARRAV_BLACK_ARM_GANG, QuestHelperQuest.SHIELD_OF_ARRAV_PHOENIX_GANG, QuestHelperQuest.CREATURE_OF_FENKENSTRAIN, @@ -115,7 +120,6 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.ENTER_THE_ABYSS, QuestHelperQuest.WANTED, QuestHelperQuest.THE_FEUD, - QuestHelperQuest.DEATH_ON_THE_ISLE, QuestHelperQuest.TROLL_STRONGHOLD, QuestHelperQuest.TROLL_ROMANCE, QuestHelperQuest.DRAGON_SLAYER_I, @@ -123,22 +127,31 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.ERNEST_THE_CHICKEN, QuestHelperQuest.ANIMAL_MAGNETISM, QuestHelperQuest.SHILO_VILLAGE, - QuestHelperQuest.DORICS_QUEST, QuestHelperQuest.SPIRITS_OF_THE_ELID, QuestHelperQuest.ICTHLARINS_LITTLE_HELPER, + QuestHelperQuest.ETHICALLY_ACQUIRED_ANTIQUITIES, + QuestHelperQuest.TWILIGHTS_PROMISE, + QuestHelperQuest.DEATH_ON_THE_ISLE, QuestHelperQuest.RATCATCHERS, + QuestHelperQuest.THE_GARDEN_OF_DEATH, + QuestHelperQuest.ENLIGHTENED_JOURNEY, + QuestHelperQuest.BALLOON_TRANSPORT_CRAFTING_GUILD, + QuestHelperQuest.SEA_SLUG, + QuestHelperQuest.CURRENT_AFFAIRS, QuestHelperQuest.FISHING_CONTEST, QuestHelperQuest.RECIPE_FOR_DISASTER_DWARF, QuestHelperQuest.GHOSTS_AHOY, QuestHelperQuest.FORGETTABLE_TALE, QuestHelperQuest.GARDEN_OF_TRANQUILLITY, - QuestHelperQuest.ENLIGHTENED_JOURNEY, QuestHelperQuest.RECIPE_FOR_DISASTER_EVIL_DAVE, QuestHelperQuest.BIG_CHOMPY_BIRD_HUNTING, QuestHelperQuest.ZOGRE_FLESH_EATERS, + QuestHelperQuest.VARROCK_EASY, + QuestHelperQuest.DESERT_EASY, QuestHelperQuest.DARKNESS_OF_HALLOWVALE, QuestHelperQuest.TOWER_OF_LIFE, QuestHelperQuest.RECIPE_FOR_DISASTER_PIRATE_PETE, + QuestHelperQuest.FALADOR_EASY, QuestHelperQuest.TAI_BWO_WANNAI_TRIO, QuestHelperQuest.THE_TOURIST_TRAP, QuestHelperQuest.EADGARS_RUSE, @@ -149,12 +162,13 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.RECIPE_FOR_DISASTER_LUMBRIDGE_GUIDE, QuestHelperQuest.RECIPE_FOR_DISASTER_SKRACH_UGLOGWEE, QuestHelperQuest.HAUNTED_MINE, + QuestHelperQuest.KARAMJA_EASY, QuestHelperQuest.WATCHTOWER, QuestHelperQuest.PRINCE_ALI_RESCUE, QuestHelperQuest.CONTACT, QuestHelperQuest.THE_EYES_OF_GLOUPHRIE, QuestHelperQuest.TEMPLE_OF_THE_EYE, - QuestHelperQuest.SEA_SLUG, + QuestHelperQuest.BALLOON_TRANSPORT_VARROCK, QuestHelperQuest.OLAFS_QUEST, QuestHelperQuest.TEARS_OF_GUTHIX, QuestHelperQuest.TEMPLE_OF_IKOV, @@ -163,7 +177,6 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.THE_SLUG_MENACE, QuestHelperQuest.BETWEEN_A_ROCK, QuestHelperQuest.MONKEY_MADNESS_I, - QuestHelperQuest.ETHICALLY_ACQUIRED_ANTIQUITIES, QuestHelperQuest.COLD_WAR, QuestHelperQuest.THE_ASCENT_OF_ARCEUUS, QuestHelperQuest.EAGLES_PEAK, @@ -171,35 +184,29 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.SKIPPY_AND_THE_MOGRES, QuestHelperQuest.RAG_AND_BONE_MAN_II, QuestHelperQuest.LAIR_OF_TARN_RAZORLOR, - QuestHelperQuest.THE_GARDEN_OF_DEATH, QuestHelperQuest.RUM_DEAL, - QuestHelperQuest.PIRATES_TREASURE, QuestHelperQuest.CABIN_FEVER, - QuestHelperQuest.MEAT_AND_GREET, + QuestHelperQuest.HIS_FAITHFUL_SERVANTS, QuestHelperQuest.THE_GREAT_BRAIN_ROBBERY, + QuestHelperQuest.SCRAMBLED, QuestHelperQuest.THE_HAND_IN_THE_SAND, QuestHelperQuest.ENAKHRAS_LAMENT, + QuestHelperQuest.MEAT_AND_GREET, QuestHelperQuest.HEROES_QUEST, QuestHelperQuest.THRONE_OF_MISCELLANIA, QuestHelperQuest.ROYAL_TROUBLE, QuestHelperQuest.DESERT_TREASURE, - QuestHelperQuest.CURSE_OF_THE_EMPTY_LORD, - QuestHelperQuest.THE_GENERALS_SHADOW, - QuestHelperQuest.HIS_FAITHFUL_SERVANTS, QuestHelperQuest.A_TASTE_OF_HOPE, QuestHelperQuest.FAMILY_CREST, QuestHelperQuest.LEGENDS_QUEST, QuestHelperQuest.RECIPE_FOR_DISASTER_SIR_AMIK_VARZE, - QuestHelperQuest.ARDOUGNE_EASY, - QuestHelperQuest.DESERT_EASY, - QuestHelperQuest.FALADOR_EASY, + QuestHelperQuest.CURSE_OF_THE_EMPTY_LORD, + QuestHelperQuest.THE_GENERALS_SHADOW, QuestHelperQuest.FREMENNIK_EASY, QuestHelperQuest.KANDARIN_EASY, - QuestHelperQuest.KARAMJA_EASY, QuestHelperQuest.KOUREND_EASY, QuestHelperQuest.LUMBRIDGE_EASY, QuestHelperQuest.MORYTANIA_EASY, - QuestHelperQuest.VARROCK_EASY, QuestHelperQuest.WESTERN_EASY, QuestHelperQuest.WILDERNESS_EASY, QuestHelperQuest.ARDOUGNE_MEDIUM, @@ -211,7 +218,7 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.TALE_OF_THE_RIGHTEOUS, QuestHelperQuest.THE_FORSAKEN_TOWER, QuestHelperQuest.A_KINGDOM_DIVIDED, - QuestHelperQuest.TWILIGHTS_PROMISE, + QuestHelperQuest.THE_HEART_OF_DARKNESS, QuestHelperQuest.PERILOUS_MOON, QuestHelperQuest.RECIPE_FOR_DISASTER_MONKEY_AMBASSADOR, QuestHelperQuest.REGICIDE, @@ -234,17 +241,19 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.LUMBRIDGE_MEDIUM, QuestHelperQuest.MORYTANIA_MEDIUM, QuestHelperQuest.DEVIOUS_MINDS, + QuestHelperQuest.THE_FINAL_DAWN, + QuestHelperQuest.SHADOWS_OF_CUSTODIA, QuestHelperQuest.THE_PATH_OF_GLOUPHRIE, - QuestHelperQuest.THE_HEART_OF_DARKNESS, QuestHelperQuest.THE_FREMENNIK_EXILES, QuestHelperQuest.SINS_OF_THE_FATHER, QuestHelperQuest.BENEATH_CURSED_SANDS, + QuestHelperQuest.THE_CURSE_OF_ARRAV, QuestHelperQuest.MAKING_FRIENDS_WITH_MY_ARM, + QuestHelperQuest.TROUBLED_TORTUGANS, QuestHelperQuest.MONKEY_MADNESS_II, QuestHelperQuest.FREMENNIK_MEDIUM, QuestHelperQuest.A_NIGHT_AT_THE_THEATRE, QuestHelperQuest.DRAGON_SLAYER_II, - QuestHelperQuest.THE_CURSE_OF_ARRAV, QuestHelperQuest.SECRETS_OF_THE_NORTH, QuestHelperQuest.WHILE_GUTHIX_SLEEPS, QuestHelperQuest.SONG_OF_THE_ELVES, @@ -252,14 +261,9 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.THE_CORSAIR_CURSE, QuestHelperQuest.IN_SEARCH_OF_KNOWLEDGE, QuestHelperQuest.HOPESPEARS_WILL, - // Unsorted - QuestHelperQuest.THE_FINAL_DAWN, - QuestHelperQuest.SHADOWS_OF_CUSTODIA, - QuestHelperQuest.SCRAMBLED, // Quests & mini quests that are not part of the OSRS Wiki's Optimal Ironman Quest Guide - QuestHelperQuest.BALLOON_TRANSPORT_CRAFTING_GUILD, + QuestHelperQuest.VALE_TOTEMS, QuestHelperQuest.BALLOON_TRANSPORT_GRAND_TREE, - QuestHelperQuest.BALLOON_TRANSPORT_VARROCK, QuestHelperQuest.BALLOON_TRANSPORT_CASTLE_WARS, QuestHelperQuest.BARBARIAN_TRAINING, QuestHelperQuest.BEAR_YOUR_SOUL, @@ -267,7 +271,6 @@ public class IronmanOptimalQuestGuide QuestHelperQuest.FAMILY_PEST, QuestHelperQuest.THE_MAGE_ARENA, QuestHelperQuest.THE_MAGE_ARENA_II, - QuestHelperQuest.VALE_TOTEMS, QuestHelperQuest.DESERT_MEDIUM, QuestHelperQuest.WESTERN_MEDIUM, QuestHelperQuest.ARDOUGNE_HARD, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/OptimalQuestGuide.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/OptimalQuestGuide.java index cf346d647ea..1e2a0ce6478 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/OptimalQuestGuide.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/OptimalQuestGuide.java @@ -92,6 +92,9 @@ public class OptimalQuestGuide QuestHelperQuest.RECIPE_FOR_DISASTER_START, QuestHelperQuest.RECIPE_FOR_DISASTER_WARTFACE_AND_BENTNOZE, QuestHelperQuest.SEA_SLUG, + QuestHelperQuest.PANDEMONIUM, + QuestHelperQuest.PRYING_TIMES, + QuestHelperQuest.CURRENT_AFFAIRS, QuestHelperQuest.FISHING_CONTEST, QuestHelperQuest.RECIPE_FOR_DISASTER_DWARF, QuestHelperQuest.MOUNTAIN_DAUGHTER, @@ -224,6 +227,7 @@ public class OptimalQuestGuide QuestHelperQuest.THE_GENERALS_SHADOW, QuestHelperQuest.HIS_FAITHFUL_SERVANTS, QuestHelperQuest.THE_GREAT_BRAIN_ROBBERY, + QuestHelperQuest.SCRAMBLED, QuestHelperQuest.FAIRYTALE_II__CURE_A_QUEEN, QuestHelperQuest.RECIPE_FOR_DISASTER_MONKEY_AMBASSADOR, QuestHelperQuest.RECIPE_FOR_DISASTER_FINALE, @@ -247,6 +251,8 @@ public class OptimalQuestGuide QuestHelperQuest.IN_SEARCH_OF_KNOWLEDGE, QuestHelperQuest.HOPESPEARS_WILL, QuestHelperQuest.BENEATH_CURSED_SANDS, + QuestHelperQuest.SHADOWS_OF_CUSTODIA, + QuestHelperQuest.TROUBLED_TORTUGANS, QuestHelperQuest.MONKEY_MADNESS_II, //QuestHelperQuest.INTO_THE_TOMBS, - Placeholder for future addition. QuestHelperQuest.A_NIGHT_AT_THE_THEATRE, @@ -254,23 +260,20 @@ public class OptimalQuestGuide QuestHelperQuest.THE_CURSE_OF_ARRAV, QuestHelperQuest.MAKING_FRIENDS_WITH_MY_ARM, QuestHelperQuest.SECRETS_OF_THE_NORTH, + QuestHelperQuest.THE_FINAL_DAWN, QuestHelperQuest.WHILE_GUTHIX_SLEEPS, QuestHelperQuest.DESERT_TREASURE_II, QuestHelperQuest.SONG_OF_THE_ELVES, QuestHelperQuest.CLOCK_TOWER, QuestHelperQuest.THE_CORSAIR_CURSE, - // Unsorted - QuestHelperQuest.THE_FINAL_DAWN, - QuestHelperQuest.SHADOWS_OF_CUSTODIA, - QuestHelperQuest.SCRAMBLED, // Quests & mini quests that are not part of the OSRS Wiki's Optimal Quest Guide + QuestHelperQuest.VALE_TOTEMS, QuestHelperQuest.BARBARIAN_TRAINING, QuestHelperQuest.BEAR_YOUR_SOUL, QuestHelperQuest.ENCHANTED_KEY, QuestHelperQuest.FAMILY_PEST, QuestHelperQuest.THE_MAGE_ARENA, QuestHelperQuest.THE_MAGE_ARENA_II, - QuestHelperQuest.VALE_TOTEMS, QuestHelperQuest.ARDOUGNE_HARD, QuestHelperQuest.DESERT_HARD, QuestHelperQuest.FALADOR_HARD, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/ReleaseDate.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/ReleaseDate.java index e1350cd9362..45dac69e04b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/ReleaseDate.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/questorders/ReleaseDate.java @@ -219,6 +219,13 @@ public class ReleaseDate QuestHelperQuest.MEAT_AND_GREET, QuestHelperQuest.ETHICALLY_ACQUIRED_ANTIQUITIES, QuestHelperQuest.THE_CURSE_OF_ARRAV, + QuestHelperQuest.THE_FINAL_DAWN, + QuestHelperQuest.SHADOWS_OF_CUSTODIA, + QuestHelperQuest.SCRAMBLED, + QuestHelperQuest.PANDEMONIUM, + QuestHelperQuest.PRYING_TIMES, + QuestHelperQuest.CURRENT_AFFAIRS, + QuestHelperQuest.TROUBLED_TORTUGANS, // Miniquests QuestHelperQuest.ALFRED_GRIMHANDS_BARCRAWL, QuestHelperQuest.THE_MAGE_ARENA, @@ -238,9 +245,6 @@ public class ReleaseDate QuestHelperQuest.HOPESPEARS_WILL, //QuestHelperQuest.INTO_THE_TOMBS, - Placeholder for future addition. QuestHelperQuest.HIS_FAITHFUL_SERVANTS, - QuestHelperQuest.THE_FINAL_DAWN, - QuestHelperQuest.SHADOWS_OF_CUSTODIA, - QuestHelperQuest.SCRAMBLED, QuestHelperQuest.VALE_TOTEMS ); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/AbstractQuestSection.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/AbstractQuestSection.java new file mode 100644 index 00000000000..85251329c00 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/AbstractQuestSection.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.panel.queststepsection; + +import net.runelite.client.plugins.microbot.questhelper.panel.JGenerator; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.api.Client; + +import javax.swing.*; +import java.util.List; + +public abstract class AbstractQuestSection extends JPanel +{ + protected final JPanel headerPanel = new JPanel(); + protected final JTextPane headerLabel = JGenerator.makeJTextPane(); + protected final JPanel bodyPanel = new JPanel(); + protected final JCheckBox lockStep = new JCheckBox(); + + protected JPanel leftTitleContainer; + protected JPanel viewControls; + + protected PanelDetails panelDetails; + + + public abstract boolean updateStepVisibility(Client client); + + protected abstract QuestStep currentlyActiveQuestSidebarStep(); + + public abstract void setLockable(boolean canLock); + + public abstract boolean updateHighlightCheck(Client client, QuestStep newStep, QuestHelper currentQuest); + + public abstract void removeHighlight(); + + public abstract void updateLock(); + + protected abstract void lockSection(boolean locked); + + protected abstract void collapse(); + + protected abstract void expand(); + + public abstract boolean isCollapsed(); + + protected abstract void applyDimmer(boolean brighten, JPanel panel); + + public abstract void updateRequirements(Client client); + + public abstract void updateAllText(); + + public abstract List getIds(); +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/QuestSectionSection.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/QuestSectionSection.java new file mode 100644 index 00000000000..af26014f442 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/QuestSectionSection.java @@ -0,0 +1,561 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.panel.queststepsection; + +import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; +import net.runelite.client.plugins.microbot.questhelper.managers.QuestManager; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.panel.QuestOverviewPanel; +import net.runelite.client.plugins.microbot.questhelper.panel.TopLevelPanelDetails; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.api.Client; +import net.runelite.client.ui.ColorScheme; +import net.runelite.client.ui.FontManager; +import net.runelite.client.util.ImageUtil; +import net.runelite.client.util.SwingUtil; + +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.*; +import java.util.List; +import java.util.stream.Collectors; + +public class QuestSectionSection extends AbstractQuestSection implements MouseListener +{ + // Idea is to contain multiple sections or queststeppanel + private static final int TITLE_PADDING = 5; + private static final ImageIcon DRAG_ICON = new ImageIcon(ImageUtil.loadImageResource(QuestHelperPlugin.class, "/hamburger.png")); + + private final QuestOverviewPanel questOverviewPanel; + private final QuestHelperPlugin questHelperPlugin; + + private final JPanel stepsPanel = new JPanel(); + + private final List subPanels = new ArrayList<>(); + + private boolean stepAutoLocked; + private final QuestHelper questHelper; + private AbstractQuestSection lastHighlightedSection = null; + private final boolean draggable; + public QuestSectionSection(QuestOverviewPanel questOverviewPanel, TopLevelPanelDetails panelDetails, QuestStep currentStep, QuestManager questManager, QuestHelperPlugin questHelperPlugin) + { + this.questOverviewPanel = questOverviewPanel; + this.panelDetails = panelDetails; + this.questHelperPlugin = questHelperPlugin; + this.questHelper = questManager.getSelectedQuest(); + + setLayout(new BorderLayout(0, 1)); + setBorder(new EmptyBorder(5, 0, 0, 0)); + + leftTitleContainer = new JPanel(new BorderLayout(5, 0)); + + headerLabel.addMouseListener(this); + addMouseListener(this); + + headerLabel.setText(panelDetails.getHeader()); + headerLabel.setFont(FontManager.getRunescapeBoldFont()); + + headerLabel.setMinimumSize(new Dimension(1, headerLabel.getPreferredSize().height)); + + headerPanel.setLayout(new BoxLayout(headerPanel, BoxLayout.X_AXIS)); + headerPanel.setBorder(new EmptyBorder(7, 7, 3, 7)); + + headerPanel.add(Box.createRigidArea(new Dimension(TITLE_PADDING, 0))); + leftTitleContainer.add(headerLabel, BorderLayout.CENTER); + headerPanel.add(leftTitleContainer, BorderLayout.WEST); + + viewControls = new JPanel(new GridLayout(1, 3, 10, 0)); + + SwingUtil.addModalTooltip(lockStep, "Mark section as incomplete", "Mark section as complete"); + lockStep.setBackground(ColorScheme.DARKER_GRAY_COLOR); + lockStep.addActionListener(ev -> lockSection(lockStep.isSelected())); + lockStep.setVisible(false); + headerPanel.add(lockStep, BorderLayout.EAST); + + viewControls.add(lockStep); + + headerPanel.add(viewControls, BorderLayout.EAST); + + if (panelDetails.contains(currentStep)) + { + headerLabel.setForeground(Color.BLACK); + headerPanel.setBackground(ColorScheme.BRAND_ORANGE); + viewControls.setBackground(ColorScheme.BRAND_ORANGE); + leftTitleContainer.setBackground(ColorScheme.BRAND_ORANGE); + } + else + { + headerLabel.setForeground(Color.WHITE); + headerPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + viewControls.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + leftTitleContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + } + + /* Body */ + stepsPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); + stepsPanel.setLayout(new BoxLayout(stepsPanel, BoxLayout.Y_AXIS)); + stepsPanel.setBorder(new EmptyBorder(10, 5, 10, 5)); + + // Dragging functionality + this.draggable = panelDetails.getPanelDetails().stream().anyMatch((pDetails -> pDetails.getId() != -1)); + List order = questHelperPlugin.loadSidebarOrder(questManager.getSelectedQuest()); + + List panelDetailsList = panelDetails.getPanelDetails(); + + if (draggable && order != null) + { + Map idx = new HashMap<>(); + for (int i = 0; i < order.size(); i++) + { + idx.put(order.get(i), i); + } + + panelDetailsList.sort(Comparator.comparingInt( + pd -> idx.getOrDefault(pd.getId(), Integer.MAX_VALUE) + )); + } + + for (PanelDetails panelDetail : panelDetailsList) + { + AbstractQuestSection newSection; + if (panelDetail instanceof TopLevelPanelDetails) + { + var topLevelPanelDetails = (TopLevelPanelDetails) panelDetail; + newSection = new QuestSectionSection(questOverviewPanel, topLevelPanelDetails, currentStep, questManager, questHelperPlugin); + } + else + { + newSection = new QuestStepPanel(panelDetail, currentStep, questManager, questHelperPlugin); + } + + if (panelDetail.getLockingQuestSteps() != null && + (panelDetail.getVars() == null + || questManager.getSelectedQuest() == null + || panelDetail.getVars().contains(questManager.getSelectedQuest().getVar()))) + { + newSection.setLockable(true); + } + + stepsPanel.add(newSection); + subPanels.add(newSection); + + if (draggable) makeDraggable(newSection); + } + + + add(headerPanel, BorderLayout.NORTH); + add(stepsPanel, BorderLayout.CENTER); + + if (!panelDetails.getSteps().contains(currentStep)) + { + collapse(); + } + + // Setup right-click context menu for resetting order + if (draggable) + { + setupContextMenu(); + } + } + + private void setupContextMenu() + { + JPopupMenu contextMenu = new JPopupMenu(); + JMenuItem resetOrderItem = new JMenuItem("Reset order"); + resetOrderItem.addActionListener(e -> resetSectionOrder()); + contextMenu.add(resetOrderItem); + + headerPanel.setComponentPopupMenu(contextMenu); + headerLabel.setComponentPopupMenu(contextMenu); + } + + private void resetSectionOrder() + { + if (questHelper == null) return; + + List sectionIds = getIds(); + questHelperPlugin.resetSidebarOrderForSection(questHelper, sectionIds); + } + + @Override + public void mouseClicked(MouseEvent e) + { + if (e.getButton() == MouseEvent.BUTTON1) + { + if (isCollapsed()) + { + expand(); + } + else + { + collapse(); + } + } + } + + @Override + public void mousePressed(MouseEvent mouseEvent) + { + } + + @Override + public void mouseReleased(MouseEvent mouseEvent) + { + } + + @Override + public void mouseEntered(MouseEvent mouseEvent) + { + } + + @Override + public void mouseExited(MouseEvent mouseEvent) + { + } + + public boolean updateStepVisibility(Client client) + { + boolean stepVisibilityChanged = false; + + for (AbstractQuestSection questSectionPanel : subPanels) + { + if (questSectionPanel.updateStepVisibility(client)) stepVisibilityChanged = true; + } + + if (stepVisibilityChanged) + { + updateHighlightCheck(client, currentlyActiveQuestSidebarStep(), questHelper); + } + + return stepVisibilityChanged; + } + + protected QuestStep currentlyActiveQuestSidebarStep() + { + var selectedQuest = questHelperPlugin.getSelectedQuest(); + if (selectedQuest == null) return null; + var currentStep = selectedQuest.getCurrentStep(); + return currentStep.getActiveStep(); + } + + public void setLockable(boolean canLock) + { + lockStep.setVisible(canLock); + } + + public boolean updateHighlightCheck(Client client, QuestStep newStep, QuestHelper currentQuest) + { + if (panelDetails.getHideCondition() == null || !panelDetails.getHideCondition().check(client)) + { + setVisible(true); + boolean highlighted = false; + setLockable(panelDetails.getLockingQuestSteps() != null && + (panelDetails.getVars() == null || panelDetails.getVars().contains(currentQuest.getVar()))); + + for (AbstractQuestSection panel : subPanels) + { + if (panel.updateHighlightCheck(client, newStep, currentQuest)) + { + highlighted = true; + lastHighlightedSection = panel; + } + } + + if (!highlighted) + { + removeHighlight(); + } + else + { + updateHighlight(); + } + + return highlighted; + } + else + { + setVisible(false); + return false; + } + } + + + public void updateHighlight() + { + expand(); + + headerLabel.setForeground(Color.BLACK); + headerPanel.setBackground(ColorScheme.BRAND_ORANGE); + viewControls.setBackground(ColorScheme.BRAND_ORANGE); + leftTitleContainer.setBackground(ColorScheme.BRAND_ORANGE); + } + + public void removeHighlight() + { + headerLabel.setForeground(Color.WHITE); + if (isCollapsed()) + { + applyDimmer(false, headerPanel); + } + + headerPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + viewControls.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + leftTitleContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + + + if (lastHighlightedSection != null) + { + lastHighlightedSection.removeHighlight(); + } + + collapse(); + } + + public void updateLock() + { + if (panelDetails.getLockingQuestSteps() == null) + { + return; + } + + if (panelDetails.getLockingQuestSteps().isUnlockable()) + { + stepAutoLocked = false; + lockStep.setEnabled(true); + } + else + { + if (!stepAutoLocked) + { + collapse(); + } + stepAutoLocked = true; + lockStep.setEnabled(false); + } + + if (panelDetails.getLockingQuestSteps().isLocked()) + { + lockStep.setSelected(true); + } + } + + protected void lockSection(boolean locked) + { + if (locked) + { + panelDetails.getLockingQuestSteps().setLockedManually(true); + if (!isCollapsed()) + { + collapse(); + } + } + else + { + panelDetails.getLockingQuestSteps().setLockedManually(false); + if (isCollapsed()) + { + expand(); + } + } + } + + protected void collapse() + { + if (!isCollapsed()) + { + stepsPanel.setVisible(false); + applyDimmer(false, headerPanel); + } + } + + protected void expand() + { + if (isCollapsed()) + { + stepsPanel.setVisible(true); + applyDimmer(true, headerPanel); + } + } + + public boolean isCollapsed() + { + return !stepsPanel.isVisible(); + } + + protected void applyDimmer(boolean brighten, JPanel panel) + { + for (Component component : panel.getComponents()) + { + Color color = component.getForeground(); + component.setForeground(brighten ? color.brighter() : color.darker()); + } + } + + public void updateRequirements(Client client) + { + for (AbstractQuestSection subPanel : subPanels) + { + subPanel.updateRequirements(client); + } + updateStepVisibility(client); + } + + @Override + public void updateAllText() + { + for (AbstractQuestSection subPanel : subPanels) + { + subPanel.updateAllText(); + } + } + + public HashMap getStepsLabels() + { + return new HashMap<>(); + } + + private void makeDraggable(AbstractQuestSection newStep) + { + JLabel grip = new JLabel(DRAG_ICON); + grip.setBorder(new EmptyBorder(0, 0, 3, 0)); + grip.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); + + GripDragListener listener = new GripDragListener(newStep); + grip.addMouseListener(listener); + grip.addMouseMotionListener(listener); + + newStep.leftTitleContainer.add(grip, BorderLayout.WEST); + } + + private void swapPanels(AbstractQuestSection a, AbstractQuestSection b) + { + int ia = subPanels.indexOf(a); + int ib = subPanels.indexOf(b); + if (ia < 0 || ib < 0) return; + + Collections.swap(subPanels, ia, ib); + + stepsPanel.removeAll(); + // Create again in new order + for (AbstractQuestSection p : subPanels) + { + stepsPanel.add(p); + } + revalidate(); + repaint(); + } + + public List getIds() + { + List allIds = new ArrayList<>(); + if (panelDetails.getId() != -1) allIds.add(panelDetails.getId()); + + allIds.addAll(subPanels.stream() + .map(AbstractQuestSection::getIds) + .flatMap(Collection::stream) + .collect(Collectors.toList())); + return allIds; + } + + private class GripDragListener extends MouseAdapter implements MouseMotionListener + { + private final AbstractQuestSection panel; + + private AbstractQuestSection draggingPanel = null; + + + GripDragListener(AbstractQuestSection panel) + { + this.panel = panel; + } + + @Override + public void mousePressed(MouseEvent e) + { + if (e.getButton() != MouseEvent.BUTTON1) + { + return; + } + draggingPanel = panel; + } + + @Override + public void mouseDragged(MouseEvent e) + { + if (draggingPanel == null) return; + + // Convert mouse position to coordinates relative to stepsPanel + // This ensures scrolling doesn't affect the drag calculations + Point mousePoint = e.getLocationOnScreen(); + SwingUtilities.convertPointFromScreen(mousePoint, stepsPanel); + int currentY = mousePoint.y; + + for (AbstractQuestSection other : subPanels) + { + if (other == draggingPanel) continue; + + Rectangle r = other.getBounds(); + // Use bounds relative to stepsPanel, not screen coordinates + int midY = r.y + r.height / 2; + + int fromIndex = subPanels.indexOf(draggingPanel); + int toIndex = subPanels.indexOf(other); + + // dragged down + if (fromIndex < toIndex && currentY > midY) + { + swapPanels(draggingPanel, other); + break; + } + // dragged up + else if (fromIndex > toIndex && currentY < midY) + { + swapPanels(draggingPanel, other); + break; + } + } + } + + @Override + public void mouseReleased(MouseEvent e) + { + if (e.getButton() != MouseEvent.BUTTON1) + { + return; + } + draggingPanel = null; + + questOverviewPanel.saveSidebar(); + } + + @Override public void mouseMoved(MouseEvent e) { } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/QuestStepPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/QuestStepPanel.java new file mode 100644 index 00000000000..5665aca9eec --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/panel/queststepsection/QuestStepPanel.java @@ -0,0 +1,505 @@ +/* + * Copyright (c) 2020, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.panel.queststepsection; + +import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; +import net.runelite.client.plugins.microbot.questhelper.managers.QuestManager; +import net.runelite.client.plugins.microbot.questhelper.panel.JGenerator; +import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; +import net.runelite.client.plugins.microbot.questhelper.panel.QuestRequirementsPanel; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.steps.PortTaskStep; +import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import net.runelite.api.Client; +import net.runelite.client.ui.ColorScheme; +import net.runelite.client.ui.FontManager; +import net.runelite.client.util.SwingUtil; + +import javax.annotation.Nullable; +import javax.swing.*; +import javax.swing.border.EmptyBorder; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; + +public class QuestStepPanel extends AbstractQuestSection implements MouseListener +{ + private static final int TITLE_PADDING = 5; + + private final QuestHelperPlugin questHelperPlugin; + private final HashMap steps = new HashMap<>(); + private final @Nullable QuestRequirementsPanel requiredItemsPanel; + private final @Nullable QuestRequirementsPanel recommendedItemsPanel; + private boolean stepAutoLocked; + private final QuestHelper questHelper; + private QuestStep lastHighlightedStep = null; + + public QuestStepPanel(PanelDetails panelDetails, QuestStep currentStep, QuestManager questManager, QuestHelperPlugin questHelperPlugin) + { + this.panelDetails = panelDetails; + this.questHelperPlugin = questHelperPlugin; + this.questHelper = questManager.getSelectedQuest(); + + setLayout(new BorderLayout(0, 1)); + setBorder(new EmptyBorder(5, 0, 0, 0)); + + leftTitleContainer = new JPanel(new BorderLayout(5, 0)); + + headerLabel.addMouseListener(this); + addMouseListener(this); + + headerLabel.setText(panelDetails.getHeader()); + headerLabel.setFont(FontManager.getRunescapeBoldFont()); + + headerLabel.setMinimumSize(new Dimension(1, headerLabel.getPreferredSize().height)); + + headerPanel.setLayout(new BoxLayout(headerPanel, BoxLayout.X_AXIS)); + headerPanel.setBorder(new EmptyBorder(7, 7, 3, 7)); + + headerPanel.add(Box.createRigidArea(new Dimension(TITLE_PADDING, 0))); + leftTitleContainer.add(headerLabel, BorderLayout.CENTER); + headerPanel.add(leftTitleContainer, BorderLayout.WEST); + + viewControls = new JPanel(new GridLayout(1, 3, 10, 0)); + + SwingUtil.addModalTooltip(lockStep, "Mark section as incomplete", "Mark section as complete"); + lockStep.setBackground(ColorScheme.DARKER_GRAY_COLOR); + lockStep.addActionListener(ev -> lockSection(lockStep.isSelected())); + lockStep.setVisible(false); + headerPanel.add(lockStep, BorderLayout.EAST); + + viewControls.add(lockStep); + + headerPanel.add(viewControls, BorderLayout.EAST); + + if (panelDetails.contains(currentStep)) + { + headerLabel.setForeground(Color.BLACK); + headerPanel.setBackground(ColorScheme.BRAND_ORANGE); + viewControls.setBackground(ColorScheme.BRAND_ORANGE); + leftTitleContainer.setBackground(ColorScheme.BRAND_ORANGE); + } + else + { + headerLabel.setForeground(Color.WHITE); + headerPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + viewControls.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + leftTitleContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + } + + /* Body */ + bodyPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); + bodyPanel.setLayout(new BorderLayout()); + bodyPanel.setBorder(new EmptyBorder(10, 5, 10, 5)); + + if (panelDetails.getRequirements() != null) + { + requiredItemsPanel = new QuestRequirementsPanel("Bring the following items:", panelDetails.getRequirements(), questManager, false); + bodyPanel.add(requiredItemsPanel, BorderLayout.NORTH); + } + else + { + requiredItemsPanel = null; + } + + if (panelDetails.getRecommended() != null) + { + recommendedItemsPanel = new QuestRequirementsPanel("Optionally bring the following items:", panelDetails.getRecommended(), questManager, + false); + bodyPanel.add(recommendedItemsPanel, BorderLayout.CENTER); + } + else + { + recommendedItemsPanel = null; + } + + JPanel questStepsPanel = new JPanel(); + questStepsPanel.setLayout(new BoxLayout(questStepsPanel, BoxLayout.Y_AXIS)); + questStepsPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); + + for (QuestStep step : panelDetails.getSteps()) + { + if(step instanceof PortTaskStep) + { + for (QuestStep step2 : ((PortTaskStep) step).getStepsList()) + { + JTextPane questStepLabel = createQuestStepLabel(step2); + steps.put(step2, questStepLabel); + questStepsPanel.add(questStepLabel); + } + }else{ + JTextPane questStepLabel = createQuestStepLabel(step); + steps.put(step, questStepLabel); + questStepsPanel.add(questStepLabel); + } + } + + bodyPanel.add(questStepsPanel, BorderLayout.SOUTH); + + add(headerPanel, BorderLayout.NORTH); + add(bodyPanel, BorderLayout.CENTER); + + if (!panelDetails.getSteps().contains(currentStep)) + { + collapse(); + } + } + + private JTextPane createQuestStepLabel(QuestStep step){ + JTextPane questStepLabel = JGenerator.makeJTextPane(); + questStepLabel.setLayout(new BorderLayout()); + questStepLabel.setAlignmentX(SwingConstants.LEFT); + questStepLabel.setAlignmentY(SwingConstants.TOP); + questStepLabel.setBackground(ColorScheme.DARKER_GRAY_COLOR); + questStepLabel.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createMatteBorder(1, 0, 1, 0, ColorScheme.DARK_GRAY_COLOR.brighter()), + BorderFactory.createEmptyBorder(5, 5, 10, 0) + )); + questStepLabel.setText(generateText(step)); + questStepLabel.setOpaque(true); + questStepLabel.setVisible(step.isShowInSidebar()); + return questStepLabel; + } + + public void updateAllText() + { + steps.forEach((questStep, textPane) -> { + if (textPane != null) + { + String newText = generateText(questStep); + String oldText = textPane.getText(); + + if (!newText.equals(oldText)) + { + textPane.setText(newText); + } + } + }); + } + + public String generateText(QuestStep step) + { + StringBuilder text = new StringBuilder(); + QuestStep textStep = step; + if (textStep.getText() != null) + { + var first = true; + for (var line : textStep.getText()) + { + if (!first) + { + text.append("\n\n"); + } + text.append(line); + first = false; + } + } + + return text.toString(); + } + + public List getSteps() + { + return new ArrayList<>(steps.keySet()); + } + + public void setLockable(boolean canLock) + { + lockStep.setVisible(canLock); + } + + public boolean updateHighlightCheck(Client client, QuestStep newStep, QuestHelper currentQuest) + { + if (panelDetails.getHideCondition() == null || !panelDetails.getHideCondition().check(client)) + { + setVisible(true); + boolean highlighted = false; + setLockable(panelDetails.getLockingQuestSteps() != null && + (panelDetails.getVars() == null || panelDetails.getVars().contains(currentQuest.getVar()))); + + for (QuestStep sidebarStep : getSteps()) + { + if (sidebarStep.getConditionToHide() != null && sidebarStep.getConditionToHide().check(client)) continue; + + if (sidebarStep.getFadeCondition() != null) + { + if (sidebarStep.getFadeCondition().check(client)) + { + updateTextToFaded(sidebarStep); + } + else + { + updateTextToUnfaded(sidebarStep); + } + } + + if (!highlighted && sidebarStep.containsSteps(newStep, new HashSet<>())) + { + highlighted = true; + updateHighlight(sidebarStep); + } + } + + if (!highlighted) + { + removeHighlight(); + } + + return highlighted; + } + else + { + setVisible(false); + return false; + } + } + + public void updateTextToFaded(QuestStep questStep) + { + if (steps.get(questStep) != null) + { + steps.get(questStep).setForeground(Color.DARK_GRAY); + steps.get(questStep).setToolTipText(questStep.getFadeCondition().getDisplayText()); + } + } + + public void updateTextToUnfaded(QuestStep questStep) + { + if (steps.get(questStep) != null) + { + steps.get(questStep).setForeground(Color.LIGHT_GRAY); + steps.get(questStep).setToolTipText(null); + } + } + + public void updateHighlight(QuestStep currentStep) + { + expand(); + + if (steps.get(lastHighlightedStep) != null) + { + steps.get(lastHighlightedStep).setForeground(Color.LIGHT_GRAY); + } + + if (steps.get(currentStep) != null) + { + steps.get(currentStep).setForeground(ColorScheme.BRAND_ORANGE); + headerLabel.setForeground(Color.BLACK); + headerPanel.setBackground(ColorScheme.BRAND_ORANGE); + viewControls.setBackground(ColorScheme.BRAND_ORANGE); + leftTitleContainer.setBackground(ColorScheme.BRAND_ORANGE); + } + + lastHighlightedStep = currentStep; + } + + public void removeHighlight() + { + headerLabel.setForeground(Color.WHITE); + if (isCollapsed()) + { + applyDimmer(false, headerPanel); + } + headerPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + viewControls.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + leftTitleContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR.darker()); + if (steps.get(currentlyActiveQuestSidebarStep()) != null) + { + steps.get(currentlyActiveQuestSidebarStep()).setForeground(Color.LIGHT_GRAY); + } + + collapse(); + } + + public void updateLock() + { + if (panelDetails.getLockingQuestSteps() == null) + { + return; + } + + if (panelDetails.getLockingQuestSteps().isUnlockable()) + { + stepAutoLocked = false; + lockStep.setEnabled(true); + } + else + { + if (!stepAutoLocked) + { + collapse(); + } + stepAutoLocked = true; + lockStep.setEnabled(false); + } + + if (panelDetails.getLockingQuestSteps().isLocked()) + { + lockStep.setSelected(true); + } + } + + protected void lockSection(boolean locked) + { + if (locked) + { + panelDetails.getLockingQuestSteps().setLockedManually(true); + if (!isCollapsed()) + { + collapse(); + } + } + else + { + panelDetails.getLockingQuestSteps().setLockedManually(false); + if (isCollapsed()) + { + expand(); + } + } + } + + protected void collapse() + { + if (!isCollapsed()) + { + bodyPanel.setVisible(false); + applyDimmer(false, headerPanel); + } + } + + protected void expand() + { + if (isCollapsed()) + { + bodyPanel.setVisible(true); + applyDimmer(true, headerPanel); + } + } + + public boolean isCollapsed() + { + return !bodyPanel.isVisible(); + } + + protected void applyDimmer(boolean brighten, JPanel panel) + { + for (Component component : panel.getComponents()) + { + Color color = component.getForeground(); + component.setForeground(brighten ? color.brighter() : color.darker()); + } + } + + public void updateRequirements(Client client) + { + if (requiredItemsPanel != null) + { + requiredItemsPanel.update(client, questHelperPlugin); + } + + if (recommendedItemsPanel != null) + { + recommendedItemsPanel.update(client, questHelperPlugin); + } + + updateStepVisibility(client); + } + + public boolean updateStepVisibility(Client client) + { + boolean stepVisibilityChanged = false; + for (QuestStep step : steps.keySet()) + { + boolean oldVisibility = step.isShowInSidebar(); + boolean newVisibility = step.getConditionToHide() == null || !step.getConditionToHide().check(client); + stepVisibilityChanged = stepVisibilityChanged || (oldVisibility != newVisibility); + + step.setShowInSidebar(newVisibility); + steps.get(step).setVisible(newVisibility); + } + + if (stepVisibilityChanged) + { + updateHighlightCheck(client, currentlyActiveQuestSidebarStep(), questHelper); + } + + return stepVisibilityChanged; + } + + protected QuestStep currentlyActiveQuestSidebarStep() + { + var selectedQuest = questHelperPlugin.getSelectedQuest(); + if (selectedQuest == null) return null; + var currentStep = selectedQuest.getCurrentStep(); + return currentStep.getActiveStep(); + } + + public List getIds() + { + if (panelDetails.getId() == -1) return List.of(); + return List.of(panelDetails.getId()); + } + + @Override + public void mouseClicked(MouseEvent e) + { + if (e.getButton() == MouseEvent.BUTTON1) + { + if (isCollapsed()) + { + expand(); + } + else + { + collapse(); + } + } + } + + @Override + public void mousePressed(MouseEvent mouseEvent) + { + } + + @Override + public void mouseReleased(MouseEvent mouseEvent) + { + } + + @Override + public void mouseEntered(MouseEvent mouseEvent) + { + } + + @Override + public void mouseExited(MouseEvent mouseEvent) + { + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/bikeshedder/BikeShedder.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/bikeshedder/BikeShedder.java index 31cf0efb50e..552e6bcaadf 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/bikeshedder/BikeShedder.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/bikeshedder/BikeShedder.java @@ -25,6 +25,12 @@ package net.runelite.client.plugins.microbot.questhelper.playerquests.bikeshedder; import com.google.common.collect.ImmutableMap; +import net.runelite.api.Skill; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.ObjectID; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.collections.TeleportCollections; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; @@ -40,12 +46,6 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.*; import net.runelite.client.plugins.microbot.questhelper.steps.widget.NormalSpells; -import net.runelite.api.Skill; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.InterfaceID; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; import java.util.ArrayList; import java.util.Arrays; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/cookshelper/CooksHelper.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/cookshelper/CooksHelper.java index 3c084ebef07..50bc5a9b56f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/cookshelper/CooksHelper.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/playerquests/cookshelper/CooksHelper.java @@ -24,6 +24,11 @@ */ package net.runelite.client.plugins.microbot.questhelper.playerquests.cookshelper; +import net.runelite.api.QuestState; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ItemID; +import net.runelite.api.gameval.NpcID; +import net.runelite.api.gameval.ObjectID; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.PlayerMadeQuestHelper; import net.runelite.client.plugins.microbot.questhelper.questinfo.QuestHelperQuest; @@ -48,11 +53,6 @@ import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.TileStep; import net.runelite.client.plugins.microbot.questhelper.steps.playermadesteps.RuneliteObjectStep; -import net.runelite.api.QuestState; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.ItemID; -import net.runelite.api.gameval.NpcID; -import net.runelite.api.gameval.ObjectID; import java.util.ArrayList; import java.util.Arrays; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/BasicQuestHelper.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/BasicQuestHelper.java index 2d16a78f35a..299e2944126 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/BasicQuestHelper.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/BasicQuestHelper.java @@ -27,6 +27,7 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; +import lombok.Getter; import java.util.ArrayList; import java.util.List; @@ -37,10 +38,20 @@ public abstract class BasicQuestHelper extends QuestHelper protected Map steps; protected int var; - public Map getStepList() { + @Getter + protected Integer selectedStateOverride = null; + + public Map getStepList() + { return this.steps; } + public void setSelectedStateOverride(Integer state) + { + this.selectedStateOverride = state; + questHelperPlugin.getClientThread().invokeLater(this::updateQuest); + } + /** * Attempt to load steps from the quest if steps have not yet been loaded */ @@ -82,9 +93,10 @@ public void shutDown() @Override public boolean updateQuest() { - if (var != getVar()) + int targetVar = selectedStateOverride != null ? selectedStateOverride : getVar(); + if (var != targetVar) { - var = getVar(); + var = targetVar; shutDownStep(); startUpStep(steps.get(var)); return true; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/QuestHelper.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/QuestHelper.java index 99276e9fad3..18a590d939a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/QuestHelper.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questhelpers/QuestHelper.java @@ -30,7 +30,6 @@ import com.google.inject.Module; import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.panel.PanelDetails; import net.runelite.client.plugins.microbot.questhelper.questinfo.ExternalQuestResources; import net.runelite.client.plugins.microbot.questhelper.questinfo.HelperConfig; @@ -39,6 +38,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.rewards.*; import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects.RuneliteObjectManager; +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; import net.runelite.client.plugins.microbot.questhelper.steps.OwnerStep; import net.runelite.client.plugins.microbot.questhelper.steps.QuestStep; import lombok.Getter; @@ -70,9 +70,6 @@ public abstract class QuestHelper implements Module, QuestDebugRenderer @Inject protected RuneliteObjectManager runeliteObjectManager; - @Inject - protected QuestBank questBank; - @Getter @Setter protected QuestHelperConfig config; @@ -100,6 +97,8 @@ public abstract class QuestHelper implements Module, QuestDebugRenderer @Setter protected List sidebarOrder; + protected QuestState lastQuestState; + @Override public void configure(Binder binder) { @@ -133,6 +132,13 @@ protected void startUpStep(QuestStep step) currentStep.startUp(); eventBus.register(currentStep); } + else if (!hasQuestStateBecomeFinished() && getState(client) == QuestState.FINISHED) + { + currentStep = new DetailedQuestStep(this, "Quest completed!"); + instantiateStep(currentStep); + currentStep.startUp(); + eventBus.register(currentStep); + } else { currentStep = null; @@ -225,6 +231,15 @@ public int getVar() return quest.getVar(client); } + public boolean hasQuestStateBecomeFinished() + { + var currentQuestState = getState(client); + if (lastQuestState == null) lastQuestState = currentQuestState; + boolean questStateEnteredFinished = currentQuestState == QuestState.FINISHED && lastQuestState != QuestState.FINISHED; + lastQuestState = currentQuestState; + return questStateEnteredFinished; + } + public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/ExternalQuestResources.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/ExternalQuestResources.java index 12fbe616fb9..17b6e155644 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/ExternalQuestResources.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/ExternalQuestResources.java @@ -185,6 +185,13 @@ public enum ExternalQuestResources DEATH_ON_THE_ISLE("https://oldschool.runescape.wiki/w/Death_on_the_Isle"), MEAT_AND_GREET("https://oldschool.runescape.wiki/w/Meat_and_Greet"), THE_HEART_OF_DARKNESS("https://oldschool.runescape.wiki/w/The_Heart_of_Darkness"), + THE_FINAL_DAWN("https://oldschool.runescape.wiki/w/The_Final_Dawn"), + SHADOWS_OF_CUSTODIA("https://oldschool.runescape.wiki/w/Shadows_of_Custodia"), + SCRAMBLED("https://oldschool.runescape.wiki/w/Scrambled!"), + PANDEMONIUM("https://oldschool.runescape.wiki/w/Pandemonium"), + PRYING_TIMES("https://oldschool.runescape.wiki/w/Prying_Times"), + CURRENT_AFFAIRS("https://oldschool.runescape.wiki/w/Current_Affairs"), + TROUBLED_TORTUGANS("https://oldschool.runescape.wiki/w/Troubled_Tortugans"), //Miniquests ENTER_THE_ABYSS("https://oldschool.runescape.wiki/w/Enter_the_Abyss"), @@ -204,6 +211,7 @@ public enum ExternalQuestResources DADDYS_HOME("https://oldschool.runescape.wiki/w/Daddy%27s_Home"), HOPESPEARS_WILL("https://oldschool.runescape.wiki/w/Hopespear%27s_Will"), THE_CURSE_OF_ARRAV("https://oldschool.runescape.wiki/w/The_Curse_of_Arrav"), + VALE_TOTEMS("https://oldschool.runescape.wiki/w/Vale_Totems_(miniquest)"), // Fake miniquests KNIGHT_WAVES_TRAINING_GROUNDS("https://oldschool.runescape.wiki/w/Camelot_training_room"), @@ -296,7 +304,9 @@ public enum ExternalQuestResources // Skills AGILITY("https://oldschool.runescape.wiki/w/Agility_training"), WOODCUTTING_MEMBER("https://oldschool.runescape.wiki/w/Pay-to-play_Woodcutting_training"), - WOODCUTTING("https://oldschool.runescape.wiki/w/Free-to-play_Woodcutting_training"); + WOODCUTTING("https://oldschool.runescape.wiki/w/Free-to-play_Woodcutting_training"), + SEA_CHARTING("https://oldschool.runescape.wiki/w/Sea_charting") + ; ExternalQuestResources() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/PlayerQuests.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/PlayerQuests.java index dc6f12db27a..12325b30e1a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/PlayerQuests.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/PlayerQuests.java @@ -28,8 +28,6 @@ public enum PlayerQuests { - - COOKS_HELPER("cooks_helper"), BIKE_SHEDDER("bike_shedder"); @Getter diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestHelperQuest.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestHelperQuest.java index f95c38ab87c..6c18daca5b0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestHelperQuest.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestHelperQuest.java @@ -70,6 +70,7 @@ import net.runelite.client.plugins.microbot.questhelper.helpers.achievementdiaries.wilderness.WildernessElite; import net.runelite.client.plugins.microbot.questhelper.helpers.achievementdiaries.wilderness.WildernessHard; import net.runelite.client.plugins.microbot.questhelper.helpers.achievementdiaries.wilderness.WildernessMedium; +import net.runelite.client.plugins.microbot.questhelper.helpers.activities.charting.ChartingHelper; import net.runelite.client.plugins.microbot.questhelper.helpers.miniquests.alfredgrimhandsbarcrawl.AlfredGrimhandsBarcrawl; import net.runelite.client.plugins.microbot.questhelper.helpers.miniquests.barbariantraining.BarbarianTraining; import net.runelite.client.plugins.microbot.questhelper.helpers.miniquests.curseoftheemptylord.CurseOfTheEmptyLord; @@ -87,10 +88,10 @@ import net.runelite.client.plugins.microbot.questhelper.helpers.miniquests.themagearenaii.TheMageArenaII; import net.runelite.client.plugins.microbot.questhelper.helpers.miniquests.valetotems.ValeTotems; import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.allneededitems.AllNeededItems; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.knightswaves.KnightWaves; -import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.strongholdofsecurity.StrongholdOfSecurity; import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.HerbRun; import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.farmruns.TreeRun; +import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.knightswaves.KnightWaves; +import net.runelite.client.plugins.microbot.questhelper.helpers.mischelpers.strongholdofsecurity.StrongholdOfSecurity; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.akingdomdivided.AKingdomDivided; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.anightatthetheatre.ANightAtTheTheatre; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.animalmagnetism.AnimalMagnetism; @@ -116,6 +117,7 @@ import net.runelite.client.plugins.microbot.questhelper.helpers.quests.contact.Contact; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.cooksassistant.CooksAssistant; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.creatureoffenkenstrain.CreatureOfFenkenstrain; +import net.runelite.client.plugins.microbot.questhelper.helpers.quests.currentaffairs.CurrentAffairs; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.darknessofhallowvale.DarknessOfHallowvale; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.deathontheisle.DeathOnTheIsle; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.deathplateau.DeathPlateau; @@ -185,11 +187,13 @@ import net.runelite.client.plugins.microbot.questhelper.helpers.quests.observatoryquest.ObservatoryQuest; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.olafsquest.OlafsQuest; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.onesmallfavour.OneSmallFavour; +import net.runelite.client.plugins.microbot.questhelper.helpers.quests.pandemonium.Pandemonium; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.perilousmoon.PerilousMoon; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.piratestreasure.PiratesTreasure; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.plaguecity.PlagueCity; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.priestinperil.PriestInPeril; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.princealirescue.PrinceAliRescue; +import net.runelite.client.plugins.microbot.questhelper.helpers.quests.pryingtimes.PryingTimes; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.ragandboneman.RagAndBoneManI; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.ragandboneman.RagAndBoneManII; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.ratcatchers.RatCatchers; @@ -256,6 +260,7 @@ import net.runelite.client.plugins.microbot.questhelper.helpers.quests.tribaltotem.TribalTotem; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.trollromance.TrollRomance; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.trollstronghold.TrollStronghold; +import net.runelite.client.plugins.microbot.questhelper.helpers.quests.troubledtortugans.TroubledTortugans; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.twilightspromise.TwilightsPromise; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.undergroundpass.UndergroundPass; import net.runelite.client.plugins.microbot.questhelper.helpers.quests.vampyreslayer.VampyreSlayer; @@ -273,7 +278,6 @@ import net.runelite.client.plugins.microbot.questhelper.helpers.skills.woodcutting.Woodcutting; import net.runelite.client.plugins.microbot.questhelper.helpers.skills.woodcutting.WoodcuttingMember; import net.runelite.client.plugins.microbot.questhelper.playerquests.bikeshedder.BikeShedder; -import net.runelite.client.plugins.microbot.questhelper.playerquests.cookshelper.CooksHelper; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestDetails; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import lombok.Getter; @@ -472,9 +476,12 @@ public enum QuestHelperQuest THE_HEART_OF_DARKNESS(new TheHeartOfDarkness(), Quest.THE_HEART_OF_DARKNESS, QuestVarbits.QUEST_THE_HEART_OF_DARKNESS, QuestDetails.Type.P2P, QuestDetails.Difficulty.EXPERIENCED), THE_CURSE_OF_ARRAV(new TheCurseOfArrav(), Quest.THE_CURSE_OF_ARRAV, QuestVarbits.QUEST_THE_CURSE_OF_ARRAV, QuestDetails.Type.P2P, QuestDetails.Difficulty.MASTER), THE_FINAL_DAWN(new TheFinalDawn(), Quest.THE_FINAL_DAWN, QuestVarbits.QUEST_THE_FINAL_DAWN, QuestDetails.Type.P2P, QuestDetails.Difficulty.MASTER), - SHADOWS_OF_CUSTODIA(new ShadowsOfCustodia(), Quest.SHADOWS_OF_CUSTODIA, QuestVarbits.QUEST_SHADOWS_OF_CUSTODIA, QuestDetails.Type.P2P, QuestDetails.Difficulty.MASTER /* TODO: CONFIRM DIFFICULTY */), + SHADOWS_OF_CUSTODIA(new ShadowsOfCustodia(), Quest.SHADOWS_OF_CUSTODIA, QuestVarbits.QUEST_SHADOWS_OF_CUSTODIA, QuestDetails.Type.P2P, QuestDetails.Difficulty.EXPERIENCED), SCRAMBLED(new Scrambled(), Quest.SCRAMBLED, QuestVarbits.QUEST_SCRAMBLED, QuestDetails.Type.P2P, QuestDetails.Difficulty.INTERMEDIATE), - + PANDEMONIUM(new Pandemonium(), Quest.PANDEMONIUM, QuestVarbits.QUEST_PANDEMONIUM, QuestDetails.Type.P2P, QuestDetails.Difficulty.NOVICE), + PRYING_TIMES(new PryingTimes(), Quest.PRYING_TIMES, QuestVarbits.QUEST_PRYING_TIMES, QuestDetails.Type.P2P, QuestDetails.Difficulty.INTERMEDIATE), + CURRENT_AFFAIRS(new CurrentAffairs(), Quest.CURRENT_AFFAIRS, QuestVarbits.QUEST_CURRENT_AFFAIRS, QuestDetails.Type.P2P, QuestDetails.Difficulty.NOVICE), + TROUBLED_TORTUGANS(new TroubledTortugans(), Quest.TROUBLED_TORTUGANS, QuestVarbits.QUEST_TROUBLED_TORTUGANS, QuestDetails.Type.P2P, QuestDetails.Difficulty.EXPERIENCED), //Miniquests ENTER_THE_ABYSS(new EnterTheAbyss(), Quest.ENTER_THE_ABYSS, QuestVarPlayer.QUEST_ENTER_THE_ABYSS, QuestDetails.Type.MINIQUEST, QuestDetails.Difficulty.MINIQUEST), BEAR_YOUR_SOUL(new BearYourSoul(), Quest.BEAR_YOUR_SOUL, QuestVarbits.QUEST_BEAR_YOUR_SOUL, QuestDetails.Type.MINIQUEST, QuestDetails.Difficulty.MINIQUEST), @@ -506,7 +513,6 @@ public enum QuestHelperQuest BALLOON_TRANSPORT_GRAND_TREE(new GrandTreeBalloonFlight(), "Balloon Transport - Grand Tree", QuestVarbits.BALLOON_TRANSPORT_GRAND_TREE, 1, QuestDetails.Type.MINIQUEST, QuestDetails.Difficulty.MINIQUEST), - // Achievement diaries // Ardougne @@ -643,6 +649,7 @@ public enum QuestHelperQuest BARROWS_HELPER(new BarrowsHelper(), "Barrows helper", QuestVarbits.CUTSCENE, -1, QuestDetails.Type.GENERIC, QuestDetails.Difficulty.GENERIC), STRONGHOLD_OF_SECURITY(new StrongholdOfSecurity(), "Stronghold of Security", QuestVarbits.STRONGHOLD_OF_SECURITY, 1, QuestDetails.Type.GENERIC, QuestDetails.Difficulty.GENERIC), + SEA_CHARTING(new ChartingHelper(), "Sea charting", QuestVarbits.CHARTING, 1, QuestDetails.Type.GENERIC, QuestDetails.Difficulty.GENERIC), // Skill AGILITY(new Agility(), "Agility", Skill.AGILITY, 99, QuestDetails.Type.SKILL_P2P, QuestDetails.Difficulty.SKILL), WOODCUTTING_MEMBER(new WoodcuttingMember(), "Woodcutting - Member", Skill.WOODCUTTING, 99, QuestDetails.Type.SKILL_P2P, QuestDetails.Difficulty.SKILL), @@ -652,7 +659,6 @@ public enum QuestHelperQuest MINING(new Mining(), "Mining", Skill.MINING, 99, QuestDetails.Type.SKILL_F2P, QuestDetails.Difficulty.SKILL), // Player Quests - COOKS_HELPER(new CooksHelper(), "Cook's Helper", PlayerQuests.COOKS_HELPER, 4, false), BIKE_SHEDDER(new BikeShedder(), "Bike Shedder", PlayerQuests.BIKE_SHEDDER, 4, true); @Getter @@ -669,9 +675,8 @@ public enum QuestHelperQuest @Getter private final QuestDetails.Difficulty difficulty; - @Getter - public final QuestVarbits varbit; + private final QuestVarbits varbit; private final QuestVarPlayer varPlayer; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestVarbits.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestVarbits.java index 35d5c638d04..d6ce0c95361 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestVarbits.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/questinfo/QuestVarbits.java @@ -124,6 +124,10 @@ public enum QuestVarbits QUEST_THE_FINAL_DAWN(VarbitID.VMQ4), QUEST_SHADOWS_OF_CUSTODIA(VarbitID.SOC), QUEST_SCRAMBLED(VarbitID.SCRAMBLED), + QUEST_PANDEMONIUM(VarbitID.SAILING_INTRO), + QUEST_PRYING_TIMES(VarbitID.QUEST_PRY), + QUEST_CURRENT_AFFAIRS(VarbitID.CURRENT_AFFAIRS), + QUEST_TROUBLED_TORTUGANS(VarbitID.TT), /** * mini-quest varbits, these don't hold the completion value. */ @@ -225,6 +229,10 @@ public enum QuestVarbits ACHIEVEMENT_DIARY_WILDERNESS_HARD(VarbitID.WILDERNESS_HARD_REWARD), ACHIEVEMENT_DIARY_WILDERNESS_ELITE(VarbitID.WILDERNESS_ELITE_REWARD), + // Misc + // TODO: Not confirmed for complete state + CHARTING(VarbitID.SAILING_CHARTING_FULL_COMPLETION), + CUTSCENE(VarbitID.CUTSCENE_STATUS), DIALOG_CHOICE(VarbitID.SETTINGS_BARBARIAN_POTION_MAKEX); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/AbstractRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/AbstractRequirement.java index e4480df65e2..b1f02da01fb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/AbstractRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/AbstractRequirement.java @@ -24,8 +24,8 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements; -import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.api.Client; +import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.ui.overlay.components.LineComponent; import javax.annotation.Nonnull; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/ChatMessageRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/ChatMessageRequirement.java index 1f15f19c2e6..7bef5083ecd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/ChatMessageRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/ChatMessageRequirement.java @@ -26,11 +26,11 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements; -import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ConditionForStep; import lombok.Setter; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.events.ChatMessage; +import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ConditionForStep; import java.util.Arrays; import java.util.List; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/RegionHintArrowRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/RegionHintArrowRequirement.java index 7827be9a65a..6d58100b98b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/RegionHintArrowRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/RegionHintArrowRequirement.java @@ -24,10 +24,10 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements; -import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import net.runelite.api.Client; import net.runelite.api.coords.WorldPoint; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; public class RegionHintArrowRequirement extends SimpleRequirement { @@ -53,7 +53,7 @@ public boolean check(Client client) return false; } - WorldPoint wp = QuestPerspective.getInstanceWorldPointFromReal(client, hintArrowPoint); + WorldPoint wp = QuestPerspective.getWorldPointConsideringWorldView(client, client.getTopLevelWorldView(), hintArrowPoint); if (wp == null) { return false; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/Requirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/Requirement.java index 0384ec86310..343a8b16c8b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/Requirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/Requirement.java @@ -26,9 +26,9 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements; -import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.api.Client; import net.runelite.client.config.ConfigManager; +import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.ui.overlay.components.LineComponent; import javax.annotation.Nonnull; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/StepIsActiveRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/StepIsActiveRequirement.java new file mode 100644 index 00000000000..a8d6dbc232c --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/StepIsActiveRequirement.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.requirements; + +import net.runelite.client.plugins.microbot.questhelper.steps.DetailedQuestStep; +import net.runelite.api.Client; +import org.jetbrains.annotations.NotNull; + +public class StepIsActiveRequirement extends AbstractRequirement +{ + private final DetailedQuestStep questStep; + + public StepIsActiveRequirement(DetailedQuestStep questStep) + { + this.questStep = questStep; + } + + @Override + public boolean check(Client client) + { + return questStep.isStarted(); + } + + @NotNull + @Override + public String getDisplayText() + { + return "Step '" + questStep.getText() + "' is active."; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/conditional/ObjectCondition.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/conditional/ObjectCondition.java index edf7ff1d66d..2117c649a11 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/conditional/ObjectCondition.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/conditional/ObjectCondition.java @@ -24,13 +24,13 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements.conditional; -import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import lombok.Setter; import net.runelite.api.Client; import net.runelite.api.GameObject; import net.runelite.api.Tile; import net.runelite.api.TileObject; import net.runelite.api.coords.WorldPoint; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import java.util.Objects; import java.util.Set; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileConsideringSceneLoadRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileConsideringSceneLoadRequirement.java index 06c546ffb43..5d7f8857460 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileConsideringSceneLoadRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileConsideringSceneLoadRequirement.java @@ -3,7 +3,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.InitializableRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.location.TileIsLoadedRequirement; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import lombok.NonNull; import net.runelite.api.Client; import net.runelite.api.Tile; @@ -18,7 +18,7 @@ public class ItemOnTileConsideringSceneLoadRequirement implements InitializableRequirement { private final List itemID; - private WorldPoint worldPoint; + private DefinedPoint definedPoint; // This is inclusive of 27 private final int MAX_ZONE = 27; @@ -35,8 +35,8 @@ public ItemOnTileConsideringSceneLoadRequirement(ItemRequirement item, WorldPoin assert(worldPoint != null); this.itemID = item.getAllIds(); - this.worldPoint = worldPoint; - tileLoadedReq = new TileIsLoadedRequirement(worldPoint); + this.definedPoint = DefinedPoint.of(worldPoint); + tileLoadedReq = new TileIsLoadedRequirement(definedPoint); } public ItemOnTileConsideringSceneLoadRequirement(int itemID, WorldPoint worldPoint) @@ -44,8 +44,8 @@ public ItemOnTileConsideringSceneLoadRequirement(int itemID, WorldPoint worldPoi assert(worldPoint != null); this.itemID = Collections.singletonList(itemID); - this.worldPoint = worldPoint; - tileLoadedReq = new TileIsLoadedRequirement(worldPoint); + this.definedPoint = DefinedPoint.of(worldPoint); + tileLoadedReq = new TileIsLoadedRequirement(definedPoint); } @@ -86,12 +86,12 @@ public String getDisplayText() private boolean playerInRegion(Client client) { // Return true for unknown - if (worldPoint == null) return true; + if (definedPoint == null) return true; if (!tileLoadedReq.check(client)) return true; - WorldPoint playerPoint = QuestPerspective.getRealWorldPointFromLocal(client, client.getLocalPlayer().getWorldLocation()); + var playerPoint = client.getLocalPlayer().getLocalLocation(); if (playerPoint == null) return false; - if (playerPoint.distanceTo(worldPoint) <= MAX_ZONE) + if (definedPoint.distanceTo(client, playerPoint) <= MAX_ZONE) { @@ -103,9 +103,9 @@ private boolean playerInRegion(Client client) private boolean checkAllTiles(Client client) { - if (worldPoint != null) + if (definedPoint != null) { - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); + List localPoints = definedPoint.resolveLocalPoints(client); for (LocalPoint localPoint : localPoints) { Tile tile = client.getTopLevelWorldView().getScene().getTiles()[client.getTopLevelWorldView().getPlane()][localPoint.getSceneX()][localPoint.getSceneY()]; @@ -126,7 +126,7 @@ private boolean checkAllTiles(Client client) return false; } - Tile[][] squareOfTiles = client.getScene().getTiles()[client.getPlane()]; + Tile[][] squareOfTiles = client.getTopLevelWorldView().getScene().getTiles()[client.getTopLevelWorldView().getPlane()]; for (Tile[] lineOfTiles : squareOfTiles) { for (Tile tile : lineOfTiles) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileRequirement.java index 0730f370388..4f882979d52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemOnTileRequirement.java @@ -28,20 +28,22 @@ package net.runelite.client.plugins.microbot.questhelper.requirements.item; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.ConditionForStep; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.api.Client; import net.runelite.api.Tile; import net.runelite.api.TileItem; +import net.runelite.api.WorldView; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; +import java.util.ArrayList; import java.util.Collections; import java.util.List; public class ItemOnTileRequirement extends ConditionForStep { private final List itemID; - private WorldPoint worldPoint; + private DefinedPoint definedPoint; public ItemOnTileRequirement(int itemID) { @@ -60,7 +62,7 @@ public ItemOnTileRequirement(int itemID, WorldPoint worldPoint) assert(worldPoint != null); this.itemID = Collections.singletonList(itemID); - this.worldPoint = worldPoint; + this.definedPoint = DefinedPoint.of(worldPoint); } public ItemOnTileRequirement(ItemRequirement item, WorldPoint worldPoint) @@ -69,7 +71,7 @@ public ItemOnTileRequirement(ItemRequirement item, WorldPoint worldPoint) assert(worldPoint != null); this.itemID = item.getAllIds(); - this.worldPoint = worldPoint; + this.definedPoint = DefinedPoint.of(worldPoint); } @@ -82,9 +84,9 @@ private boolean checkAllTiles(Client client) { if (client.getTopLevelWorldView().getScene() == null) return false; - if (worldPoint != null) + if (definedPoint != null) { - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); + var localPoints = definedPoint.resolveLocalPoints(client); for (LocalPoint localPoint : localPoints) { Tile tile = client.getTopLevelWorldView().getScene().getTiles()[client.getTopLevelWorldView().getPlane()][localPoint.getSceneX()][localPoint.getSceneY()]; @@ -104,21 +106,37 @@ private boolean checkAllTiles(Client client) return false; } - Tile[][] squareOfTiles = client.getScene().getTiles()[client.getPlane()]; - for (Tile[] lineOfTiles : squareOfTiles) + var worldViews = new ArrayList(); + var topLevelWorldView = client.getTopLevelWorldView(); + var playerWorldView = client.getLocalPlayer().getWorldView(); + if (topLevelWorldView != null) { - for (Tile tile : lineOfTiles) + worldViews.add(topLevelWorldView); + } + + if (playerWorldView != null && playerWorldView != topLevelWorldView) + { + worldViews.add(playerWorldView); + } + + for (WorldView worldView : worldViews) + { + Tile[][] squareOfTiles = worldView.getScene().getTiles()[worldView.getPlane()]; + for (Tile[] lineOfTiles : squareOfTiles) { - if (tile != null) + for (Tile tile : lineOfTiles) { - List items = tile.getGroundItems(); - if (items != null) + if (tile != null) { - for (TileItem item : items) + List items = tile.getGroundItems(); + if (items != null) { - if (itemID.contains(item.getId())) + for (TileItem item : items) { - return true; + if (itemID.contains(item.getId())) + { + return true; + } } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirement.java index 854e6517e10..0c6e999b09a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirement.java @@ -27,7 +27,6 @@ package net.runelite.client.plugins.microbot.questhelper.requirements.item; import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.collections.ItemCollections; import net.runelite.client.plugins.microbot.questhelper.collections.ItemWithCharge; import net.runelite.client.plugins.microbot.questhelper.managers.ItemAndLastUpdated; @@ -46,10 +45,11 @@ import net.runelite.client.util.Text; import org.jetbrains.annotations.Nullable; +import javax.annotation.CheckReturnValue; import javax.annotation.Nonnull; import java.awt.*; -import java.util.List; import java.util.*; +import java.util.List; import java.util.stream.Collectors; /** @@ -92,9 +92,14 @@ public class ItemRequirement extends AbstractRequirement /** * Indicates whether the item must be equipped. */ - @Getter @Setter - protected boolean equip; + @Getter + protected boolean mustBeEquipped; + + public boolean mustBeEquipped() { + return this.mustBeEquipped; + } + /** * Whether the item should be highlighted in the inventory. @@ -122,13 +127,6 @@ public class ItemRequirement extends AbstractRequirement @Getter protected Requirement conditionToHide = new ManualRequirement(); - /** - * The quest bank used for additional bank checks. - */ - @Setter - @Getter - private QuestBank questBank; - /** * Flag to indicate whether the bank should be checked. */ @@ -195,7 +193,7 @@ public ItemRequirement(String name, int id, int quantity) this.id = id; this.quantity = quantity; this.name = name; - equip = false; + mustBeEquipped = false; } /** @@ -204,12 +202,12 @@ public ItemRequirement(String name, int id, int quantity) * @param name the display name of the item requirement * @param id the primary item id for the requirement * @param quantity the required quantity of the item - * @param equip {@code true} if the item must be equipped, {@code false} otherwise + * @param mustBeEquipped {@code true} if the item must be equipped, {@code false} otherwise */ - public ItemRequirement(String name, int id, int quantity, boolean equip) + public ItemRequirement(String name, int id, int quantity, boolean mustBeEquipped) { this(name, id, quantity); - this.equip = equip; + this.mustBeEquipped = mustBeEquipped; } /** @@ -263,14 +261,14 @@ public ItemRequirement(String name, List items, int quantity) * @param name the display name of the item requirement * @param items the list of item ids, where the first element is the primary id * @param quantity the required quantity of the item - * @param equip {@code true} if the item must be equipped, {@code false} otherwise + * @param mustBeEquipped {@code true} if the item must be equipped, {@code false} otherwise * @throws AssertionError if any item in the list is {@code null} */ - public ItemRequirement(String name, List items, int quantity, boolean equip) + public ItemRequirement(String name, List items, int quantity, boolean mustBeEquipped) { this(name, items.get(0), quantity); assert (items.stream().noneMatch(Objects::isNull)); - this.equip = equip; + this.mustBeEquipped = mustBeEquipped; this.addAlternates(items.subList(1, items.size())); } @@ -313,13 +311,13 @@ public ItemRequirement(String name, ItemCollections itemCollection, int quantity * @param name the display name of the item requirement * @param itemCollection the {@link ItemCollections} containing item ids and wiki term information * @param quantity the required quantity of the item - * @param equip {@code true} if the item must be equipped, {@code false} otherwise + * @param mustBeEquipped {@code true} if the item must be equipped, {@code false} otherwise */ - public ItemRequirement(String name, ItemCollections itemCollection, int quantity, boolean equip) + public ItemRequirement(String name, ItemCollections itemCollection, int quantity, boolean mustBeEquipped) { this(name, itemCollection.getItems().get(0), quantity); this.setUrlSuffix(itemCollection.getWikiTerm()); - this.equip = equip; + this.mustBeEquipped = mustBeEquipped; this.addAlternates(itemCollection.getItems().subList(1, itemCollection.getItems().size())); } @@ -376,26 +374,15 @@ public ItemRequirement highlighted() } /** - * Configures this requirement to check the specified quest bank. Needs to not need {@link QuestBank} in the future as it no longer uses it. + * Returns a copy of this requirement that includes bank containers in its checks. * - * @param questBank the {@link QuestBank} to use for bank checks; if {@code null}, bank checks are disabled - */ - public void useQuestBank(QuestBank questBank) - { - this.shouldCheckBank = questBank != null; - this.questBank = questBank; - } - - /** - * Returns a copy of this requirement that also checks the specified quest bank. Needs to not need {@link QuestBank} in the future as it no longer uses it. - * - * @param questBank the {@link QuestBank} to use for additional bank checks * @return a new {@link ItemRequirement} instance configured to check the bank */ - public ItemRequirement alsoCheckBank(QuestBank questBank) + @CheckReturnValue + public ItemRequirement alsoCheckBank() { ItemRequirement newItem = copy(); - newItem.useQuestBank(questBank); + newItem.setShouldCheckBank(true); return newItem; } @@ -420,7 +407,7 @@ public ItemRequirement named(String name) public ItemRequirement equipped() { ItemRequirement newItem = copy(); - newItem.setEquip(true); + newItem.setMustBeEquipped(true); return newItem; } @@ -502,7 +489,7 @@ protected ItemRequirement copyOfClass() { throw new UnsupportedOperationException("Subclasses must override copy()"); } - return new ItemRequirement(name, id, quantity, equip); + return new ItemRequirement(name, id, quantity, mustBeEquipped); } /** @@ -515,14 +502,13 @@ public ItemRequirement copy() ItemRequirement newItem = copyOfClass(); newItem.setName(name); newItem.setId(id); - newItem.setEquip(equip); + newItem.setMustBeEquipped(mustBeEquipped); newItem.setQuantity(quantity); newItem.addAlternates(alternateItems); newItem.setDisplayItemId(displayItemId); newItem.setHighlightInInventory(highlightInInventory); newItem.setDisplayMatchedItemName(displayMatchedItemName); newItem.setConditionToHide(conditionToHide); - newItem.questBank = questBank; newItem.isConsumedItem = isConsumedItem; newItem.shouldAggregate = shouldAggregate; // Need to get actual tooltip or we get the appended containers info @@ -694,20 +680,27 @@ public boolean shouldDisplayText(Client client) @Override public Color getColor(Client client, QuestHelperConfig config) { - Color color = config.failColour(); if (!this.isActualItem()) { - color = Color.GRAY; + return Color.GRAY; + } + + if (additionalOptions != null && additionalOptions.check(client)) + { + return config.passColour(); } - else if (this.checkContainersOnPlayer(client)) + + if (this.checkContainersOnPlayer(client)) { - color = config.passColour(); + return config.passColour(); } - else if (this.checkWithAllContainers()) + + if (this.checkWithAllContainers()) { - color = config.partialSuccessColour(); + return config.partialSuccessColour(); } - return color; + + return config.failColour(); } /** @@ -915,7 +908,7 @@ protected ArrayList getAdditionalText(Client client, boolean incl Color equipColor = config.passColour(); ArrayList lines = new ArrayList<>(); - if (this.isEquip()) + if (this.mustBeEquipped()) { String equipText = "(equipped)"; if (!checkContainers(QuestContainerManager.getEquippedData())) @@ -958,7 +951,7 @@ public boolean check(Client client) List containers = new ArrayList<>(); containers.add(QuestContainerManager.getEquippedData()); - if (!equip) + if (!mustBeEquipped) { containers.add(QuestContainerManager.getInventoryData()); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirements.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirements.java index b9915cb80bb..6b7c039a108 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirements.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/ItemRequirements.java @@ -36,8 +36,8 @@ import net.runelite.api.Item; import java.awt.*; -import java.util.List; import java.util.*; +import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -335,13 +335,13 @@ public boolean checkItems(Client client, List items) public ItemRequirement copy() { ItemRequirements newItem = new ItemRequirements(getLogicType(), getName(), getItemRequirements()); - newItem.setEquip(equip); + newItem.setMustBeEquipped(mustBeEquipped); newItem.addAlternates(alternateItems); newItem.setDisplayItemId(getDisplayItemId()); newItem.setHighlightInInventory(highlightInInventory); newItem.setDisplayMatchedItemName(isDisplayMatchedItemName()); newItem.setConditionToHide(getConditionToHide()); - newItem.setQuestBank(getQuestBank()); + newItem.setShouldCheckBank(isShouldCheckBank()); newItem.setTooltip(tooltip); newItem.additionalOptions = additionalOptions; @@ -381,19 +381,19 @@ public ItemRequirement equipped() } newItem.itemRequirements.clear(); newItem.itemRequirements.addAll(newReqs); - newItem.equip = true; + newItem.mustBeEquipped = true; return newItem; } /** * Sets the equip flag for all aggregated item requirements. * - * @param shouldEquip {@code true} to mark the items as equipped; {@code false} otherwise. + * @param mustBeEquipped {@code true} to mark the items as equipped; {@code false} otherwise. */ @Override - public void setEquip(boolean shouldEquip) + public void setMustBeEquipped(boolean mustBeEquipped) { - equip = shouldEquip; + this.mustBeEquipped = mustBeEquipped; } /** diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/KeyringRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/KeyringRequirement.java index a5ed3e3134a..0326f47b07e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/KeyringRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/KeyringRequirement.java @@ -31,11 +31,9 @@ import net.runelite.api.Client; import net.runelite.api.gameval.ItemID; import net.runelite.client.config.ConfigManager; -import net.runelite.client.util.Text; import java.awt.*; import java.util.Set; -import java.util.stream.Collectors; // TODO: Convert this to be a TrackedContainer instead? public class KeyringRequirement extends ItemRequirement @@ -89,7 +87,6 @@ public ItemRequirement copy() newItem.setDisplayMatchedItemName(isDisplayMatchedItemName()); newItem.setConditionToHide(getConditionToHide()); newItem.setShouldCheckBank(isShouldCheckBank()); - newItem.setQuestBank(getQuestBank()); newItem.setTooltip(getTooltip()); newItem.setUrlSuffix(getUrlSuffix()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/NoItemRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/NoItemRequirement.java index 3c6af8e354c..8c560187e52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/NoItemRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/item/NoItemRequirement.java @@ -35,28 +35,36 @@ import java.util.Objects; /** - * Requirement that checks if a player has no item in a specified {@link ItemSlots}. + * Requirement that checks if a player has no item in all specified {@link ItemSlots}. */ public class NoItemRequirement extends ItemRequirement { - private final ItemSlots slot; + private final ItemSlots[] slots; /** - * Checks if a player has no items in a given {@link ItemSlots} + * Checks if a player has no items in all given {@link ItemSlots} * - * @param text display text - * @param slot the slot to check + * @param text display text + * @param slots the slots to check */ - public NoItemRequirement(String text, @Nonnull ItemSlots slot) + public NoItemRequirement(String text, @Nonnull ItemSlots... slots) { super(text, -1, -1); - this.slot = slot; + this.slots = slots; } @Override public boolean check(Client client) { - return slot.checkInventory(client, Objects::isNull); + for (ItemSlots slot : slots) + { + boolean isEmpty = slot.checkInventory(client, Objects::isNull); + if (!isEmpty) + { + return false; + } + } + return true; } @Override @@ -69,12 +77,29 @@ public Color getColor(Client client, QuestHelperConfig config) @Override public String getDisplayText() { - return "Nothing in your " + slot.getName(); + + String displayString = "Nothing in your "; + for (int i = 0; i < slots.length; i++) + { + if (i == slots.length - 1 && "Nothing in your ".equals(displayString)) + { + displayString += slots[i].getName(); + } + else if (i == slots.length - 1) + { + displayString += " or " + slots[i].getName(); + } + else + { + displayString += ", " + slots[i].getName(); + } + } + return displayString; } @Override protected NoItemRequirement copyOfClass() { - return new NoItemRequirement(getName(), slot); + return new NoItemRequirement(getName(), slots); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/location/TileIsLoadedRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/location/TileIsLoadedRequirement.java index 47ab4e65f0b..0f86521c3b2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/location/TileIsLoadedRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/location/TileIsLoadedRequirement.java @@ -27,7 +27,7 @@ package net.runelite.client.plugins.microbot.questhelper.requirements.location; import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.api.Client; import net.runelite.api.Constants; import net.runelite.api.coords.LocalPoint; @@ -38,7 +38,7 @@ public class TileIsLoadedRequirement extends AbstractRequirement { - private final WorldPoint worldPoint; + private final DefinedPoint definedPoint; private final String displayText; /** @@ -48,15 +48,20 @@ public class TileIsLoadedRequirement extends AbstractRequirement */ public TileIsLoadedRequirement(WorldPoint worldPoint) { - assert(worldPoint != null); - this.worldPoint = worldPoint; - this.displayText = "WorldPoint " + worldPoint.toString() + "is loaded locally."; + this(DefinedPoint.of(worldPoint)); + } + + public TileIsLoadedRequirement(DefinedPoint definedPoint) + { + assert(definedPoint != null); + this.definedPoint = definedPoint; + this.displayText = "WorldPoint " + definedPoint.getWorldPoint().toString() + "is loaded locally."; } @Override public boolean check(Client client) { - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); + List localPoints = definedPoint.resolveLocalPoints(client); for (LocalPoint localPoint : localPoints) { // Final tiles of a scene do not have objects of them diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/npc/NoFollowerRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/npc/NoFollowerRequirement.java index 333c82db8f1..5538b4c3249 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/npc/NoFollowerRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/npc/NoFollowerRequirement.java @@ -28,6 +28,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; import net.runelite.api.Client; +import net.runelite.api.gameval.VarPlayerID; import javax.annotation.Nonnull; @@ -43,7 +44,7 @@ public NoFollowerRequirement(String text) @Override public boolean check(Client client) { - return client.getVarpValue(447) == -1; + return client.getVarpValue(VarPlayerID.FOLLOWER_NPC) == -1; } @Nonnull diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreeInventorySlotRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreeInventorySlotRequirement.java index 588eba35881..79d1b132f3d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreeInventorySlotRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreeInventorySlotRequirement.java @@ -29,13 +29,13 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; import lombok.Getter; +import lombok.Setter; import net.runelite.api.Client; -import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; +import net.runelite.api.gameval.InventoryID; import javax.annotation.Nonnull; -import java.util.Locale; /** * Requirement that checks if a player has a required number of slots free in a given @@ -45,19 +45,21 @@ public class FreeInventorySlotRequirement extends AbstractRequirement { private final int NUM_INVENTORY_SLOTS_TOTAL = 28; - private InventoryID inventoryID; + + private final int inventoryID; + + @Setter private int numSlotsFree; /** * Checks if the player has a required number of slots free in a given * {@link InventoryID} * - * @param inventoryID the inventory to check * @param numSlotsFree the required number of slots free */ public FreeInventorySlotRequirement(int numSlotsFree) { - this.inventoryID = InventoryID.INVENTORY; + this.inventoryID = InventoryID.INV; this.numSlotsFree = numSlotsFree; } @@ -82,6 +84,6 @@ private boolean isOpenSlot(Item item) @Override public String getDisplayText() { - return getNumSlotsFree() + " free " + getInventoryID().name().toLowerCase(Locale.ROOT).replaceAll("_", " ") + " slots"; + return getNumSlotsFree() + " free inventory slots"; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreePortTaskSlotsRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreePortTaskSlotsRequirement.java new file mode 100644 index 00000000000..9340e324b9f --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/FreePortTaskSlotsRequirement.java @@ -0,0 +1,84 @@ +/* + * + * * Copyright (c) 2025, TTvanWillegen + * * All rights reserved. + * * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions are met: + * * + * * 1. Redistributions of source code must retain the above copyright notice, this + * * list of conditions and the following disclaimer. + * * 2. Redistributions in binary form must reproduce the above copyright notice, + * * this list of conditions and the following disclaimer in the documentation + * * and/or other materials provided with the distribution. + * * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package net.runelite.client.plugins.microbot.questhelper.requirements.player; + +import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.gameval.VarbitID; + +import javax.annotation.Nonnull; + +/** + * Requirement that checks if a player has a required number of Port Task slots free. + */ +public class FreePortTaskSlotsRequirement extends AbstractRequirement +{ + @Getter + private final int numSlotsFree; + + /** + * Checks if the player has a required number of slots free. + * + * @param numSlotsFree the required number of slots free + */ + public FreePortTaskSlotsRequirement(int numSlotsFree) + { + this.numSlotsFree = numSlotsFree; + } + + @Override + public boolean check(Client client) + { + int freeSlots = client.getVarbitValue(VarbitID.PORT_TASK_SLOT_0_ID) == 0 ? 1 : 0; + int extraSlotsUnlocked = client.getVarbitValue(VarbitID.PORT_TASK_EXTRA_SLOTS_UNLOCKED); + if (extraSlotsUnlocked >= 1) + { + freeSlots += client.getVarbitValue(VarbitID.PORT_TASK_SLOT_1_ID) == 0 ? 1 : 0; + } + if (extraSlotsUnlocked >= 2) + { + freeSlots += client.getVarbitValue(VarbitID.PORT_TASK_SLOT_2_ID) == 0 ? 1 : 0; + } + if (extraSlotsUnlocked >= 3) + { + freeSlots += client.getVarbitValue(VarbitID.PORT_TASK_SLOT_3_ID) == 0 ? 1 : 0; + } + if (extraSlotsUnlocked >= 4) + { + freeSlots += client.getVarbitValue(VarbitID.PORT_TASK_SLOT_4_ID) == 0 ? 1 : 0; + } + return freeSlots >= numSlotsFree; + } + + @Nonnull + @Override + public String getDisplayText() + { + return getNumSlotsFree() + " free Sailing Port task slot" + (getNumSlotsFree() == 1 ? "" : "s"); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/ShipInPortRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/ShipInPortRequirement.java new file mode 100644 index 00000000000..3fd9c191767 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/ShipInPortRequirement.java @@ -0,0 +1,113 @@ +/* + * + * * Copyright (c) 2025, TTvanWillegen + * * All rights reserved. + * * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions are met: + * * + * * 1. Redistributions of source code must retain the above copyright notice, this + * * list of conditions and the following disclaimer. + * * 2. Redistributions in binary form must reproduce the above copyright notice, + * * this list of conditions and the following disclaimer in the documentation + * * and/or other materials provided with the distribution. + * * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package net.runelite.client.plugins.microbot.questhelper.requirements.player; + +import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Port; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.gameval.VarbitID; + +import javax.annotation.Nonnull; +import java.util.stream.IntStream; + +/** + * Requirement that checks if a player has a ship at the requested port. + */ +@Getter +public class ShipInPortRequirement extends AbstractRequirement +{ + private final Port port; + private final boolean strictOnRecentShip; + + private int[] allDocks; + private int lastDock; + + /** + * Checks if the player has a ship docked at the requested port. + * + * @param port the id of the port + * @param strictOnRecentShip if true, only checks is most recently used boat is at a port, if false checks if any boat is at a port. + */ + public ShipInPortRequirement(Port port, boolean strictOnRecentShip) + { + assert(port != null); + this.port = port; + this.strictOnRecentShip = strictOnRecentShip; + } + /** + * Checks if the player's most-recently used ship is at the requested port. + * + * @param port the id of the port + */ + public ShipInPortRequirement(Port port) + { + this(port, true); + } + + @Override + public boolean check(Client client) + { + lastDock = client.getVarbitValue(VarbitID.SAILING_BOARDED_BOAT_LAST_DOCK); + allDocks = new int[]{ + client.getVarbitValue(VarbitID.SAILING_BOAT_1_PORT), + client.getVarbitValue(VarbitID.SAILING_BOAT_2_PORT), + client.getVarbitValue(VarbitID.SAILING_BOAT_3_PORT), + client.getVarbitValue(VarbitID.SAILING_BOAT_4_PORT), + client.getVarbitValue(VarbitID.SAILING_BOAT_5_PORT) + }; + + if(strictOnRecentShip) + { + return lastDock == port.getId(); + }else + { + return anyDocked(); + } + } + + private boolean anyDocked(){ + return IntStream.of(allDocks).anyMatch(x -> x == port.getId()); + } + + @Nonnull + @Override + public String getDisplayText() + { + return "A ship docked at " + this.port.getName(); + } + + public String getTooltip() + { + if(lastDock != port.getId()){ + if(anyDocked()){ + return "You have other ships docked at this port!"; + } + } + return null; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/SpellbookRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/SpellbookRequirement.java index 0f8df1ba556..98661d13b7c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/SpellbookRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/player/SpellbookRequirement.java @@ -29,12 +29,12 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.util.Spellbook; import net.runelite.api.Client; +import net.runelite.api.gameval.VarbitID; import javax.annotation.Nonnull; public class SpellbookRequirement extends AbstractRequirement { - private static final int SPELLBOOK_VARBIT = 4070; private final Spellbook spellBook; public SpellbookRequirement(Spellbook spellBook) @@ -46,7 +46,7 @@ public SpellbookRequirement(Spellbook spellBook) @Override public boolean check(Client client) { - return spellBook.check(client, SPELLBOOK_VARBIT); + return spellBook.check(client, VarbitID.SPELLBOOK); } @Nonnull diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/quest/QuestPointRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/quest/QuestPointRequirement.java index 18403e8f688..4607255e05b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/quest/QuestPointRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/quest/QuestPointRequirement.java @@ -31,7 +31,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; import lombok.Getter; import net.runelite.api.Client; -import net.runelite.api.VarPlayer; +import net.runelite.api.gameval.VarPlayerID; import javax.annotation.Nonnull; @@ -72,7 +72,7 @@ public QuestPointRequirement(int requiredQuestPoints, Operation operation) @Override public boolean check(Client client) { - return operation.check(client.getVarpValue(VarPlayer.QUEST_POINTS), requiredQuestPoints); + return operation.check(client.getVarpValue(VarPlayerID.QP), requiredQuestPoints); } @Nonnull diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/runelite/RuneliteRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/runelite/RuneliteRequirement.java index 2b6502a7a5c..e7f3f60b96c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/runelite/RuneliteRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/runelite/RuneliteRequirement.java @@ -58,6 +58,11 @@ public RuneliteRequirement(ConfigManager configManager, String id, String expect this(configManager, id, "false", expectedValue, text, requirements); } + public RuneliteRequirement(ConfigManager configManager, String id) + { + this(configManager, id, "true", new HashMap<>()); + } + public RuneliteRequirement(ConfigManager configManager, String id, String expectedValue) { this(configManager, id, expectedValue, new HashMap<>()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/sailing/BoatResistanceType.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/sailing/BoatResistanceType.java new file mode 100644 index 00000000000..187ac5aa59c --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/sailing/BoatResistanceType.java @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.requirements.sailing; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.gameval.VarbitID; + +@AllArgsConstructor +@Getter +public enum BoatResistanceType +{ + KELP("kelp", VarbitID.SAILING_SIDEPANEL_BOAT_TANGLEDKELP_RESISTANT, false), + ICE("ice", VarbitID.SAILING_SIDEPANEL_BOAT_ICYSEAS_RESISTANT, false), + CRYSTAL("crystal", VarbitID.SAILING_SIDEPANEL_BOAT_CRYSTALFLECKED_RESISTANT, false), + FETID_WATER("fetid water", VarbitID.SAILING_SIDEPANEL_BOAT_FETIDWATER_RESISTANT, false), + RAPID("rapid", VarbitID.SAILING_SIDEPANEL_BOAT_RAPIDRESISTANCE, true), + STORM("storm", VarbitID.SAILING_SIDEPANEL_BOAT_STORMRESISTANCE, true); + + private final String displayName; + private final int varbitId; + private final boolean showLevel; + + public int getActiveBoatLevel(Client client) + { + if (client == null) + { + return 0; + } + return client.getVarbitValue(varbitId); + } + + public int getBoatSlotLevel(Client client, int boatSlot) + { + if (client == null || boatSlot < 1 || boatSlot > 5) + { + return 0; + } + + switch (this) + { + case KELP: + return getKelpResistance(client, boatSlot); + case ICE: + return getIceResistance(client, boatSlot); + case CRYSTAL: + return getCrystalResistance(client, boatSlot); + case FETID_WATER: + return getFetidWaterResistance(client, boatSlot); + case RAPID: + return getRapidResistance(client, boatSlot); + case STORM: + return getStormResistance(client, boatSlot); + default: + return 0; + } + } + + private int getKelpResistance(Client client, int boatSlot) + { + int steering = getSteering(client, boatSlot); + return steering >= 4 ? 1 : 0; + } + + private int getIceResistance(Client client, int boatSlot) + { + int brazier = getBrazier(client, boatSlot); + return brazier > 0 ? 1 : 0; + } + + private int getCrystalResistance(Client client, int boatSlot) + { + int keel = getKeel(client, boatSlot); + return keel >= 4 ? 1 : 0; + } + + private int getFetidWaterResistance(Client client, int boatSlot) + { + int boatType = getType(client, boatSlot); + if (boatType == 0) + { + return 0; + } + else if (boatType == 1) + { + int hotspot5 = getHotspot5(client, boatSlot); + return hotspot5 == 1 ? 1 : 0; + } + else if (boatType == 2) + { + int hotspot9 = getHotspot9(client, boatSlot); + return hotspot9 == 1 ? 1 : 0; + } + return 0; + } + + private int getRapidResistance(Client client, int boatSlot) + { + int sail = getSail(client, boatSlot); + if (sail == 0) + { + return 0; + } + else if (sail <= 2) + { + return 1; + } + else if (sail <= 6) + { + return 2; + } + return 0; + } + + private int getStormResistance(Client client, int boatSlot) + { + int hull = getHull(client, boatSlot); + if (hull == 0) + { + return 0; + } + else if (hull <= 3) + { + return 1; + } + else if (hull <= 6) + { + return 2; + } + return 0; + } + + private int getSteering(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_STEERING); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_STEERING); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_STEERING); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_STEERING); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_STEERING); + default: return 0; + } + } + + private int getBrazier(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_BRAZIER); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_BRAZIER); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_BRAZIER); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_BRAZIER); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_BRAZIER); + default: return 0; + } + } + + private int getHull(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_HULL); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_HULL); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_HULL); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_HULL); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_HULL); + default: return 0; + } + } + + private int getKeel(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_KEEL); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_KEEL); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_KEEL); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_KEEL); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_KEEL); + default: return 0; + } + } + + private int getSail(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_SAIL); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_SAIL); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_SAIL); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_SAIL); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_SAIL); + default: return 0; + } + } + + private int getType(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_TYPE); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_TYPE); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_TYPE); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_TYPE); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_TYPE); + default: return 0; + } + } + + private int getHotspot5(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_HOTSPOT_5); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_HOTSPOT_5); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_HOTSPOT_5); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_HOTSPOT_5); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_HOTSPOT_5); + default: return 0; + } + } + + private int getHotspot9(Client client, int boatSlot) + { + switch (boatSlot) + { + case 1: return client.getVarbitValue(VarbitID.SAILING_BOAT_1_HOTSPOT_9); + case 2: return client.getVarbitValue(VarbitID.SAILING_BOAT_2_HOTSPOT_9); + case 3: return client.getVarbitValue(VarbitID.SAILING_BOAT_3_HOTSPOT_9); + case 4: return client.getVarbitValue(VarbitID.SAILING_BOAT_4_HOTSPOT_9); + case 5: return client.getVarbitValue(VarbitID.SAILING_BOAT_5_HOTSPOT_9); + default: return 0; + } + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/sailing/HasBoatResistanceRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/sailing/HasBoatResistanceRequirement.java new file mode 100644 index 00000000000..5ec4ff42616 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/sailing/HasBoatResistanceRequirement.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.requirements.sailing; + +import net.runelite.api.Client; +import net.runelite.api.GameState; +import net.runelite.api.gameval.VarbitID; +import net.runelite.client.plugins.microbot.questhelper.requirements.AbstractRequirement; + +import javax.annotation.Nonnull; +import java.util.Objects; + +public class HasBoatResistanceRequirement extends AbstractRequirement +{ + private static final int MAX_BOATS = 5; + + private final BoatResistanceType resistanceType; + private final boolean checkCurrentShip; + private final int minimumLevel; + private final String displayText; + + public HasBoatResistanceRequirement(BoatResistanceType resistanceType, boolean checkCurrentShip, int minimumLevel) + { + this.resistanceType = Objects.requireNonNull(resistanceType); + this.checkCurrentShip = checkCurrentShip; + this.minimumLevel = minimumLevel; + this.shouldCountForFilter = true; + this.displayText = buildDisplayText(); + } + + private String buildDisplayText() + { + String shipType = checkCurrentShip ? "Current ship" : "Any ship"; + String levelText = resistanceType.isShowLevel() + ? " (level " + minimumLevel + "+)" + : ""; + return shipType + " with " + resistanceType.getDisplayName() + " resistance" + levelText; + } + + @Override + public boolean check(Client client) + { + if (client == null || client.getGameState() != GameState.LOGGED_IN) + { + return false; + } + + if (checkCurrentShip) + { + return checkCurrentShipFromVarbits(client); + } + else + { + return checkAnyShipFromVarbits(client); + } + } + + private boolean checkCurrentShipFromVarbits(Client client) + { + // Check if player is on a boat + if (client.getVarbitValue(VarbitID.SAILING_BOARDED_BOAT) != 1) + { + return false; + } + + int currentLevel = resistanceType.getActiveBoatLevel(client); + return currentLevel >= minimumLevel; + } + + private boolean checkAnyShipFromVarbits(Client client) + { + for (int boatSlot = 1; boatSlot <= MAX_BOATS; boatSlot++) + { + int level = resistanceType.getBoatSlotLevel(client, boatSlot); + if (level >= minimumLevel) + { + return true; + } + } + return false; + } + + @Nonnull + @Override + public String getDisplayText() + { + return displayText; + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/InventorySlots.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/InventorySlots.java index a83d855c33e..3de13dd1040 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/InventorySlots.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/InventorySlots.java @@ -27,9 +27,9 @@ package net.runelite.client.plugins.microbot.questhelper.requirements.util; import net.runelite.api.Client; -import net.runelite.api.gameval.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; +import net.runelite.api.gameval.InventoryID; import java.util.Arrays; import java.util.Objects; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/ItemSlots.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/ItemSlots.java index 2fe6db42379..e693900f061 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/ItemSlots.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/ItemSlots.java @@ -28,9 +28,9 @@ import lombok.Getter; import net.runelite.api.Client; -import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; +import net.runelite.api.gameval.InventoryID; import java.util.function.Predicate; import java.util.stream.Stream; @@ -90,7 +90,7 @@ public boolean checkInventory(Client client, Predicate predicate) { return false; } - ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT); + ItemContainer equipment = client.getItemContainer(InventoryID.WORN); if (equipment == null || getSlotIdx() < 0) // unknown slot { return false; @@ -120,7 +120,7 @@ public boolean contains(Client client, Predicate predicate) { return false; } - ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT); + ItemContainer equipment = client.getItemContainer(InventoryID.WORN); if (equipment == null || getSlotIdx() < 0) // unknown slot { return false; @@ -133,4 +133,4 @@ public boolean contains(Client client, Predicate predicate) return predicate.test(item); } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/Port.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/Port.java new file mode 100644 index 00000000000..b6ec18cdea8 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/Port.java @@ -0,0 +1,117 @@ +/* + * + * * Copyright (c) 2025, TTvanWillegen + * * All rights reserved. + * * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions are met: + * * + * * 1. Redistributions of source code must retain the above copyright notice, this + * * list of conditions and the following disclaimer. + * * 2. Redistributions in binary form must reproduce the above copyright notice, + * * this list of conditions and the following disclaimer in the documentation + * * and/or other materials provided with the distribution. + * * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package net.runelite.client.plugins.microbot.questhelper.requirements.util; + +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.ObjectID; + +@AllArgsConstructor +@Getter +public enum Port +{ + PORT_SARIM(0, "Port Sarim", ObjectID.SAILING_DOCKING_BUOY_PORT_SARIM, new WorldPoint(3048, 3186, 0), new Zone(new WorldPoint(3045, 3183, 0), new WorldPoint(3061, 3208, 0)), new WorldPoint(3051, 3193, 0), new WorldPoint(3028, 3194, 0), ObjectID.PORT_TASK_BOARD_PORT_SARIM, new WorldPoint(3030, 3197, 0)) + , PANDEMONIUM(1, "the Pandemonium", ObjectID.SAILING_DOCKING_BUOY_THE_PANDEMONIUM, new WorldPoint(3069, 2981, 0), new Zone(new WorldPoint(3065, 2974, 0), new WorldPoint(3084, 2998, 0)), new WorldPoint(3070, 2987, 0), new WorldPoint(3061,2985, 0), ObjectID.PORT_TASK_BOARD_PANDEMONIUM, new WorldPoint(3058, 2958, 0)) +// , LANDS_END(2, "Land's End", ObjectID.SAILING_DOCKING_BUOY_LANDS_END, null, null, null, null, ObjectID.PORT_TASK_BOARD_LANDS_END, null) + , MUSA_POINT(3, "Musa Point", ObjectID.SAILING_DOCKING_BUOY_MUSA_POINT, new WorldPoint(2961, 3152, 0), new Zone(new WorldPoint(2974, 3156, 0), new WorldPoint(2956, 3144, 0)), new WorldPoint(2961, 3146, 0), new WorldPoint(2952, 3150, 0), ObjectID.PORT_TASK_BOARD_MUSA_POINT, new WorldPoint(2956, 3144, 0)) +// , HOSIDIUS(4, "Hosidius", ObjectID.SAILING_DOCKING_BUOY_HOSIDIUS, null, null, null, null, -1, null) +// , PORT_PISCARILIUS(-1, "Port Piscarilius", ObjectID.SAILING_DOCKING_BUOY_PORT_PISCARILIUS, null, null, null, null, ObjectID.PORT_TASK_BOARD_PORT_PISCARILIUS, null) +// , RIMMINGTON(-1, "Rimmington", ObjectID.SAILING_DOCKING_BUOY_RIMMINGTON, null, null, null, null, -1, null) + , CATHERBY(6, "Catherby", ObjectID.SAILING_DOCKING_BUOY_CATHERBY, new WorldPoint(2788, 3409, 0), new Zone(new WorldPoint(2804, 3401, 0), new WorldPoint(2786, 3413, 0)), new WorldPoint(2796, 3412, 0), new WorldPoint(2799, 3413, 0), ObjectID.PORT_TASK_BOARD_CATHERBY, new WorldPoint(2803, 3418, 0)) +// , BRIMHAVEN(-1, "Brimhaven", ObjectID.SAILING_DOCKING_BUOY_BRIMHAVEN, null, null, null, null, ObjectID.PORT_TASK_BOARD_BRIMHAVEN, null) +// , ARDOUGNE(-1, "Ardougne", ObjectID.SAILING_DOCKING_BUOY_ARDOUGNE, null, null, null, null, ObjectID.PORT_TASK_BOARD_ARDOUGNE, null) +// , PORT_KHAZARD(-1, "Port Khazard", ObjectID.SAILING_DOCKING_BUOY_PORT_KHAZARD, null, null, null, null, ObjectID.PORT_TASK_BOARD_PORT_KHAZARD, null) +// , WITCHAVEN(-1, "Witchaven", ObjectID.SAILING_DOCKING_BUOY_WITCHAVEN, null, null, null, null, -1, null) +// , ENTRANA(-1, "Entrana", ObjectID.SAILING_DOCKING_BUOY_ENTRANA, null, null, null, null, -1, null) +// , CIVITAS_ILLA_FORTIS(-1, "Civitas illa Fortis", ObjectID.SAILING_DOCKING_BUOY_CIVITAS_ILLA_FORTIS, null, null, null, null, ObjectID.PORT_TASK_BOARD_CIVITAS_ILLA_FORTIS, null) +// , CORSAIR_COVE(-1, "Corsair Cove", ObjectID.SAILING_DOCKING_BUOY_CORSAIR_COVE, null, null, null, null, ObjectID.PORT_TASK_BOARD_CORSAIR_COVE, null) +// , CAIRN_ISLE(-1, "Cairn Isle", ObjectID.SAILING_DOCKING_BUOY_CAIRN_ISLE, null, null, null, null, -1, null) +// , THE_SUMMER_SHORE(-1, "the Summer Shore", ObjectID.SAILING_DOCKING_BUOY_THE_SUMMER_SHORE, null, null, null, null, ObjectID.PORT_TASK_BOARD_THE_SUMMER_SHORE, null) +// , ALDARIN(-1, "Aldarin", ObjectID.SAILING_DOCKING_BUOY_ALDARIN, null, null, null, null, ObjectID.PORT_TASK_BOARD_ALDARIN, null) +// , RUINS_OF_UNKAH(-1, "Ruins of Unkah", ObjectID.SAILING_DOCKING_BUOY_RUINS_OF_UNKAH, null, null, null, null, ObjectID.PORT_TASK_BOARD_RUINS_OF_UNKAH, null) +// , VOID_KNIGHTS_OUTPOST(-1, "Void Knights Outpost", ObjectID.SAILING_DOCKING_BUOY_VOID_KNIGHTS_OUTPOST, null, null, null, null, ObjectID.PORT_TASK_BOARD_VOID_KNIGHTS_OUTPOST, null) +// , PORT_ROBERTS(-1, "Port Roberts", ObjectID.SAILING_DOCKING_BUOY_PORT_ROBERTS, null, null, null, null, ObjectID.PORT_TASK_BOARD_PORT_ROBERTS, null) +// , RELLEKKA(-1, "Rellekka", ObjectID.SAILING_DOCKING_BUOY_RELLEKKA, null, null, null, null, ObjectID.PORT_TASK_BOARD_RELLEKKA, null) +// , ETCETERIA(-1, "Etceteria", ObjectID.SAILING_DOCKING_BUOY_ETCETERIA, null, null, null, null, ObjectID.PORT_TASK_BOARD_ETCETERIA, null) +// , PORT_TYRAS(-1, "Port Tyras", ObjectID.SAILING_DOCKING_BUOY_PORT_TYRAS, null, null, null, null, ObjectID.PORT_TASK_BOARD_PORT_TYRAS, null) +// , DEEPFIN_POINT(-1, "Deepfin Point", ObjectID.SAILING_DOCKING_BUOY_DEEPFIN_POINT, null, null, null, null, ObjectID.PORT_TASK_BOARD_DEEPFIN_POINT, null) +// , JATIZSO(-1, "Jatizso", ObjectID.SAILING_DOCKING_BUOY_JATIZSO, null, null, null, null, -1, null) +// , NEITIZNOT(-1, "Neitiznot", ObjectID.SAILING_DOCKING_BUOY_NEITIZNOT, null, null, null, null, -1, null) +// , PRIFDDINAS(-1, "Prifddinas", ObjectID.SAILING_DOCKING_BUOY_PRIFDDINAS, null, null, null, null, ObjectID.PORT_TASK_BOARD_PRIFDDINAS, null) +// , PISCATORIS(-1, "Piscatoris", ObjectID.SAILING_DOCKING_BUOY_PISCATORIS, null, null, null, null, -1, null) +// , LUNAR_ISLE(-1, "Lunar Isle", ObjectID.SAILING_DOCKING_BUOY_LUNAR_ISLE, null, null, null, null, ObjectID.PORT_TASK_BOARD_LUNAR_ISLE, null) + ; + + + private final int id; + private final String name; + private final int buoyId; + private final WorldPoint buoyLocation; + private final Zone dockZone; + private final WorldPoint gangplankLocation; // Relevant ObjectIDs: SAILING_GANGPLANK_DISEMBARK, SAILING_GANGPLANK_EMBARK, SAILING_MOORING_DISEMBARK, SAILING_MOORING_EMBARK; + private final WorldPoint ledgerTableLocation; // Relevant ObjectIDs: DOCK_LOADING_BAY_LEDGER_TABLE_WITHDRAW, DOCK_LOADING_BAY_LEDGER_TABLE_DEPOSIT; + private final int portTaskBoardId; + private final WorldPoint portTaskBoardLocation; // Relevant ObjectIDs: DOCK_LOADING_BAY_LEDGER_TABLE_WITHDRAW, DOCK_LOADING_BAY_LEDGER_TABLE_DEPOSIT; + + static Port getPort(int portId) { + for (Port p : Port.values()) { + if (p.id == portId) { + return p; + } + } + return null; + } +} +// SAILING_DOCKING_BUOY_ISLE_OF_SOULS = 59801; +// SAILING_DOCKING_BUOY_WATERBIRTH_ISLAND = 59802; +// SAILING_DOCKING_BUOY_WEISS = 59803; +// SAILING_DOCKING_BUOY_DOGNOSE_ISLAND = 59804; +// SAILING_DOCKING_BUOY_REMOTE_ISLAND = 59805; +// SAILING_DOCKING_BUOY_THE_LITTLE_PEARL = 59806; +// SAILING_DOCKING_BUOY_THE_ONYX_CREST = 59807; +// SAILING_DOCKING_BUOY_LAST_LIGHT = 59808; +// SAILING_DOCKING_BUOY_CHARRED_ISLAND = 59809; +// SAILING_DOCKING_BUOY_VATRACHOS_ISLAND = 59810; +// SAILING_DOCKING_BUOY_ANGLERS_RETREAT = 59811; +// SAILING_DOCKING_BUOY_MINOTAURS_REST = 59812; +// SAILING_DOCKING_BUOY_ISLE_OF_BONES = 59813; +// SAILING_DOCKING_BUOY_TEAR_OF_THE_SOUL = 59814; +// SAILING_DOCKING_BUOY_WINTUMBER_ISLAND = 59815; +// SAILING_DOCKING_BUOY_THE_CROWN_JEWEL = 59816; +// SAILING_DOCKING_BUOY_RAINBOWS_END = 59817; +// SAILING_DOCKING_BUOY_SUNBLEAK_ISLAND = 59818; +// SAILING_DOCKING_BUOY_SHIMMERING_ATOLL = 59819; +// SAILING_DOCKING_BUOY_LAGUNA_AURORAE = 59820; +// SAILING_DOCKING_BUOY_CHINCHOMPA_ISLAND = 59821; +// SAILING_DOCKING_BUOY_LLEDRITH_ISLAND = 59822; +// SAILING_DOCKING_BUOY_YNYSDAIL = 59823; +// SAILING_DOCKING_BUOY_BUCCANEERS_HAVEN = 59824; +// SAILING_DOCKING_BUOY_DRUMSTICK_ISLE = 59825; +// SAILING_DOCKING_BUOY_BRITTLE_ISLE = 59826; +// SAILING_DOCKING_BUOY_GRIMSTONE = 59827; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/RequirementBuilder.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/RequirementBuilder.java index fd66dae20ba..7eeb14574a3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/RequirementBuilder.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/util/RequirementBuilder.java @@ -26,7 +26,6 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements.util; -import net.runelite.client.plugins.microbot.questhelper.requirements.ComplexRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.api.Client; @@ -36,7 +35,7 @@ /** * Builder for building non-standard simple {@link Requirement}s.
* For complex requirements, use {@link ComplexRequirementBuilder}, - * {@link ComplexRequirement}, or + * {@link net.runelite.client.plugins.microbot.questhelper.requirements.ComplexRequirement}, or * implement your own {@link Requirement}. */ public final class RequirementBuilder diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/var/VarbitBuilder.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/var/VarbitBuilder.java new file mode 100644 index 00000000000..d1252b37af3 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/var/VarbitBuilder.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2025, pajlada + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.requirements.var; + +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; + +/// VarbitBuilder can be used to build VarbitRequirements in case your +/// quest needs to refer to multiple states of the same varbit. +public class VarbitBuilder +{ + /// The Varbit ID + private final int id; + + /// Create a VarbitBuilder for the given Varbit ID `id`. + public VarbitBuilder(int id) + { + this.id = id; + } + + /// Returns a VarbitRequirement with the EQUALS operator for the given value. + public VarbitRequirement eq(int value) + { + return new VarbitRequirement(id, value); + } + + /// Returns a VarbitRequirement with the GREATER_EQUAL (>=) operator for the given value. + public VarbitRequirement ge(int value) + { + return new VarbitRequirement(id, value, Operation.GREATER_EQUAL); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/widget/WidgetTextRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/widget/WidgetTextRequirement.java index 5f395c2ce96..41d3223ec6a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/widget/WidgetTextRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/widget/WidgetTextRequirement.java @@ -32,6 +32,7 @@ import lombok.Setter; import net.runelite.api.Client; import net.runelite.api.annotations.Component; +import net.runelite.api.gameval.InterfaceID; import net.runelite.api.widgets.Widget; import javax.annotation.Nonnull; @@ -125,6 +126,13 @@ public WidgetTextRequirement(int groupId, int childId, int childChildId, String. this.text = Arrays.asList(text); } + /// Checks for the text in the chat / message box. + /// + /// Usually used when the player right-click checks a game object or item in their inventory. + public static WidgetTextRequirement messageBox(String... text) { + return new WidgetTextRequirement(InterfaceID.Messagebox.TEXT, text); + } + public void addRange(int min, int max) { this.min = min; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/Zone.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/Zone.java index 431afd24dbc..f87505be699 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/Zone.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/Zone.java @@ -25,7 +25,11 @@ */ package net.runelite.client.plugins.microbot.questhelper.requirements.zone; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.WorldView; +import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import static net.runelite.api.Constants.REGION_SIZE; @@ -101,6 +105,46 @@ public boolean contains(WorldPoint worldPoint) && worldPoint.getPlane() <= maxPlane; } + public boolean contains(Client client, LocalPoint localPoint) + { + if (client == null || localPoint == null) + { + return false; + } + + WorldPoint normalizedPoint; + WorldView worldView = client.getWorldView(localPoint.getWorldView()); + var zoneWorldView = QuestPerspective.getLocalPointsFromWorldPointInInstance(worldView, new WorldPoint(minX, minY, minPlane)); + if (!zoneWorldView.isEmpty()) + { + return contains(WorldPoint.fromLocalInstance(client, localPoint)); + } + + if (worldView != null && !worldView.isTopLevel()) + { + var topLevel = client.getTopLevelWorldView(); + var worldEntity = topLevel.worldEntities().byIndex(worldView.getId()); + if (worldEntity == null) + { + return false; + } + + LocalPoint mainLocal = worldEntity.transformToMainWorld(localPoint); + normalizedPoint = WorldPoint.fromLocalInstance(client, mainLocal); + } + else + { + normalizedPoint = WorldPoint.fromLocalInstance(client, localPoint); + } + + if (normalizedPoint == null) + { + return false; + } + + return contains(normalizedPoint); + } + public WorldPoint getMinWorldPoint() { return new WorldPoint(minX, minY, minPlane); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/ZoneRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/ZoneRequirement.java index f1919a53498..c0e6e8fc095 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/ZoneRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/requirements/zone/ZoneRequirement.java @@ -50,7 +50,7 @@ public class ZoneRequirement extends AbstractRequirement * Check if the player is either in the specified zone. * * @param displayText display text - * @param zone the zone to check + * @param zone the zone to check */ public ZoneRequirement(String displayText, Zone zone) { @@ -60,9 +60,9 @@ public ZoneRequirement(String displayText, Zone zone) /** * Check if the player is either in, or not in, the specified zone. * - * @param displayText display text + * @param displayText display text * @param checkNotInZone true to negate this requirement check (i.e. it will check if the player is NOT in the zone) - * @param zone the zone to check + * @param zone the zone to check */ public ZoneRequirement(String displayText, boolean checkNotInZone, Zone zone) { @@ -106,8 +106,7 @@ public boolean check(Client client) Player player = client.getLocalPlayer(); if (player != null && zones != null) { - WorldPoint location = WorldPoint.fromLocalInstance(client, player.getLocalLocation()); - boolean inZone = zones.stream().anyMatch(z -> z.contains(location)); + boolean inZone = zones.stream().anyMatch(z -> z.contains(client, player.getLocalLocation())); return inZone == checkInZone; } return false; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/GlobalFakeObjects.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/GlobalFakeObjects.java index e262b48e40f..ef91ce9c5cf 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/GlobalFakeObjects.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/GlobalFakeObjects.java @@ -25,18 +25,9 @@ package net.runelite.client.plugins.microbot.questhelper.runeliteobjects; import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; -import net.runelite.client.plugins.microbot.questhelper.questinfo.PlayerQuests; -import net.runelite.client.plugins.microbot.questhelper.requirements.runelite.PlayerQuestStateRequirement; -import net.runelite.client.plugins.microbot.questhelper.requirements.util.Operation; -import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects.ReplacedNpc; import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects.RuneliteObjectManager; -import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects.WidgetReplacement; -import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetDetails; import lombok.Setter; import net.runelite.api.Client; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.gameval.InterfaceID; -import net.runelite.api.gameval.NpcID; import net.runelite.client.config.ConfigManager; public class GlobalFakeObjects @@ -46,9 +37,8 @@ public class GlobalFakeObjects public static void createNpcs(Client client, RuneliteObjectManager runeliteObjectManager, ConfigManager configManager, QuestHelperConfig questHelperConfig) { - if (initialized || !questHelperConfig.showRuneliteObjects()) return; + if (initialized) return; initialized = true; - createHopleez(runeliteObjectManager, client, configManager); Cheerer.createCheerers(runeliteObjectManager, client, configManager); } @@ -58,16 +48,4 @@ public static void disableNpcs(RuneliteObjectManager runeliteObjectManager) runeliteObjectManager.removeGroupAndSubgroups("global"); initialized = false; } - - private static void createHopleez(RuneliteObjectManager runeliteObjectManager, Client client, ConfigManager configManager) - { - ReplacedNpc replacedHopleez = runeliteObjectManager.createReplacedNpc(client.getNpcDefinition(NpcID.ZEAH_DEFENCE_PURE).getModels(), new WorldPoint(3235, 3215, 0), NpcID.HATIUS_LUMBRIDGE_DIARY); - replacedHopleez.setName("Hopleez"); - replacedHopleez.setFace(7481); - replacedHopleez.setExamine("He was here first."); - replacedHopleez.addExamineAction(runeliteObjectManager); - replacedHopleez.setDisplayRequirement(new PlayerQuestStateRequirement(configManager, PlayerQuests.COOKS_HELPER, 4, Operation.GREATER_EQUAL)); - replacedHopleez.addWidgetReplacement(new WidgetReplacement(new WidgetDetails(InterfaceID.ChatLeft.TEXT), "Hatius Cosaintus", "Hopleez")); - replacedHopleez.addWidgetReplacement(new WidgetReplacement(new WidgetDetails(InterfaceID.Objectbox.TEXT), "Hatius", "Hopleez")); - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ExtendedRuneliteObject.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ExtendedRuneliteObject.java index 6275094d6ad..0e315b7445a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ExtendedRuneliteObject.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ExtendedRuneliteObject.java @@ -45,8 +45,8 @@ import net.runelite.client.game.chatbox.ChatboxPanelManager; import java.awt.*; -import java.util.List; import java.util.*; +import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import java.util.function.Supplier; @@ -157,11 +157,11 @@ protected ExtendedRuneliteObject(Client client, ClientThread clientThread, World this.worldPoint = worldPoint; - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); - if (localPoints.isEmpty()) return; + if (!updateRuneLiteObjectLocation(worldPoint)) + { + return; + } - // Set it to first found local point - runeliteObject.setLocation(localPoints.get(0), client.getTopLevelWorldView().getPlane()); activate(); } @@ -188,10 +188,10 @@ private static ModelData createModel(Client client, ModelData[] data) public Shape getClickbox() { - if (QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint).isEmpty()) return null; + if (QuestPerspective.resolveLocalPointForWorldPoint(client, worldPoint, null) == null) return null; return Perspective.getClickbox(client, - client.getTopLevelWorldView(), + client.getWorldView(getRuneliteObject().getWorldView()), getRuneliteObject().getModel(), getRuneliteObject().getOrientation(), getRuneliteObject().getLocation().getX(), @@ -220,11 +220,7 @@ public void setModel(int[] model) public void setWorldPoint(WorldPoint worldPoint) { this.worldPoint = worldPoint; - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); - if (localPoints.isEmpty()) return; - - // Set it to first found local point - this.runeliteObject.setLocation(localPoints.get(0), client.getTopLevelWorldView().getPlane()); + updateRuneLiteObjectLocation(worldPoint); } public void setScaledModel(int[] model, int xScale, int yScale, int zScale) @@ -664,4 +660,19 @@ public boolean partiallyRotateToGoal() } return isFacingPlayer; } + + private boolean updateRuneLiteObjectLocation(WorldPoint worldPoint) + { + LocalPoint localPoint = QuestPerspective.resolveLocalPointForWorldPoint(client, worldPoint, null); + if (localPoint == null) + { + return false; + } + + WorldView worldView = client.getWorldView(localPoint.getWorldView()); + int plane = worldView != null ? worldView.getPlane() : client.getTopLevelWorldView().getPlane(); + + runeliteObject.setLocation(localPoint, plane); + return true; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/FakeItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/FakeItem.java index eb2c1df4622..af9c2a20ec8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/FakeItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/FakeItem.java @@ -25,10 +25,10 @@ package net.runelite.client.plugins.microbot.questhelper.runeliteobjects.extendedruneliteobjects; import net.runelite.client.plugins.microbot.questhelper.runeliteobjects.RuneliteConfigSetter; -import net.runelite.api.AnimationID; import net.runelite.api.Client; import net.runelite.api.Player; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.AnimationID; import net.runelite.client.callback.ClientThread; public class FakeItem extends ExtendedRuneliteObject @@ -52,7 +52,7 @@ public void addTakeAction(RuneliteObjectManager runeliteObjectManager, RuneliteC if (player.getWorldLocation().distanceTo(getWorldPoint()) <= 1) { runeliteObjectManager.createChatboxMessage(actionText); - player.setAnimation(AnimationID.BURYING_BONES); + player.setAnimation(AnimationID.HUMAN_PICKUPFLOOR); player.setAnimationFrame(0); // Set variable diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ReplacedNpc.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ReplacedNpc.java index f966b4b6d9f..ba5496a3745 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ReplacedNpc.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/ReplacedNpc.java @@ -96,7 +96,7 @@ public void addMenuEntry(MenuEntryWrapper menuEntry) public Shape getClickbox() { if (npc == null) return null; - return Perspective.getClickbox(client, client.getTopLevelWorldView(), npc.getModel(), npc.getOrientation(), npc.getLocalLocation().getX(), npc.getLocalLocation().getY(), + return Perspective.getClickbox(client, npc.getWorldView(), npc.getModel(), npc.getOrientation(), npc.getLocalLocation().getX(), npc.getLocalLocation().getY(), Perspective.getTileHeight(client, npc.getLocalLocation(), getWorldPoint().getPlane())); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/RuneliteObjectManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/RuneliteObjectManager.java index b282fdfd052..027788ac707 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/RuneliteObjectManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/runeliteobjects/extendedruneliteobjects/RuneliteObjectManager.java @@ -29,13 +29,14 @@ import com.google.inject.Singleton; import net.runelite.client.plugins.microbot.questhelper.steps.widget.WidgetDetails; import lombok.extern.slf4j.Slf4j; +import net.runelite.api.*; import net.runelite.api.Menu; import net.runelite.api.Point; -import net.runelite.api.*; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.*; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.SpriteID; import net.runelite.api.widgets.Widget; import net.runelite.client.callback.ClientThread; import net.runelite.client.callback.Hooks; @@ -53,8 +54,8 @@ import java.awt.*; import java.awt.image.BufferedImage; -import java.util.List; import java.util.*; +import java.util.List; import java.util.function.Consumer; // This will hold all RuneliteObjects @@ -81,7 +82,12 @@ public class RuneliteObjectManager Point clickPos; int redClickAnimationFrame = 0; int bufferRedClickAnimation = 0; - int[] redClick = new int[]{SpriteID.RED_CLICK_ANIMATION_1, SpriteID.RED_CLICK_ANIMATION_2, SpriteID.RED_CLICK_ANIMATION_3, SpriteID.RED_CLICK_ANIMATION_4}; + int[] redClick = new int[]{ + SpriteID.CrossInterface.RED_CLICK_ANIMATION_1, + SpriteID.CrossInterface.RED_CLICK_ANIMATION_2, + SpriteID.CrossInterface.RED_CLICK_ANIMATION_3, + SpriteID.CrossInterface.RED_CLICK_ANIMATION_4 + }; final int ANIMATION_PERIOD = 5; ExtendedRuneliteObject lastInteractedWithRuneliteObject; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/statemanagement/PlayerStateManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/statemanagement/PlayerStateManager.java index 689f151152f..c761f48baa5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/statemanagement/PlayerStateManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/statemanagement/PlayerStateManager.java @@ -33,11 +33,11 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.Player; -import net.runelite.api.Varbits; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameTick; import net.runelite.api.events.VarbitChanged; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; @@ -139,7 +139,7 @@ public void onGameTick(GameTick gameTick) @Subscribe public void onVarbitChanged(VarbitChanged event) { - if (event.getVarbitId() == Varbits.ACCOUNT_TYPE) { + if (event.getVarbitId() == VarbitID.IRONMAN) { var newAccountType = AccountType.get(event.getValue()); if (newAccountType == null) { // The account type value is invalid, leave previous account type as is @@ -150,6 +150,7 @@ public void onVarbitChanged(VarbitChanged event) } } + public String getPlayerName() { if (client.getLocalPlayer() == null) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/BoardShipStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/BoardShipStep.java new file mode 100644 index 00000000000..ef3e8947284 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/BoardShipStep.java @@ -0,0 +1,41 @@ +package net.runelite.client.plugins.microbot.questhelper.steps; + +import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.ShipInPortRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Port; +import lombok.NonNull; +import net.runelite.api.gameval.ObjectID; +import net.runelite.client.ui.overlay.components.PanelComponent; + +import java.util.ArrayList; +import java.util.List; + +/** + * Redirects you to board your ship, at the port you left it at. + */ +public class BoardShipStep extends ConditionalStep +{ + public BoardShipStep(QuestHelper questHelper, Requirement... requirements) + { + super(questHelper, new ObjectStep(questHelper, ObjectID.SAILING_GANGPLANK_EMBARK, Port.PORT_SARIM.getGangplankLocation(), "Board your ship in Port Sarim.", requirements), "Board your ship."); + for(Port port: Port.values()){ + this.addStep(new ShipInPortRequirement(port), new ObjectStep(questHelper, ObjectID.SAILING_GANGPLANK_EMBARK, port.getGangplankLocation(), "Board your ship in " + port.getName() + ", or reclaim it with a shipwright/ teleport it to you at your preferred dock.", requirements)); + } + } + + @Override + public void makeOverlayHint(PanelComponent panelComponent, QuestHelperPlugin plugin, @NonNull List additionalText, @NonNull List additionalRequirements) + { + List allRequirements = new ArrayList<>(additionalRequirements); + allRequirements.addAll(requirements); + + List allAdditionalText = new ArrayList<>(additionalText); + + if (currentStep != null) + { + currentStep.makeOverlayHint(panelComponent, plugin, allAdditionalText, allRequirements); + } + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ConditionalStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ConditionalStep.java index 1e21000c657..9802adc2c3a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ConditionalStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ConditionalStep.java @@ -35,19 +35,19 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.npc.DialogRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.runelite.RuneliteRequirement; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.client.plugins.microbot.questhelper.steps.widget.AbstractWidgetHighlight; import lombok.NonNull; import lombok.Setter; import net.runelite.api.GameState; -import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.*; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.overlay.components.PanelComponent; import java.awt.*; -import java.util.List; import java.util.*; +import java.util.List; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -59,7 +59,10 @@ public class ConditionalStep extends QuestStep implements OwnerStep protected boolean started = false; - /** + /// Controls whether the sidebar step text should use the current step / child step / fallback step instead of the ConditionalStep's text. + protected boolean passthroughText = false; + + /** * Controls whether the sidebar highlight should consider child steps when determining what to highlight. * When true, the sidebar will highlight the most specific active step in the step hierarchy. * When false, the sidebar will only highlight this ConditionalStep itself, ignoring any active child steps. @@ -71,7 +74,6 @@ public class ConditionalStep extends QuestStep implements OwnerStep protected boolean checkAllChildStepsOnListenerCall = false; protected LinkedHashMap steps; - protected final HashMap orderedSteps; protected final List chatConditions = new ArrayList<>(); protected final List npcConditions = new ArrayList<>(); protected final List dialogConditions = new ArrayList<>(); @@ -102,11 +104,6 @@ public ConditionalStep(QuestHelper questHelper, Integer id, QuestStep step, Stri this.requirements.addAll(Arrays.asList(requirements)); this.steps = new LinkedHashMap<>(); this.steps.put(null, step); - this.orderedSteps = new LinkedHashMap<>(); - if (id != null) - { - this.orderedSteps.put(id, step); - } this.id = id; } @@ -425,12 +422,12 @@ public void makeWidgetOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) { currentStep.makeWidgetOverlayHint(graphics, plugin); } - WorldPoint activeWp = (currentStep instanceof DetailedQuestStep) ? ((DetailedQuestStep) currentStep).getWorldPoint() : null; + DefinedPoint activeDp = (currentStep instanceof DetailedQuestStep) ? ((DetailedQuestStep) currentStep).getDefinedPoint(): null; List itemRequirements = requirements.stream() .filter(ItemRequirement.class::isInstance) .map(ItemRequirement.class::cast) .collect(Collectors.toList()); - renderInventory(graphics, activeWp, itemRequirements, false); + renderInventory(graphics, activeDp, itemRequirements, false); for (AbstractWidgetHighlight widgetHighlights : widgetsToHighlight) { widgetHighlights.highlightChoices(graphics, client, plugin); @@ -485,6 +482,11 @@ public Collection getSteps() return steps.values(); } + public HashMap getStepsMap() + { + return steps; + } + public ConditionalStep copy() { ConditionalStep newStep = new ConditionalStep(getQuestHelper(), steps.get(null)); @@ -497,4 +499,26 @@ public ConditionalStep copy() .forEach(conditions -> newStep.addStep(conditions, steps.get(conditions))); return newStep; } + + /// Set to true if this conditional step should pass through the current step's text in the sidebar + public void setShouldPassthroughText(boolean newPassthroughText) + { + this.passthroughText = newPassthroughText; + } + + @Override + public List getText() + { + if (passthroughText) + { + if (currentStep != null) + { + return currentStep.getText(); + } + + return steps.get(null).getText(); + } + + return super.getText(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DetailedQuestStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DetailedQuestStep.java index 070b92c5909..106aaf186eb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DetailedQuestStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DetailedQuestStep.java @@ -28,13 +28,13 @@ import com.google.common.collect.Multimap; import com.google.inject.Inject; import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; -import net.runelite.client.plugins.microbot.questhelper.bank.QuestBank; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.steps.overlay.DirectionArrow; import net.runelite.client.plugins.microbot.questhelper.steps.overlay.WorldLines; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import net.runelite.client.plugins.microbot.questhelper.steps.widget.AbstractWidgetHighlight; import net.runelite.client.plugins.microbot.questhelper.tools.QuestHelperWorldMapPoint; @@ -43,15 +43,16 @@ import lombok.Getter; import lombok.NonNull; import lombok.Setter; +import net.runelite.api.*; import net.runelite.api.Menu; import net.runelite.api.Point; -import net.runelite.api.*; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.ItemDespawned; import net.runelite.api.events.ItemSpawned; +import net.runelite.api.gameval.SpriteID; import net.runelite.api.widgets.Widget; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; @@ -64,8 +65,8 @@ import java.awt.*; import java.awt.image.BufferedImage; -import java.util.List; import java.util.*; +import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -77,14 +78,10 @@ public class DetailedQuestStep extends QuestStep @Inject EventBus eventBus; - @Inject - private QuestBank questBank; - @Getter - protected WorldPoint worldPoint; + protected DefinedPoint definedPoint; - @Setter - protected Zone highlightZone; + protected List highlightZones = new ArrayList<>(); @Setter protected List linePoints; @@ -113,6 +110,7 @@ public class DetailedQuestStep extends QuestStep protected final int MAX_RENDER_SIZE = 4; + @Getter protected boolean started; @Setter @@ -144,14 +142,21 @@ public DetailedQuestStep(QuestHelper questHelper, String text, List public DetailedQuestStep(QuestHelper questHelper, WorldPoint worldPoint, String text, Requirement... requirements) { super(questHelper, text); - this.worldPoint = worldPoint; + this.definedPoint = DefinedPoint.of(worldPoint); + this.requirements.addAll(Arrays.asList(requirements)); + } + + public DetailedQuestStep(QuestHelper questHelper, DefinedPoint definedPoint, String text, Requirement... requirements) + { + super(questHelper, text); + this.definedPoint = definedPoint; this.requirements.addAll(Arrays.asList(requirements)); } public DetailedQuestStep(QuestHelper questHelper, WorldPoint worldPoint, String text, List requirements, List recommended) { super(questHelper, text); - this.worldPoint = worldPoint; + this.definedPoint = DefinedPoint.of(worldPoint); if (requirements != null) { this.requirements.addAll(requirements); @@ -171,11 +176,11 @@ public DetailedQuestStep(QuestHelper questHelper, String text, List public void startUp() { super.startUp(); - if (worldPoint != null) + if (definedPoint != null) { if (questHelper.getConfig().showWorldMapPoint()) { - mapPoint = new QuestHelperWorldMapPoint(worldPoint, getQuestImage()); + mapPoint = new QuestHelperWorldMapPoint(definedPoint.getWorldPoint(), getQuestImage()); worldMapPointManager.add(mapPoint); } @@ -206,6 +211,11 @@ public void addRequirement(Requirement... requirements) this.requirements.addAll(Arrays.asList(requirements)); } + public void addRequirement(List requirements) + { + this.requirements.addAll(requirements); + } + public void addItemRequirements(List requirement) { requirements.addAll(requirement); @@ -227,6 +237,11 @@ public void addRecommended(Requirement newRecommended) recommended.add(newRecommended); } + public void addRecommended(List newRecommended) + { + recommended.addAll(newRecommended); + } + public void setRecommended(List newRecommended) { recommended.clear(); @@ -247,20 +262,20 @@ public void onGameStateChanged(final GameStateChanged event) } } - public void setWorldPoint(WorldPoint worldPoint) + public void setWorldPoint(DefinedPoint definedPoint) { - this.worldPoint = worldPoint; + this.definedPoint = definedPoint; if (started) { if (mapPoint != null) { worldMapPointManager.remove(mapPoint); } - if (worldPoint != null) + if (definedPoint != null) { if (questHelper.getConfig().showWorldMapPoint()) { - mapPoint = new QuestHelperWorldMapPoint(worldPoint, getQuestImage()); + mapPoint = new QuestHelperWorldMapPoint(definedPoint.getWorldPoint(), getQuestImage()); worldMapPointManager.add(mapPoint); } } @@ -271,6 +286,11 @@ public void setWorldPoint(WorldPoint worldPoint) } } + public void setWorldPoint(WorldPoint worldPoint) + { + setWorldPoint(DefinedPoint.of(worldPoint)); + } + public void setWorldPoint(int x, int y, int z) { setWorldPoint(new WorldPoint(x, y, z)); @@ -294,7 +314,7 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) for (QuestTile location : markedTiles) { BufferedImage combatIcon = spriteManager.getSprite(location.getIconID(), 0); - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, location.getWorldPoint()); + List localPoints = DefinedPoint.of(location.getWorldPoint()).resolveLocalPoints(client); for (LocalPoint localPoint : localPoints) { @@ -303,22 +323,22 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) } } - if (highlightZone != null) + for (Zone highlightZone : highlightZones) { Polygon zonePoly = QuestPerspective.getZonePoly(client, highlightZone); OverlayUtil.renderPolygon(graphics, zonePoly, questHelper.getConfig().targetOverlayColor()); } - tileHighlights.keySet().forEach(tile -> checkAllTilesForHighlighting(tile, tileHighlights.get(tile), graphics)); + + tileHighlights.keySet().forEach(tile -> checkAllTilesForItemHighlighting(tile, tileHighlights.get(tile), graphics)); renderTileIcon(graphics); } protected void renderTileIcon(Graphics2D graphics) { if (icon == null || iconItemID == -1) return; - - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); - + if (definedPoint == null) return; + List localPoints = definedPoint.resolveLocalPoints(client); for (LocalPoint localPoint : localPoints) { OverlayUtil.renderTileOverlay(client, graphics, localPoint, icon, questHelper.getConfig().targetOverlayColor()); @@ -373,12 +393,12 @@ public void renderArrow(Graphics2D graphics) { if (questHelper.getConfig().showMiniMapArrow()) { - if (worldPoint == null || hideWorldArrow) + if (definedPoint == null || hideWorldArrow) { return; } - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); + List localPoints = definedPoint.resolveLocalPoints(client); for (LocalPoint localPoint : localPoints) { @@ -427,7 +447,7 @@ public void addSafeSpots(WorldPoint... worldPoints) { for (WorldPoint worldPoint : worldPoints) { - markedTiles.add(new QuestTile(worldPoint, SpriteID.TAB_COMBAT)); + markedTiles.add(new QuestTile(worldPoint, SpriteID.SideIcons.COMBAT)); } } @@ -446,8 +466,8 @@ public void makeWidgetOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) .filter(ItemRequirement.class::isInstance) .map(ItemRequirement.class::cast) .collect(Collectors.toList()); - renderInventory(graphics, worldPoint, itemRequirements, false); - renderInventory(graphics, worldPoint, teleportRequirements, true); + renderInventory(graphics, definedPoint, itemRequirements, false); + renderInventory(graphics, definedPoint, teleportRequirements, true); for (AbstractWidgetHighlight widgetHighlights : widgetsToHighlight) { widgetHighlights.highlightChoices(graphics, client, plugin); @@ -512,14 +532,15 @@ public void renderMinimapArrow(Graphics2D graphics) { if (questHelper.getConfig().showMiniMapArrow()) { - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); + List localPoints = definedPoint.resolveLocalPoints(client); + if (localPoints == null) return; for (LocalPoint localPoint : localPoints) { DirectionArrow.renderMinimapArrowFromLocal(graphics, client, localPoint, getQuestHelper().getConfig().targetOverlayColor()); } if (localPoints.isEmpty()) { - DirectionArrow.renderMinimapArrow(graphics, client, worldPoint, getQuestHelper().getConfig().targetOverlayColor()); + DirectionArrow.renderMinimapArrow(graphics, client, definedPoint, getQuestHelper().getConfig().targetOverlayColor()); } } } @@ -559,7 +580,7 @@ private void processRequirements(Stream requirementsStream, PanelCo .flatMap(Collection::stream) .forEach(line -> tmpComponent.getChildren().add(line)); - if (tmpComponent.getChildren().size() > 0) + if (!tmpComponent.getChildren().isEmpty()) { panelComponent.getChildren().add(LineComponent.builder().left(title).build()); panelComponent.getChildren().addAll(tmpComponent.getChildren()); @@ -571,7 +592,7 @@ public void onItemSpawned(ItemSpawned itemSpawned) { TileItem item = itemSpawned.getItem(); Tile tile = itemSpawned.getTile(); - if (onlyHighlightItemsOnTile && !QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint).contains(tile.getLocalLocation())) return; + if (onlyHighlightItemsOnTile && !definedPoint.resolveLocalPoints(client).contains(tile.getLocalLocation())) return; for (Requirement requirement : requirements) { if (isItemRequirement(requirement) && requirementContainsID((ItemRequirement) requirement, item.getId())) @@ -621,7 +642,7 @@ protected void addItemTiles(Collection requirements) { continue; } - if (onlyHighlightItemsOnTile && !QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint).contains(tile.getLocalLocation())) continue; + if (onlyHighlightItemsOnTile && !definedPoint.resolveLocalPoints(client).contains(tile.getLocalLocation())) continue; for (Requirement requirement : requirements) { if (isValidRequirementForTileItem(requirement, item)) @@ -665,7 +686,7 @@ private boolean requirementContainsID(ItemRequirement requirement, Collection requirementContainsID(requirement, id)); } - private void checkAllTilesForHighlighting(Tile tile, Collection ids, Graphics2D graphics) + private void checkAllTilesForItemHighlighting(Tile tile, Collection ids, Graphics2D graphics) { if (inCutscene) { @@ -688,12 +709,20 @@ private void checkAllTilesForHighlighting(Tile tile, Collection ids, Gr return; } - if (location.distanceTo(playerLocation) > MAX_DISTANCE) + var tileWp = tile.getWorldLocation(); + if (tileWp == null || tileWp.getPlane() != player.getWorldLocation().getPlane()) { return; } - Polygon poly = Perspective.getCanvasTilePoly(client, location); + + if (location.distanceTo(playerLocation) > MAX_DISTANCE) + { + return; + } + final int zOffset = tile.getItemLayer().getHeight(); + final Polygon poly = Perspective.getCanvasTilePoly(client, location, zOffset); + final Point imgPoint = Perspective.getCanvasImageLocation(client, location, icon, zOffset); if (poly == null) { return; @@ -703,13 +732,13 @@ private void checkAllTilesForHighlighting(Tile tile, Collection ids, Gr for (Requirement requirement : requirements) { - if (isReqValidForHighlighting(requirement, ids)) + if (isReqValidForItemHighlighting(requirement, ids)) { if (iconToUseForNeededItems != -1) { BufferedImage icon = spriteManager.getSprite(iconToUseForNeededItems, 0); - - OverlayUtil.renderTileOverlay(client, graphics, location, icon, questHelper.getConfig().targetOverlayColor()); + OverlayUtil.renderPolygon(graphics, poly, questHelper.getConfig().targetOverlayColor()); + OverlayUtil.renderImageLocation(graphics, imgPoint, icon); } else @@ -742,7 +771,7 @@ private void highlightGroundItem(Tile tile, Color color, Graphics2D graphics, Po } } - private boolean isReqValidForHighlighting(Requirement requirement, Collection ids) + private boolean isReqValidForItemHighlighting(Requirement requirement, Collection ids) { return isItemRequirement(requirement) && requirementIsItem((ItemRequirement) requirement) @@ -783,7 +812,7 @@ protected void renderHoveredMenuEntryPanel(PanelComponent panelComponent, String if (currentMenuEntries != null) { - net.runelite.api.Point mousePosition = client.getMouseCanvasPosition(); + Point mousePosition = client.getMouseCanvasPosition(); int menuX = menu.getMenuX(); int menuY = menu.getMenuY(); int menuWidth = menu.getMenuWidth(); @@ -844,22 +873,32 @@ protected boolean isValidRenderRequirementInInventory(ItemRequirement requiremen @Override public void setShortestPath() { - if (worldPoint != null && !isLineDrawn()) + if (definedPoint == null) { - WorldPoint playerWp = client.getLocalPlayer().getWorldLocation(); - if (getQuestHelper().getConfig().useShortestPath() && playerWp != null) { - Map data = new HashMap<>(); - data.put("start", playerWp); - data.put("target", worldPoint); - eventBus.post(new PluginMessage("shortestpath", "path", data)); - } + return; + } + if (isLineDrawn()) + { + return; + } + var playerWp = client.getLocalPlayer().getWorldLocation(); + if (playerWp == null) + { + return; + } + if (getQuestHelper().getConfig().useShortestPath()) + { + Map data = new HashMap<>(); + data.put("start", playerWp); + data.put("target", definedPoint.getWorldPoint()); + eventBus.post(new PluginMessage("shortestpath", "path", data)); } } @Override public void removeShortestPath() { - if (getQuestHelper().getConfig().useShortestPath() && worldPoint != null && !isLineDrawn()) + if (getQuestHelper().getConfig().useShortestPath() && definedPoint != null && !isLineDrawn()) { eventBus.post(new PluginMessage("shortestpath", "clear")); } @@ -868,7 +907,7 @@ public void removeShortestPath() @Override public void disableShortestPath() { - if (worldPoint != null && !isLineDrawn()) + if (definedPoint.getWorldPoint() != null && !isLineDrawn()) { eventBus.post(new PluginMessage("shortestpath", "clear")); } @@ -878,4 +917,24 @@ private boolean isLineDrawn() { return linePoints != null && !linePoints.isEmpty(); } + + public void setHighlightZone(List zones) + { + highlightZones = new ArrayList<>(zones); + } + + public void addHighlightZones(Zone[] zones) + { + highlightZones.addAll(List.of(zones)); + } + + public void setHighlightZone(Zone zone) + { + highlightZones = new ArrayList<>(List.of(zone)); + } + + public void addHighlightZone(Zone zone) + { + highlightZones.add(zone); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DigStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DigStep.java index aae07b61a5d..26e40a76388 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DigStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/DigStep.java @@ -29,8 +29,6 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; -import java.awt.*; -import java.awt.image.BufferedImage; import lombok.Setter; import net.runelite.api.Player; import net.runelite.api.coords.LocalPoint; @@ -40,6 +38,9 @@ import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.overlay.OverlayUtil; +import java.awt.*; +import java.awt.image.BufferedImage; + public class DigStep extends DetailedQuestStep { private final ItemRequirement spade; @@ -76,7 +77,7 @@ public void onGameTick(GameTick event) { return; } - WorldPoint targetLocation = worldPoint; + WorldPoint targetLocation = definedPoint.getWorldPoint(); boolean shouldHighlightSpade = false; switch (this.whenToHighlight) { @@ -101,7 +102,7 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) return; } - LocalPoint localLocation = LocalPoint.fromWorld(client, worldPoint); + LocalPoint localLocation = definedPoint.resolveLocalPoint(client); if (localLocation == null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/MultiNpcStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/MultiNpcStep.java index 334a397191a..7acd1c1b4b6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/MultiNpcStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/MultiNpcStep.java @@ -138,7 +138,7 @@ public void onNpcDespawned(NpcDespawned event) @Override public NpcStep copy() { - MultiNpcStep newStep = new MultiNpcStep(getQuestHelper(), npcID, worldPoint, null, multinpcVarbit, npcCompositionID, requirements); + MultiNpcStep newStep = new MultiNpcStep(getQuestHelper(), npcID, definedPoint.getWorldPoint(), null, multinpcVarbit, npcCompositionID, requirements); if (text != null) { newStep.setText(text); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/NpcStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/NpcStep.java index c7380fff76d..f68d90fd5e0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/NpcStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/NpcStep.java @@ -31,16 +31,16 @@ import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.steps.overlay.DirectionArrow; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import lombok.Setter; -import net.runelite.api.Point; import net.runelite.api.*; +import net.runelite.api.Point; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.NpcChanged; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcSpawned; -import net.runelite.api.gameval.NpcID; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.overlay.OverlayUtil; import net.runelite.client.util.ColorUtil; @@ -50,7 +50,6 @@ import java.awt.geom.Line2D; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.List; import java.util.function.Function; @@ -64,8 +63,8 @@ public class NpcStep extends DetailedQuestStep protected final int npcID; protected final List alternateNpcIDs = new ArrayList<>(); - @Getter @Setter + @Getter protected boolean allowMultipleHighlights; @Getter @@ -158,9 +157,18 @@ public NpcStep(QuestHelper questHelper, int npcID, String text, boolean allowMul this(questHelper, npcID, null, text, allowMultipleHighlights, requirements); } + public NpcStep(QuestHelper questHelper, int npcID, DefinedPoint definedPoint, String text, Requirement... requirements) + { + super(questHelper, definedPoint, text, requirements); + this.npcID = npcID; + } + public NpcStep copy() { - NpcStep newStep = new NpcStep(getQuestHelper(), npcID, worldPoint, null, requirements, recommended); + NpcStep newStep = new NpcStep(getQuestHelper(), npcID, definedPoint, null); + newStep.setRequirements(requirements); + newStep.setRecommended(recommended); + if (text != null) { newStep.setText(text); @@ -196,6 +204,12 @@ public void scanForNpcs() { addNpcToListGivenMatchingID(npc, this::npcPassesChecks, npcs); } + var playerWorldView = client.getLocalPlayer().getWorldView(); + if (playerWorldView == null || playerWorldView.npcs() == null) return; + for (NPC npc : playerWorldView.npcs()) + { + addNpcToListGivenMatchingID(npc, this::npcPassesChecks, npcs); + } } public NpcStep addAlternateNpcs(Integer... alternateNpcIDs) @@ -263,21 +277,26 @@ public void addNpcToListGivenMatchingID(NPC npc, Function conditio { if (condition.apply(npc)) { - WorldPoint npcPoint = WorldPoint.fromLocalInstance(client, npc.getLocalLocation()); - if (npcs.size() == 0) + var npcPoint = npc.getLocalLocation(); + if (npcPoint == null) { - if (worldPoint == null) + return; + } + + if (npcs.isEmpty()) + { + if (definedPoint == null) { list.add(npc); } - else if (npcPoint.distanceTo(worldPoint) < maxRoamRange) + else if (definedPoint.distanceTo(client, npcPoint) < maxRoamRange) { list.add(npc); } } else if (allowMultipleHighlights) { - if (worldPoint == null || npcPoint.distanceTo(worldPoint) < maxRoamRange) + if (definedPoint == null || definedPoint.distanceTo(client, npcPoint) < maxRoamRange) { list.add(npc); } @@ -301,7 +320,7 @@ public void onNpcChanged(NpcChanged npcChanged) // This MAY for some NPCs which have alternate version (The Kendal) require re-consideration if (allIds().contains(newNpcId)) { - if (npcs.size() == 0 || allowMultipleHighlights) + if (npcs.isEmpty() || allowMultipleHighlights) { npcs.add(npcChanged.getNpc()); } @@ -315,13 +334,10 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) super.makeWorldOverlayHint(graphics, plugin); - if (worldPoint != null) + if (definedPoint != null) { - Collection localWorldPoints = QuestPerspective.toLocalInstanceFromReal(client, worldPoint); - if (localWorldPoints.isEmpty()) - { - return; - } + WorldPoint localWorldPoint = QuestPerspective.getWorldPointConsideringWorldView(client, client.getTopLevelWorldView(), definedPoint.getWorldPoint()); + if (localWorldPoint == null) return; } Color configColor = getQuestHelper().getConfig().targetOverlayColor(); @@ -399,7 +415,7 @@ public void renderArrow(Graphics2D graphics) { if (questHelper.getConfig().showMiniMapArrow()) { - if (npcs.size() == 0) + if (npcs.isEmpty()) { super.renderArrow(graphics); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ObjectStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ObjectStep.java index 4fbf84b9dca..9cf33dfdd94 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ObjectStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ObjectStep.java @@ -31,10 +31,11 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; import net.runelite.client.plugins.microbot.questhelper.steps.overlay.DirectionArrow; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import lombok.Setter; -import net.runelite.api.Point; import net.runelite.api.*; +import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.*; @@ -63,6 +64,7 @@ public class ObjectStep extends DetailedQuestStep private int maxRenderDistance = 50; private TileObject closestObject = null; private int lastPlane; + @Setter private boolean revalidateObjects; public ObjectStep(QuestHelper questHelper, int objectID, WorldPoint worldPoint, String text, Requirement... requirements) @@ -81,13 +83,13 @@ public ObjectStep(QuestHelper questHelper, int objectID, WorldPoint worldPoint, public ObjectStep(QuestHelper questHelper, int objectID, String text, Requirement... requirements) { - super(questHelper, null, text, requirements); + super(questHelper, DefinedPoint.of(null), text, requirements); this.objectID = objectID; } public ObjectStep(QuestHelper questHelper, int objectID, String text, boolean showAllInArea, Requirement... requirements) { - super(questHelper, null, text, requirements); + super(questHelper, DefinedPoint.of(null), text, requirements); this.showAllInArea = showAllInArea; this.objectID = objectID; } @@ -99,9 +101,18 @@ public ObjectStep(QuestHelper questHelper, int objectID, WorldPoint worldPoint, this.showAllInArea = false; } + // New DefinedPoint function + public ObjectStep(QuestHelper questHelper, int objectID, DefinedPoint definedPoint, String text, Requirement... requirements) + { + super(questHelper, definedPoint, text, requirements); + this.objectID = objectID; + } + public ObjectStep copy() { - ObjectStep newStep = new ObjectStep(getQuestHelper(), objectID, worldPoint, null, requirements, recommended); + ObjectStep newStep = new ObjectStep(getQuestHelper(), objectID, definedPoint, null); + newStep.setRequirements(requirements); + newStep.setRecommended(recommended); if (text != null) { newStep.setText(text); @@ -118,18 +129,13 @@ public ObjectStep copy() return newStep; } - public void setRevalidateObjects(boolean value) - { - this.revalidateObjects = value; - } - @Override public void startUp() { super.startUp(); - if (worldPoint != null && !showAllInArea) + if (definedPoint != null && !showAllInArea) { - checkTileForObject(worldPoint); + checkTileForObject(definedPoint); } else { @@ -141,7 +147,17 @@ protected void loadObjects() { // TODO: This needs to be tested in Shadow of the Storm's Demon Room objects.clear(); - Tile[][] tiles = client.getScene().getTiles()[client.getPlane()]; + loadObjectsInWorldView(client.getTopLevelWorldView()); + var playerWorldView = client.getLocalPlayer().getWorldView(); + if (playerWorldView != client.getTopLevelWorldView()) + { + loadObjectsInWorldView(client.getLocalPlayer().getWorldView()); + } + } + + protected void loadObjectsInWorldView(WorldView worldView) + { + Tile[][] tiles = worldView.getScene().getTiles()[worldView.getPlane()]; for (Tile[] lineOfTiles : tiles) { for (Tile tile : lineOfTiles) @@ -167,37 +183,41 @@ public void onGameTick(final GameTick event) super.onGameTick(event); if (revalidateObjects) { - if (lastPlane != client.getPlane()) + if (lastPlane != client.getTopLevelWorldView().getPlane()) { - lastPlane = client.getPlane(); + lastPlane = client.getTopLevelWorldView().getPlane(); loadObjects(); } } - if (worldPoint == null || showAllInArea) + if (definedPoint == null || showAllInArea) { return; } closestObject = null; objects.clear(); - checkTileForObject(worldPoint); + checkTileForObject(definedPoint); } - public void checkTileForObject(WorldPoint wp) + public void checkTileForObject(DefinedPoint point) { - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, wp); - - for (LocalPoint localPoint : localPoints) + if (point == null) { - Tile[][][] tiles = client.getTopLevelWorldView().getScene().getTiles(); + return; + } - Tile tile = tiles[client.getTopLevelWorldView().getPlane()][localPoint.getSceneX()][localPoint.getSceneY()]; - if (tile != null) - { - Arrays.stream(tile.getGameObjects()).forEach(this::handleObjects); - handleObjects(tile.getDecorativeObject()); - handleObjects(tile.getGroundObject()); - handleObjects(tile.getWallObject()); - } + LocalPoint localPoint = point.resolveLocalPoint(client, client.getTopLevelWorldView()); + if (localPoint == null) return; + + var wv = client.getWorldView(localPoint.getWorldView()); + Tile[][][] tiles = wv.getScene().getTiles(); + + Tile tile = tiles[wv.getPlane()][localPoint.getSceneX()][localPoint.getSceneY()]; + if (tile != null) + { + Arrays.stream(tile.getGameObjects()).forEach(this::handleObjects); + handleObjects(tile.getDecorativeObject()); + handleObjects(tile.getGroundObject()); + handleObjects(tile.getWallObject()); } } @@ -299,53 +319,66 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) { return; } - WorldPoint playerPosition = client.getLocalPlayer().getWorldLocation(); + WorldPoint playerPosition = QuestPerspective.getWorldPointConsideringWorldView(client, client.getLocalPlayer().getWorldView(), + client.getLocalPlayer().getWorldLocation()); + if (playerPosition == null) + { + return; + } + + WorldPoint closestObjectPosition = null; for (TileObject tileObject : objects) { - int distanceFromPlayer = tileObject.getWorldLocation().distanceTo(playerPosition); + if (tileObject.getWorldView() == null) continue; + WorldPoint objectPosition = QuestPerspective.getWorldPointConsideringWorldView(client, tileObject.getWorldView(), tileObject.getWorldLocation()); + if (objectPosition == null) + { + continue; + } + + int distanceFromPlayer = objectPosition.distanceTo(playerPosition); if (maxRenderDistance < distanceFromPlayer) { continue; } - if (tileObject.getPlane() == client.getPlane()) + if (closestObject == null || closestObjectPosition == null + || closestObjectPosition.distanceTo(playerPosition) > distanceFromPlayer) { - if (closestObject == null || closestObject.getWorldLocation().distanceTo(playerPosition) > distanceFromPlayer) - { - closestObject = tileObject; - } + closestObject = tileObject; + closestObjectPosition = objectPosition; + } - Color configColor = getQuestHelper().getConfig().targetOverlayColor(); + Color configColor = getQuestHelper().getConfig().targetOverlayColor(); - QuestHelperConfig.ObjectHighlightStyle highlightStyle = visibilityHelper.isObjectVisible(tileObject) - ? questHelper.getConfig().highlightStyleObjects() - : CLICK_BOX; + QuestHelperConfig.ObjectHighlightStyle highlightStyle = visibilityHelper.isObjectVisible(tileObject) + ? questHelper.getConfig().highlightStyleObjects() + : CLICK_BOX; - switch (highlightStyle) - { - case CLICK_BOX: - Color fillColor = new Color(configColor.getRed(), configColor.getGreen(), configColor.getBlue(), 20); - OverlayUtil.renderHoverableArea( - graphics, - tileObject.getClickbox(), - mousePosition, - fillColor, - questHelper.getConfig().targetOverlayColor().darker(), - questHelper.getConfig().targetOverlayColor() - ); - break; - case OUTLINE: - modelOutlineRenderer.drawOutline( - tileObject, - questHelper.getConfig().outlineThickness(), - configColor, - questHelper.getConfig(). - outlineFeathering() - ); - break; - default: - } + switch (highlightStyle) + { + case CLICK_BOX: + Color fillColor = new Color(configColor.getRed(), configColor.getGreen(), configColor.getBlue(), 20); + OverlayUtil.renderHoverableArea( + graphics, + tileObject.getClickbox(), + mousePosition, + fillColor, + questHelper.getConfig().targetOverlayColor().darker(), + questHelper.getConfig().targetOverlayColor() + ); + break; + case OUTLINE: + modelOutlineRenderer.drawOutline( + tileObject, + questHelper.getConfig().outlineThickness(), + configColor, + questHelper.getConfig(). + outlineFeathering() + ); + break; + default: } } @@ -398,14 +431,19 @@ public void renderMinimapArrow(Graphics2D graphics) return; } - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); - for (LocalPoint localPoint : localPoints) + LocalPoint localPoint = definedPoint != null + ? definedPoint.resolveLocalPoint(client, client.getTopLevelWorldView()) + : null; + if (localPoint != null) { DirectionArrow.renderMinimapArrowFromLocal(graphics, client, localPoint, getQuestHelper().getConfig().targetOverlayColor()); } - if (localPoints.isEmpty()) + else { - DirectionArrow.renderMinimapArrow(graphics, client, worldPoint, getQuestHelper().getConfig().targetOverlayColor()); + if (definedPoint != null) + { + DirectionArrow.renderMinimapArrow(graphics, client, definedPoint, getQuestHelper().getConfig().targetOverlayColor()); + } } } } @@ -420,13 +458,19 @@ private void handleRemoveObjects(TileObject object) objects.remove(object); } - private void handleObjects(TileObject object) + protected void handleObjects(TileObject object) { if (object == null) { return; } + var worldViewsToConsider = List.of(client.getTopLevelWorldView(), client.getLocalPlayer().getWorldView()); + if (!worldViewsToConsider.contains(object.getWorldView())) + { + return; + } + if (object.getId() == objectID || alternateObjectIDs.contains(object.getId())) { setObjects(object); @@ -447,9 +491,9 @@ private void handleObjects(TileObject object) } } - private void setObjects(TileObject object) + protected void setObjects(TileObject object) { - if (worldPoint == null) + if (definedPoint == null) { if (!this.objects.contains(object)) { @@ -458,16 +502,8 @@ private void setObjects(TileObject object) return; } - WorldPoint objectWP = QuestPerspective.getRealWorldPointFromLocal(client, object.getWorldLocation()); - - if (objectWP == null) - { - return; - } - - if ( - (worldPoint.equals(objectWP)) || - (object instanceof GameObject && objZone((GameObject) object).contains(worldPoint)) + if (definedPoint.matchesTileObject(client, object) || + (object instanceof GameObject && objZone((GameObject) object).contains(definedPoint.getWorldPoint())) ) { if (!this.objects.contains(object)) @@ -477,7 +513,7 @@ private void setObjects(TileObject object) } else if (showAllInArea) { - if (worldPoint != null && worldPoint.distanceTo(objectWP) < maxObjectDistance) + if (definedPoint != null && definedPoint.distanceTo(client, object.getLocalLocation()) < maxObjectDistance) { if (!this.objects.contains(object)) { @@ -491,7 +527,7 @@ else if (showAllInArea) // See https://github.com/runelite/runelite/commit/4f34a0de6a0100adf79cac5b92198aa432debc4c private Zone objZone(GameObject obj) { - WorldPoint bottomLeftCorner = QuestPerspective.getRealWorldPointFromLocal(client, obj.getWorldLocation()); + WorldPoint bottomLeftCorner = QuestPerspective.getWorldPointConsideringWorldView(client, obj.getWorldView(), obj.getWorldLocation()); if (bottomLeftCorner == null) { return new Zone(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PortTaskStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PortTaskStep.java new file mode 100644 index 00000000000..bc667aa9045 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PortTaskStep.java @@ -0,0 +1,81 @@ +package net.runelite.client.plugins.microbot.questhelper.steps; + +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.ShipInPortRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Port; +import net.runelite.client.plugins.microbot.questhelper.requirements.var.VarbitRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; +import lombok.Getter; +import net.runelite.api.gameval.ObjectID; +import net.runelite.api.gameval.VarbitID; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.and; +import static net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicHelper.or; + +public class PortTaskStep extends ConditionalStep +{ + + @Getter + private final List stepsList = new ArrayList<>(); + + public PortTaskStep(QuestHelper questHelper, Port fromPort, Port toPort, Requirement... requirements) + { + this(questHelper, fromPort, toPort, -1, requirements); + } + + public PortTaskStep(QuestHelper questHelper, Port fromPort, Port toPort, int portTaskId, Requirement... requirements) + { + super(questHelper, new SailStep(questHelper, fromPort), requirements); + stepsList.add(super.getStepsMap().get(null)); + ShipInPortRequirement fromPortReq = new ShipInPortRequirement(fromPort); + ZoneRequirement toPortReq = new ZoneRequirement(toPort.getDockZone()); + + Requirement cargoForTaskTaken = or( + and(new VarbitRequirement(VarbitID.PORT_TASK_SLOT_0_ID, portTaskId), new VarbitRequirement(VarbitID.PORT_TASK_SLOT_0_CARGO_TAKEN, 1)), + and(new VarbitRequirement(VarbitID.PORT_TASK_SLOT_1_ID, portTaskId), new VarbitRequirement(VarbitID.PORT_TASK_SLOT_1_CARGO_TAKEN, 1)), + and(new VarbitRequirement(VarbitID.PORT_TASK_SLOT_2_ID, portTaskId), new VarbitRequirement(VarbitID.PORT_TASK_SLOT_2_CARGO_TAKEN, 1)), + and(new VarbitRequirement(VarbitID.PORT_TASK_SLOT_3_ID, portTaskId), new VarbitRequirement(VarbitID.PORT_TASK_SLOT_3_CARGO_TAKEN, 1)), + and(new VarbitRequirement(VarbitID.PORT_TASK_SLOT_4_ID, portTaskId), new VarbitRequirement(VarbitID.PORT_TASK_SLOT_4_CARGO_TAKEN, 1)) + ); + Requirement holdingCargo = new VarbitRequirement(VarbitID.SAILING_CARRYING_CARGO, 1); + Requirement notHoldingCargo = new VarbitRequirement(VarbitID.SAILING_CARRYING_CARGO, 0); + + Requirement onShip = new VarbitRequirement(VarbitID.SAILING_PLAYER_IS_ON_PLAYER_BOAT, 1); + + Collection cargoHoldIds = new HashSet<>(); + for (int i = ObjectID.SAILING_BOAT_CARGO_HOLD_REGULAR_RAFT_OPEN; i <= ObjectID.SAILING_BOAT_CARGO_HOLD_ROSEWOOD_LARGE_OPEN; i++) + { + cargoHoldIds.add(i); + } + + DetailedQuestStep pickupCargo = new ObjectStep(questHelper, ObjectID.DOCK_LOADING_BAY_LEDGER_TABLE_WITHDRAW, fromPort.getLedgerTableLocation(), "Pickup the cargo from the ledger table on the docks of " + fromPort.getName() + "."); + var placeCargoInHold = new ObjectStep(questHelper, ObjectID.SAILING_BOAT_CARGO_HOLD_REGULAR_RAFT, "Place the cargo in the cargo hold of your ship."); + placeCargoInHold.addAlternateObjects(cargoHoldIds); + // SAILING_BOARDED_BOAT is the type of boat slot boarded? + // TODO: Container tracker for boats + var boardShipWithCargo = new BoardShipStep(questHelper); + SailStep sailToToPort = new SailStep(questHelper, toPort); + ObjectStep pickupCargoFromHold = new ObjectStep(questHelper, ObjectID.SAILING_BOAT_CARGO_HOLD_REGULAR_RAFT, "Pickup the cargo from the cargo hold of your ship."); + pickupCargoFromHold.addAlternateObjects(cargoHoldIds); + DetailedQuestStep deliverCargo = new ObjectStep(questHelper, ObjectID.DOCK_LOADING_BAY_LEDGER_TABLE_DEPOSIT, toPort.getLedgerTableLocation(), "Deliver the cargo to the ledger table on the docks of " + toPort.getName() + "."); + super.addStep(and(toPortReq, cargoForTaskTaken, holdingCargo), deliverCargo); + super.addStep(and(toPortReq, notHoldingCargo, cargoForTaskTaken), pickupCargoFromHold); + super.addStep(and(fromPortReq, notHoldingCargo, cargoForTaskTaken), sailToToPort); + super.addStep(and(fromPortReq, cargoForTaskTaken, holdingCargo, onShip), placeCargoInHold); + super.addStep(and(fromPortReq, cargoForTaskTaken, holdingCargo), boardShipWithCargo); + super.addStep(fromPortReq, pickupCargo); + + this.stepsList.add(pickupCargo); + this.stepsList.add(boardShipWithCargo); + this.stepsList.add(placeCargoInHold); + this.stepsList.add(sailToToPort); + this.stepsList.add(pickupCargoFromHold); + this.stepsList.add(deliverCargo); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PuzzleWrapperStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PuzzleWrapperStep.java index f73b5a4a231..b2f10303d9e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PuzzleWrapperStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/PuzzleWrapperStep.java @@ -32,10 +32,11 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; import net.runelite.client.plugins.microbot.questhelper.requirements.conditional.Conditions; import net.runelite.client.plugins.microbot.questhelper.requirements.util.LogicType; +import net.runelite.client.plugins.microbot.questhelper.steps.choice.DialogChoiceStep; +import lombok.Getter; import lombok.NonNull; import net.runelite.client.ui.overlay.components.PanelComponent; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -47,6 +48,9 @@ public class PuzzleWrapperStep extends ConditionalStep { public static String DEFAULT_TEXT = "If you want help with this, enable 'Show Puzzle Solutions' in the Quest Helper configuration settings."; final QuestHelperConfig questHelperConfig; + + @Getter + final QuestStep solvingStep; final QuestStep noSolvingStep; ManualRequirement shouldHideHiddenPuzzleHintInSidebar = new ManualRequirement(); @@ -54,6 +58,7 @@ public PuzzleWrapperStep(QuestHelper questHelper, QuestStep step, QuestStep hidd { super(questHelper, step, "", requirements); this.text = hiddenStep.getText(); + this.solvingStep = step; this.noSolvingStep = hiddenStep; this.questHelperConfig = questHelper.getConfig(); addStep(not(new ConfigRequirement(questHelper.getConfig()::solvePuzzles)), noSolvingStep); @@ -172,9 +177,9 @@ public QuestStep addDialogSteps(String... newChoices) } @Override - public QuestStep addDialogConsideringLastLineCondition(String dialogString, String choiceValue) + public QuestStep addDialogStep(DialogChoiceStep dialogStep) { - steps.get(null).addDialogConsideringLastLineCondition(dialogString, choiceValue); + steps.get(null).addDialogStep(dialogStep); return this; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/QuestStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/QuestStep.java index 559bf4c854d..c5f9068481a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/QuestStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/QuestStep.java @@ -27,7 +27,6 @@ import com.google.inject.Binder; import com.google.inject.Inject; import com.google.inject.Module; -import net.runelite.client.plugins.microbot.questhelper.QuestHelperConfig; import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestUtil; @@ -35,7 +34,7 @@ import net.runelite.client.plugins.microbot.questhelper.requirements.item.ItemRequirement; import net.runelite.client.plugins.microbot.questhelper.steps.choice.*; import net.runelite.client.plugins.microbot.questhelper.steps.overlay.IconOverlay; -import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.client.plugins.microbot.questhelper.steps.widget.AbstractWidgetHighlight; import net.runelite.client.plugins.microbot.questhelper.steps.widget.Spell; import net.runelite.client.plugins.microbot.questhelper.steps.widget.SpellWidgetHighlight; @@ -47,12 +46,12 @@ import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.VarbitChanged; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.gameval.InterfaceID; +import net.runelite.api.gameval.SpriteID; import net.runelite.api.gameval.VarbitID; import net.runelite.api.widgets.Widget; import net.runelite.client.callback.ClientThread; @@ -68,8 +67,8 @@ import java.awt.*; import java.awt.image.BufferedImage; -import java.util.List; import java.util.*; +import java.util.List; import java.util.regex.Pattern; import static net.runelite.client.plugins.microbot.questhelper.overlays.QuestHelperOverlay.TITLED_CONTENT_COLOR; @@ -155,6 +154,9 @@ public abstract class QuestStep implements Module @Getter private Requirement conditionToHide; + @Getter + private Requirement fadeCondition; + @Getter @Setter private boolean showInSidebar = true; @@ -173,6 +175,10 @@ public abstract class QuestStep implements Module @Setter protected boolean shouldOverlayWidget; + @Getter + @Setter + protected List geInterfaceIcon; + public QuestStep(QuestHelper questHelper) { this.questHelper = questHelper; @@ -221,6 +227,10 @@ public void shutDown() public QuestStep withId(Integer id) { this.id = id; + for (QuestStep substep : substeps) + { + substep.withId(id); + } return this; } @@ -231,6 +241,7 @@ public void addSubSteps(QuestStep... substep) public void addSubSteps(Collection substeps) { + if (substeps == null) return; this.substeps.addAll(substeps); } @@ -359,10 +370,16 @@ public QuestStep addDialogSteps(String... newChoices) return this; } - public QuestStep addDialogConsideringLastLineCondition(String dialogString, String choiceValue) + public QuestStep addDialogStep(DialogChoiceStep dialogStep) + { + choices.addChoice(dialogStep); + return this; + } + + public QuestStep addDialogConsideringLastLineAndVarbit(String dialogString, int varbitId, Map valueToAnswer) { - DialogChoiceStep choice = new DialogChoiceStep(questHelper.getConfig(), dialogString); - choice.setExpectedPreviousLine(choiceValue); + DialogChoiceStep choice = new DialogChoiceStep(questHelper.getConfig(), varbitId, valueToAnswer); + choice.setExpectedPreviousLine(dialogString); choices.addChoice(choice); return this; } @@ -462,7 +479,7 @@ public void makeOverlayHint(PanelComponent panelComponent, QuestHelperPlugin plu .filter(s -> !s.isEmpty()) .forEach(line -> addTextToPanel(panelComponent, line)); - if (text != null && (text.size() > 0 && !text.get(0).isEmpty())) + if (text != null && (!text.isEmpty() && !text.get(0).isEmpty())) { addTextToPanel(panelComponent, ""); } @@ -575,9 +592,14 @@ public void conditionToHideInSidebar(Requirement hideCondition) conditionToHide = hideCondition; } + public void conditionToFadeInSidebar(Requirement fadeCondition) + { + this.fadeCondition = fadeCondition; + } + public BufferedImage getQuestImage() { - return spriteManager.getSprite(SpriteID.TAB_QUESTS, 0); + return spriteManager.getSprite(SpriteID.SideiconsInterface.QUESTS, 0); } @@ -601,7 +623,7 @@ protected Widget getInventoryWidget() return client.getWidget(InterfaceID.Inventory.ITEMS); } - protected void renderInventory(Graphics2D graphics, WorldPoint worldPoint, List passedRequirements, boolean distanceLimit) + protected void renderInventory(Graphics2D graphics, DefinedPoint definedPoint, List passedRequirements, boolean distanceLimit) { Widget inventoryWidget = getInventoryWidget(); if (inventoryWidget == null || inventoryWidget.isHidden()) @@ -622,8 +644,7 @@ protected void renderInventory(Graphics2D graphics, WorldPoint worldPoint, List< if (distanceLimit) { WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation(); - WorldPoint goalWp = QuestPerspective.getInstanceWorldPointFromReal(client, worldPoint); - if (goalWp != null && playerLocation.distanceTo(goalWp) <= 100) continue; + if (definedPoint == null || definedPoint.distanceTo(playerLocation) <= 100) continue; } if (isValidRequirementForRenderInInventory(requirement, item)) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ReorderableConditionalStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ReorderableConditionalStep.java index 2eb66054336..82ecad17bc7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ReorderableConditionalStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/ReorderableConditionalStep.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.runelite.client.plugins.microbot.questhelper.steps; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; @@ -27,16 +51,22 @@ private void organiseSteps() if (step.getId() == null) continue; if (step.getId().equals(sidebarId)) { - newSteps.put(req, step); - break; + newSteps.put(req, step); } } } for (Requirement req : steps.keySet()) { QuestStep step = steps.get(req); - if (step.getId() == null) newSteps.put(req, step); + if (step.getId() == null && req == null) continue; + if (step.getId() == null || !sideOrder.contains(step.getId())) + { + newSteps.put(req, step); + } } + QuestStep step = steps.get(null); + if (step.getId() == null) newSteps.put(null, step); + steps = newSteps; } @@ -50,6 +80,40 @@ protected void updateSteps() if (sideOrder != null) organiseSteps(); } - super.updateSteps(); + Requirement lastPossibleCondition = null; + + for (Requirement conditions : steps.keySet()) + { + boolean stepIsLocked = steps.get(conditions).isLocked(); + // Null condition usually skipped until the end. Here it can be reordered to earlier so we allow it + if (conditions == null && !stepIsLocked && sidebarOrder != null) + { + startUpStep(steps.get(null)); + return; + } + else if (conditions != null && conditions.check(client) && !stepIsLocked) + { + startUpStep(steps.get(conditions)); + return; + } + else if (steps.get(conditions).isBlocker() && stepIsLocked) + { + startUpStep(steps.get(lastPossibleCondition)); + return; + } + else if (conditions != null && !stepIsLocked) + { + lastPossibleCondition = conditions; + } + } + + if (!steps.get(null).isLocked()) + { + startUpStep(steps.get(null)); + } + else + { + startUpStep(steps.get(lastPossibleCondition)); + } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/SailStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/SailStep.java new file mode 100644 index 00000000000..8946b2d0756 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/SailStep.java @@ -0,0 +1,56 @@ +package net.runelite.client.plugins.microbot.questhelper.steps; + +import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; +import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.player.ShipInPortRequirement; +import net.runelite.client.plugins.microbot.questhelper.requirements.util.Port; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; +import net.runelite.client.plugins.microbot.questhelper.requirements.zone.ZoneRequirement; +import lombok.Getter; +import net.runelite.api.coords.WorldPoint; + +public class SailStep extends DetailedQuestStep +{ + @Getter + private final ZoneRequirement zoneRequirement; + + public SailStep(QuestHelper questHelper, Port toPort){ + this(questHelper, new ShipInPortRequirement(toPort)); + } + + public SailStep(QuestHelper questHelper, ShipInPortRequirement toPort) + { + super(questHelper, "Sail to " + toPort.getPort().getName() + "."); + Zone zone = toPort.getPort().getDockZone(); + setHighlightZone(zone); + this.zoneRequirement = new ZoneRequirement(zone); + setWorldPoint(toPort.getPort().getGangplankLocation()); + } + + public SailStep(QuestHelper questHelper, Port toPort, Requirement... requirements){ + this(questHelper, new ShipInPortRequirement(toPort), requirements); + } + + public SailStep(QuestHelper questHelper, ShipInPortRequirement toPort, Requirement... requirements) + { + this(questHelper,toPort); + this.addRequirement(requirements); + } + + public SailStep(QuestHelper questHelper, WorldPoint toPoint, String text, Requirement... requirements) + { + super(questHelper, text); + this.addRequirement(requirements); + Zone zone = new Zone(toPoint.dx(-5).dy(-5), toPoint.dx(5).dy(5)); + setHighlightZone(zone); + this.zoneRequirement = new ZoneRequirement(zone); + setWorldPoint(toPoint); + } + + public SailStep(QuestHelper questHelper, WorldPoint toPoint, Requirement... requirements) + { + this(questHelper, toPoint, "Sail to the location on your map."); + this.addRequirement(requirements); + } +} + diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/TileStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/TileStep.java index c5877b58ee8..0c9e6b27c08 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/TileStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/TileStep.java @@ -3,6 +3,7 @@ import net.runelite.client.plugins.microbot.questhelper.QuestHelperPlugin; import net.runelite.client.plugins.microbot.questhelper.questhelpers.QuestHelper; import net.runelite.client.plugins.microbot.questhelper.requirements.Requirement; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.api.Perspective; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; @@ -15,7 +16,7 @@ public class TileStep extends DetailedQuestStep public TileStep(QuestHelper questHelper, WorldPoint worldPoint, String text, Requirement... requirements) { super(questHelper, text, requirements); - this.worldPoint = worldPoint; + this.definedPoint = DefinedPoint.of(worldPoint); } @Override @@ -23,7 +24,7 @@ public void makeWorldOverlayHint(Graphics2D graphics, QuestHelperPlugin plugin) { super.makeWorldOverlayHint(graphics, plugin); - LocalPoint lp = LocalPoint.fromWorld(client, worldPoint); + LocalPoint lp = definedPoint.resolveLocalPoint(client); if (lp == null) { return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/WidgetStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/WidgetStep.java index 39b4b6f31bc..bb9179ff237 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/WidgetStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/WidgetStep.java @@ -39,8 +39,8 @@ public class WidgetStep extends DetailedQuestStep { - @Getter @Setter + @Getter protected List widgetDetails = new ArrayList<>(); protected List> extraWidgetOverlayHintFunctions = new ArrayList<>(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/DialogChoiceStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/DialogChoiceStep.java index c1a43ca1a08..4d291340f87 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/DialogChoiceStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/DialogChoiceStep.java @@ -4,6 +4,7 @@ import lombok.Getter; import lombok.Setter; +import java.util.Map; import java.util.regex.Pattern; public class DialogChoiceStep extends WidgetChoiceStep @@ -41,4 +42,11 @@ public DialogChoiceStep(QuestHelperConfig config, int choice) super(config, choice, 219, 1); shouldNumber = true; } + + public DialogChoiceStep(QuestHelperConfig config, int varbitId, Map valueToAnswer) + { + super(config, 219, 1, varbitId, valueToAnswer); + shouldNumber = true; + + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/WidgetChoiceStep.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/WidgetChoiceStep.java index 1021b1a2fd5..35f30184193 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/WidgetChoiceStep.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/choice/WidgetChoiceStep.java @@ -34,6 +34,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.regex.Pattern; public class WidgetChoiceStep @@ -59,6 +60,10 @@ public class WidgetChoiceStep protected final int groupId; protected final int childId; + protected final int varbitId; + protected int varbitValue = -1; + protected final Map varbitValueToAnswer; + protected boolean shouldNumber = false; @Setter @@ -74,6 +79,8 @@ public WidgetChoiceStep(QuestHelperConfig config, String choice, int groupId, in this.groupIdForChecking = groupId; this.childId = childId; this.pattern = null; + this.varbitId = -1; + this.varbitValueToAnswer = null; } public WidgetChoiceStep(QuestHelperConfig config, int groupId, int childId) @@ -85,6 +92,8 @@ public WidgetChoiceStep(QuestHelperConfig config, int groupId, int childId) this.groupIdForChecking = groupId; this.childId = childId; this.pattern = null; + this.varbitId = -1; + this.varbitValueToAnswer = null; } public WidgetChoiceStep(QuestHelperConfig config, Pattern pattern, int groupId, int childId) @@ -96,6 +105,8 @@ public WidgetChoiceStep(QuestHelperConfig config, Pattern pattern, int groupId, this.groupIdForChecking = groupId; this.childId = childId; this.pattern = pattern; + this.varbitId = -1; + this.varbitValueToAnswer = null; } public WidgetChoiceStep(QuestHelperConfig config, int choiceId, int groupId, int childId) @@ -106,6 +117,8 @@ public WidgetChoiceStep(QuestHelperConfig config, int choiceId, int groupId, int this.groupId = groupId; this.groupIdForChecking = groupId; this.childId = childId; + this.varbitId = -1; + this.varbitValueToAnswer = null; } public WidgetChoiceStep(QuestHelperConfig config, int choiceId, String choice, int groupId, int childId) @@ -116,6 +129,8 @@ public WidgetChoiceStep(QuestHelperConfig config, int choiceId, String choice, i this.groupId = groupId; this.groupIdForChecking = groupId; this.childId = childId; + this.varbitId = -1; + this.varbitValueToAnswer = null; } public WidgetChoiceStep(QuestHelperConfig config, int choiceId, Pattern pattern, int groupId, int childId) @@ -127,6 +142,21 @@ public WidgetChoiceStep(QuestHelperConfig config, int choiceId, Pattern pattern, this.groupIdForChecking = groupId; this.childId = childId; this.pattern = pattern; + this.varbitId = -1; + this.varbitValueToAnswer = null; + } + + public WidgetChoiceStep(QuestHelperConfig config, int groupId, int childId, int varbitId, Map varbitValueToAnswer) + { + this.config = config; + this.choice = null; + this.choiceById = -1; + this.groupId = groupId; + this.groupIdForChecking = groupId; + this.childId = childId; + this.pattern = null; + this.varbitId = varbitId; + this.varbitValueToAnswer = varbitValueToAnswer; } public void addExclusion(int excludedGroupId, int excludedChildId, String excludedString) @@ -169,6 +199,9 @@ public void highlightChoice(Client client) { return; } + if(varbitId != -1){ + varbitValue = client.getVarbitValue(varbitId); + } Widget[] choices = dialogChoice.getChildren(); checkWidgets(choices); @@ -189,6 +222,18 @@ protected void checkWidgets(Widget[] choices) highlightText(choices[choiceById], choiceById); } } + else if (varbitId != -1 && varbitValue != -1 && varbitValueToAnswer != null) + { + String choice = varbitValueToAnswer.get(varbitValue); + for (int i = 0; i < choices.length; i++) + { + if (choices[i].getText().equals(choice)) + { + highlightText(choices[i], i); + return; + } + } + } else { for (int i = 0; i < choices.length; i++) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/emote/QuestEmote.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/emote/QuestEmote.java index f52103e6454..67cd6f540fa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/emote/QuestEmote.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/emote/QuestEmote.java @@ -25,27 +25,26 @@ package net.runelite.client.plugins.microbot.questhelper.steps.emote; import lombok.Getter; - -import static net.runelite.api.SpriteID.*; +import net.runelite.api.gameval.SpriteID; @Getter public enum QuestEmote { - SKILL_CAPE("Skill Cape", EMOTE_SKILLCAPE), - FLEX("Flex", 2426), - CLAP("Clap", EMOTE_CLAP), - CRY("Cry", EMOTE_CRY), - BOW("Bow", EMOTE_BOW), - DANCE("Dance", EMOTE_DANCE), - WAVE("Wave", EMOTE_WAVE), - THINK("Think", EMOTE_THINK), - GOBLIN_BOW("Goblin bow", EMOTE_GOBLIN_BOW), - BLOW_KISS("Blow Kiss", EMOTE_BLOW_KISS), - IDEA("Idea", 732), - STAMP("Stamp", 730), - FLAP("Flap", 731), - SLAP_HEAD("Slap Head", 729), - SPIN("Spin", EMOTE_SPIN); + SKILL_CAPE("Skill Cape", SpriteID.Emotes.SKILLCAPE), + FLEX("Flex", SpriteID.Emotes._51), + CLAP("Clap", SpriteID.Emotes.CLAP), + CRY("Cry", SpriteID.Emotes.CRY), + BOW("Bow", SpriteID.Emotes.BOW), + DANCE("Dance", SpriteID.Emotes.DANCE), + WAVE("Wave", SpriteID.Emotes.WAVE), + THINK("Think", SpriteID.Emotes.THINK), + GOBLIN_BOW("Goblin bow", SpriteID.Emotes.GOBLIN_BOW), + BLOW_KISS("Blow Kiss", SpriteID.Emotes.BLOW_KISS), + IDEA("Idea", SpriteID.Emotes.IDEA), + STAMP("Stamp", SpriteID.Emotes.STAMP), + FLAP("Flap", SpriteID.Emotes.FLAP), + SLAP_HEAD("Slap Head", SpriteID.Emotes.SLAP_HEAD), + SPIN("Spin", SpriteID.Emotes.SPIN); private String name; private int spriteId; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/DirectionArrow.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/DirectionArrow.java index d8a582e2cf3..c76e78aa950 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/DirectionArrow.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/DirectionArrow.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.microbot.questhelper.steps.overlay; +import net.runelite.client.plugins.microbot.questhelper.steps.tools.DefinedPoint; import net.runelite.client.plugins.microbot.questhelper.steps.tools.QuestPerspective; import net.runelite.client.plugins.microbot.questhelper.tools.QuestHelperWorldMapPoint; import net.runelite.api.Client; @@ -32,12 +33,11 @@ import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; +import org.jetbrains.annotations.NotNull; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Line2D; -import java.util.List; - public class DirectionArrow { /** @@ -54,6 +54,47 @@ public static int getMaxMinimapDrawDistance(Client client) return 16; } + /** + * Converts a LocalPoint to a WorldPoint, handling WorldView considerations + * for instanced areas like boats. + * + * @param client the {@link Client} + * @param localPoint the {@link LocalPoint} to convert + * @return the {@link WorldPoint} in the real world, or null if conversion fails + */ + @SuppressWarnings("unused") + private static WorldPoint getWorldPointFromLocal(Client client, LocalPoint localPoint) + { + if (localPoint == null) + { + return null; + } + + var worldView = client.getWorldView(localPoint.getWorldView()); + + // If in a non-top level WorldView (a boat) need to translate + if (worldView != null && !worldView.isTopLevel()) + { + // Currently the entity should be the player's boat only? + var worldEntity = client.getTopLevelWorldView() + .worldEntities() + .byIndex(worldView.getId()); + + if (worldEntity == null) + { + return null; + } + + var mainLocal = worldEntity.transformToMainWorld(localPoint); + return WorldPoint.fromLocal(client.getTopLevelWorldView(), + mainLocal.getX(), mainLocal.getY(), worldView.getPlane()); + } + else + { + return WorldPoint.fromLocalInstance(client, localPoint); + } + } + public static void renderMinimapArrowFromLocal(Graphics2D graphics, Client client, LocalPoint localPoint, Color color) { var maxMinimapDrawDistance = getMaxMinimapDrawDistance(client); @@ -68,13 +109,13 @@ public static void renderMinimapArrowFromLocal(Graphics2D graphics, Client clien return; } - WorldPoint playerRealLocation = WorldPoint.fromLocalInstance(client, player.getLocalLocation()); - WorldPoint goalRealLocation = WorldPoint.fromLocalInstance(client, localPoint); + WorldPoint playerRealLocation = QuestPerspective.getWorldPointConsideringWorldView(client, player.getLocalLocation()); + WorldPoint goalRealLocation = QuestPerspective.getWorldPointConsideringWorldView(client, localPoint); if (playerRealLocation == null) return; if (goalRealLocation.distanceTo(playerRealLocation) >= maxMinimapDrawDistance) { - createMinimapDirectionArrow(graphics, client, playerRealLocation, goalRealLocation, color); + createMinimapDirectionArrow(graphics, client, goalRealLocation, color); return; } @@ -91,47 +132,37 @@ public static void renderMinimapArrowFromLocal(Graphics2D graphics, Client clien } - public static void renderMinimapArrow(Graphics2D graphics, Client client, WorldPoint worldPoint, Color color) + public static void renderMinimapArrow(Graphics2D graphics, Client client, DefinedPoint definedPoint, Color color) { var maxMinimapDrawDistance = getMaxMinimapDrawDistance(client); Player player = client.getLocalPlayer(); - if (player == null) + if (player == null) return; + + if (definedPoint.distanceTo(client, player.getLocalLocation()) >= maxMinimapDrawDistance) { + createMinimapDirectionArrow(graphics, client, definedPoint.getWorldPoint(), color); return; } - if (worldPoint == null) + LocalPoint localPoint = definedPoint.resolveLocalPoint(client); + if (localPoint == null) { return; } - WorldPoint playerRealLocation = WorldPoint.fromLocalInstance(client, player.getLocalLocation()); - if (playerRealLocation == null) return; - - if (worldPoint.distanceTo(playerRealLocation) >= maxMinimapDrawDistance) + Point posOnMinimap = Perspective.localToMinimap(client, localPoint); + if (posOnMinimap == null) { - createMinimapDirectionArrow(graphics, client, playerRealLocation, worldPoint, color); return; } - List localPoints = QuestPerspective.getInstanceLocalPointFromReal(client, worldPoint); - - for (LocalPoint localPoint : localPoints) - { - Point posOnMinimap = Perspective.localToMinimap(client, localPoint); - if (posOnMinimap == null) - { - continue; - } - - Line2D.Double line = new Line2D.Double(posOnMinimap.getX(), posOnMinimap.getY() - 18, posOnMinimap.getX(), - posOnMinimap.getY() - 8); + Line2D.Double line = new Line2D.Double(posOnMinimap.getX(), posOnMinimap.getY() - 18, posOnMinimap.getX(), + posOnMinimap.getY() - 8); - drawMinimapArrow(graphics, line, color); - } + drawMinimapArrow(graphics, line, color); } - protected static void createMinimapDirectionArrow(Graphics2D graphics, Client client, WorldPoint playerRealWp, WorldPoint wp, Color color) + protected static void createMinimapDirectionArrow(Graphics2D graphics, Client client, WorldPoint wp, Color color) { Player player = client.getLocalPlayer(); @@ -140,6 +171,9 @@ protected static void createMinimapDirectionArrow(Graphics2D graphics, Client cl return; } + var playerRealWp = WorldPoint.fromLocalInstance(client, player.getLocalLocation()); + playerRealWp = QuestPerspective.getWorldPointConsideringWorldView(client, player.getLocalLocation()); + if (wp == null) { return; @@ -154,6 +188,14 @@ protected static void createMinimapDirectionArrow(Graphics2D graphics, Client cl return; } + Line2D.Double line = getLine(playerPosOnMinimap, destinationPosOnMinimap); + + drawMinimapArrow(graphics, line, color); + } + + @NotNull + private static Line2D.Double getLine(Point playerPosOnMinimap, Point destinationPosOnMinimap) + { double xDiff = playerPosOnMinimap.getX() - destinationPosOnMinimap.getX(); double yDiff = destinationPosOnMinimap.getY() - playerPosOnMinimap.getY(); double angle = Math.atan2(yDiff, xDiff); @@ -164,9 +206,7 @@ protected static void createMinimapDirectionArrow(Graphics2D graphics, Client cl int endX = (int) (playerPosOnMinimap.getX() - (Math.cos(angle) * 65)); int endY = (int) (playerPosOnMinimap.getY() + (Math.sin(angle) * 65)); - Line2D.Double line = new Line2D.Double(startX, startY, endX, endY); - - drawMinimapArrow(graphics, line, color); + return new Line2D.Double(startX, startY, endX, endY); } public static void drawWorldArrow(Graphics2D graphics, Color color, int startX, int startY) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/WorldLines.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/WorldLines.java index d67f5c476a8..eb088d44ad6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/WorldLines.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/overlay/WorldLines.java @@ -74,8 +74,8 @@ public static void createMinimapLines(Graphics2D graphics, Client client, List startPoints = QuestPerspective.getInstanceLocalPointFromReal(client, currentPoint); - List destinationPoints = QuestPerspective.getInstanceLocalPointFromReal(client, nextPoint); + List startPoints = QuestPerspective.getLocalPointsFromWorldPointInInstance(client.getTopLevelWorldView(), currentPoint); + List destinationPoints = QuestPerspective.getLocalPointsFromWorldPointInInstance(client.getTopLevelWorldView(), nextPoint); if (startPoints.isEmpty() || destinationPoints.isEmpty()) continue; LocalPoint startPoint = startPoints.get(0); LocalPoint destinationPoint = destinationPoints.get(0); @@ -170,8 +170,8 @@ public static void drawLinesOnWorld(Graphics2D graphics, Client client, List startPoints = QuestPerspective.getInstanceLocalPointFromReal(client, startWp); - List destinationPoints = QuestPerspective.getInstanceLocalPointFromReal(client, endWp); + List startPoints = QuestPerspective.getLocalPointsFromWorldPointInInstance(client.getTopLevelWorldView(), startWp); + List destinationPoints = QuestPerspective.getLocalPointsFromWorldPointInInstance(client.getTopLevelWorldView(), endWp); if (startPoints.isEmpty() || destinationPoints.isEmpty()) continue; LocalPoint startPoint = startPoints.get(0); LocalPoint destinationPoint = destinationPoints.get(0); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/DefinedPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/DefinedPoint.java new file mode 100644 index 00000000000..158e0f611eb --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/DefinedPoint.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2025, Zoinkwiz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.microbot.questhelper.steps.tools; + +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.TileObject; +import net.runelite.api.WorldView; +import net.runelite.api.coords.LocalPoint; +import net.runelite.api.coords.WorldPoint; + +import javax.annotation.Nullable; +import java.util.List; + +/** + * Wrapper representing a quest-defined coordinate. Using this type makes it explicit that any comparison + * or rendering should go through {@link QuestPerspective} helpers so WorldView translations are handled + * consistently. + */ +@Getter +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public final class DefinedPoint +{ + private final WorldPoint worldPoint; + + @Nullable + public static DefinedPoint of(@Nullable WorldPoint worldPoint) + { + return worldPoint == null ? null : new DefinedPoint(worldPoint); + } + + public int getX() + { + return worldPoint.getX(); + } + + public int getY() + { + return worldPoint.getY(); + } + + public int getPlane() + { + return worldPoint.getPlane(); + } + + public boolean matchesTileObject(Client client, TileObject tileObject) + { + if (tileObject == null) + { + return false; + } + return QuestPerspective.matchesWorldPoint(client, this, tileObject.getLocalLocation()); + } + + public LocalPoint resolveLocalPoint(Client client) + { + return QuestPerspective.resolveLocalPointForWorldPoint(client, worldPoint, null); + } + + public LocalPoint resolveLocalPoint(Client client, WorldView preferredWorldView) + { + return QuestPerspective.resolveLocalPointForWorldPoint(client, worldPoint, preferredWorldView); + } + + public List resolveLocalPoints(Client client) + { + var topLevelWorldView = client.getTopLevelWorldView(); + List lps = QuestPerspective.getLocalPointsFromWorldPointInInstance(topLevelWorldView, worldPoint); + var playerWorldView = client.getLocalPlayer().getWorldView(); + + if (topLevelWorldView != playerWorldView) + { + var moreLps = QuestPerspective.getLocalPointsFromWorldPointInInstance(playerWorldView, worldPoint); + if (!moreLps.isEmpty()) lps.addAll(moreLps); + } + return lps; + } + + public int distanceTo(WorldPoint runtimeWorldPoint) + { + return worldPoint.distanceTo(runtimeWorldPoint); + } + + public int distanceTo(Client client, LocalPoint runtimeLocalPoint) + { + return QuestPerspective.getTileDistance(client, this, runtimeLocalPoint); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/QuestPerspective.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/QuestPerspective.java index d52911ea07e..d758cfce979 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/QuestPerspective.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/tools/QuestPerspective.java @@ -25,8 +25,7 @@ package net.runelite.client.plugins.microbot.questhelper.steps.tools; import net.runelite.client.plugins.microbot.questhelper.requirements.zone.Zone; -import net.runelite.api.Client; -import net.runelite.api.Perspective; +import net.runelite.api.*; import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; @@ -36,12 +35,9 @@ import java.awt.*; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; +import java.util.LinkedHashSet; import java.util.List; -import static net.runelite.api.Constants.CHUNK_SIZE; - public class QuestPerspective { // Order of poly corners from getCanvasTilePoly @@ -50,108 +46,114 @@ public class QuestPerspective private final static int NE = 2; private final static int SE = 1; - public static Collection toLocalInstanceFromReal(Client client, WorldPoint worldPoint) + /** + * Converts a LocalPoint to a WorldPoint, handling WorldView considerations + * for instanced areas like boats. + * + * @param client the {@link Client} + * @param localPoint the {@link LocalPoint} to convert + * @return the {@link WorldPoint} in the real world, or null if conversion fails + */ + public static WorldPoint getWorldPointConsideringWorldView(Client client, LocalPoint localPoint) { - if (!client.isInInstancedRegion()) + if (localPoint == null) { - return Collections.singleton(worldPoint); + return null; } - if (worldPoint == null) return Collections.singleton(null); + var worldView = client.getWorldView(localPoint.getWorldView()); - // find instance chunks using the template point. there might be more than one. - List worldPoints = new ArrayList<>(); - - int[][][] instanceTemplateChunks = client.getInstanceTemplateChunks(); - for (int z = 0; z < instanceTemplateChunks.length; ++z) + // If in a non-top level WorldView (a boat) need to translate + if (worldView != null && !worldView.isTopLevel()) { - for (int x = 0; x < instanceTemplateChunks[z].length; ++x) + // Currently the entity should be the player's boat only? + var worldEntity = client.getTopLevelWorldView() + .worldEntities() + .byIndex(worldView.getId()); + + if (worldEntity == null) { - for (int y = 0; y < instanceTemplateChunks[z][x].length; ++y) - { - int chunkData = instanceTemplateChunks[z][x][y]; - int rotation = chunkData >> 1 & 0x3; - int templateChunkY = (chunkData >> 3 & 0x7FF) * CHUNK_SIZE; - int templateChunkX = (chunkData >> 14 & 0x3FF) * CHUNK_SIZE; - if (worldPoint.getX() >= templateChunkX && worldPoint.getX() < templateChunkX + CHUNK_SIZE - && worldPoint.getY() >= templateChunkY && worldPoint.getY() < templateChunkY + CHUNK_SIZE) - { - WorldPoint p = - new WorldPoint(client.getBaseX() + x * CHUNK_SIZE + (worldPoint.getX() & (CHUNK_SIZE - 1)), - client.getBaseY() + y * CHUNK_SIZE + (worldPoint.getY() & (CHUNK_SIZE - 1)), - z); - p = rotate(p, rotation); - if (p.isInScene(client)) - { - worldPoints.add(p); - } - } - } + return null; } + + var mainLocal = worldEntity.transformToMainWorld(localPoint); + return WorldPoint.fromLocal(client.getTopLevelWorldView(), + mainLocal.getX(), mainLocal.getY(), client.getTopLevelWorldView().getPlane()); + } + else + { + return WorldPoint.fromLocalInstance(client, localPoint); } - return worldPoints; } - private static WorldPoint rotate(WorldPoint point, int rotation) + /** + * Converts a WorldPoint from a given WorldView to the main world coordinate system, + * handling WorldView considerations for instanced areas like boats. + * + * @param client the {@link Client} + * @param worldView the {@link WorldView} the worldPoint is currently in + * @param worldPoint the {@link WorldPoint} to convert + * @return the {@link WorldPoint} in the main/real world, or the original worldPoint if conversion fails + */ + public static WorldPoint getWorldPointConsideringWorldView(Client client, WorldView worldView, WorldPoint worldPoint) { - int chunkX = point.getX() & -CHUNK_SIZE; - int chunkY = point.getY() & -CHUNK_SIZE; - int x = point.getX() & (CHUNK_SIZE - 1); - int y = point.getY() & (CHUNK_SIZE - 1); - switch (rotation) - { - case 1: - return new WorldPoint(chunkX + y, chunkY + (CHUNK_SIZE - 1 - x), point.getPlane()); - case 2: - return new WorldPoint(chunkX + (CHUNK_SIZE - 1 - x), chunkY + (CHUNK_SIZE - 1 - y), point.getPlane()); - case 3: - return new WorldPoint(chunkX + (CHUNK_SIZE - 1 - y), chunkY + x, point.getPlane()); - } - return point; - } + if (worldPoint == null) + { + return null; + } - public static List getInstanceLocalPointFromReal(Client client, WorldPoint wp) - { - List instanceWorldPoint = new ArrayList<>(QuestPerspective.toLocalInstanceFromReal(client, wp)); + if (worldView == null) return worldPoint; + var localPoint = LocalPoint.fromWorld(worldView, worldPoint); + if (localPoint == null) + { + return worldPoint; + } - List localPoints = new ArrayList<>(); - for (WorldPoint worldPoint : instanceWorldPoint) + // If in a non-top level WorldView (a boat) need to translate to main world + if (!worldView.isTopLevel()) { - if (worldPoint == null) continue; - LocalPoint lp = LocalPoint.fromWorld(client.getTopLevelWorldView(), worldPoint); - if (lp != null) + // Currently the entity should be the player's boat only? + var worldEntity = client.getTopLevelWorldView() + .worldEntities() + .byIndex(worldView.getId()); + + if (worldEntity == null) { - localPoints.add(lp); + return worldPoint; } - } - return localPoints; + var mainLocal = worldEntity.transformToMainWorld(localPoint); + return WorldPoint.fromLocal(client.getTopLevelWorldView(), + mainLocal.getX(), mainLocal.getY(), client.getTopLevelWorldView().getPlane()); + } + else + { + // For top-level WorldView, still use fromLocalInstance to handle any instance normalization + return WorldPoint.fromLocalInstance(client, localPoint); + } } - public static WorldPoint getInstanceWorldPointFromReal(Client client, WorldPoint wp) + private static LocalPoint getLocalPointFromWorldPointInInstance(WorldView wv, WorldPoint worldPoint) { - if (wp == null) return null; - Collection points = QuestPerspective.toLocalInstanceFromReal(client, wp); - - if (points.isEmpty()) return null; - - WorldPoint p = null; - for (WorldPoint point : points) - { - if (point != null) - { - p = point; - } - } - return p; + if (worldPoint == null) return null; + var instanceWps = WorldPoint.toLocalInstance(wv, worldPoint); + if (instanceWps.isEmpty()) return null; + return LocalPoint.fromWorld(wv, instanceWps.iterator().next()); } - public static WorldPoint getRealWorldPointFromLocal(Client client, WorldPoint wp) + public static List getLocalPointsFromWorldPointInInstance(WorldView wv, WorldPoint worldPoint) { - LocalPoint lp = LocalPoint.fromWorld(client.getTopLevelWorldView(), wp); - if (lp == null) return null; + if (worldPoint == null) return List.of(); + var instanceWps = WorldPoint.toLocalInstance(wv, worldPoint); + if (instanceWps.isEmpty()) return List.of(); - return WorldPoint.fromLocalInstance(client, lp); + List lps = new ArrayList<>(); + for (WorldPoint instanceWp : instanceWps) + { + var lp = LocalPoint.fromWorld(wv, instanceWp); + if (lp != null) lps.add(LocalPoint.fromWorld(wv, instanceWp)); + } + return lps; } public static Rectangle getWorldMapClipArea(Client client) @@ -209,7 +211,18 @@ public static Point mapWorldPointToGraphicsPoint(Client client, WorldPoint world public static Point getMinimapPoint(Client client, WorldPoint start, WorldPoint destination) { - var worldMapData = client.getWorldMap().getWorldMapData(); + var worldMap = client.getWorldMap(); + if (worldMap == null) + { + return null; + } + + var worldMapData = worldMap.getWorldMapData(); + if (worldMapData == null) + { + return null; + } + if (worldMapData.surfaceContainsPosition(start.getX(), start.getY()) != worldMapData.surfaceContainsPosition(destination.getX(), destination.getY())) { @@ -220,6 +233,12 @@ public static Point getMinimapPoint(Client client, WorldPoint start, WorldPoint int y = (destination.getY() - start.getY()); float maxDistance = Math.max(Math.abs(x), Math.abs(y)); + // Avoid division by zero when start == destination + if (maxDistance == 0) + { + return null; + } + x = x * 100; y = y * 100; x /= maxDistance; @@ -261,51 +280,75 @@ public static Point getMinimapPoint(Client client, WorldPoint start, WorldPoint return new Point(miniMapX, miniMapY); } + private static boolean worldViewContainsWorldPoint(WorldView worldView, WorldPoint wp) + { + var wvRegions = worldView.getMapRegions(); + for (int wvRegion : wvRegions) + { + if (wvRegion == wp.getRegionID()) return true; + } + + return false; + } + public static Polygon getZonePoly(Client client, Zone zone) { Polygon areaPoly = new Polygon(); if (zone == null) return areaPoly; + var minWp = zone.getMinWorldPoint(); + var localPlayerWorldView = client.getLocalPlayer().getWorldView(); + WorldView worldView = client.getTopLevelWorldView(); + if (localPlayerWorldView != worldView && worldViewContainsWorldPoint(localPlayerWorldView, minWp)) + { + worldView = localPlayerWorldView; + } + for (int x = zone.getMinX(); x < zone.getMaxX(); x++) { - addToPoly(client, areaPoly, new WorldPoint(x, zone.getMaxY(), zone.getMinWorldPoint().getPlane()), NW); + var convertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(x, zone.getMaxY(), zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, convertedWp, NW); } // NE corner - addToPoly(client, areaPoly, new WorldPoint(zone.getMaxX(), zone.getMaxY(), zone.getMinWorldPoint().getPlane()), NW, NE, SE); + var convertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(zone.getMaxX(), zone.getMaxY(), zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, convertedWp, NW, NE, SE); // West side for (int y = zone.getMaxY() - 1; y > zone.getMinY(); y--) { - addToPoly(client, areaPoly, new WorldPoint(zone.getMaxX(), y, zone.getMinWorldPoint().getPlane()), SE); + var newConvertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(zone.getMaxX(), y, zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, newConvertedWp, SE); } // SE corner - addToPoly(client, areaPoly, new WorldPoint(zone.getMaxX(), zone.getMinY(), zone.getMinWorldPoint().getPlane()), SE, SW); + var newConvertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(zone.getMaxX(), zone.getMinY(), zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, newConvertedWp, SE, SW); // South side for (int x = zone.getMaxX() - 1; x > zone.getMinX(); x--) { - addToPoly(client, areaPoly, new WorldPoint(x, zone.getMinY(), zone.getMinWorldPoint().getPlane()), SW); + var southConvertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(x, zone.getMinY(), zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, southConvertedWp, SW); } // SW corner - addToPoly(client, areaPoly, new WorldPoint(zone.getMinX(), zone.getMinY(), zone.getMinWorldPoint().getPlane()), SW, NW); + var southWestConvertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(zone.getMinX(), zone.getMinY(), zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, southWestConvertedWp, SW, NW); for (int y = zone.getMinY() + 1; y < zone.getMaxY(); y++) { - addToPoly(client, areaPoly, new WorldPoint(zone.getMinX(), y, zone.getMinWorldPoint().getPlane()), NW); + var sConvertedWp = QuestPerspective.getLocalPointFromWorldPointInInstance(worldView, new WorldPoint(zone.getMinX(), y, zone.getMinWorldPoint().getPlane())); + addToPoly(client, areaPoly, sConvertedWp, NW); } return areaPoly; } - private static void addToPoly(Client client, Polygon areaPoly, WorldPoint wp, int... points) + private static void addToPoly(Client client, Polygon areaPoly, LocalPoint localPoint, int... points) { - LocalPoint localPoint = LocalPoint.fromWorld(client.getTopLevelWorldView(), wp); if (localPoint == null) return; - Polygon poly = Perspective.getCanvasTilePoly(client, localPoint); if (poly != null) { @@ -315,4 +358,132 @@ private static void addToPoly(Client client, Polygon areaPoly, WorldPoint wp, in } } } + + /** + * Compares a quest-defined {@link WorldPoint} with a runtime {@link LocalPoint}, normalizing + * both into the top-level world space so they can be compared safely across WorldViews. + * + * @return {@code true} when both coordinates refer to the same tile in the main world. + */ + public static boolean matchesWorldPoint(Client client, DefinedPoint definedPoint, LocalPoint runtimeLocalPoint) + { + if (client == null || definedPoint == null || runtimeLocalPoint == null) + { + return false; + } + + var runtimeWorldView = client.getWorldView(runtimeLocalPoint.getWorldView()); + return matchesWorldPoint(client, definedPoint, runtimeLocalPoint, runtimeWorldView); + } + + /** + * Variant of {@link #matchesWorldPoint(Client, DefinedPoint, LocalPoint)} that allows callers to + * explicitly pass the {@link WorldView} associated with the runtime {@link LocalPoint}. + */ + public static boolean matchesWorldPoint(Client client, DefinedPoint definedPoint, LocalPoint runtimeLocalPoint, WorldView runtimeWorldView) + { + if (client == null || definedPoint == null || runtimeLocalPoint == null) + { + return false; + } + + var runtimeWorldPoint = getWorldPointConsideringWorldView(client, runtimeLocalPoint); + if (runtimeWorldPoint == null) + { + return false; + } + + var normalizedDefinedPoint = getWorldPointConsideringWorldView(client, definedPoint.resolveLocalPoint(client)); + return normalizedDefinedPoint != null && normalizedDefinedPoint.equals(runtimeWorldPoint); + } + + private static WorldPoint normalizeWorldPointToTopLevel(Client client, WorldView sourceWorldView, WorldPoint worldPoint) + { + if (client == null || worldPoint == null) + { + return null; + } + + var viewToUse = sourceWorldView != null ? sourceWorldView : client.getTopLevelWorldView(); + if (viewToUse == null) + { + return worldPoint; + } + + return getWorldPointConsideringWorldView(client, viewToUse, worldPoint); + } + + /** + * Resolves the {@link LocalPoint} to use for drawing a {@link WorldPoint}, automatically + * checking the preferred view, the player's active view, and finally the top-level view. + */ + public static LocalPoint resolveLocalPointForWorldPoint(Client client, WorldPoint worldPoint, WorldView preferredWorldView) + { + if (client == null || worldPoint == null) + { + return null; + } + + var viewsToCheck = new LinkedHashSet(); + if (preferredWorldView != null) + { + viewsToCheck.add(preferredWorldView); + } + + Player localPlayer = client.getLocalPlayer(); + if (localPlayer != null && localPlayer.getWorldView() != null) + { + viewsToCheck.add(localPlayer.getWorldView()); + } + + var topLevel = client.getTopLevelWorldView(); + if (topLevel != null) + { + viewsToCheck.add(topLevel); + } + + for (WorldView view : viewsToCheck) + { + LocalPoint localPoint = getLocalPointFromWorldPointInInstance(view, worldPoint); + if (localPoint != null) + { + return localPoint; + } + } + + return null; + } + + public static int getTileDistance(Client client, DefinedPoint definedWorldPoint, LocalPoint runtimeLocalPoint) + { + if (runtimeLocalPoint == null || client == null) + { + return Integer.MAX_VALUE; + } + + var runtimeWorldView = client.getWorldView(runtimeLocalPoint.getWorldView()); + return getTileDistance(client, definedWorldPoint, runtimeLocalPoint, runtimeWorldView); + } + + public static int getTileDistance(Client client, DefinedPoint definedPoint, LocalPoint runtimeLocalPoint, WorldView runtimeWorldView) + { + if (client == null || definedPoint == null || runtimeLocalPoint == null) + { + return Integer.MAX_VALUE; + } + + var runtimeWorldPoint = getWorldPointConsideringWorldView(client, runtimeLocalPoint); + if (runtimeWorldPoint == null) + { + return Integer.MAX_VALUE; + } + + var normalizedDefinedPoint = normalizeWorldPointToTopLevel(client, runtimeWorldView, definedPoint.getWorldPoint()); + if (normalizedDefinedPoint == null) + { + return Integer.MAX_VALUE; + } + + return normalizedDefinedPoint.distanceTo(runtimeWorldPoint); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/widget/WidgetHighlight.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/widget/WidgetHighlight.java index 42c15e62e34..90e9ad5b2fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/widget/WidgetHighlight.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/steps/widget/WidgetHighlight.java @@ -38,7 +38,6 @@ public class WidgetHighlight extends AbstractWidgetHighlight { @Getter protected final int interfaceID; - @Getter protected final int childChildId; @@ -54,6 +53,7 @@ public class WidgetHighlight extends AbstractWidgetHighlight protected String requiredText; @Nullable + @Getter private String nameToCheckFor = null; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/tools/QuestTile.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/tools/QuestTile.java index abcd5d5ed2b..ff80a65dd02 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/tools/QuestTile.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/tools/QuestTile.java @@ -25,8 +25,8 @@ package net.runelite.client.plugins.microbot.questhelper.tools; import lombok.Getter; -import net.runelite.api.SpriteID; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.gameval.SpriteID; public class QuestTile { @@ -38,7 +38,7 @@ public class QuestTile public QuestTile(WorldPoint worldPoint) { this.worldPoint = worldPoint; - this.iconID = SpriteID.QUESTS_PAGE_ICON_BLUE_QUESTS; + this.iconID = SpriteID.AchievementDiaryIcons.BLUE_QUESTS; } public QuestTile(WorldPoint worldPoint, int iconID) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/util/Utils.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/util/Utils.java index b0300f29196..11b51401499 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/util/Utils.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/questhelper/util/Utils.java @@ -33,6 +33,7 @@ import net.runelite.api.GameState; import net.runelite.api.Varbits; import net.runelite.api.annotations.Component; +import net.runelite.api.gameval.VarbitID; import net.runelite.client.util.ColorUtil; import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.NotNull; @@ -57,7 +58,7 @@ public AccountType getAccountType(@NotNull Client client) { return AccountType.NORMAL; } - return AccountType.get(client.getVarbitValue(Varbits.ACCOUNT_TYPE)); + return AccountType.get(client.getVarbitValue(VarbitID.IRONMAN)); } /** diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathConfig.java index 114ea79a59b..30e21f9067b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathConfig.java @@ -624,4 +624,67 @@ default boolean preferTransportToTarget() { default int maxSimilarTransportDistance() { return 0; } + + @ConfigSection( + name = "Spirit tree teleports", + description = "Toggle which spirit tree destinations to use", + position = 5, + closedByDefault = true + ) + String sectionSpiritTrees = "sectionSpiritTrees"; + + @ConfigItem( + keyName = "spiritTreeEtceteria", + name = "Etceteria", + description = "Use the spirit tree teleport to Etceteria", + position = 0, + section = sectionSpiritTrees + ) + default boolean spiritTreeEtceteria() { + return true; + } + + @ConfigItem( + keyName = "spiritTreeBrimhaven", + name = "Brimhaven", + description = "Use the spirit tree teleport to Brimhaven", + position = 1, + section = sectionSpiritTrees + ) + default boolean spiritTreeBrimhaven() { + return true; + } + + @ConfigItem( + keyName = "spiritTreePortSarim", + name = "Port Sarim", + description = "Use the spirit tree teleport to Port Sarim", + position = 2, + section = sectionSpiritTrees + ) + default boolean spiritTreePortSarim() { + return true; + } + + @ConfigItem( + keyName = "spiritTreeHosidius", + name = "Hosidius", + description = "Use the spirit tree teleport to Hosidius", + position = 3, + section = sectionSpiritTrees + ) + default boolean spiritTreeHosidius() { + return true; + } + + @ConfigItem( + keyName = "spiritTreeFarmingGuild", + name = "Farming Guild", + description = "Use the spirit tree teleport to the Farming Guild", + position = 4, + section = sectionSpiritTrees + ) + default boolean spiritTreeFarmingGuild() { + return true; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathPanel.java index 0f0878c9fa1..0680c07374c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/ShortestPathPanel.java @@ -691,7 +691,7 @@ private WorldPoint getCurrentQuestLocation() // Extract WorldPoint from DetailedQuestStep if (activeStep instanceof DetailedQuestStep) { - return ((DetailedQuestStep) activeStep).getWorldPoint(); + return ((DetailedQuestStep) activeStep).getDefinedPoint().getWorldPoint(); } } catch (Exception e) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/PathfinderConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/PathfinderConfig.java index b672fdc954f..3594a1e19ca 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/PathfinderConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/shortestpath/pathfinder/PathfinderConfig.java @@ -43,12 +43,17 @@ public class PathfinderConfig { private static final WorldArea FEROX_ENCLAVE_1 = new WorldArea(3123, 3622, 2, 10, 0); private static final WorldArea FEROX_ENCLAVE_2 = new WorldArea(3125, 3617, 16, 23, 0); private static final WorldArea FEROX_ENCLAVE_3 = new WorldArea(3138, 3636, 18, 10, 0); - private static final WorldArea FEROX_ENCLAVE_4 = new WorldArea(3141, 3625, 14, 11, 0); - private static final WorldArea FEROX_ENCLAVE_5 = new WorldArea(3141, 3619, 7, 6, 0); - private static final WorldArea NOT_WILDERNESS_1 = new WorldArea(2997, 3525, 34, 9, 0); - private static final WorldArea NOT_WILDERNESS_2 = new WorldArea(3005, 3534, 21, 10, 0); - private static final WorldArea NOT_WILDERNESS_3 = new WorldArea(3000, 3534, 5, 5, 0); - private static final WorldArea NOT_WILDERNESS_4 = new WorldArea(3031, 3525, 2, 2, 0); + private static final WorldArea FEROX_ENCLAVE_4 = new WorldArea(3141, 3625, 14, 11, 0); + private static final WorldArea FEROX_ENCLAVE_5 = new WorldArea(3141, 3619, 7, 6, 0); + private static final WorldArea NOT_WILDERNESS_1 = new WorldArea(2997, 3525, 34, 9, 0); + private static final WorldArea NOT_WILDERNESS_2 = new WorldArea(3005, 3534, 21, 10, 0); + private static final WorldArea NOT_WILDERNESS_3 = new WorldArea(3000, 3534, 5, 5, 0); + private static final WorldArea NOT_WILDERNESS_4 = new WorldArea(3031, 3525, 2, 2, 0); + private static final WorldPoint SPIRIT_TREE_ETCETERIA = new WorldPoint(2613, 3855, 0); + private static final WorldPoint SPIRIT_TREE_BRIMHAVEN = new WorldPoint(2800, 3203, 0); + private static final WorldPoint SPIRIT_TREE_PORT_SARIM = new WorldPoint(3058, 3257, 0); + private static final WorldPoint SPIRIT_TREE_HOSIDIUS = new WorldPoint(1693, 3540, 0); + private static final WorldPoint SPIRIT_TREE_FARMING_GUILD = new WorldPoint(1251, 3750, 0); private final SplitFlagMap mapData; private final ThreadLocal map; @@ -97,7 +102,12 @@ public class PathfinderConfig { useTeleportationPortals, useTeleportationSpells, useMagicCarpets, - useWildernessObelisks; + useWildernessObelisks, + useSpiritTreeEtceteria, + useSpiritTreeBrimhaven, + useSpiritTreePortSarim, + useSpiritTreeHosidius, + useSpiritTreeFarmingGuild; //START microbot variables @Getter private volatile int distanceBeforeUsingTeleport; @@ -160,6 +170,11 @@ public void refresh(WorldPoint target) { usePoh = ShortestPathPlugin.override("usePoh", config.usePoh()); useQuetzals = ShortestPathPlugin.override("useQuetzals", config.useQuetzals()); useSpiritTrees = ShortestPathPlugin.override("useSpiritTrees", config.useSpiritTrees()); + useSpiritTreeEtceteria = ShortestPathPlugin.override("spiritTreeEtceteria", config.spiritTreeEtceteria()); + useSpiritTreeBrimhaven = ShortestPathPlugin.override("spiritTreeBrimhaven", config.spiritTreeBrimhaven()); + useSpiritTreePortSarim = ShortestPathPlugin.override("spiritTreePortSarim", config.spiritTreePortSarim()); + useSpiritTreeHosidius = ShortestPathPlugin.override("spiritTreeHosidius", config.spiritTreeHosidius()); + useSpiritTreeFarmingGuild = ShortestPathPlugin.override("spiritTreeFarmingGuild", config.spiritTreeFarmingGuild()); useTeleportationItems = ShortestPathPlugin.override("useTeleportationItems", config.useTeleportationItems()); useTeleportationMinigames = ShortestPathPlugin.override("useTeleportationMinigames", config.useTeleportationMinigames()); useTeleportationLevers = ShortestPathPlugin.override("useTeleportationLevers", config.useTeleportationLevers()); @@ -462,6 +477,10 @@ private boolean useTransport(Transport transport) { log.debug("Transport ( O: {} D: {} ) requires members world", transport.getOrigin(), transport.getDestination()); return false; } + if (transport.getType() == TransportType.SPIRIT_TREE && !isSpiritTreeDestinationEnabled(transport)) { + log.debug("Transport ( O: {} D: {} ) is a spirit tree route but the destination is disabled", transport.getOrigin(), transport.getDestination()); + return false; + } // If you don't meet level requirements if (!hasRequiredLevels(transport)) { log.debug("Transport ( O: {} D: {} ) requires skill levels {}", transport.getOrigin(), transport.getDestination(), Arrays.toString(transport.getSkillLevels())); @@ -560,6 +579,29 @@ private void updateActionBasedOnQuestState(Transport transport) { } } + private boolean isSpiritTreeDestinationEnabled(Transport transport) { + WorldPoint destination = transport.getDestination(); + if (destination == null) { + return true; + } + if (destination.equals(SPIRIT_TREE_ETCETERIA)) { + return useSpiritTreeEtceteria; + } + if (destination.equals(SPIRIT_TREE_BRIMHAVEN)) { + return useSpiritTreeBrimhaven; + } + if (destination.equals(SPIRIT_TREE_PORT_SARIM)) { + return useSpiritTreePortSarim; + } + if (destination.equals(SPIRIT_TREE_HOSIDIUS)) { + return useSpiritTreeHosidius; + } + if (destination.equals(SPIRIT_TREE_FARMING_GUILD)) { + return useSpiritTreeFarmingGuild; + } + return true; + } + private boolean isFeatureEnabled(Transport transport) { TransportType type = transport.getType(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotConfigPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotConfigPanel.java index 83ed9de9439..6dfcae8a9d8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotConfigPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotConfigPanel.java @@ -41,6 +41,7 @@ import net.runelite.client.plugins.microbot.MicrobotConfigManager; import net.runelite.client.plugins.microbot.inventorysetups.InventorySetup; import net.runelite.client.plugins.microbot.inventorysetups.MInventorySetupsPlugin; +import net.runelite.client.plugins.microbot.mouserecorder.MouseMacroRecorderPlugin; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.DynamicGridLayout; import net.runelite.client.ui.FontManager; @@ -358,7 +359,10 @@ public void mouseClicked(MouseEvent e) { configEntryName.setToolTipText("" + name + ":
" + description + ""); } MicrobotPluginListItem.addLabelPopupMenu(configEntryName, createResetMenuItem(pluginConfig, cid)); - item.add(configEntryName, BorderLayout.CENTER); + boolean isButtonItem = cid.getType() == ConfigButton.class; + if (!isButtonItem) { + item.add(configEntryName, BorderLayout.CENTER); + } if (cid.getType() == boolean.class) { item.add(createCheckbox(cd, cid), BorderLayout.EAST); @@ -368,6 +372,8 @@ public void mouseClicked(MouseEvent e) { item.add(createDoubleSpinner(cd, cid), BorderLayout.EAST); } else if (cid.getType() == String.class) { item.add(createTextField(cd, cid), BorderLayout.SOUTH); + } else if (cid.getType() == ConfigButton.class) { + item.add(createActionButton(cd, cid), BorderLayout.CENTER); } else if (cid.getType() == Color.class) { item.add(createColorPicker(cd, cid), BorderLayout.EAST); } else if (cid.getType() == Dimension.class) { @@ -766,6 +772,19 @@ public void focusLost(FocusEvent e) { return list; } + private JButton createActionButton(ConfigDescriptor cd, ConfigItemDescriptor cid) { + JButton button = new JButton(cid.getItem().name()); + button.addActionListener(e -> { + ConfigButton next = new ConfigButton(UUID.randomUUID().toString()); + configManager.setConfiguration(cd.getGroup().value(), cid.getItem().keyName(), next); + if (MouseMacroRecorderPlugin.CONFIG_GROUP.equals(cd.getGroup().value()) + && "openRecordingsFolder".equals(cid.getItem().keyName())) { + MouseMacroRecorderPlugin.openRecordingsFolderStatic(); + } + }); + return button; + } + private void changeConfiguration(Component component, ConfigDescriptor cd, ConfigItemDescriptor cid) { final ConfigItem configItem = cid.getItem(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotPluginHubPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotPluginHubPanel.java index e3bfad0c6f3..f6233df8a4a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotPluginHubPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/ui/MicrobotPluginHubPanel.java @@ -28,6 +28,7 @@ import com.google.common.html.HtmlEscapers; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import net.runelite.client.RuneLite; import net.runelite.client.RuneLiteProperties; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.ExternalPluginsChanged; @@ -58,6 +59,8 @@ import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; import java.io.IOException; +import java.io.File; +import java.awt.Desktop; import java.util.List; import java.util.*; import java.util.concurrent.ScheduledExecutorService; @@ -73,6 +76,8 @@ public class MicrobotPluginHubPanel extends MicrobotPluginPanel { private static final ImageIcon HELP_ICON; private static final ImageIcon CONFIGURE_ICON; private static final Pattern SPACES = Pattern.compile(" +"); + private static final Color PASTEL_GREEN = new Color(0x7CB987); + private static final Color PASTEL_ORANGE = new Color(0xD4A574); static { BufferedImage missingIcon = ImageUtil.loadImageResource(MicrobotPluginHubPanel.class, "pluginhub_missingicon.png"); @@ -199,13 +204,15 @@ private class PluginItem extends JPanel implements SearchablePlugin { private final int userCount; @Getter - private final boolean installed; + private boolean installed; private MicrobotPluginManifest manifest; + private String latestVersion; PluginItem(MicrobotPluginManifest manifest, Collection loadedPlugins, int userCount, boolean installed) { this.manifest = manifest; this.userCount = userCount; this.installed = installed; + this.latestVersion = manifest.getVersion(); var currentVersion = loadedPlugins.isEmpty() ? manifest.getVersion() : loadedPlugins.iterator().next().getClass().getAnnotation(PluginDescriptor.class).version(); @@ -248,24 +255,16 @@ private class PluginItem extends JPanel implements SearchablePlugin { author.setHorizontalAlignment(JLabel.LEFT); author.setBorder(new EmptyBorder(0, 0, 0, 5)); List availableVersions = manifest.getAvailableVersions(); - JLabel version = new JLabel(currentVersion); - version.setFont(FontManager.getRunescapeSmallFont()); - if (availableVersions.isEmpty()) { - version.setToolTipText(currentVersion); - } else { - String joinedVersions = availableVersions.stream() - .collect(Collectors.joining(", ")); - String tooltip = "Installed: " + HtmlEscapers.htmlEscaper().escape(currentVersion) + - "
Available: " + HtmlEscapers.htmlEscaper().escape(joinedVersions) + ""; - version.setToolTipText(tooltip); - } String suggestedVersion = !Strings.isNullOrEmpty(manifest.getVersion()) ? manifest.getVersion() : currentVersion; if (Strings.isNullOrEmpty(suggestedVersion)) { suggestedVersion = "unknown"; } String storedVersion = microbotPluginManager.getInstalledPluginVersion(manifest.getInternalName()).orElse(null); - String initialSelectedVersion = installed ? storedVersion : null; - final VersionActionDropdown versionDropdown = new VersionActionDropdown( + String installedVersion = installed + ? (!Strings.isNullOrEmpty(storedVersion) ? storedVersion : currentVersion) + : null; + String initialSelectedVersion = installed ? installedVersion : null; + final VersionSelector versionSelector = new VersionSelector( manifest, availableVersions, initialSelectedVersion, @@ -315,9 +314,7 @@ private class PluginItem extends JPanel implements SearchablePlugin { } GroupLayout.SequentialGroup bottomRow = layout.createSequentialGroup() - .addComponent(version, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) - .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) - .addComponent(versionDropdown, GroupLayout.PREFERRED_SIZE, 165, GroupLayout.PREFERRED_SIZE) + .addComponent(versionSelector, 100, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE); bottomRow.addComponent(help, 0, 24, 24) .addComponent(configure, 0, 24, 24) @@ -338,8 +335,7 @@ private class PluginItem extends JPanel implements SearchablePlugin { int lineHeight = description.getFontMetrics(description.getFont()).getHeight(); GroupLayout.ParallelGroup bottomRowVertical = layout.createParallelGroup(GroupLayout.Alignment.BASELINE) - .addComponent(version, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT) - .addComponent(versionDropdown, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT) + .addComponent(versionSelector, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT) .addComponent(help, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT) .addComponent(configure, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT, BOTTOM_LINE_HEIGHT); @@ -356,6 +352,8 @@ private class PluginItem extends JPanel implements SearchablePlugin { .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) .addGroup(bottomRowVertical) .addGap(5))); + + updateBorder(initialSelectedVersion); } @Override @@ -368,29 +366,77 @@ public int installs() { return userCount; } - private final class VersionActionDropdown extends JButton + private void updateBorder(String selectedVersion) + { + if (!installed) + { + setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + } + else if (!Strings.isNullOrEmpty(latestVersion) && latestVersion.equals(selectedVersion)) + { + setBorder(BorderFactory.createLineBorder(PASTEL_GREEN, 2)); + } + else + { + setBorder(BorderFactory.createLineBorder(PASTEL_ORANGE, 2)); + } + } + + private void setInstalled(boolean installed, String selectedVersion) + { + this.installed = installed; + updateBorder(selectedVersion); + } + + private final class VersionSelector extends JPanel { private final MicrobotPluginManifest manifest; - private final List versions; - private final String suggestedVersion; + private final JComboBox comboBox; + private final JButton removeButton; private boolean installed; - private String selectedVersion; - private VersionActionDropdown(MicrobotPluginManifest manifest, List availableVersions, + private VersionSelector(MicrobotPluginManifest manifest, List availableVersions, String initialSelectedVersion, String suggestedVersion, boolean installed) { this.manifest = manifest; this.installed = installed; - this.suggestedVersion = suggestedVersion; - this.selectedVersion = Strings.emptyToNull(initialSelectedVersion); - this.versions = buildVersionList(availableVersions, suggestedVersion, this.selectedVersion); - setFont(FontManager.getRunescapeSmallFont()); - setFocusPainted(false); - setBorder(new LineBorder(ColorScheme.DARKER_GRAY_COLOR.brighter())); - setToolTipText("Select a version or action"); - updateButtonLabel(); - updateButtonColor(); - addActionListener(e -> showMenu()); + + setLayout(new BorderLayout(2, 0)); + setOpaque(false); + + List versions = buildVersionList(availableVersions, suggestedVersion, initialSelectedVersion); + comboBox = new JComboBox<>(versions.toArray(new String[0])); + comboBox.setFont(FontManager.getRunescapeSmallFont()); + comboBox.setFocusable(false); + + if (!Strings.isNullOrEmpty(initialSelectedVersion) && versions.contains(initialSelectedVersion)) + { + comboBox.setSelectedItem(initialSelectedVersion); + } + else if (!Strings.isNullOrEmpty(suggestedVersion) && versions.contains(suggestedVersion)) + { + comboBox.setSelectedItem(suggestedVersion); + } + + comboBox.addActionListener(e -> { + if (e.getActionCommand().equals("comboBoxChanged")) + { + performInstallOrUpdate(); + } + }); + + removeButton = new JButton("✕"); + removeButton.setFont(FontManager.getRunescapeSmallFont()); + removeButton.setForeground(new Color(0xBE2828)); + removeButton.setPreferredSize(new Dimension(20, 16)); + removeButton.setMargin(new Insets(0, 0, 0, 0)); + removeButton.setFocusPainted(false); + removeButton.setToolTipText("Remove plugin"); + removeButton.setVisible(installed); + removeButton.addActionListener(e -> removePlugin()); + + add(comboBox, BorderLayout.CENTER); + add(removeButton, BorderLayout.EAST); } private List buildVersionList(List availableVersions, String suggested, String selected) @@ -417,97 +463,9 @@ private List buildVersionList(List availableVersions, String sug return new ArrayList<>(unique); } - private void showMenu() - { - JPopupMenu menu = new JPopupMenu(); - ButtonGroup versionGroup = new ButtonGroup(); - for (String version : versions) - { - JRadioButtonMenuItem item = new JRadioButtonMenuItem(version, version.equals(selectedVersion)); - item.addActionListener(ev -> setSelectedVersion(version, true)); - versionGroup.add(item); - menu.add(item); - } - - if (installed) - { - menu.addSeparator(); - menu.add(createActionItem("Remove", true, this::removePlugin)); - } - - menu.show(this, 0, getHeight()); - } - - private JMenuItem createActionItem(String label, boolean enabled, Runnable action) - { - JMenuItem item = new JMenuItem(label); - item.setEnabled(enabled); - if ("Remove".equalsIgnoreCase(label)) - { - item.setForeground(new Color(0xBE2828)); - } - item.addActionListener(ev -> action.run()); - return item; - } - - private void setSelectedVersion(String version, boolean triggerInstall) - { - selectedVersion = version; - updateButtonLabel(); - updateButtonColor(); - if (triggerInstall) - { - performInstallOrUpdate(); - } - } - - private void updateButtonLabel() - { - if (!Strings.isNullOrEmpty(selectedVersion)) - { - setText("Version: " + selectedVersion); - } - else if (!Strings.isNullOrEmpty(suggestedVersion)) - { - setText("Select version (" + suggestedVersion + ")"); - } - else - { - setText("Select version"); - } - } - - private void updateButtonColor() - { - Color color; - Color textColor = Color.BLACK; - if (!installed) - { - color = ColorScheme.DARKER_GRAY_COLOR; - textColor = Color.WHITE; - } - else if (hasUpdateAvailable()) - { - color = ColorScheme.BRAND_ORANGE; - } - else - { - color = new Color(0x28BE28); - } - setOpaque(true); - setBackground(color); - setForeground(textColor); - } - - private boolean hasUpdateAvailable() - { - return installed - && !Strings.isNullOrEmpty(manifest.getVersion()) - && (Strings.isNullOrEmpty(selectedVersion) || !manifest.getVersion().equals(selectedVersion)); - } - private void performInstallOrUpdate() { + String selectedVersion = (String) comboBox.getSelectedItem(); if (Strings.isNullOrEmpty(selectedVersion)) { return; @@ -515,32 +473,34 @@ private void performInstallOrUpdate() if (!installed) { - installSelectedVersion(); + installSelectedVersion(selectedVersion); } else { - updateSelectedVersion(); + updateSelectedVersion(selectedVersion); } } - private void installSelectedVersion() + private void installSelectedVersion(String version) { if (!ensureClientVersionCompatible()) { return; } - microbotPluginManager.installPlugin(manifest, selectedVersion); + microbotPluginManager.installPlugin(manifest, version); installed = true; - updateButtonColor(); + removeButton.setVisible(true); + setInstalled(true, version); } - private void updateSelectedVersion() + private void updateSelectedVersion(String version) { if (!ensureClientVersionCompatible()) { return; } - microbotPluginManager.updatePlugin(manifest, selectedVersion); + microbotPluginManager.updatePlugin(manifest, version); + updateBorder(version); MicrobotPluginHubPanel.this.reloadPluginList(); } @@ -548,9 +508,8 @@ private void removePlugin() { microbotPluginManager.removePlugin(manifest); installed = false; - selectedVersion = null; - updateButtonLabel(); - updateButtonColor(); + removeButton.setVisible(false); + setInstalled(false, null); } private boolean ensureClientVersionCompatible() @@ -627,6 +586,8 @@ private boolean ensureClientVersionCompatible() private final JPanel mainPanel; private List plugins = null; + private static final File MICROBOT_PLUGIN_DIR = new File(RuneLite.RUNELITE_DIR, "microbot-plugins"); + @Inject MicrobotPluginHubPanel( MicrobotTopLevelConfigPanel topLevelConfigPanel, @@ -675,23 +636,6 @@ public void changedUpdate(DocumentEvent e) { } }); - JLabel externalPluginWarning1 = new JLabel("Microbot plugins are verified to not be " + - "malicious, but are not " + - "maintained by the Microbot developers. " + - "They may cause bugs or instability."); - externalPluginWarning1.setBackground(new Color(0xFFBB33)); - externalPluginWarning1.setForeground(Color.BLACK); - externalPluginWarning1.setBorder(new EmptyBorder(5, 5, 5, 2)); - externalPluginWarning1.setOpaque(true); - - JLabel externalPluginWarning2 = new JLabel("Use at your own risk!"); - externalPluginWarning2.setHorizontalAlignment(JLabel.CENTER); - externalPluginWarning2.setFont(FontManager.getRunescapeBoldFont()); - externalPluginWarning2.setBackground(externalPluginWarning1.getBackground()); - externalPluginWarning2.setForeground(externalPluginWarning1.getForeground()); - externalPluginWarning2.setBorder(new EmptyBorder(0, 5, 5, 5)); - externalPluginWarning2.setOpaque(true); - mainPanel = new JPanel(); mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 7, 7, 7)); mainPanel.setLayout(new DynamicGridLayout(0, 1, 0, 5)); @@ -701,22 +645,23 @@ public void changedUpdate(DocumentEvent e) { refreshing.setHorizontalAlignment(JLabel.CENTER); JPanel mainPanelWrapper = new FixedWidthPanel(); + JButton openFolderButton = new JButton("Open Plugins Folder"); + SwingUtil.removeButtonDecorations(openFolderButton); + openFolderButton.setFocusable(false); + openFolderButton.setToolTipText("Open " + MICROBOT_PLUGIN_DIR.getAbsolutePath()); + openFolderButton.addActionListener(e -> openMicrobotPluginFolder()); { GroupLayout layout = new GroupLayout(mainPanelWrapper); mainPanelWrapper.setLayout(layout); layout.setVerticalGroup(layout.createSequentialGroup() - .addComponent(externalPluginWarning1) - .addComponent(externalPluginWarning2) .addGap(7) .addComponent(mainPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(refreshing) .addGap(0, 0, 0x7000)); layout.setHorizontalGroup(layout.createParallelGroup() - .addComponent(externalPluginWarning1, 0, Short.MAX_VALUE, Short.MAX_VALUE) - .addComponent(externalPluginWarning2, 0, Short.MAX_VALUE, Short.MAX_VALUE) .addComponent(mainPanel) .addComponent(refreshing, 0, Short.MAX_VALUE, Short.MAX_VALUE)); } @@ -727,20 +672,25 @@ public void changedUpdate(DocumentEvent e) { scrollPane.setPreferredSize(new Dimension(0x7000, 0x7000)); scrollPane.setViewportView(mainPanelWrapper); + JPanel searchRow = new JPanel(new BorderLayout(5, 0)); + searchRow.setOpaque(false); + searchRow.add(searchBar, BorderLayout.CENTER); + searchRow.add(openFolderButton, BorderLayout.EAST); + { GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setVerticalGroup(layout.createSequentialGroup() .addGap(10) - .addComponent(searchBar, 30, 30, 30) + .addComponent(searchRow, 30, 30, 30) .addGap(10) .addComponent(scrollPane)); layout.setHorizontalGroup(layout.createParallelGroup() .addGroup(layout.createSequentialGroup() .addGap(10) - .addComponent(searchBar) + .addComponent(searchRow) .addGap(10)) .addComponent(scrollPane)); } @@ -751,6 +701,23 @@ public void changedUpdate(DocumentEvent e) { reloadPluginList(); } + private void openMicrobotPluginFolder() { + if (!MICROBOT_PLUGIN_DIR.exists() && !MICROBOT_PLUGIN_DIR.mkdirs()) { + log.warn("Unable to create microbot plugin directory at {}", MICROBOT_PLUGIN_DIR.getAbsolutePath()); + return; + } + + try { + if (!Desktop.isDesktopSupported() || !Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { + log.warn("Desktop browsing not supported; plugin folder: {}", MICROBOT_PLUGIN_DIR.getAbsolutePath()); + return; + } + Desktop.getDesktop().open(MICROBOT_PLUGIN_DIR); + } catch (Exception ex) { + log.warn("Failed to open microbot plugin folder {}", MICROBOT_PLUGIN_DIR.getAbsolutePath(), ex); + } + } + private void reloadPluginList() { if (refreshing.isVisible()) { return; diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/microbot/questhelper/hamburger.png b/runelite-client/src/main/resources/net/runelite/client/plugins/microbot/questhelper/hamburger.png new file mode 100644 index 00000000000..66df4a06a9f Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/microbot/questhelper/hamburger.png differ