diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/GeoEngine.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java index b695cfd5b2..e8ced2ddef 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java @@ -929,16 +929,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -946,6 +940,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2486,6 +2481,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 cc2c4dc9ee..0a67233a0a 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 @@ -12718,6 +12718,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/GeoEngine.ini b/L2J_Mobius_2.5_Underground/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java index c48fe444f3..ec1def3779 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java @@ -939,16 +939,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -956,6 +950,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2508,6 +2503,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 4b55e849d8..5165fb789a 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 @@ -12725,6 +12725,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/GeoEngine.ini b/L2J_Mobius_3.0_Helios/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java index 1d5b0c14e9..9a7d8d6fc2 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java @@ -952,16 +952,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -969,6 +963,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2530,6 +2525,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 33b2cfee2a..b98b846242 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 @@ -12727,6 +12727,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/GeoEngine.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java index 2eb568071b..2e1ffb2bd6 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -939,16 +939,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -956,6 +950,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2505,6 +2500,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 b87f3cc1f4..6cd41e8431 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 @@ -12707,6 +12707,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/GeoEngine.ini b/L2J_Mobius_5.0_Salvation/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java index a7895b4194..8537119ea4 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java @@ -934,16 +934,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -951,6 +945,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2505,6 +2500,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 e69eb0e73b..3b0cc99cf1 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 @@ -12694,6 +12694,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/GeoEngine.ini b/L2J_Mobius_5.5_EtinasFate/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java index 40e852bb72..c93f84b637 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java @@ -941,16 +941,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -958,6 +952,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2517,6 +2512,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 5cef36705c..0692a48fd5 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 @@ -12697,6 +12697,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/config/GeoEngine.ini b/L2J_Mobius_6.0_Fafurion/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_6.0_Fafurion/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java index 174b28d304..31c0174f51 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java @@ -953,16 +953,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -970,6 +964,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2560,6 +2555,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 c83783cfc4..93a59658bc 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 @@ -12703,6 +12703,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/GeoEngine.ini b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java index 06adcdce1c..a19230d974 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -964,16 +964,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -981,6 +975,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2584,6 +2579,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 7c585caea7..d5cb4a03c0 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 @@ -12711,6 +12711,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/config/GeoEngine.ini b/L2J_Mobius_8.0_Homunculus/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_8.0_Homunculus/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java index 9586f4504a..d53600f9ae 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/Config.java @@ -961,16 +961,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -978,6 +972,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2578,6 +2573,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 851fd2e049..92237a7300 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 @@ -12752,6 +12752,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/main/GeoEngine.ini b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/main/GeoEngine.ini index 183e0314b5..c579cd8f12 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/main/GeoEngine.ini +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/main/GeoEngine.ini @@ -55,9 +55,12 @@ HeuristicWeight = 20 MaxIterations = 3500 # ================================================================= -# Other +# Other # ================================================================= +# Correct player Z after falling through the ground. +CorrectPlayerZ = False + # When a character falls, he takes damages. # Default: True FallDamage = True diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java index ca6aff37ab..e13ef61787 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java @@ -938,6 +938,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; public static boolean FALL_DAMAGE; public static boolean ALLOW_WATER; @@ -2504,6 +2505,7 @@ public class Config OBSTACLE_MULTIPLIER = geoengineConfig.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = geoengineConfig.getInt("HeuristicWeight", 20); MAX_ITERATIONS = geoengineConfig.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = geoengineConfig.getBoolean("CorrectPlayerZ", false); FALL_DAMAGE = geoengineConfig.getBoolean("FallDamage", false); ALLOW_WATER = geoengineConfig.getBoolean("AllowWater", false); } 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 97b7878e9f..5d3abcf9f4 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 @@ -15447,6 +15447,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ), false); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_C6_Interlude/dist/game/config/main/GeoEngine.ini b/L2J_Mobius_C6_Interlude/dist/game/config/main/GeoEngine.ini index 183e0314b5..c579cd8f12 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/config/main/GeoEngine.ini +++ b/L2J_Mobius_C6_Interlude/dist/game/config/main/GeoEngine.ini @@ -55,9 +55,12 @@ HeuristicWeight = 20 MaxIterations = 3500 # ================================================================= -# Other +# Other # ================================================================= +# Correct player Z after falling through the ground. +CorrectPlayerZ = False + # When a character falls, he takes damages. # Default: True FallDamage = True diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java index d2dcddf599..d97610d206 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java @@ -972,6 +972,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; public static boolean FALL_DAMAGE; public static boolean ALLOW_WATER; @@ -2569,6 +2570,7 @@ public class Config OBSTACLE_MULTIPLIER = geoengineConfig.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = geoengineConfig.getInt("HeuristicWeight", 20); MAX_ITERATIONS = geoengineConfig.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = geoengineConfig.getBoolean("CorrectPlayerZ", false); FALL_DAMAGE = geoengineConfig.getBoolean("FallDamage", false); ALLOW_WATER = geoengineConfig.getBoolean("AllowWater", false); } 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 1c9854e881..92f6c166e8 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 @@ -15813,6 +15813,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ), false); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/GeoEngine.ini b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java index d1f7626103..a0f118f14b 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java @@ -1058,16 +1058,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -1075,6 +1069,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; // -------------------------------------------------- // Custom Settings @@ -2604,6 +2599,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 286a59befb..2fad0307d8 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 @@ -13533,6 +13533,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/GeoEngine.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java index 2e22d7ab87..5d311fcfc8 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java @@ -1057,16 +1057,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -1074,6 +1068,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; // -------------------------------------------------- // Custom Settings @@ -2611,6 +2606,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 b2912bb4eb..aec1e2a35c 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 @@ -13426,6 +13426,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index 33f9ce5fb3..3d131aa9d8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -872,16 +872,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -889,6 +883,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2375,6 +2370,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 54b83dd7e6..3498400fed 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 @@ -12502,6 +12502,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java index 4b04f8b623..df27361c75 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java @@ -876,16 +876,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -893,6 +887,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2381,6 +2376,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 1cca142906..104aacfc97 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 @@ -12502,6 +12502,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java index 4b04f8b623..df27361c75 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java @@ -876,16 +876,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -893,6 +887,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2381,6 +2376,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 c6f8f4a60e..dfec7e2eb2 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 @@ -12488,6 +12488,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java index a4202f1f57..89950a21be 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java @@ -876,16 +876,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -893,6 +887,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2382,6 +2377,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 4dd12564eb..4a2f837608 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 @@ -12530,6 +12530,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java index e4cf4d220a..cd685d27f8 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -881,16 +881,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -898,6 +892,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2391,6 +2386,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 73029fb553..a92d49c553 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 @@ -12530,6 +12530,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index f86bff6acb..36c4d2a1c2 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -889,16 +889,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -906,6 +900,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2408,6 +2403,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 c4b50572ed..aed7a7df05 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 @@ -12500,6 +12500,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/GeoEngine.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 8043e5f202..048c8caf2c 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -890,16 +890,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -907,6 +901,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2406,6 +2401,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 278c4a6c6c..2020d52e12 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 @@ -12523,6 +12523,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/config/GeoEngine.ini b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/config/GeoEngine.ini index 94a0b1ac44..3eee183747 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/config/GeoEngine.ini +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/config/GeoEngine.ini @@ -53,3 +53,10 @@ HeuristicWeight = 20 # Maximum number of generated nodes per one path-finding process, default 3500 MaxIterations = 3500 + +# ================================================================= +# Other +# ================================================================= + +# Correct player Z after falling through the ground. +CorrectPlayerZ = False diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/Config.java index c679851f51..f71bade6e8 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/Config.java @@ -900,16 +900,10 @@ public class Config // -------------------------------------------------- // GeoEngine // -------------------------------------------------- - - /** Geodata */ public static String GEODATA_PATH; public static int COORD_SYNCHRONIZE; - - /** Path checking */ public static int PART_OF_CHARACTER_HEIGHT; public static int MAX_OBSTACLE_HEIGHT; - - /** Path finding */ public static boolean PATHFINDING; public static String PATHFIND_BUFFERS; public static int BASE_WEIGHT; @@ -917,6 +911,7 @@ public class Config public static int HEURISTIC_WEIGHT; public static int OBSTACLE_MULTIPLIER; public static int MAX_ITERATIONS; + public static boolean CORRECT_PLAYER_Z; /** Attribute System */ public static int S_WEAPON_STONE; @@ -2434,6 +2429,7 @@ public class Config OBSTACLE_MULTIPLIER = GeoEngine.getInt("ObstacleMultiplier", 10); HEURISTIC_WEIGHT = GeoEngine.getInt("HeuristicWeight", 20); MAX_ITERATIONS = GeoEngine.getInt("MaxIterations", 3500); + CORRECT_PLAYER_Z = GeoEngine.getBoolean("CorrectPlayerZ", false); // Load AllowedPlayerRaces config file (if exists) final PropertiesParser AllowedPlayerRaces = new PropertiesParser(CUSTOM_ALLOWED_PLAYER_RACES_CONFIG_FILE); 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 f0f42b2aad..ac7430069f 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 @@ -12669,6 +12669,14 @@ public class PlayerInstance extends Playable } if (_fallingDamageTask != null) { + if (Config.CORRECT_PLAYER_Z) + { + final int nearestZ = GeoEngine.getInstance().getHeightNearest(getX(), getY(), getZ()); + if (getZ() < nearestZ) + { + teleToLocation(new Location(getX(), getY(), nearestZ)); + } + } _fallingDamageTask.cancel(true); } _fallingDamageTask = ThreadPool.schedule(() ->