Package games.stendhal.server.core.rp
Class StendhalRPAction
java.lang.Object
games.stendhal.server.core.rp.StendhalRPAction
Fighting and player teleport support.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddecideChangeZone(Entity entity, int x, int y) Change an entity's zone based on its global world coordinates.static voidinitialize(RPServerManager rpMan) Initializes the StendhalRPAction.static booleanplaceat(StendhalRPZone zone, Entity entity, int x, int y) Places an entity at a specified position in a specified zone.static booleanplaceat(StendhalRPZone zone, Entity entity, int x, int y, Shape allowedArea) Places an entity at a specified position in a specified zone.static booleanplayerAttack(Player player, RPEntity defender) Lets the attacker try to attack the defender.static voidstartAttack(Player player, RPEntity victim) Do logic for starting an attack on an entity.static voidtransferContent(Player player) Send the content of the zone the player is in to the client.static voidtransferContent(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- The attacker.defender- The defending RPEntity.- Returns:
trueif 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 for whom content is sent.
-
transferContent
Transfers arbritary content.- Parameters:
player- Player for whom content is sent.contents- Content being sent.
-
decideChangeZone
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
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:
trueif 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 in.entity- The entity to place.x- Zone X coordinate.y- Zone Y coordinate.allowedArea- If notnull, only search within this area for a possible new position.- Returns:
trueif it was possible to place the entity, false otherwise.
-