Package games.stendhal.server.core.rp
Class StendhalRPAction
java.lang.Object
games.stendhal.server.core.rp.StendhalRPAction
fighting and player teleport support
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
decideChangeZone(Entity entity, int x, int y)
Change an entity's zone based on it's global world coordinates.static void
initialize(RPServerManager rpMan)
initializes the StendhalRPActionstatic boolean
placeat(StendhalRPZone zone, Entity entity, int x, int y)
Places an entity at a specified position in a specified zone.static boolean
placeat(StendhalRPZone zone, Entity entity, int x, int y, Shape allowedArea)
Places an entity at a specified position in a specified zone.static boolean
playerAttack(Player player, RPEntity defender)
Lets the attacker try to attack the defender.static void
startAttack(Player player, RPEntity victim)
Do logic for starting an attack on an entity.static void
transferContent(Player player)
send the content of the zone the player is in to the client.static void
transferContent(Player player, List<TransferContent> contents)
transfers arbritary content
-
Constructor Details
-
StendhalRPAction
public StendhalRPAction()
-
-
Method Details
-
initialize
initializes the StendhalRPAction- Parameters:
rpMan
- RPServerManager
-
startAttack
Do logic for starting an attack on an entity.- Parameters:
player
- The player wanting to attack.victim
- The target of attack.
-
playerAttack
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
send the content of the zone the player is in to the client.- Parameters:
player
- player
-
transferContent
transfers arbritary content- Parameters:
player
- playercontents
- content
-
decideChangeZone
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
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 inentity
- the entity to placex
- xy
- y- Returns:
- true, if it was possible to place the entity, false otherwise
-
placeat
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 inentity
- the entity to placex
- xy
- yallowedArea
- only search within this area for a possible new position- Returns:
- true, if it was possible to place the entity, false otherwise
-