Class NPC

All Implemented Interfaces:
IEntity, RPObjectChangeListener
Direct Known Subclasses:
DomesticAnimal

public class NPC extends RPEntity
An NPC entity.
  • Field Details

    • PROP_IDEA

      public static final games.stendhal.client.entity.Property PROP_IDEA
      Idea property for NPCs and domestic animals.
  • Constructor Details

    • NPC

      public NPC()
  • Method Details

    • getIdea

      public String getIdea()
      Get the idea setting.
      Returns:
      The NPC's idea.
    • isAttending

      public boolean isAttending()
      Ask NPC if they are attending.
      Returns:
      true if attending.
    • initialize

      public void initialize(RPObject object)
      Initialize this entity for an object.
      Specified by:
      initialize in interface IEntity
      Overrides:
      initialize in class RPEntity
      Parameters:
      object - The object.
      See Also:
      RPEntity.release()
    • onChangedAdded

      public void onChangedAdded(RPObject object, RPObject changes)
      The object added/changed attribute(s).
      Specified by:
      onChangedAdded in interface RPObjectChangeListener
      Overrides:
      onChangedAdded in class RPEntity
      Parameters:
      object - The base object.
      changes - The changes.
    • onChangedRemoved

      public void onChangedRemoved(RPObject object, RPObject changes)
      The object removed attribute(s).
      Specified by:
      onChangedRemoved in interface RPObjectChangeListener
      Overrides:
      onChangedRemoved in class RPEntity
      Parameters:
      object - The base object.
      changes - The changes.
    • isClone

      public boolean isClone()
      Checks if this entity is a clone of another NPC.
    • addSounds

      protected void addSounds(String groupName, String categoryName, String... soundNames)
    • onPosition

      protected void onPosition(double x, double y)
      Description copied from class: Entity
      When the entity's position changed.
      Overrides:
      onPosition in class Entity
      Parameters:
      x - The new X coordinate.
      y - The new Y coordinate.
    • playRandomSoundFromCategory

      protected void playRandomSoundFromCategory(String groupName, String categoryName)
    • playRandomSoundFromGroup

      protected void playRandomSoundFromGroup(String groupName, String categoryName, long waitTimeInMilliSec)
    • playSoundFromCategory

      protected void playSoundFromCategory(String groupName, String categoryName)
    • playSoundFromCategory

      protected void playSoundFromCategory(String groupName, String categoryName, int index)