From 39ef320fab46813c9ce40c20987100c1e4beec9c Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Mon, 1 Mar 2021 03:31:23 +0000 Subject: [PATCH] Ignore no path found issues. Thanks to Trance. --- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- .../dist/game/data/geodata/Readme.txt | 21 ++---- .../gameserver/geoengine/GeoEngine.java | 70 +++++++++++++------ .../gameserver/model/actor/Creature.java | 15 ++-- .../model/actor/instance/PlayerInstance.java | 2 +- 88 files changed, 1386 insertions(+), 990 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/geodata/Readme.txt b/L2J_Mobius_1.0_Ertheia/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0da99668a3..08c564784d 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index a5119614ad..bfa5289e16 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12708,7 +12708,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/geodata/Readme.txt b/L2J_Mobius_2.5_Underground/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_2.5_Underground/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0da99668a3..08c564784d 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 64e939317c..df944635f0 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12715,7 +12715,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/geodata/Readme.txt b/L2J_Mobius_3.0_Helios/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_3.0_Helios/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index 329d674cdf..342cd8ab67 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 19bdf88e8c..486d5cfabc 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12717,7 +12717,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/geodata/Readme.txt b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index 329d674cdf..342cd8ab67 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index f236475af9..ff294fcdfc 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12697,7 +12697,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/geodata/Readme.txt b/L2J_Mobius_5.0_Salvation/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4d68d399c7..9e4bc93dde 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index f57bf5792d..bdba2bc444 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12684,7 +12684,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/geodata/Readme.txt b/L2J_Mobius_5.5_EtinasFate/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4d68d399c7..9e4bc93dde 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 43679f1fe7..64fc03912c 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12687,7 +12687,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/geodata/Readme.txt b/L2J_Mobius_6.0_Fafurion/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4d68d399c7..9e4bc93dde 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index c0d3f1a699..427601a3fb 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12693,7 +12693,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/geodata/Readme.txt b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index 74ba3e4326..33fb768e9f 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3383,6 +3383,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3396,13 +3397,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 11284a6533..06abca176a 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12701,7 +12701,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/geodata/Readme.txt b/L2J_Mobius_8.0_Homunculus/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java index 74ba3e4326..33fb768e9f 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3383,6 +3383,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3396,13 +3397,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 0382aaaf08..5d4d00cffd 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12742,7 +12742,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/geodata/Readme.txt b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/geodata/Readme.txt index 57e07aded2..5c756621e5 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/main/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index 33f2015cc5..ccafb3803f 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -177,6 +177,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -271,6 +282,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -325,18 +372,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -699,17 +734,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 c363df6da6..5a7bcebf55 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 @@ -5516,6 +5516,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -5529,13 +5530,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 930e1808bc..297768df40 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -15483,7 +15483,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ), false); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/geodata/Readme.txt b/L2J_Mobius_C6_Interlude/dist/game/data/geodata/Readme.txt index 57e07aded2..5c756621e5 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_C6_Interlude/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/main/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index 33f2015cc5..ccafb3803f 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -177,6 +177,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -271,6 +282,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -325,18 +372,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -699,17 +734,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 03e32a3bd7..fe71d8e867 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 @@ -5562,6 +5562,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -5575,13 +5576,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index c82a437c98..0d38b9b75b 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -15849,7 +15849,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ), false); diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/geodata/Readme.txt b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index aec1df85d4..143a5e0124 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -178,6 +178,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -272,6 +283,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -326,18 +373,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -700,17 +735,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 b3ec6eb0fd..44fd77b56f 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 @@ -4325,6 +4325,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -4338,13 +4339,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 0bb081b781..3fa4a44092 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -13513,7 +13513,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/geodata/Readme.txt b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index aec1df85d4..143a5e0124 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -178,6 +178,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -272,6 +283,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -326,18 +373,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -700,17 +735,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 846c0f8e4c..3ae312728d 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 @@ -4327,6 +4327,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceId()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -4340,13 +4341,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceId()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 0722a5cd0e..44e0081947 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -13406,7 +13406,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 c9afa67674..126b4cb663 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 @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 7889ccf963..45a0ccf134 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12492,7 +12492,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index c9afa67674..126b4cb663 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 242ea769b5..df39c1ad14 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12492,7 +12492,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index 6f7f03a11c..4244fddcfe 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index b9b667671d..1eca9205c5 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12478,7 +12478,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index 64c003c89a..2dd61e16aa 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3397,6 +3397,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3410,13 +3411,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 27501af525..43682770f7 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12527,7 +12527,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index 64c003c89a..2dd61e16aa 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3397,6 +3397,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3410,13 +3411,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index af171eece9..1615c60649 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12527,7 +12527,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 f57115a1e6..99c0f57dd5 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 @@ -3396,6 +3396,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3409,13 +3410,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 0b4c1db152..d8b74a9acc 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12505,7 +12505,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Classic_Interlude/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; 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 c9afa67674..126b4cb663 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 @@ -3384,6 +3384,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3397,13 +3398,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index f4922d03e3..d95a8af611 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12513,7 +12513,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java index fdf1213cfd..62e08a045d 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3399,6 +3399,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3412,13 +3413,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 0061d4d812..6f30942c3b 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12696,7 +12696,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ)); diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/geodata/Readme.txt b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/geodata/Readme.txt index 8b18814e82..a480c8c380 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/geodata/Readme.txt +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/geodata/Readme.txt @@ -2,16 +2,14 @@ GEODATA COMPENDIUM ############################################## -Comprehensive guide for geodata, by Tryskell and Hasha. +Comprehensive guide for geodata. -I - How to configure it - a - Prerequisites - b - Make it work - c - L2D format -II - Addendum +How to configure it + a - Prerequisites + b - Make it work ############################################## -I - How to configure it +How to configure it ############################################## ---------------------------------------------- @@ -30,12 +28,3 @@ To make geodata working: * open "/config/GeoEngine.ini" with your favorite text editor and then edit following config: - CoordSynchronize = 2 * If you do not use any geodata files, the server will automatically change this setting to -1. - ----------------------------------------------- -c - L2D format ----------------------------------------------- - -* L2D is a new geodata file format. It holds diagonal movement informations, in addition to regular NSWE flags. -* Heavier file weight (+30%), but the pathfinding algorithms are processed way faster (-35% calculation times). -* L2D files can be converted from L2OFF/L2J formats without losing any information. Converter is part of the gameserver. -* Keep in mind to convert new geodata files, once you update your L2OFF/L2J ones. diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java index fbddb17df9..c51fcd92f0 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -180,6 +180,17 @@ public class GeoEngine return region.hasGeo(); } + /** + * Checks the specified position for available geodata. + * @param x the world x + * @param y the world y + * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise + */ + public boolean hasGeo(int x, int y) + { + return hasGeoPos(getGeoX(x), getGeoY(y)); + } + /** * @param geoX * @param geoY @@ -274,6 +285,42 @@ public class GeoEngine return region.getNextHigherZ(geoX, geoY, worldZ); } + /** + * Gets the Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHeight(int x, int y, int z) + { + return getNearestZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next lower Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getLowerHeight(int x, int y, int z) + { + return getNextLowerZ(getGeoX(x), getGeoY(y), z); + } + + /** + * Gets the next higher Z height. + * @param x the world x + * @param y the world y + * @param z the world z + * @return the nearest Z height + */ + public int getHigherHeight(int x, int y, int z) + { + return getNextHigherZ(getGeoX(x), getGeoY(y), z); + } + /** * @param worldX * @return the geo X @@ -328,18 +375,6 @@ public class GeoEngine return (geoZ * 16) + WORLD_MIN_Z + 8; } - /** - * Gets the Z height. - * @param x the x coordinate - * @param y the y coordinate - * @param z the z coordinate - * @return the nearest Z height - */ - public int getHeight(int x, int y, int z) - { - return getNearestZ(getGeoX(x), getGeoY(y), z); - } - /** * Can see target. Doors as target always return true. Checks doors between. * @param cha the character @@ -710,17 +745,6 @@ public class GeoEngine return true; } - /** - * Checks the specified position for available geodata. - * @param x the X coordinate - * @param y the Y coordinate - * @return {@code true} if there is geodata for the given coordinates, {@code false} otherwise - */ - public boolean hasGeo(int x, int y) - { - return hasGeoPos(getGeoX(x), getGeoY(y)); - } - public static GeoEngine getInstance() { return SingletonHolder.INSTANCE; diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java index 4e05ad4963..ef57116124 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3406,6 +3406,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe final Location destiny = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, x, y, z, getInstanceWorld()); x = destiny.getX(); y = destiny.getY(); + z = destiny.getZ(); dx = x - curX; dy = y - curY; dz = z - curZ; @@ -3419,13 +3420,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe m.geoPath = GeoEnginePathfinding.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found { + if ((isPlayer()) || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((Summon) this).getFollowStatus())) + { + return; + } + m.disregardingGeodata = true; - // Mobius: Verify destination. Prevents wall collision issues. - final Location newDestination = GeoEngine.getInstance().canMoveToTargetLoc(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld()); - x = newDestination.getX(); - y = newDestination.getY(); - z = newDestination.getZ(); + x = originalX; + y = originalY; + z = originalZ; + distance = originalDistance; } else { diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 3370cfdcce..23ed36dfb6 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12700,7 +12700,7 @@ public class PlayerInstance extends Playable { if (Config.CORRECT_PLAYER_Z) { - final int nearestZ = GeoEngine.getInstance().getNextLowerZ(getX(), getY(), getZ()); + final int nearestZ = GeoEngine.getInstance().getHigherHeight(getX(), getY(), getZ()); if (getZ() < nearestZ) { teleToLocation(new Location(getX(), getY(), nearestZ));