Class OSRSNpc

    • Constructor Detail

      • OSRSNpc

        public OSRSNpc​(long uid)
    • Method Detail

      • getLevel

        public int getLevel()
        Description copied from interface: Npc
        Gets the npcs current level
        Specified by:
        getLevel in interface Npc
        Returns:
        the npcs level, otherwise -1
      • getDefinition

        @Nullable
        public NpcDefinition getDefinition()
        Description copied from interface: Npc
        A definition containing a vast collection of data regarding this npcs creation on the world-graph
        Specified by:
        getDefinition in interface Npc
        Returns:
        The definition, otherwise null
      • getOverheadIcons

        @NonNull
        public @NonNull java.util.List<OverheadIcon> getOverheadIcons()
        Description copied from interface: Actor
        Gets a list of the overhead icons currently above the npc.
        Specified by:
        getOverheadIcons in interface Actor
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Onymous
      • getModel

        public Model getModel()
        Description copied from interface: Modeled
        Gets the polygon-based model of the entity
        Specified by:
        getModel in interface Modeled
        Overrides:
        getModel in class OSRSEntity
        Returns:
        the entities model, otherwise the backup if set, if neither are available null
      • isValid

        public boolean isValid()
        Description copied from interface: Validatable
        Verifies whether this entity is valid and still exists, typically on the world-graph
        Specified by:
        isValid in interface Validatable
        Overrides:
        isValid in class Entity
        Returns:
        true if it's still available, otherwise false
      • getAnimationId

        public final int getAnimationId()
        Description copied from interface: Animable
        Gets the entities current animation id
        Specified by:
        getAnimationId in interface Animable
        Returns:
        the current animation id, or if unavailable -1
      • getAnimationFrame

        public final int getAnimationFrame()
        Description copied from interface: Actor
        Gets the current frame of the actors animation
        Specified by:
        getAnimationFrame in interface Actor
        Returns:
        the current frame, otherwise -1
      • getStanceId

        public int getStanceId()
        Description copied from interface: Actor
        Gets the current stance animation id
        Specified by:
        getStanceId in interface Actor
        Returns:
        the current stance animation id, otherwise -1
      • getStanceFrame

        public final int getStanceFrame()
        Description copied from interface: Actor
        Gets the current frame of the actors stance animation
        Specified by:
        getStanceFrame in interface Actor
        Returns:
        the current frame, otherwise -1
      • getHighPrecisionOrientation

        public final int getHighPrecisionOrientation()
        Description copied from interface: Rotatable
        For internal usage only. Subject to removal without notice.
        Specified by:
        getHighPrecisionOrientation in interface Rotatable
      • getOrientationAsAngle

        public final int getOrientationAsAngle()
        Description copied from interface: Rotatable
        Gets the current orientation as an angle.
        Specified by:
        getOrientationAsAngle in interface Rotatable
      • isFacing

        public boolean isFacing​(Locatable locatable)
        Description copied from interface: Rotatable
        Checks if this rotatable entity is facing a locatable object
        Specified by:
        isFacing in interface Rotatable
      • isMoving

        public final boolean isMoving()
        Description copied from interface: Actor
        Gets whether or not the actor is moving across the world graph
        Specified by:
        isMoving in interface Actor
      • getHealthGauge

        @Nullable
        public final @Nullable CombatGauge getHealthGauge()
        The health gauge displayed during combat
        Specified by:
        getHealthGauge in interface Actor
        Returns:
        The health gauge if visible, else null
      • getDialogue

        @Nullable
        public final @Nullable java.lang.String getDialogue()
        Description copied from interface: Actor
        Gets the dialogue above an actors head
        Specified by:
        getDialogue in interface Actor
        Returns:
        The actors current dialogue, otherwise null
      • getTarget

        @Nullable
        public final @Nullable Actor getTarget()
        Description copied from interface: Actor
        Gets the Actor that this Actor is targeting (talking, attacking, trading, pickpocketing, etc)
        Specified by:
        getTarget in interface Actor
        Returns:
        The target, otherwise null
      • getSpotAnimationIds

        @NonNull
        public @NonNull java.util.List<java.lang.Integer> getSpotAnimationIds()
        Description copied from interface: Actor
        Gets a list of the spot animation ids of the entity. A spot animation is a model that is animated simultaneously with the actor's model.
        Specified by:
        getSpotAnimationIds in interface Actor
      • getPosition

        @Nullable
        public final @Nullable Coordinate getPosition​(Coordinate regionBase)
        Description copied from interface: LocatableEntity
        Gets the position using the region base as the coordinate to offset from. For optimization.
        Specified by:
        getPosition in interface LocatableEntity
        Parameters:
        regionBase - The Coordinate base of the loaded region
      • getHitsplats

        @NonNull
        public @NonNull java.util.List<Hitsplat> getHitsplats()
        Specified by:
        getHitsplats in interface Actor
      • getServerPosition

        public Coordinate getServerPosition()
        Description copied from interface: Actor
        Gets the position of the actor according to the server.

        This value is typically ahead of where the client renders.

        Specified by:
        getServerPosition in interface Actor
      • getPath

        @NonNull
        public @NonNull java.util.List<Coordinate> getPath()
        Specified by:
        getPath in interface Actor