Class KSNPC

    • Constructor Detail

      • KSNPC

        public KSNPC​(net.runelite.api.NPC npc)
    • Method Detail

      • getId

        public int getId()
        Gets the NPC ID.
        Returns:
        the ID of the NPC.
      • getIndex

        public int getIndex()
        Gets the NPC Index.
        Returns:
        the Index of the NPC.
      • getName

        public java.lang.String getName()
        Gets the name of the NPC.
        Returns:
        the name of the NPC as a String.
      • getActions

        public java.lang.String[] getActions()
        Gets the actions available for the NPC.
        Returns:
        an array of Strings representing the available actions.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getComp

        public net.runelite.api.NPCComposition getComp()
        Gets the NPC composition, which contains detailed data about the NPC.
        Returns:
        the NPCComposition object for the NPC.
      • getOptionIndex

        public int getOptionIndex​(java.lang.String action)
        Finds the index of a specified action in the NPC's available actions.
        Parameters:
        action - the name of the action to search for.
        Returns:
        the index of the action in the action array, or -1 if not found.
      • getWorldArea

        public net.runelite.api.coords.WorldArea getWorldArea()
        Gets the NPC's world area (the region in which the NPC is located).
        Returns:
        the WorldArea object representing the NPC's location.
      • isDead

        public boolean isDead()
        Checks if the NPC is dead.
        Returns:
        true if the NPC is dead, false otherwise.
      • interact

        public boolean interact​(int action)
        Interacts with the NPC using a specified action index.
        Parameters:
        action - the index of the action to perform (1-based).
      • interact

        public boolean interact​(java.lang.String action)
        Interacts with the NPC using a specified action name.
        Parameters:
        action - the name of the action to perform (e.g., "Talk-to").
      • interact

        public void interact​(net.runelite.api.MenuAction menuAction)
      • getLocalLocation

        public net.runelite.api.coords.LocalPoint getLocalLocation()
        Specified by:
        getLocalLocation in interface Locatable
      • getAnimation

        public int getAnimation()
      • isAnimating

        public boolean isAnimating()
      • getHealthRatio

        public int getHealthRatio()
      • getHealth

        public int getHealth()
      • getHealthPercentage

        public int getHealthPercentage()
      • getHeadIcon

        public net.runelite.api.HeadIcon getHeadIcon()
      • getInteracting

        public net.runelite.api.Actor getInteracting()
      • getCombatLevel

        public int getCombatLevel()