Package dev.twilite.game.wrapper
Class Npc
java.lang.Object
dev.twilite.game.wrapper.Actor<dev.twilite.game.internal.memory.RSNpc>
dev.twilite.game.wrapper.Npc
- All Implemented Interfaces:
Id,Interactable,InteractableUnit,Unit
NPC actor wrapper.
-
Method Summary
Modifier and TypeMethodDescriptionintbaseId()Returns the raw NPC definition id before transforms.intcombat()Returns the combat level from the current definition.Returns the generated gameval constant name forId.id(), or the numeric id as text when no constant is known.int[]Returns NPC head icon ids.int[]Returns NPC head icon sprite ids.intid()Returns the transformed NPC definition id.integerParameter(int id) Returns an integer cache parameter from the current NPC definition.name()Returns the standardized NPC name.objectParameter(int id) Returns a raw cache parameter from the current NPC definition.options()Returns NPC menu options from the current definition.booleanselect()Enqueues the selected-use-on-NPC action.booleantarget()Enqueues the selected-target-on-NPC action.Methods inherited from class dev.twilite.game.wrapper.Actor
animating, animation, area, coord, dying, effects, equals, faceUnit, facingUnit, facingUnit, fine, headbarPercent, headbarRendered, headbars, headMessage, healthPercent, healthRendered, hitmarks, index, map, moving, orientation, stance, worldMethods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.twilite.game.trait.Interactable
interact, optionMethods 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
-
baseId
public int baseId()Returns the raw NPC definition id before transforms. -
id
public int id()Returns the transformed NPC definition id. -
constantName
Description copied from interface:IdReturns the generated gameval constant name forId.id(), or the numeric id as text when no constant is known.This is intended for logs and diagnostics where a stable symbolic name is easier to read than a raw number.
- Specified by:
constantNamein interfaceId
-
combat
public int combat()Returns the combat level from the current definition. -
headIconIds
public int[] headIconIds()Returns NPC head icon ids. -
headIconSprites
public int[] headIconSprites()Returns NPC head icon sprite ids. -
name
Returns the standardized NPC name. Standardized text is tag-stripped, trimmed, and lowercased. -
integerParameter
Returns an integer cache parameter from the current NPC definition. -
objectParameter
Returns a raw cache parameter from the current NPC definition. -
options
Returns NPC menu options from the current definition.- Specified by:
optionsin interfaceInteractable
-
target
public boolean target()Enqueues the selected-target-on-NPC action.- Specified by:
targetin interfaceInteractable
-
select
public boolean select()Enqueues the selected-use-on-NPC action.- Specified by:
selectin interfaceInteractable
-