Package dev.twilite.game.wrapper
Class Actor<T extends dev.twilite.game.internal.memory.RSActor>
java.lang.Object
dev.twilite.game.wrapper.Actor<T>
- All Implemented Interfaces:
Interactable,InteractableUnit,Unit
public abstract class Actor<T extends dev.twilite.game.internal.memory.RSActor>
extends Object
implements InteractableUnit
Base wrapper for actor units such as players and NPCs.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this Actor is currently animating (animation not -1)intReturns the current animation id, or-1when absent.area()Returns the area this unit occupies.coord()Returns this unit's world coordinate.booleandying()Returns whether this actor is dying.effects()Returns active spot animation/effect ids on this actor.booleanCompares actors by wrapper type and client actor index.faceUnit()Resolves the unit this actor is currently facing.booleanReturns whether this actor is facing another unit.booleanfacingUnit(Unit other) Returns whether this actor is facing the specified unit.fine()Returns this unit's fine coordinate, representing its model location.intheadbarPercent(int id) Returns the current fill percent for an active headbar id, or-1when absent.booleanheadbarRendered(int id) Returns whether the headbar id is currently rendered by the client for this actor.headbars()Returns active headbar ids on this actor.Returns the head message text on this actor.intReturns the current health percent from known health headbars, or-1when unavailable.booleanReturns whether any known health headbar id is currently rendered by the client for this actor.hitmarks()Returns active hitmarks on this actor.intindex()Returns the actor index in the client actor table.map()Returns this unit's map coordinate relative to the loaded world area.booleanmoving()Returns whether this actor has queued movement waypoints.abstract Stringname()Returns the standardized display name.intReturns the actor orientation.intstance()Returns the current stance animation id, or-1when absent.world()Returns the world this unit belongs to.Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.twilite.game.trait.Interactable
interact, option, options, select, targetMethods inherited from interface dev.twilite.game.trait.Unit
directPathTo, directPathTo, directPathTo, distanceTo, distanceTo, distanceTo, lineOfSightTo, lineOfSightTo, lineOfSightTo, lineOfWalkTo, lineOfWalkTo, lineOfWalkTo, manhattanDistanceTo, manhattanDistanceTo, manhattanDistanceTo, pathInDirection
-
Method Details
-
name
Returns the standardized display name. Standardized text is tag-stripped, trimmed, and lowercased. -
index
public int index()Returns the actor index in the client actor table. This is a unique identifier for an actor.Jagex references this value as the server creation cycle, it will not be constant throughout updates
-
stance
public int stance()Returns the current stance animation id, or-1when absent. -
animation
public int animation()Returns the current animation id, or-1when absent. -
animating
public boolean animating()Returns whether this Actor is currently animating (animation not -1) -
orientation
public int orientation()Returns the actor orientation. -
moving
public boolean moving()Returns whether this actor has queued movement waypoints. -
effects
Returns active spot animation/effect ids on this actor. -
hitmarks
Returns active hitmarks on this actor. -
headbars
Returns active headbar ids on this actor. -
headMessage
Returns the head message text on this actor. -
dying
public boolean dying()Returns whether this actor is dying. -
healthPercent
public int healthPercent()Returns the current health percent from known health headbars, or-1when unavailable. -
healthRendered
public boolean healthRendered()Returns whether any known health headbar id is currently rendered by the client for this actor. -
headbarPercent
public int headbarPercent(int id) Returns the current fill percent for an active headbar id, or-1when absent. -
headbarRendered
public boolean headbarRendered(int id) Returns whether the headbar id is currently rendered by the client for this actor. -
facingUnit
public boolean facingUnit()Returns whether this actor is facing another unit. Also known as `target` or `interacting`. -
facingUnit
Returns whether this actor is facing the specified unit. Also known as `target` or `interacting`. -
faceUnit
Resolves the unit this actor is currently facing. This can be aPlayer,NpcorWorldEntity. Also known as `target` or `interacting`. -
world
Description copied from interface:UnitReturns the world this unit belongs to. -
coord
Description copied from interface:UnitReturns this unit's world coordinate. -
fine
Description copied from interface:UnitReturns this unit's fine coordinate, representing its model location. -
map
Description copied from interface:UnitReturns this unit's map coordinate relative to the loaded world area. -
area
Description copied from interface:UnitReturns the area this unit occupies. -
equals
Compares actors by wrapper type and client actor index.A player and NPC with the same client index are not equal because they are different actor tables. Two wrappers of the same actor type with the same index are considered equal snapshots of the same in-game actor.
-