Interface ICombat
This interface offers methods for managing combat state, including special attacks, health, status effects (poison, venom, antifire), auto-retaliate settings, and finding attackable NPCs.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault INPCgetAttackableNPC(int... ids) Finds an attackable NPC with any of the specified IDs.default INPCgetAttackableNPC(String... names) Finds an attackable NPC with any of the specified names.getAttackableNPC(Predicate<INPC> filter) Finds an attackable NPC matching the specified filter.Gets the currently selected attack style.intGets the current Soulreaper Axe stack count.net.runelite.api.coords.WorldPointGets the world location of the player's placed dwarf multicannon.intGets the current hitpoints level.Gets the weapon style of the currently equipped weapon.doubleGets the current health as a percentage of maximum health.intGets the amount of health points currently missing.intGets the current special attack energy percentage.net.runelite.api.coords.WorldPointGets the world location of the player's gravestone/tomb.booleanChecks if the player has antifire (dragonfire protection) active.booleanChecks if the player currently has antipoison protection active.booleanChecks if the player currently has antivenom protection active.booleanChecks if the player is currently poisoned.booleanChecks if auto-retaliate is currently enabled.booleanChecks if special attack is currently enabled/toggled on.booleanChecks if the player has super antifire (extended dragonfire protection) active.booleanChecks if the player is currently afflicted with venom.voidsetAttackStyle(AttackStyle attackStyle) Sets the attack style to the specified option.default voidToggles auto-retaliate to the opposite of its current state.voidtoggleAutoRetaliate(Boolean active) Sets auto-retaliate to the specified state.voidToggles the special attack bar.
-
Method Details
-
getSpecEnergy
int getSpecEnergy()Gets the current special attack energy percentage.- Returns:
- the special attack energy (0-100)
-
getMissingHealth
int getMissingHealth()Gets the amount of health points currently missing.Calculated as base hitpoints level minus current boosted hitpoints. Returns 0 if at full health or overhealed.
- Returns:
- the missing health points, minimum 0
-
isVenomed
boolean isVenomed()Checks if the player is currently afflicted with venom.Venom is a stronger form of poison that increases in damage over time.
- Returns:
- true if venomed, false otherwise
-
isPoisoned
boolean isPoisoned()Checks if the player is currently poisoned.Note: This returns true for both poison and venom. Use
isVenomed()to specifically check for venom.- Returns:
- true if poisoned or venomed, false otherwise
-
isAntiPoisoned
boolean isAntiPoisoned()Checks if the player currently has antipoison protection active.- Returns:
- true if antipoison effect is active, false otherwise
-
isAntiVenomed
boolean isAntiVenomed()Checks if the player currently has antivenom protection active.Antivenom provides stronger protection than regular antipoison.
- Returns:
- true if antivenom effect is active, false otherwise
-
isSpecEnabled
boolean isSpecEnabled()Checks if special attack is currently enabled/toggled on.- Returns:
- true if special attack is enabled, false otherwise
-
getAxeEnergy
int getAxeEnergy()Gets the current Soulreaper Axe stack count.The Soulreaper Axe builds stacks that increase special attack damage but drain hitpoints.
- Returns:
- the current number of Soulreaper Axe stacks
-
isAntifired
boolean isAntifired()Checks if the player has antifire (dragonfire protection) active.- Returns:
- true if antifire is active, false otherwise
-
isSuperAntifired
boolean isSuperAntifired()Checks if the player has super antifire (extended dragonfire protection) active.Super antifire provides complete protection against dragonfire without a shield.
- Returns:
- true if super antifire is active, false otherwise
-
isRetaliating
boolean isRetaliating()Checks if auto-retaliate is currently enabled.When enabled, the player will automatically attack back when attacked.
- Returns:
- true if auto-retaliate is on, false otherwise
-
toggleAutoRetaliate
default void toggleAutoRetaliate()Toggles auto-retaliate to the opposite of its current state. -
toggleAutoRetaliate
Sets auto-retaliate to the specified state.If the requested state matches the current state, no action is taken.
- Parameters:
active- true to enable auto-retaliate, false to disable
-
toggleSpec
void toggleSpec()Toggles the special attack bar.Clicking the special attack bar will enable it for the next attack (if enough energy is available).
-
getAttackStyle
AttackStyle getAttackStyle()Gets the currently selected attack style.- Returns:
- the current attack style
-
setAttackStyle
Sets the attack style to the specified option.This will click the corresponding attack style button in the combat interface.
- Parameters:
attackStyle- the attack style to select
-
getAttackableNPC
Finds an attackable NPC with any of the specified IDs.An NPC is considered attackable if it has an "Attack" action, is not already being attacked by another player, and prioritizes NPCs that are already attacking the local player.
- Parameters:
ids- the NPC IDs to search for- Returns:
- the nearest attackable NPC matching the IDs, or null if none found
-
getAttackableNPC
Finds an attackable NPC with any of the specified names.An NPC is considered attackable if it has an "Attack" action, is not already being attacked by another player, and prioritizes NPCs that are already attacking the local player.
- Parameters:
names- the NPC names to search for- Returns:
- the nearest attackable NPC matching the names, or null if none found
-
getAttackableNPC
Finds an attackable NPC matching the specified filter.The search prioritizes:
- NPCs that are attacking the local player and not being attacked by others
- NPCs that are not interacting with anyone and not being attacked by others
- Parameters:
filter- the predicate to filter NPCs- Returns:
- the nearest attackable NPC matching the filter, or null if none found
-
getCurrentHealth
int getCurrentHealth()Gets the current hitpoints level.- Returns:
- the current boosted hitpoints level
-
getHealthPercent
double getHealthPercent()Gets the current health as a percentage of maximum health.- Returns:
- the health percentage (0.0 to 100.0)
-
getTombWorldPoint
net.runelite.api.coords.WorldPoint getTombWorldPoint()Gets the world location of the player's gravestone/tomb.Returns the location where items can be retrieved after death.
- Returns:
- the gravestone location, or null if no active gravestone exists
-
getCannonWorldPoint
net.runelite.api.coords.WorldPoint getCannonWorldPoint()Gets the world location of the player's placed dwarf multicannon.- Returns:
- the cannon location, or null if no cannon is placed
-
getCurrentWeaponStyle
WeaponStyle getCurrentWeaponStyle()Gets the weapon style of the currently equipped weapon.Returns the combat style category (melee, ranged, magic) based on the weapon in the weapon equipment slot.
- Returns:
- the current weapon style, defaults to MELEE if no weapon equipped
-