Interface Actor

    • Method Detail

      • getCombatLevel

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

        @Nullable
        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 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.
        Returns:
        the animation ID
        See Also:
        AnimationID
      • getIdlePoseAnimation

        int getIdlePoseAnimation()
        If this is equal to the pose animation, the pose animation is ignored when you are doing another action.
        Returns:
        the animation ID
        See Also:
        AnimationID
      • setAnimation

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

        @VisibleForDevtools
        void setActionFrame​(int actionFrame)
        Sets the frame of the animation the actor is performing.
        Parameters:
        actionFrame - the animation frame
      • getGraphic

        int getGraphic()
        Gets the graphic that is currently on the player.
        Returns:
        the graphic of the actor
        See Also:
        GraphicID
      • getCanvasTilePoly

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

        @Nullable
        Point getCanvasTextLocation​(Graphics2D graphics,
                                    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​(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

        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

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

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

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