Interface Actor

    • Method Detail

      • getCombatLevel

        int getCombatLevel()
        Gets the combat level of the actor.
        Returns:
        the combat level
      • getName

        @Nullable
        java.lang.String getName()
        Gets the name of the actor.
        Returns:
        the name
      • getInteracting

        Actor getInteracting()
        Gets the actor being interacted with.

        Examples of interaction include:

        • A monster focusing an Actor to attack
        • Targetting a player to trade
        • Following a player
        Returns:
        the actor, null if no interaction is occurring
      • getHealthRatio

        int getHealthRatio()
        Gets the health of the actor in getHealthScale() units. The server does not transmit actors' real health, only this value between zero and getHealthScale(). Some actors may be missing this info, in which case -1 is returned.
      • getHealthScale

        int getHealthScale()
        Gets the maximum value getHealthRatio() can return For actors with the default size health bar this is 30, but for bosses with a larger health bar this can be a larger number. Some actors may be missing this info, in which case -1 is returned.
      • getWorldLocation

        WorldPoint getWorldLocation()
        Gets the server-side location of the actor.

        This value is typically ahead of where the client renders and is not affected by things such as animations.

        Returns:
        the server location
      • getLocalLocation

        LocalPoint getLocalLocation()
        Gets the client-side location of the actor.
        Returns:
        the client location
      • getOrientation

        int getOrientation()
        Gets the target orientation of the actor.
        Returns:
        the orientation
        See Also:
        Angle
      • getCurrentOrientation

        int getCurrentOrientation()
        Gets the current orientation of the actor.
        Returns:
        the orientation
        See Also:
        Angle
      • getAnimation

        int getAnimation()
        Gets the current animation the actor is performing.
        Returns:
        the animation ID
        See Also:
        AnimationID
      • getPoseAnimation

        int getPoseAnimation()
        Gets the secondary animation the actor is performing. Usually an idle animation, or one of the walking ones.
        Returns:
        the animation ID
        See Also:
        AnimationID
      • getIdlePoseAnimation

        int getIdlePoseAnimation()
        The idle pose animation. If the actor is not walking or otherwise animating, this will be used for their pose animation.
        Returns:
        the animation ID
        See Also:
        AnimationID
      • getIdleRotateLeft

        int getIdleRotateLeft()
        Animation used for rotating left if the actor is also not walking
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setIdleRotateLeft

        void setIdleRotateLeft​(int animationID)
      • getIdleRotateRight

        int getIdleRotateRight()
        Animation used for rotating right if the actor is also not walking
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setIdleRotateRight

        void setIdleRotateRight​(int animationID)
      • getWalkAnimation

        int getWalkAnimation()
        Animation used for walking
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setWalkAnimation

        void setWalkAnimation​(int animationID)
      • getWalkRotateLeft

        int getWalkRotateLeft()
        Animation used for rotating left while walking
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setWalkRotateLeft

        void setWalkRotateLeft​(int animationID)
      • getWalkRotateRight

        int getWalkRotateRight()
        Animation used for rotating right while walking
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setWalkRotateRight

        void setWalkRotateRight​(int animationID)
      • getWalkRotate180

        int getWalkRotate180()
        Animation used for an about-face while walking
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setWalkRotate180

        void setWalkRotate180​(int animationID)
      • getRunAnimation

        int getRunAnimation()
        Animation used for running
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setRunAnimation

        void setRunAnimation​(int animationID)
      • setAnimation

        @VisibleForDevtools
        void setAnimation​(int animation)
        Sets an animation for the actor to perform.
        Parameters:
        animation - the animation ID
        See Also:
        AnimationID
      • getAnimationFrame

        int getAnimationFrame()
        Get the frame of the animation the actor is performing
        Returns:
        the frame
      • setActionFrame

        @Deprecated
        void setActionFrame​(int frame)
        Deprecated.
        use setAnimationFrame
        Sets the frame of the animation the actor is performing.
        Parameters:
        frame - the animation frame
      • setAnimationFrame

        void setAnimationFrame​(int frame)
        Sets the frame of the animation the actor is performing.
        Parameters:
        frame - the animation frame
      • getGraphic

        int getGraphic()
        Get the graphic/spotanim that is currently on the actor.
        Returns:
        the spotanim of the actor
        See Also:
        GraphicID
      • setGraphic

        void setGraphic​(int graphic)
        Set the graphic/spotanim that is currently on the actor.
        Parameters:
        graphic - The spotanim id
        See Also:
        GraphicID
      • getSpotAnimFrame

        int getSpotAnimFrame()
        Get the frame of the currently playing spotanim
        Returns:
      • setSpotAnimFrame

        void setSpotAnimFrame​(int spotAnimFrame)
        Set the frame of the currently playing spotanim
        Parameters:
        spotAnimFrame -
      • getCanvasTilePoly

        java.awt.Polygon getCanvasTilePoly()
        Gets the canvas area of the current tiles the actor is standing on.
        Returns:
        the current tile canvas area
      • getCanvasTextLocation

        @Nullable
        Point getCanvasTextLocation​(java.awt.Graphics2D graphics,
                                    java.lang.String text,
                                    int zOffset)
        Gets the point at which text should be drawn, relative to the current location with the given z-axis offset.
        Parameters:
        graphics - engine graphics
        text - the text to draw
        zOffset - the z-axis offset
        Returns:
        the text drawing location
      • getCanvasImageLocation

        Point getCanvasImageLocation​(java.awt.image.BufferedImage image,
                                     int zOffset)
        Gets the point at which an image should be drawn, relative to the current location with the given z-axis offset.
        Parameters:
        image - the image to draw
        zOffset - the z-axis offset
        Returns:
        the image drawing location
      • getCanvasSpriteLocation

        Point getCanvasSpriteLocation​(SpritePixels sprite,
                                      int zOffset)
        Gets the point at which a sprite should be drawn, relative to the current location with the given z-axis offset.
        Parameters:
        sprite - the sprite to draw
        zOffset - the z-axis offset
        Returns:
        the sprite drawing location
      • getMinimapLocation

        Point getMinimapLocation()
        Gets a point on the canvas of where this actors mini-map indicator should appear.
        Returns:
        mini-map location on canvas
      • getLogicalHeight

        int getLogicalHeight()
        Gets the logical height of the actors model.

        This z-axis offset is roughly where the health bar of the actor is drawn.

        Returns:
        the logical height
      • getConvexHull

        java.awt.Shape getConvexHull()
        Gets the convex hull of the actors model.
        Returns:
        the convex hull
        See Also:
        Jarvis
      • getWorldArea

        WorldArea getWorldArea()
        Gets the world area that the actor occupies.
        Returns:
        the world area
      • getOverheadText

        java.lang.String getOverheadText()
        Gets the overhead text that is displayed above the actor
        Returns:
        the overhead text
      • setOverheadText

        void setOverheadText​(java.lang.String overheadText)
        Sets the overhead text that is displayed above the actor
        Parameters:
        overheadText - the overhead text
      • getOverheadCycle

        int getOverheadCycle()
        Get the number of cycles/client ticks remaining before the overhead text is timed out
        Returns:
      • setOverheadCycle

        void setOverheadCycle​(int cycles)
        Set the number of cycles/client ticks before the overhead text is timed out
        Parameters:
        cycles -
      • isDead

        boolean isDead()
        Returns true if this actor has died
        Returns: