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

public class Npc extends Actor<dev.twilite.game.internal.memory.RSNpc> implements Id
NPC actor wrapper.
  • Method Details

    • baseId

      public int baseId()
      Returns the raw NPC definition id before transforms.
    • id

      public int id()
      Returns the transformed NPC definition id.
      Specified by:
      id in interface Id
    • constantName

      public String constantName()
      Description copied from interface: Id
      Returns the generated gameval constant name for Id.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:
      constantName in interface Id
    • 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

      public String name()
      Returns the standardized NPC name. Standardized text is tag-stripped, trimmed, and lowercased.
      Specified by:
      name in class Actor<dev.twilite.game.internal.memory.RSNpc>
    • integerParameter

      public OptionalInt integerParameter(int id)
      Returns an integer cache parameter from the current NPC definition.
    • objectParameter

      public Optional<Object> objectParameter(int id)
      Returns a raw cache parameter from the current NPC definition.
    • options

      public List<MenuOption> options()
      Returns NPC menu options from the current definition.
      Specified by:
      options in interface Interactable
    • target

      public boolean target()
      Enqueues the selected-target-on-NPC action.
      Specified by:
      target in interface Interactable
    • select

      public boolean select()
      Enqueues the selected-use-on-NPC action.
      Specified by:
      select in interface Interactable