From 4c1957ff3dd30e701db216a6228aefe5b0452e3c Mon Sep 17 00:00:00 2001 From: MobiusDevelopment Date: Tue, 7 Feb 2023 01:26:07 +0200 Subject: [PATCH] Player moving on ledges check replaced by combined Water-Castle check. --- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 45 ++++++------------- .../gameserver/model/actor/Creature.java | 45 ++++++------------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- .../gameserver/model/actor/Creature.java | 21 ++------- 31 files changed, 144 insertions(+), 555 deletions(-) diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index 6f5ad93460..46c965e597 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index 6f5ad93460..46c965e597 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index 6f5ad93460..46c965e597 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index 6f5ad93460..46c965e597 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index dd3b25f2de..0c1f15d7ed 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index dd3b25f2de..0c1f15d7ed 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index dd3b25f2de..0c1f15d7ed 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index a36335dd30..4cf8f2282b 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3275,25 +3275,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3320,7 +3307,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3522,7 +3509,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java index c8b5079eb1..6d13e435a9 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3275,25 +3275,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3320,7 +3307,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3522,7 +3509,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java index c8b5079eb1..6d13e435a9 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3275,25 +3275,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3320,7 +3307,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3522,7 +3509,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java index ff79ae711a..35f6ba1085 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3285,25 +3285,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3330,7 +3317,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3532,7 +3519,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java index 231f7081e2..f494d77534 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3285,25 +3285,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3330,7 +3317,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3532,7 +3519,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java index a5d2aebbdd..012d050e44 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -4950,18 +4950,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder double dx = m._xDestination - m._xAccurate; double dy = m._yDestination - m._yAccurate; double dz = m._zDestination - zPrev; // Z coordinate will follow client values - - float speed; - if (this instanceof Boat) - { - speed = ((Boat) this).boatSpeed; - } - else - { - speed = getStat().getMoveSpeed(); - } - - if (isPlayer()) + if (isPlayer() && !_isFlying) { // In case of cursor movement, avoid moving through obstacles. if (_cursorKeyMovement) @@ -5037,37 +5026,31 @@ public abstract class Creature extends WorldObject implements ISkillsHolder } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - double distFraction; - final double distPassed = (speed * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND; - if ((((dx * dx) + (dy * dy)) < 10000) && ((dz * dz) > 2500)) // close enough, allows error between client and server geodata if it cannot be avoided + double delta = (dx * dx) + (dy * dy); + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { - distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy)); + delta = Math.sqrt(delta); } else { - distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); + delta = Math.sqrt(delta + (dz * dz)); + } + + double distFraction = Double.MAX_VALUE; + if (delta > 1) + { + final double distPassed = (_stat.getMoveSpeed() * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND; + distFraction = distPassed / delta; } if (distFraction > 1) { // Set the position of the Creature to the destination super.setXYZ(m._xDestination, m._yDestination, m._zDestination); - if (isBoat()) { ((Boat) this).updatePeopleInTheBoat(m._xDestination, m._yDestination, m._zDestination); @@ -5306,7 +5289,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder final int curZ = getZ(); // Mobius: Fix for teleporting on top of catacomb entrances. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (z > curZ)) { z = Math.max(z - 500, curZ); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index d38002bddf..8227572f0a 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -4996,18 +4996,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder double dx = m._xDestination - m._xAccurate; double dy = m._yDestination - m._yAccurate; double dz = m._zDestination - zPrev; // Z coordinate will follow client values - - float speed; - if (this instanceof Boat) - { - speed = ((Boat) this).boatSpeed; - } - else - { - speed = getStat().getMoveSpeed(); - } - - if (isPlayer()) + if (isPlayer() && !_isFlying) { // In case of cursor movement, avoid moving through obstacles. if (_cursorKeyMovement) @@ -5083,37 +5072,31 @@ public abstract class Creature extends WorldObject implements ISkillsHolder } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - double distFraction; - final double distPassed = (speed * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND; - if ((((dx * dx) + (dy * dy)) < 10000) && ((dz * dz) > 2500)) // close enough, allows error between client and server geodata if it cannot be avoided + double delta = (dx * dx) + (dy * dy); + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { - distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy)); + delta = Math.sqrt(delta); } else { - distFraction = distPassed / Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); + delta = Math.sqrt(delta + (dz * dz)); + } + + double distFraction = Double.MAX_VALUE; + if (delta > 1) + { + final double distPassed = (_stat.getMoveSpeed() * (gameTicks - m._moveTimestamp)) / GameTimeTaskManager.TICKS_PER_SECOND; + distFraction = distPassed / delta; } if (distFraction > 1) { // Set the position of the Creature to the destination super.setXYZ(m._xDestination, m._yDestination, m._zDestination); - if (isBoat()) { ((Boat) this).updatePeopleInTheBoat(m._xDestination, m._yDestination, m._zDestination); @@ -5352,7 +5335,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder final int curZ = getZ(); // Mobius: Fix for teleporting on top of catacomb entrances. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (z > curZ)) { z = Math.max(z - 500, curZ); diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index ecdcaf3f85..f51db468cc 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -4059,25 +4059,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -4104,7 +4091,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -4304,7 +4291,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java index 82338633a0..fb2075a22a 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -4250,25 +4250,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -4295,7 +4282,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -4495,7 +4482,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java index 7f41ce5ddf..41832e8e67 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -4252,25 +4252,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -4297,7 +4284,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -4497,7 +4484,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java index 535e638b56..a61bebfc19 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java index 535e638b56..a61bebfc19 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index 535e638b56..a61bebfc19 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index 535e638b56..a61bebfc19 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index c76692bba5..32dabc2e6e 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index e2c0526963..e9ccb2efce 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3289,25 +3289,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3334,7 +3321,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3536,7 +3523,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index bde51800d0..1e53defc5b 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3289,25 +3289,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3334,7 +3321,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3536,7 +3523,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index e2c0526963..e9ccb2efce 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3289,25 +3289,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3334,7 +3321,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3536,7 +3523,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0fcda096f9..b1a67e3855 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3288,25 +3288,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3333,7 +3320,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3535,7 +3522,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index 535e638b56..a61bebfc19 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3276,25 +3276,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3321,7 +3308,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3523,7 +3510,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4f8477a92d..11addb6af2 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3291,25 +3291,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3336,7 +3323,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3538,7 +3525,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java index 5a3c757a1b..99eaeb75d7 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3310,25 +3310,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3355,7 +3342,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3557,7 +3544,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java index 3010e77ec5..c0eacb2af9 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3320,25 +3320,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3365,7 +3352,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3567,7 +3554,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance; diff --git a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java index 90bf5a9d3b..e16aa2d297 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3320,25 +3320,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } } } - - // Prevent player moving on ledges. - if ((dz > 180) && (distance < 300)) - { - _move.onGeodataPathIndex = -1; - if (hasAI() && getAI().isFollowing()) - { - getAI().stopFollow(); - } - stopMove(null); - return false; - } } } - final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER); double delta = (dx * dx) + (dy * dy); - if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided - && !isFloating) + final boolean isFloating = _isFlying || (isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE)); + if (!isFloating && (delta < 10000) && ((dz * dz) > 2500)) // Close enough, allows error between client and server geodata if it cannot be avoided. { delta = Math.sqrt(delta); } @@ -3365,7 +3352,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m._yAccurate += dy * distFraction; // Set the position of the Creature to estimated after parcial move - super.setXYZ((int) (m._xAccurate), (int) (m._yAccurate), zPrev + (int) ((dz * distFraction) + 0.5)); + super.setXYZ((int) m._xAccurate, (int) m._yAccurate, zPrev + (int) ((dz * distFraction) + 0.5)); } revalidateZone(false); @@ -3567,7 +3554,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe } // Make water move short and use no geodata checks for swimming chars distance in a click can easily be over 3000. - final boolean isInWater = isInsideZone(ZoneId.WATER); + final boolean isInWater = isInsideZone(ZoneId.WATER) && !isInsideZone(ZoneId.CASTLE); if (isInWater && (distance > 700)) { final double divider = 700 / distance;