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 f0047cb2fa..bdd398e71c 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 @@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -542,6 +543,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10473,6 +10476,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 479af3e531..272c7f4c14 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 @@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -544,6 +545,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10480,6 +10483,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 732b62cc54..4b74fa9886 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 @@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -546,6 +547,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10482,6 +10485,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 db7fcf6d55..c384fff7db 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 @@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -550,6 +551,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10473,6 +10476,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 4eb0a07f12..0dbf31c2d4 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 @@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -548,6 +549,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10463,6 +10466,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 b92b314908..aa3453a09a 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 @@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -548,6 +549,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10466,6 +10469,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 5c69951026..e271481cc1 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 @@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -548,6 +549,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10472,6 +10475,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 b71ca3b4ed..e222a4003d 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 @@ -39,6 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -561,6 +562,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10482,6 +10485,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 40e5b6f845..570c22dcc9 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 @@ -39,6 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -564,6 +565,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10593,6 +10596,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) diff --git a/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 7cecd14daf..1cd254b4b4 100644 --- a/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -39,6 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -577,6 +578,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10619,6 +10622,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_9.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 c68c417941..bf7b050a3c 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 @@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; @@ -528,6 +529,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10889,6 +10892,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 86aa3e4216..6bdce827b1 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 8d14104306..5915c933f2 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -53,6 +53,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 0d5ba5057f..a00d5dfca7 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 @@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; @@ -547,6 +548,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10772,6 +10775,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 86aa3e4216..6bdce827b1 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 8d14104306..5915c933f2 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -53,6 +53,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 09199185d5..6d1762769d 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 @@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -545,6 +546,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10384,6 +10387,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 ba8e7e0abe..1287469c5f 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 @@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -545,6 +546,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10384,6 +10387,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 4a65f2b5c1..1dab945a2f 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 @@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -543,6 +544,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10370,6 +10373,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 5b46cd80be..4729069c20 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 @@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -549,6 +550,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10397,6 +10400,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 54f9961e68..11334d52b5 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 @@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -549,6 +550,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10397,6 +10400,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 d11e79d455..b6193021d0 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 @@ -42,6 +42,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -564,6 +565,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10342,6 +10345,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 8f05192d4a..1090fcf180 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 @@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentSkipListMap; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -540,6 +541,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10380,6 +10383,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) 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 fdc3cc35c4..13ba4224eb 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 @@ -42,6 +42,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -583,6 +584,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10508,6 +10511,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type) diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 98cdd7c655..73395a87b8 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -42,6 +42,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.Future; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level; import java.util.stream.Collectors; @@ -607,6 +608,8 @@ public class PlayerInstance extends Playable /** Stored from last ValidatePosition **/ private final Location _lastServerPosition = new Location(0, 0, 0); + private final AtomicBoolean _blinkActive = new AtomicBoolean(); + /** The number of recommendation obtained by the PlayerInstance */ private int _recomHave; // how much I was recommended by others /** The number of recommendation that the PlayerInstance can give */ @@ -10574,6 +10577,16 @@ public class PlayerInstance extends Playable return _lastServerPosition; } + public void setBlinkActive(boolean value) + { + _blinkActive.set(value); + } + + public boolean isBlinkActive() + { + return _blinkActive.get(); + } + @Override public void addExpAndSp(double addToExp, double addToSp) { diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java index 066abf9cc9..b11c271a37 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java @@ -106,7 +106,14 @@ public class ValidatePosition implements IClientIncomingPacket // Check out of sync. if (player.calculateDistance3D(_x, _y, _z) > player.getStat().getMoveSpeed()) { - player.setXYZ(_x, _y, _z); + if (player.isBlinkActive()) + { + player.setBlinkActive(false); + } + else + { + player.setXYZ(_x, _y, _z); + } } player.setClientX(_x); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java index 7e2bbe83c8..ae088538da 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/serverpackets/FlyToLocation.java @@ -62,6 +62,11 @@ public class FlyToLocation implements IClientOutgoingPacket _destY = destY; _destZ = destZ; _type = type; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, int destX, int destY, int destZ, FlyType type, int flySpeed, int flyDelay, int animationSpeed) @@ -77,6 +82,11 @@ public class FlyToLocation implements IClientOutgoingPacket _flySpeed = flySpeed; _flyDelay = flyDelay; _animationSpeed = animationSpeed; + + if (creature.isPlayer()) + { + creature.getActingPlayer().setBlinkActive(true); + } } public FlyToLocation(Creature creature, ILocational dest, FlyType type)