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 -
      defender - The defending RPEntity.
      Returns:
      true iff 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
    • transferContent

      public static void transferContent(Player player, List<TransferContent> contents)
      transfers arbritary content
      Parameters:
      player - player
      contents - content
    • decideChangeZone

      public static void decideChangeZone(Entity entity, int x, int y)
      Change an entity's zone based on it's 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 - x
      y - y
      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 - x
      y - y
      allowedArea - only search within this area for a possible new position
      Returns:
      true, if it was possible to place the entity, false otherwise