Retail flying dismount prohibition.

This commit is contained in:
MobiusDev
2018-05-15 14:15:49 +00:00
parent 64453bb495
commit 7014a1ebed
26 changed files with 527 additions and 215 deletions
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -257,6 +257,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -502,8 +503,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -767,7 +766,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6140,16 +6139,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6160,9 +6161,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12678,29 +12712,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -259,6 +259,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -504,8 +505,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -769,7 +768,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6146,16 +6145,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6166,9 +6167,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12685,29 +12719,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -260,6 +260,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -506,8 +507,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -771,7 +770,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6148,16 +6147,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6168,9 +6169,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12695,29 +12729,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -263,6 +263,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -511,8 +512,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -778,7 +777,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6145,16 +6144,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6165,9 +6166,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12677,29 +12711,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -82,6 +82,7 @@ import com.l2jmobius.gameserver.instancemanager.CoupleManager;
import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
import com.l2jmobius.gameserver.instancemanager.DuelManager;
import com.l2jmobius.gameserver.instancemanager.FishingZoneManager;
import com.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import com.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
import com.l2jmobius.gameserver.instancemanager.PlayerCountManager;
@@ -541,9 +542,6 @@ public final class L2PcInstance extends L2Playable
/** Store object used to summon the strider you are mounting *. */
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
/** The _telemode. */
public int _telemode = 0;
@@ -1056,7 +1054,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
/** Previous coordinate sent to party in ValidatePosition *. */
@@ -17731,11 +17729,15 @@ public final class L2PcInstance extends L2Playable
*/
public boolean dismount()
{
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
setMountType(0);
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(SkillTable.getInstance().getInfo(4289, 1));
}
Ride dismount = new Ride(getObjectId(), Ride.ACTION_DISMOUNT, 0);
@@ -17745,9 +17747,34 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
private boolean canDismount()
{
return _hasDismountedWyvern;
if (FishingZoneManager.getInstance().isInsideWaterZone(getX(), getY(), getZ() - 300) == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoData.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
/**
@@ -18457,27 +18484,27 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), null, false);
sendPacket(new SystemMessage(SystemMessageId.FALL_DAMAGE_S1).addNumber(_fallingDamageSum));
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), null, false);
sendPacket(new SystemMessage(SystemMessageId.FALL_DAMAGE_S1).addNumber(_fallingDamage));
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
_fallingTimestamp = System.currentTimeMillis() + FALLING_VALIDATION_DELAY;
@@ -2933,6 +2933,12 @@ public enum SystemMessageId
*/
WOULD_YOU_LIKE_TO_CLOSE_THE_GATE(1141),
/**
* ID: 1158<br>
* Message: You cannot dismount from this elevation.
*/
YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION(1158),
/**
* ID: 1176<br>
* Message: This is a quest event period.
@@ -3365,6 +3371,12 @@ public enum SystemMessageId
*/
S1_HAS_BECOME_A_PARTY_LEADER(1384),
/**
* ID: 1385<br>
* Message: You are not allowed to dismount at this location.
*/
YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION(1385),
/**
* ID: 1388<br>
* Message: A party room has been created.
@@ -147,11 +147,7 @@ public final class ValidatePosition extends L2GameClientPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -251,6 +251,7 @@ import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2BossZone;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -507,8 +508,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
public int _telemode = 0;
@@ -796,7 +795,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -4665,10 +4664,11 @@ public final class L2PcInstance extends L2Playable
@Override
public void untransform()
{
if (_transformation == null)
if ((_transformation == null) || (isFlyingMounted() && !canDismount()))
{
return;
}
setQueuedSkill(null, false, false);
_transformation.onUntransform(this);
_transformation = null;
@@ -6373,15 +6373,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6392,9 +6395,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
private boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -13520,29 +13556,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), null, false, true, null);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), null, false, true, null);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -259,6 +259,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -501,8 +502,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -765,7 +764,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6112,16 +6111,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6132,9 +6133,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12526,29 +12560,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -259,6 +259,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -501,8 +502,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -765,7 +764,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6112,16 +6111,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6132,9 +6133,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12526,29 +12560,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;
@@ -467,6 +467,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
public void untransform()
{
if (isPlayer() && getActingPlayer().isFlyingMounted() && !getActingPlayer().canDismount())
{
return;
}
_transform.ifPresent(t -> t.onUntransform(this));
_transform = Optional.empty();
@@ -259,6 +259,7 @@ import com.l2jmobius.gameserver.model.variables.AccountVariables;
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.model.zone.type.L2WaterZone;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
@@ -501,8 +502,6 @@ public final class L2PcInstance extends L2Playable
private int _mountLevel;
/** Store object used to summon the strider you are mounting **/
private int _mountObjectID = 0;
/** Remember if dismounted from Wyvern **/
private boolean _hasDismountedWyvern = false;
private AdminTeleportType _teleportType = AdminTeleportType.NORMAL;
@@ -765,7 +764,7 @@ public final class L2PcInstance extends L2Playable
// during fall validations will be disabled for 1000 ms.
private static final int FALLING_VALIDATION_DELAY = 1000;
private volatile long _fallingTimestamp = 0;
private volatile int _fallingDamageSum = 0;
private volatile int _fallingDamage = 0;
private Future<?> _fallingDamageTask = null;
private int _multiSocialTarget = 0;
@@ -6114,16 +6113,18 @@ public final class L2PcInstance extends L2Playable
public boolean dismount()
{
final boolean wasFlying = isFlying();
if (!canDismount())
{
return false;
}
final boolean wasFlying = isFlying();
sendPacket(new SetupGauge(3, 0, 0));
final int petId = _mountNpcId;
setMount(0, 0);
stopFeed();
clearPetData();
if (wasFlying)
{
_hasDismountedWyvern = true;
removeSkill(CommonSkill.WYVERN_BREATH.getSkill());
}
broadcastPacket(new Ride(this));
@@ -6134,9 +6135,42 @@ public final class L2PcInstance extends L2Playable
return true;
}
public boolean hasDismountedWyvern()
public boolean canDismount()
{
return _hasDismountedWyvern;
L2WaterZone water = null;
for (L2ZoneType zone : ZoneManager.getInstance().getZones(getX(), getY(), getZ() - 300))
{
if (zone instanceof L2WaterZone)
{
water = (L2WaterZone) zone;
}
}
if (water == null)
{
if (!isInWater() && (getZ() > 10000))
{
sendPacket(SystemMessageId.YOU_ARE_NOT_ALLOWED_TO_DISMOUNT_IN_THIS_LOCATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if ((GeoEngine.getInstance().getHeight(getX(), getY(), getZ()) + 300) < getZ())
{
sendPacket(SystemMessageId.YOU_CANNOT_DISMOUNT_FROM_THIS_ELEVATION);
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
ThreadPool.schedule(() ->
{
if (isInWater())
{
broadcastUserInfo();
}
}, 1500);
}
return true;
}
public void setUptime(long time)
@@ -12528,29 +12562,29 @@ public final class L2PcInstance extends L2Playable
return false;
}
// TODO: Test on retail. Add or set damage?
_fallingDamageSum += (int) Formulas.calcFallDam(this, deltaZ);
if (_fallingDamage == 0)
{
_fallingDamage = (int) Formulas.calcFallDam(this, deltaZ);
}
if (_fallingDamageTask != null)
{
_fallingDamageTask.cancel(true);
}
_fallingDamageTask = ThreadPool.schedule(() ->
{
if ((_fallingDamageSum > 0) && !isInvul())
if ((_fallingDamage > 0) && !isInvul())
{
reduceCurrentHp(Math.min(_fallingDamageSum, getCurrentHp() - 1), this, null, false, true, false, false);
reduceCurrentHp(Math.min(_fallingDamage, getCurrentHp() - 1), this, null, false, true, false, false);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_RECEIVED_S1_FALLING_DAMAGE);
sm.addInt(_fallingDamageSum);
sm.addInt(_fallingDamage);
sendPacket(sm);
}
_hasDismountedWyvern = false;
_fallingDamageSum = 0;
_fallingDamage = 0;
_fallingDamageTask = null;
}, 1500);
if (!_hasDismountedWyvern)
{
// Prevent falling under ground.
sendPacket(new ValidateLocation(this));
}
setFalling();
@@ -182,11 +182,7 @@ public class ValidatePosition implements IClientIncomingPacket
{
// if ((_z - activeChar.getClientZ()) < 200 && Math.abs(activeChar.getLastServerPosition().getZ()-realZ) > 70)
if (activeChar.hasDismountedWyvern())
{
activeChar.setXYZ(_x, _y, _z);
}
else if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
if ((Math.abs(dz) > 200) && (Math.abs(dz) < 1500) && (Math.abs(_z - activeChar.getClientZ()) < 800))
{
activeChar.setXYZ(realX, realY, _z);
realZ = _z;