### Quest Helper Setup - Java Source: https://github.com/zoinkwiz/quest-helper/wiki/Template-Quest-Helper This Java code demonstrates the basic structure for setting up a quest helper plugin. It includes methods for defining item requirements, zones, conditions, and quest steps, essential for guiding players through a quest. ```java /* * Copyright (c) 2020, INSERT_YOUR_NAME_HERE * 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 com.questhelper.quests.YOUR_QUEST_FOLDER; @QuestDescriptor( quest = QuestHelperQuest.YOUR_QUEST ) public class YOURQUESTFILENAME extends BasicQuestHelper { ItemRequirement sampleRequirement; Zone sampleZone; ConditionForStep sampleCondition; QuestStep sampleStep; @Override public Map loadSteps() { setupItemRequirements(); setupZones(); setupConditions(); setupSteps(); Map steps = new HashMap<>(); return steps; } public void setupItemRequirements() { sampleRequirement = new ItemRequirement("Bucket", ItemID.BUCKET); } public void setupZones() { sampleZone = new Zone(new WorldPoint(10, 10, 0), new WorldPoint(20, 20, 0)); } public void setupConditions() { sampleCondition = new ZoneCondition(sampleZone); } public void setupSteps() { sampleStep = new DetailedQuestStep(this, "Talk to Hans in Lumbridge", sampleRequirement); } @Override public ArrayList getItemRequirements() { return new ArrayList<>(Arrays.asList(sampleRequirement)); } @Override public ArrayList getItemRecommended() { return new ArrayList<>(Arrays.asList()); } @Override public ArrayList getNotes() { return new ArrayList<>(Arrays.asList("This is a note to appear in the sidebar")); } @Override public ArrayList getCombatRequirements() { return new ArrayList<>(Collections.singletonList("Big scary monster (level 200)")); } @Override public ArrayList getPanels() { ArrayList allSteps = new ArrayList<>(); allSteps.add(new PanelDetails("The section's header!", new ArrayList<>(Arrays.asList(sampleStep)), sampleRequirement)); return allSteps; } } ``` -------------------------------- ### Run QuestHelperPluginTest in Java Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide To run the project and RuneLite, execute the `QuestHelperPluginTest` file. This requires setting up a Java run configuration with specific VM options and class names. ```java @QuestDescriptor( quest = QuestHelperQuest.ERNEST_THE_CHICKEN ) public class ErnestTheChicken ``` -------------------------------- ### Java VM Options for Run Configuration Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Configuration options for running the Quest Helper project. This includes setting the classpath, enabling assertions with `-ea`, and specifying the fully qualified class name. ```java -cp quest-helper.test -ea ``` -------------------------------- ### Create a Conditional Step Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Illustrates the creation and usage of a ConditionalStep, which allows for dynamic step progression based on defined conditions. Steps are checked in order, with a default step if no conditions are met. ```java ConditionalStep mySteps = new ConditionalStep(this, getCat); myStep.addStep(inLumbridgeFloor1AndHasCat, talkToDuke); myStep.addStep(inLumbridgeAndHasCat, goUpToDuke); ``` -------------------------------- ### Combine Conditions with LogicType Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Demonstrates how to combine multiple requirement conditions using a specified LogicType (e.g., AND, OR). This allows for complex conditional logic to be defined concisely. ```java Conditions hasDeathRunes = new ItemRequirement("Death runes", ItemID.DEATH_RUNE, 25); Conditions hasCatFollower = new FollowerRequirement(NpcID.HOUND); Conditions inWizardsTower = new ZoneRequirement(Zone.WIZARDS_TOWER); Conditions combinedConditions = new Conditions(LogicType.AND, hasDeathRunes, hasCatFollower, inWizardsTower); ``` -------------------------------- ### Core Plugin Services - Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt Demonstrates how to access core services from the QuestHelperPlugin in Java. This includes getting the active quest, background helpers, item requirements, and interacting with the plugin's UI and bank. ```java // QuestHelperPlugin is automatically loaded by RuneLite from runelite-plugin.properties // plugins=com.questhelper.QuestHelperPlugin // Access the plugin's core services @Inject private QuestHelperPlugin questHelperPlugin; // Get currently active quest helper QuestHelper activeQuest = questHelperPlugin.getSelectedQuest(); // Access background helpers (item tracking, etc.) Map backgroundHelpers = questHelperPlugin.getBackgroundHelpers(); // Get item requirements for all quests Map> requirements = questHelperPlugin.getItemRequirements(); // Refresh bank tag interface questHelperPlugin.refreshBank(); // Open the quest helper sidebar panel questHelperPlugin.displayPanel(); ``` -------------------------------- ### Object Interaction Step Configuration (Java) Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Configures steps for interacting with game objects. Supports single or multiple objects in an area and allows revalidation of objects on different planes. It also handles alternate object IDs, useful for objects that change state. ```Java ObjectStep(QuestHelper, int, WorldPoint, String, Requirement...) ObjectStep(QuestHelper, int, String, Requirement...) setRevalidateObjects(boolean) setAlternateObjects(int...) ``` -------------------------------- ### Load Quest Steps Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Provides a template for the loadSteps function, which returns a map of quest varbit states to corresponding steps. It emphasizes instantiating requirements and conditional steps before this method is called. ```java public Map loadSteps() { // Instantiate requirements, zones, conditional steps, etc. here // ... Map steps = new HashMap<>(); // Populate the map with varbit states and QuestStep objects // steps.put(questVarbitValue, questStepInstance); return steps; } ``` -------------------------------- ### Java CLI Arguments for Run Configuration Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Command-line interface arguments for the Quest Helper project's run configuration. `--debug` and `--developer-mode` are used to enable development tools within RuneLite and Quest Helper. ```java --debug --developer-mode ``` -------------------------------- ### Miscellaneous Quest Step Types (Java) Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Provides configurations for several other specific quest step types. These include digging at a location, performing an emote, navigating to a tile, and picking up items. ```Java DigStep(QuestHelper, WorldPoint, String, Requirement...) EmoteStep(QuestHelper, int, String, Requirement...) TileStep(QuestHelper, WorldPoint, String, Requirement...) ItemStep(QuestHelper, int, WorldPoint, String, Requirement...) ``` -------------------------------- ### NPC Interaction Step Configuration (Java) Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Configures steps for interacting with Non-Player Characters (NPCs), including specifying which NPC to talk to or fight. Allows for multiple highlights for scattered enemies and setting safespots for combat encounters. It also includes options to hide world arrows and manage NPC roam ranges. ```Java NpcStep(QuestHelper, int, String, boolean, Requirement...) NpcStep(QuestHelper, int, WorldPoint, String, boolean, Requirement...) setHideWorldArrow(boolean) addSafeSpots(WorldPoint...) ``` -------------------------------- ### Detailed Quest Step Configuration (Java) Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide A versatile step used for various quest objectives, including traveling to a location or drawing paths. It allows for defining line points for minimap paths and world map paths, and provides options to hide world arrows and minimap lines. ```Java DetailedQuestStep(QuestHelper, WorldPoint, String, Requirement...) setLinePoints(List) setWorldLinePoints(List) setHideWorldArrow(boolean) setHideMinimapLines(boolean) ``` -------------------------------- ### Combining Item Requirements with Logic Types Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide The `ItemRequirements` class holds multiple `ItemRequirement` objects and checks them based on a specified `LogicType`. Supported logic types include AND, OR, NAND, NOR, and XOR, allowing for complex requirement combinations. ```java ItemRequirements itemReqs = new ItemRequirements(LogicType.AND); itemReqs.addRequirement(itemReq1); itemReqs.addRequirement(itemReq2); boolean passes = itemReqs.check(); ``` -------------------------------- ### Highlighting Quest Dialog Choices Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Functions to highlight specific dialog choices in quests. `addDialogStep(String)` highlights a choice by its text, while `addDialogStep(int, String)` highlights a choice by its ID and text, ensuring it appears in the correct order. Exclusion methods are available but should be used as a last resort. ```java addDialogStep("Dialog Choice Example"); addDialogStep(3, "Dialog Choice Example"); addDialogStepWithExclusion("Dialog Choice Example", "Exclusion String"); addDialogStepWithExclusions("Dialog Choice Example", "Exclusion1", "Exclusion2"); ``` -------------------------------- ### Defining Item Requirements for Quests Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Classes and methods for defining item requirements in quests. `ItemRequirement` allows specifying item IDs, quantities, and conditions like highlighting in inventory or being equipped. Convenience methods facilitate copying and modifying requirements. ```java ItemRequirement itemReq = new ItemRequirement("item_id"); itemReq.addAlternates(new String[]{"alt_id1", "alt_id2"}); itemReq.setHighlightInInventory(true); itemReq.setEquip(true); itemReq.setQuantity(5); itemReq.setConditionToHide(someRequirement); ItemRequirement copiedReq = itemReq.copy(); ItemRequirement highlightedReq = itemReq.highlighted(); ItemRequirement equippedReq = itemReq.equipped(); ItemRequirement quantityReq = itemReq.quantity(10); ItemRequirement hideReq = itemReq.hideConditioned(anotherRequirement); itemReq.canBeObtainedDuringQuest(true); itemReq.setTooltip("This is a tooltip"); itemReq.appendToTooltip("Additional information."); itemReq.setOverlayReplacement(replacementRequirement); ``` -------------------------------- ### Specifying Non-Standard Widget Choices Source: https://github.com/zoinkwiz/quest-helper/wiki/Contribution-guide Methods for adding dialog choices to non-standard widgets. `addWidgetChoice(String, int int)` is used for specifying the group and child IDs. `addWidgetChoice(String, int, int, int)` handles widgets with nested child widgets. ```java addWidgetChoice("Widget Name", 1, 2); addWidgetChoice("Widget Name", 1, 2, 3); ``` -------------------------------- ### Creating a Basic Quest Helper - Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt Illustrates the creation of a basic quest helper by extending `BasicQuestHelper` in Java. It covers setting up zones, requirements, steps, and defining the quest's step progression logic. ```java package com.questhelper.helpers.quests.yourquest; import com.questhelper.questhelpers.BasicQuestHelper; import com.questhelper.panel.PanelDetails; import com.questhelper.requirements.item.ItemRequirement; import com.questhelper.requirements.zone.Zone; import com.questhelper.requirements.zone.ZoneRequirement; import com.questhelper.steps.*; import net.runelite.api.coords.WorldPoint; import net.runelite.api.gameval.*; import java.util.*; @QuestDescriptor(quest = QuestHelperQuest.YOUR_QUEST) public class YourQuest extends BasicQuestHelper { // Define requirements ItemRequirement sword, shield; Zone castleZone; ZoneRequirement inCastle; // Define steps NpcStep talkToKing; ObjectStep openChest; ConditionalStep mainSteps; @Override protected void setupZones() { castleZone = new Zone(new WorldPoint(3200, 3200, 0), new WorldPoint(3220, 3220, 2)); } @Override protected void setupRequirements() { sword = new ItemRequirement("Bronze sword", ItemID.BRONZE_SWORD); sword.setTooltip("Can be purchased from the sword shop in Varrock"); shield = new ItemRequirement("Wooden shield", ItemID.WOODEN_SHIELD); shield.canBeObtainedDuringQuest(); inCastle = new ZoneRequirement(castleZone); } public void setupSteps() { talkToKing = new NpcStep(this, NpcID.KING, new WorldPoint(3210, 3210, 0), "Talk to the King in Lumbridge Castle.", sword, shield); talkToKing.addDialogSteps("What's wrong?", "I'll help you!"); openChest = new ObjectStep(this, ObjectID.CHEST, new WorldPoint(3215, 3215, 0), "Open the chest in the castle."); openChest.addAlternateObjects(ObjectID.CHEST_OPEN); } @Override public Map loadSteps() { initializeRequirements(); setupSteps(); Map steps = new HashMap<>(); // Varbit 0 = quest not started mainSteps = new ConditionalStep(this, talkToKing); mainSteps.addStep(inCastle, openChest); steps.put(0, talkToKing); // Quest start steps.put(1, mainSteps); // After talking to king steps.put(2, openChest); // Final step return steps; } @Override public List getItemRequirements() { return Arrays.asList(sword, shield); } @Override public List getPanels() { List panels = new ArrayList<>(); panels.add(new PanelDetails("Starting", Arrays.asList(talkToKing), sword, shield)); panels.add(new PanelDetails("Finishing", Arrays.asList(openChest))); return panels; } } ``` -------------------------------- ### Create Detailed Quest Steps with World Markers and Paths (Java) Source: https://context7.com/zoinkwiz/quest-helper/llms.txt Demonstrates creating `DetailedQuestStep` objects for navigation, including setting world points, line paths, and teleport suggestions. It also shows how to add requirements and sub-steps. ```java DetailedQuestStep goToLocation = new DetailedQuestStep(this, new WorldPoint(3222, 3218, 0), "Walk to Lumbridge Castle courtyard."); DetailedQuestStep genericInstruction = new DetailedQuestStep(this, "Complete the puzzle on screen."); gotoLocation.addRequirement(sword); gotoLocation.addRequirement(shield); List pathToDestination = Arrays.asList( new WorldPoint(3220, 3218, 0), new WorldPoint(3225, 3220, 0), new WorldPoint(3230, 3218, 0) ); gotoLocation.setLinePoints(pathToDestination); gotoLocation.setWorldLinePoints(pathToDestination); gotoLocation.setHideWorldArrow(true); gotoLocation.setHideMinimapLines(true); TeleportItemRequirement lumbridgeTele = new TeleportItemRequirement( "Lumbridge teleport", ItemID.LUMBRIDGE_TELEPORT); gotoLocation.addTeleport(lumbridgeTele); DetailedQuestStep climbUp = new ObjectStep(this, ObjectID.LADDER_UP, "Climb up."); DetailedQuestStep climbDown = new ObjectStep(this, ObjectID.LADDER_DOWN, "Climb down."); climbUp.addSubSteps(climbDown); ``` -------------------------------- ### Configure Dialog Handling for NPCs (Java) Source: https://context7.com/zoinkwiz/quest-helper/llms.txt Shows how to configure dialog options for NPC interactions, including highlighting specific choices, handling multiple options, and excluding options based on conditions. It also covers widget-based choices and detecting dialog states for conditional logic. ```java NpcStep talkToNpc = new NpcStep(this, NpcID.QUEST_NPC, location, "Talk to the NPC."); talkToNpc.addDialogStep("I want to help!"); talkToNpc.addDialogStep(2, "Ask about the quest"); talkToNpc.addDialogSteps( "Hello there!", "Tell me about the quest.", "Yes, I'll help you." ); talkToNpc.addDialogStepWithExclusion( "Continue talking", "End conversation" ); talkToNpc.addWidgetChoice("Select option", 219, 1); DialogRequirement saidYes = new DialogRequirement("I'll help you!"); DialogRequirement questAccepted = new DialogRequirement("Thank you! Here's what you need to do."); ConditionalStep steps = new ConditionalStep(this, talkToNpc); steps.addStep(questAccepted, doFirstTask); ``` -------------------------------- ### Define Skill and Quest Requirements (Java) Source: https://context7.com/zoinkwiz/quest-helper/llms.txt Illustrates how to define various player state requirements, including skill levels (boostable and non-boostable), combat level, quest points, quest completion status, prayer, spellbook, inventory space, follower presence, and weight. ```java SkillRequirement mining40 = new SkillRequirement(Skill.MINING, 40); SkillRequirement mining40Boostable = new SkillRequirement(Skill.MINING, 40, true); CombatLevelRequirement combat50 = new CombatLevelRequirement(50); QuestPointRequirement qp100 = new QuestPointRequirement(100); QuestRequirement dragonSlayer = new QuestRequirement(QuestHelperQuest.DRAGON_SLAYER_I, QuestState.FINISHED); QuestRequirement startedRecipe = new QuestRequirement(QuestHelperQuest.RECIPE_FOR_DISASTER, QuestState.IN_PROGRESS); PrayerRequirement protectMelee = new PrayerRequirement(Prayer.PROTECT_FROM_MELEE); SpellbookRequirement onAncients = new SpellbookRequirement(Spellbook.ANCIENT); FreeInventorySlotRequirement freeSlots = new FreeInventorySlotRequirement(5); FollowerRequirement hasCat = new FollowerRequirement("Cat following", NpcID.CAT, NpcID.KITTEN); WeightRequirement underWeight = new WeightRequirement(30, Operation.LESS_EQUAL); ``` -------------------------------- ### Access and Use Quest Helper Configuration in Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt This Java code demonstrates how to access and utilize the `QuestHelperConfig` object within a quest helper. It shows how to retrieve settings for NPC and object highlighting styles, overlay colors, feature flags like showing overlays or minimap arrows, and quest filtering/ordering preferences. ```java // Assuming QuestHelperConfig, Color, QuestDetails classes and relevant enums are defined // import questhelper.api.QuestHelperConfig; // import questhelper.api.QuestHelperConfig.NpcHighlightStyle; // import questhelper.api.QuestHelperConfig.ObjectHighlightStyle; // import questhelper.api.QuestHelperConfig.QuestFilter; // import questhelper.api.QuestHelperConfig.QuestOrdering; // import questhelper.api.QuestDetails; // import java.awt.Color; // Placeholder for the quest helper object // class QuestHelper { // public QuestHelperConfig getConfig() { return null; } // Dummy implementation // } // Placeholder for the quest helper instance // QuestHelper questHelper = new QuestHelper(); // Access config from within a quest helper QuestHelperConfig config = questHelper.getConfig(); // Check highlight style settings QuestHelperConfig.NpcHighlightStyle npcStyle = config.highlightStyleNpcs(); QuestHelperConfig.ObjectHighlightStyle objStyle = config.highlightStyleObjects(); // Get configured colors Color targetColor = config.targetOverlayColor(); Color passColor = config.passColour(); Color failColor = config.failColour(); // Check feature flags boolean showOverlay = config.showOverlay(); boolean showMiniMapArrow = config.showMiniMapArrow(); boolean solvePuzzles = config.solvePuzzles(); boolean useShortestPath = config.useShortestPath(); // Quest filtering and ordering QuestHelperConfig.QuestFilter filter = config.filterListBy(); QuestHelperConfig.QuestOrdering order = config.orderListBy(); QuestDetails.Difficulty difficulty = config.difficulty(); boolean showCompleted = config.showCompletedQuests(); ``` -------------------------------- ### Varbit and Varplayer Requirements - Track Game State and Quest Progress Source: https://context7.com/zoinkwiz/quest-helper/llms.txt VarbitRequirement and VarplayerRequirement classes are used to check game state variables, such as quest progress or specific player stats. They support various comparison operations and range checks for flexible condition setting. ```java // Check if varbit equals specific value VarbitRequirement questStarted = new VarbitRequirement(VarbitID.QUEST_PROGRESS, 1); // Check varbit with comparison operation VarbitRequirement questAdvanced = new VarbitRequirement( VarbitID.QUEST_PROGRESS, 5, Operation.GREATER_EQUAL); // Range check VarbitRequirement inPhase2 = new VarbitRequirement( VarbitID.QUEST_PROGRESS, 10, 20); // Between 10 and 20 // Varplayer requirements (less common, but used for some mechanics) VarplayerRequirement hasQuestCape = new VarplayerRequirement( VarPlayerID.QUEST_POINTS, 290, Operation.GREATER_EQUAL); // Use varbit builder for cleaner syntax VarbitRequirement controlsUsed = VarbitBuilder.varbit(VarbitID.MILL_FLOUR) .equals(1) .build(); // Complex varbit conditions Conditions questReady = new Conditions(LogicType.AND, new VarbitRequirement(VarbitID.QUEST_A, 100), new VarbitRequirement(VarbitID.QUEST_B, 50), new VarbitRequirement(VarbitID.QUEST_C, 75) ); ``` -------------------------------- ### Interact with Game Objects using ObjectStep in Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt The ObjectStep class facilitates interactions with various in-game objects such as doors, chests, and ladders. It supports highlighting specific objects by location or finding the nearest one, and can handle objects with multiple IDs or states. ```java // Interact with object at specific location ObjectStep openDoor = new ObjectStep(this, ObjectID.DOOR_CLOSED, new WorldPoint(3200, 3200, 0), "Open the door to enter the building."); // Add alternate object IDs (e.g., door open/closed states) openDoor.addAlternateObjects(ObjectID.DOOR_OPEN, ObjectID.DOOR_BROKEN); // Object without specific location - finds nearest matching object ObjectStep climbLadder = new ObjectStep(this, ObjectID.LADDER, "Climb the ladder to the upper floor."); // Show all matching objects in an area ObjectStep collectOres = new ObjectStep(this, ObjectID.IRON_ROCK, new WorldPoint(3285, 3365, 0), "Mine iron ore from the rocks.", true); // true = showAllInArea collectOres.setMaxObjectDistance(30); // Add icon to show on the object ObjectStep fillHopper = new ObjectStep(this, ObjectID.HOPPER, new WorldPoint(3166, 3307, 2), "Fill the hopper with grain.", pot, grain.highlighted()); fillHopper.addIcon(ItemID.GRAIN); // Handle objects that change when player moves between planes ObjectStep useStairs = new ObjectStep(this, ObjectID.STAIRCASE, new WorldPoint(3200, 3200, 0), "Go up the stairs."); useStairs.setRevalidateObjects(true); // Limit render distance for performance collectOres.setMaxRenderDistance(25); ``` -------------------------------- ### Implement Dynamic Quest Logic with ConditionalStep in Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt ConditionalStep enables dynamic quest progression by allowing steps to be chosen based on various conditions, such as player location, inventory items, or varbit states. Conditions are evaluated in the order they are added, with the first matching condition determining the next step. ```java // Create conditional step with a fallback default step ConditionalStep questSteps = new ConditionalStep(this, goToStartLocation); // Add conditions - checked from top to bottom, first match wins questSteps.addStep(hasAllItems, finishQuest); questSteps.addStep(inUpperFloor, hasKey, openLockedDoor); questSteps.addStep(inUpperFloor, searchForKey); questSteps.addStep(hasKey, climbUpstairs); questSteps.addStep(inCastle, talkToGuard); // Default: goToStartLocation (if no conditions match) // Use logic helpers for complex conditions import static com.questhelper.requirements.util.LogicHelper.*; ConditionalStep gatherItems = new ConditionalStep(this, finishQuest); gatherItems.addStep(nor(hasMilk, hasTurnedInMilk), getMilk); gatherItems.addStep(nor(hasFlour, hasTurnedInFlour), getFlour); gatherItems.addStep(nor(hasEgg, hasTurnedInEgg), getEgg); gatherItems.addStep(or(hasEgg, hasTurnedInEverything), finishQuest); // Nested conditional steps for complex logic ConditionalStep flourSteps = new ConditionalStep(this, getPot); flourSteps.addStep(and(hasPot, hasGrain, inMillTop), fillHopper); flourSteps.addStep(and(hasPot, hasGrain), climbToMill); flourSteps.addStep(hasPot, getGrain); ConditionalStep mainSteps = new ConditionalStep(this, finishQuest); mainSteps.addStep(nor(hasFlour), flourSteps); mainSteps.addStep(nor(hasMilk), milkCow); // Make lockable steps that persist until manually unlocked questSteps.addStep(inDungeon, escapeDungeon, true); // true = isLockable ``` -------------------------------- ### ItemRequirement - Track and Display Game Items Source: https://context7.com/zoinkwiz/quest-helper/llms.txt ItemRequirement allows for detailed tracking of items, including quantities, alternates, equipment status, and conditional visibility. It supports various configurations for displaying item needs within the game. ```java // Basic item requirement ItemRequirement sword = new ItemRequirement("Bronze sword", ItemID.BRONZE_SWORD); // Require specific quantity ItemRequirement coins = new ItemRequirement("Coins", ItemID.COINS, 1000); coins.setTooltip("Needed to pay the ferry captain"); // Item from a collection (any item in collection satisfies) ItemRequirement axe = new ItemRequirement("Any axe", ItemCollections.AXES); // Alternate items that satisfy the requirement ItemRequirement pickaxe = new ItemRequirement("Pickaxe", ItemID.BRONZE_PICKAXE); pickaxe.addAlternates(ItemID.IRON_PICKAXE, ItemID.STEEL_PICKAXE, ItemID.MITHRIL_PICKAXE, ItemID.ADAMANT_PICKAXE, ItemID.RUNE_PICKAXE); // Item must be equipped ItemRequirement weapon = new ItemRequirement("Weapon", ItemID.DRAGON_SCIMITAR); weapon.setEquip(true); // Check item charges (e.g., ring of dueling (8) counts as 8) ItemRequirement duelingRing = new ItemRequirement("Ring of dueling", ItemID.RING_OF_DUELING8); duelingRing.setChargedItem(true); // Highlight item in inventory overlay ItemRequirement questItem = new ItemRequirement("Quest item", ItemID.QUEST_ITEM); questItem.setHighlightInInventory(true); // Mark as obtainable during quest (shows differently in sidebar) ItemRequirement rope = new ItemRequirement("Rope", ItemID.ROPE); rope.canBeObtainedDuringQuest(); // Hide requirement when condition is met ItemRequirement milk = new ItemRequirement("Bucket of milk", ItemID.BUCKET_MILK); milk.setConditionToHide(or(hasTurnedInMilk, questComplete)); // Convenience copy methods for variations ItemRequirement swordHighlighted = sword.highlighted(); ItemRequirement swordEquipped = sword.equipped(); ItemRequirement swordQuantity = sword.quantity(5); ItemRequirement swordConditional = sword.hideConditioned(hasWeapon); // Complex item logic - require multiple items ItemRequirements combatGear = new ItemRequirements(LogicType.AND, weapon, shield, armor); // Require any one of multiple items ItemRequirements anyFood = new ItemRequirements(LogicType.OR, new ItemRequirement("Lobster", ItemID.LOBSTER), new ItemRequirement("Shark", ItemID.SHARK), new ItemRequirement("Monkfish", ItemID.MONKFISH)); ``` -------------------------------- ### Define Quest Rewards in Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt This Java code defines various rewards for a quest, including quest points, experience in different skills, items with quantities, and unlockable features or permissions. It demonstrates how to instantiate and return different reward types. ```java import java.util.Arrays; import java.util.List; // Assuming these classes and enums are defined elsewhere in the project // import net.runelite.api.Skill; // import questhelper.api.rewards.ExperienceReward; // import questhelper.api.rewards.ItemReward; // import questhelper.api.rewards.QuestPointReward; // import questhelper.api.rewards.UnlockReward; // import questhelper.api.rewards.ItemID; public class QuestRewards { // Example implementation of reward retrieval methods public QuestPointReward getQuestPointReward() { return new QuestPointReward(2); } public List getExperienceRewards() { return Arrays.asList( new ExperienceReward(Skill.COOKING, 300), new ExperienceReward(Skill.CRAFTING, 500), new ExperienceReward(Skill.MAGIC, 1000, 5000) // 1000 base + 5000 bonus ); } public List getItemRewards() { return Arrays.asList( new ItemReward("Coins", ItemID.COINS, 5000), new ItemReward("Dragon sword", ItemID.DRAGON_SWORD, 1) ); } public List getUnlockRewards() { return Arrays.asList( new UnlockReward("Access to the Champion's Guild"), new UnlockReward("Ability to equip rune platebody"), new UnlockReward("Permission to use the Cook's range") ); } } ``` -------------------------------- ### Interact with NPCs using NpcStep in Java Source: https://context7.com/zoinkwiz/quest-helper/llms.txt The NpcStep class handles interactions with Non-Player Characters (NPCs). It supports basic dialog, combat, following, and can manage multiple NPC spawns or IDs. You can configure highlighting, combat behavior, and search ranges. ```java // Basic NPC interaction at a specific location NpcStep talkToHans = new NpcStep(this, NpcID.HANS, new WorldPoint(3222, 3218, 0), "Talk to Hans walking around Lumbridge Castle."); // Add dialog choices to highlight talkToHans.addDialogSteps("What's wrong?", "Can I help?", "Yes."); // Handle NPCs with multiple IDs (e.g., different states) int[] cookIds = {NpcID.COOK, NpcID.COOK_BUSY}; NpcStep talkToCook = new NpcStep(this, cookIds, new WorldPoint(3206, 3214, 0), "Talk to the Cook in the Lumbridge Castle kitchen."); // Combat with multiple enemies - allow highlighting all spawns NpcStep killGoblins = new NpcStep(this, NpcID.GOBLIN, new WorldPoint(3145, 3301, 0), "Kill goblins east of Lumbridge.", true, combatGear); killGoblins.setMustBeFocusedOnPlayer(true); // Only highlight NPCs attacking player killGoblins.setHideWorldArrow(true); // Don't show arrow for combat // Add safespots for the NPC killGoblins.addSafeSpots( new WorldPoint(3146, 3302, 0), new WorldPoint(3147, 3303, 0) ); // Limit search range for NPCs that wander talkToHans.setMaxRoamRange(20); // Add alternate NPC IDs after construction talkToHans.addAlternateNpcs(NpcID.HANS_WALKING, NpcID.HANS_SITTING); ``` -------------------------------- ### Zone and ZoneRequirement - Define and Check Player Location Source: https://context7.com/zoinkwiz/quest-helper/llms.txt Zone defines rectangular areas in the game world using WorldPoints, while ZoneRequirement checks if the player is currently within one or more specified zones. This is useful for location-based quest triggers. ```java // Define a zone with two corners (any two opposite corners work) Zone lumbridgeCastle = new Zone( new WorldPoint(3204, 3206, 0), // South-west corner new WorldPoint(3220, 3230, 2) // North-east corner (includes all floors 0-2) ); // Single-floor zone Zone groundFloor = new Zone( new WorldPoint(3204, 3206, 0), new WorldPoint(3220, 3230, 0) ); // Multiple zones - useful for areas with separate regions Zone[] caveZones = { new Zone(new WorldPoint(3100, 3100, 0), new WorldPoint(3150, 3150, 0)), new Zone(new WorldPoint(3200, 3100, 0), new WorldPoint(3250, 3150, 0)) }; // Create zone requirement ZoneRequirement inCastle = new ZoneRequirement(lumbridgeCastle); ZoneRequirement inCave = new ZoneRequirement(caveZones); // Use in conditional steps ConditionalStep steps = new ConditionalStep(this, goToCastle); steps.addStep(inCastle, talkToKing); // Polygon-based zones for irregular shapes PolyZone irregularArea = new PolyZone( new WorldPoint(3200, 3200, 0), new WorldPoint(3210, 3205, 0), new WorldPoint(3215, 3200, 0), new WorldPoint(3210, 3195, 0) ); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.