Disable pathfinding when moving with keys.
This commit is contained in:
parent
3bdf97394e
commit
1af47f927c
@ -245,6 +245,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -3494,7 +3495,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle())
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -5543,4 +5544,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
return calculateDistance(target, true, false);
|
||||
}
|
||||
|
||||
public void setCursorKeyMovement(boolean value)
|
||||
{
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
}
|
||||
|
@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $
|
||||
*/
|
||||
public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
{
|
||||
// cdddddd
|
||||
private int _targetX;
|
||||
private int _targetY;
|
||||
private int _targetZ;
|
||||
private int _originX;
|
||||
private int _originY;
|
||||
private int _originZ;
|
||||
private int _moveMovement;
|
||||
|
||||
// For geodata
|
||||
private int _curX;
|
||||
private int _curY;
|
||||
@SuppressWarnings("unused")
|
||||
private int _curZ;
|
||||
private int _movementMode;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
_originX = packet.readD();
|
||||
_originY = packet.readD();
|
||||
_originZ = packet.readD();
|
||||
_moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
_movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (_moveMovement == 1)
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class);
|
||||
if ((terminate != null) && terminate.terminate())
|
||||
{
|
||||
@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_curX = activeChar.getX();
|
||||
_curY = activeChar.getY();
|
||||
_curZ = activeChar.getZ();
|
||||
else // 0
|
||||
{
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
}
|
||||
|
||||
switch (activeChar.getTeleMode())
|
||||
{
|
||||
@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
}
|
||||
default:
|
||||
{
|
||||
final double dx = _targetX - _curX;
|
||||
final double dy = _targetY - _curY;
|
||||
final double dx = _targetX - activeChar.getX();
|
||||
final double dy = _targetY - activeChar.getY();
|
||||
// Can't move if character is confused, or trying to move a huge distance
|
||||
if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900
|
||||
{
|
||||
|
@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle())
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
// Dummy method to be overriden.
|
||||
}
|
||||
|
||||
public void setCursorKeyMovement(boolean value)
|
||||
{
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
}
|
||||
|
@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $
|
||||
*/
|
||||
public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
{
|
||||
// cdddddd
|
||||
private int _targetX;
|
||||
private int _targetY;
|
||||
private int _targetZ;
|
||||
private int _originX;
|
||||
private int _originY;
|
||||
private int _originZ;
|
||||
private int _moveMovement;
|
||||
|
||||
// For geodata
|
||||
private int _curX;
|
||||
private int _curY;
|
||||
@SuppressWarnings("unused")
|
||||
private int _curZ;
|
||||
private int _movementMode;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
_originX = packet.readD();
|
||||
_originY = packet.readD();
|
||||
_originZ = packet.readD();
|
||||
_moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
_movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (_moveMovement == 1)
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class);
|
||||
if ((terminate != null) && terminate.terminate())
|
||||
{
|
||||
@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_curX = activeChar.getX();
|
||||
_curY = activeChar.getY();
|
||||
_curZ = activeChar.getZ();
|
||||
else // 0
|
||||
{
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
}
|
||||
|
||||
switch (activeChar.getTeleMode())
|
||||
{
|
||||
@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
}
|
||||
default:
|
||||
{
|
||||
final double dx = _targetX - _curX;
|
||||
final double dy = _targetY - _curY;
|
||||
final double dx = _targetX - activeChar.getX();
|
||||
final double dy = _targetY - activeChar.getY();
|
||||
// Can't move if character is confused, or trying to move a huge distance
|
||||
if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900
|
||||
{
|
||||
|
@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle())
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
// Dummy method to be overriden.
|
||||
}
|
||||
|
||||
public void setCursorKeyMovement(boolean value)
|
||||
{
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
}
|
||||
|
@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $
|
||||
*/
|
||||
public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
{
|
||||
// cdddddd
|
||||
private int _targetX;
|
||||
private int _targetY;
|
||||
private int _targetZ;
|
||||
private int _originX;
|
||||
private int _originY;
|
||||
private int _originZ;
|
||||
private int _moveMovement;
|
||||
|
||||
// For geodata
|
||||
private int _curX;
|
||||
private int _curY;
|
||||
@SuppressWarnings("unused")
|
||||
private int _curZ;
|
||||
private int _movementMode;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
_originX = packet.readD();
|
||||
_originY = packet.readD();
|
||||
_originZ = packet.readD();
|
||||
_moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
_movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (_moveMovement == 1)
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class);
|
||||
if ((terminate != null) && terminate.terminate())
|
||||
{
|
||||
@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_curX = activeChar.getX();
|
||||
_curY = activeChar.getY();
|
||||
_curZ = activeChar.getZ();
|
||||
else // 0
|
||||
{
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
}
|
||||
|
||||
switch (activeChar.getTeleMode())
|
||||
{
|
||||
@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
}
|
||||
default:
|
||||
{
|
||||
final double dx = _targetX - _curX;
|
||||
final double dy = _targetY - _curY;
|
||||
final double dx = _targetX - activeChar.getX();
|
||||
final double dy = _targetY - activeChar.getY();
|
||||
// Can't move if character is confused, or trying to move a huge distance
|
||||
if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900
|
||||
{
|
||||
|
@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle())
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
// Dummy method to be overriden.
|
||||
}
|
||||
|
||||
public void setCursorKeyMovement(boolean value)
|
||||
{
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
}
|
||||
|
@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $
|
||||
*/
|
||||
public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
{
|
||||
// cdddddd
|
||||
private int _targetX;
|
||||
private int _targetY;
|
||||
private int _targetZ;
|
||||
private int _originX;
|
||||
private int _originY;
|
||||
private int _originZ;
|
||||
private int _moveMovement;
|
||||
|
||||
// For geodata
|
||||
private int _curX;
|
||||
private int _curY;
|
||||
@SuppressWarnings("unused")
|
||||
private int _curZ;
|
||||
private int _movementMode;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
_originX = packet.readD();
|
||||
_originY = packet.readD();
|
||||
_originZ = packet.readD();
|
||||
_moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
_movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (_moveMovement == 1)
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class);
|
||||
if ((terminate != null) && terminate.terminate())
|
||||
{
|
||||
@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_curX = activeChar.getX();
|
||||
_curY = activeChar.getY();
|
||||
_curZ = activeChar.getZ();
|
||||
else // 0
|
||||
{
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
}
|
||||
|
||||
switch (activeChar.getTeleMode())
|
||||
{
|
||||
@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
}
|
||||
default:
|
||||
{
|
||||
final double dx = _targetX - _curX;
|
||||
final double dy = _targetY - _curY;
|
||||
final double dx = _targetX - activeChar.getX();
|
||||
final double dy = _targetY - activeChar.getY();
|
||||
// Can't move if character is confused, or trying to move a huge distance
|
||||
if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900
|
||||
{
|
||||
|
@ -249,6 +249,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -4389,7 +4390,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle())
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -6879,4 +6880,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setCursorKeyMovement(boolean value)
|
||||
{
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
}
|
||||
|
@ -30,23 +30,17 @@ import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.StopMove;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $
|
||||
*/
|
||||
public class MoveBackwardToLocation extends L2GameClientPacket
|
||||
{
|
||||
private static final String _C__0F_MOVEBACKWARDTOLOC = "[C] 0F MoveBackwardToLoc";
|
||||
|
||||
// cdddddd
|
||||
private int _targetX;
|
||||
private int _targetY;
|
||||
private int _targetZ;
|
||||
private int _originX;
|
||||
private int _originY;
|
||||
private int _originZ;
|
||||
|
||||
private int _moveMovement;
|
||||
private int _movementMode;
|
||||
|
||||
@Override
|
||||
protected void readImpl()
|
||||
@ -59,7 +53,7 @@ public class MoveBackwardToLocation extends L2GameClientPacket
|
||||
_originZ = readD();
|
||||
try
|
||||
{
|
||||
_moveMovement = readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
_movementMode = readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
}
|
||||
catch (BufferUnderflowException e)
|
||||
{
|
||||
@ -101,8 +95,9 @@ public class MoveBackwardToLocation extends L2GameClientPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (_moveMovement == 1)
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class);
|
||||
if ((terminate != null) && terminate.terminate())
|
||||
{
|
||||
@ -110,6 +105,10 @@ public class MoveBackwardToLocation extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
else // 0
|
||||
{
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
}
|
||||
|
||||
if (activeChar.getTeleMode() > 0)
|
||||
{
|
||||
|
@ -246,6 +246,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
/** Movement data of this L2Character */
|
||||
protected MoveData _move;
|
||||
private boolean _cursorKeyMovement = false;
|
||||
|
||||
/** This creature's target. */
|
||||
private L2Object _target;
|
||||
@ -3498,7 +3499,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle())
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -5580,4 +5581,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
// Dummy method to be overriden.
|
||||
}
|
||||
|
||||
public void setCursorKeyMovement(boolean value)
|
||||
{
|
||||
_cursorKeyMovement = value;
|
||||
}
|
||||
}
|
||||
|
@ -41,26 +41,15 @@ import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMove;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.sayune.ExFlyMoveBroadcast;
|
||||
import com.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* This class ...
|
||||
* @version $Revision: 1.11.2.4.2.4 $ $Date: 2005/03/27 15:29:30 $
|
||||
*/
|
||||
public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
{
|
||||
// cdddddd
|
||||
private int _targetX;
|
||||
private int _targetY;
|
||||
private int _targetZ;
|
||||
private int _originX;
|
||||
private int _originY;
|
||||
private int _originZ;
|
||||
private int _moveMovement;
|
||||
|
||||
// For geodata
|
||||
private int _curX;
|
||||
private int _curY;
|
||||
@SuppressWarnings("unused")
|
||||
private int _curZ;
|
||||
private int _movementMode;
|
||||
|
||||
@Override
|
||||
public boolean read(L2GameClient client, PacketReader packet)
|
||||
@ -71,7 +60,7 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
_originX = packet.readD();
|
||||
_originY = packet.readD();
|
||||
_originZ = packet.readD();
|
||||
_moveMovement = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
_movementMode = packet.readD(); // is 0 if cursor keys are used 1 if mouse is used
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -105,8 +94,9 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
// Validate position packets sends head level.
|
||||
_targetZ += activeChar.getTemplate().getCollisionHeight();
|
||||
|
||||
if (_moveMovement == 1)
|
||||
if (_movementMode == 1)
|
||||
{
|
||||
activeChar.setCursorKeyMovement(false);
|
||||
final TerminateReturn terminate = EventDispatcher.getInstance().notifyEvent(new OnPlayerMoveRequest(activeChar, new Location(_targetX, _targetY, _targetZ)), activeChar, TerminateReturn.class);
|
||||
if ((terminate != null) && terminate.terminate())
|
||||
{
|
||||
@ -114,10 +104,10 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_curX = activeChar.getX();
|
||||
_curY = activeChar.getY();
|
||||
_curZ = activeChar.getZ();
|
||||
else // 0
|
||||
{
|
||||
activeChar.setCursorKeyMovement(true);
|
||||
}
|
||||
|
||||
switch (activeChar.getTeleMode())
|
||||
{
|
||||
@ -147,8 +137,8 @@ public class MoveBackwardToLocation implements IClientIncomingPacket
|
||||
}
|
||||
default:
|
||||
{
|
||||
final double dx = _targetX - _curX;
|
||||
final double dy = _targetY - _curY;
|
||||
final double dx = _targetX - activeChar.getX();
|
||||
final double dy = _targetY - activeChar.getY();
|
||||
// Can't move if character is confused, or trying to move a huge distance
|
||||
if (activeChar.isControlBlocked() || (((dx * dx) + (dy * dy)) > 98010000)) // 9900*9900
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user