Class StendhalRPAction

java.lang.Object
games.stendhal.server.core.rp.StendhalRPAction

public class StendhalRPAction extends Object
Fighting and player teleport support.
  • Constructor Details

    • StendhalRPAction

      public StendhalRPAction()
  • Method Details

    • initialize

      public static void initialize(RPServerManager rpMan)
      Initializes the StendhalRPAction.
      Parameters:
      rpMan - RPServerManager.
    • startAttack

      public static void startAttack(Player player, RPEntity victim)
      Do logic for starting an attack on an entity.
      Parameters:
      player - The player wanting to attack.
      victim - The target of attack.
    • playerAttack

      public static boolean playerAttack(Player player, RPEntity defender)
      Lets the attacker try to attack the defender.
      Parameters:
      player - The attacker.
      defender - The defending RPEntity.
      Returns:
      true if the attacker has done damage to the defender.
    • transferContent

      public static void transferContent(Player player)
      Send the content of the zone the player is in to the client.
      Parameters:
      player - Player for whom content is sent.
    • transferContent

      public static void transferContent(Player player, List<TransferContent> contents)
      Transfers arbritary content.
      Parameters:
      player - Player for whom content is sent.
      contents - Content being sent.
    • decideChangeZone

      public static void decideChangeZone(Entity entity, int x, int y)
      Change an entity's zone based on its global world coordinates.
      Parameters:
      entity - The entity changing zones.
      x - The entity's old zone X coordinate.
      y - The entity's old zone Y coordinate.
    • placeat

      public static boolean placeat(StendhalRPZone zone, Entity entity, int x, int y)
      Places an entity at a specified position in a specified zone. If this point is occupied the entity is moved slightly. This will remove the entity from any existing zone and add it to the target zone if needed.
      Parameters:
      zone - Zone to place the entity in.
      entity - The entity to place.
      x - Zone X coordinate.
      y - Zone Y coordinate.
      Returns:
      true if it was possible to place the entity, false otherwise.
    • placeat

      public static boolean placeat(StendhalRPZone zone, Entity entity, int x, int y, Shape allowedArea)
      Places an entity at a specified position in a specified zone. This will remove the entity from any existing zone and add it to the target zone if needed.
      Parameters:
      zone - Zone to place the entity in.
      entity - The entity to place.
      x - Zone X coordinate.
      y - Zone Y coordinate.
      allowedArea - If not null, only search within this area for a possible new position.
      Returns:
      true if it was possible to place the entity, false otherwise.