diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY)); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java index b3ab7cb04a..a9ecc045da 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java @@ -18,6 +18,7 @@ package handlers.effecthandlers; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.enums.FlyType; +import org.l2jmobius.gameserver.geoengine.GeoEngine; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.actor.Creature; @@ -39,6 +40,12 @@ public class BlinkSwap extends AbstractEffect { } + @Override + public boolean canStart(Creature effector, Creature effected, Skill skill) + { + return (effected != null) && GeoEngine.getInstance().canSeeTarget(effected, effector); + } + @Override public boolean isInstant() { @@ -48,8 +55,8 @@ public class BlinkSwap extends AbstractEffect @Override public void instant(Creature effector, Creature effected, Skill skill, Item item) { - final Location effectorLoc = effector.getLocation(); - final Location effectedLoc = effected.getLocation(); + final Location effectedLoc = new Location(effected); + final Location effectorLoc = new Location(effector); effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY)); @@ -57,6 +64,7 @@ public class BlinkSwap extends AbstractEffect effector.abortCast(); effector.setXYZ(effectedLoc); effector.broadcastPacket(new ValidateLocation(effector)); + effector.revalidateZone(true); effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));