diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java index 55dcf64ab3..94d2b306da 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/zone/type/TimedHuntingZone.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.model.zone.type; +import org.l2jmobius.commons.threads.ThreadPool; import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.MapRegionManager; @@ -40,7 +41,7 @@ public class TimedHuntingZone extends ZoneType @Override protected void onEnter(Creature creature) { - if (!creature.isPlayer() || creature.isInsideZone(ZoneId.TIMED_HUNTING)) + if (!creature.isPlayer()) { return; } @@ -82,11 +83,18 @@ public class TimedHuntingZone extends ZoneType } final Player player = creature.getActingPlayer(); - if ((player != null) && !player.isInTimedHuntingZone(player.getX(), player.getY())) + if (player != null) { player.setInsideZone(ZoneId.TIMED_HUNTING, false); - player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); - player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + + ThreadPool.schedule(() -> + { + if (!player.isInTimedHuntingZone(player.getX(), player.getY())) + { + player.sendPacket(TimedHuntingZoneExit.STATIC_PACKET); + player.sendPacket(TimedHuntingZoneClose.STATIC_PACKET); + } + }, 1000); } } }