diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 1b5a251110..54c45d9e14 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 1b5a251110..54c45d9e14 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 0f27c80107..fade6a2140 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 0f27c80107..fade6a2140 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 4058b70e91..6d8d0cef30 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 4058b70e91..6d8d0cef30 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 4058b70e91..6d8d0cef30 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 919cda941e..2f9f91736f 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 7a7b97ca1c..88b3fc8cae 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Summon.java
index ad18df7166..1a87fe47b3 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 7a7b97ca1c..88b3fc8cae 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Summon.java
index ad18df7166..1a87fe47b3 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 14809ac499..3f7293d2db 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -41,7 +41,6 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.ExAlterSkillRequest;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -187,9 +186,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
World.getInstance().forEachVisibleObjectInRange(effected, PlayerInstance.class, 1200, nearby ->
{
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 7a7b97ca1c..88b3fc8cae 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Summon.java
index ad18df7166..1a87fe47b3 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java
index 6382a78591..59720810f4 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/data/scripts/ai/bosses/Orfen.java
@@ -183,7 +183,7 @@ public class Orfen extends Quest
npc.getSpawn().setX(55024);
npc.getSpawn().setY(17368);
npc.getSpawn().setZ(-5412);
- npc.teleToLocation(55024, 17368, -5412, false);
+ npc.teleToLocation(55024, 17368, -5412);
break;
}
default:
@@ -211,7 +211,7 @@ public class Orfen extends Quest
npc.getSpawn().setX(43577);
npc.getSpawn().setY(15985);
npc.getSpawn().setZ(-4396);
- npc.teleToLocation(43577, 15985, -4396, false);
+ npc.teleToLocation(43577, 15985, -4396);
startQuestTimer("ORFEN_REFRESH", 10000, npc, null);
}
else if (npc.isInsideRadius2D(attacker, 1000) && !npc.isInsideRadius2D(attacker, 300) && (Rnd.get(10) == 0))
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java
index f76299676c..39f38fc868 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java
@@ -115,8 +115,8 @@ public class NpcWalkerAI extends CreatureAI implements Runnable
final int destinationX = _route.get(_currentPos).getMoveX();
final int destinationY = _route.get(_currentPos).getMoveY();
final int destinationZ = _route.get(_currentPos).getMoveZ();
+ getActor().teleToLocation(destinationX, destinationY, destinationZ);
- getActor().teleToLocation(destinationX, destinationY, destinationZ, false);
super.onEvtArrivedBlocked(location);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java
index 628d571ea7..d0055aed53 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java
@@ -418,7 +418,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
}
- activeChar.teleToLocation(x, y, z, false);
+ activeChar.teleToLocation(x, y, z);
showTeleportWindow(activeChar);
return true;
@@ -482,7 +482,7 @@ public class AdminTeleport implements IAdminCommandHandler
private void teleportTo(PlayerInstance activeChar, int x, int y, int z)
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- activeChar.teleToLocation(x, y, z, false);
+ activeChar.teleToLocation(x, y, z);
BuilderUtil.sendSysMessage(activeChar, "You have been teleported to " + x + " " + y + " " + z);
}
@@ -548,7 +548,7 @@ public class AdminTeleport implements IAdminCommandHandler
final int y = player.getY();
final int z = player.getZ();
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- activeChar.teleToLocation(x, y, z, true);
+ activeChar.teleToLocation(x, y, z);
BuilderUtil.sendSysMessage(activeChar, "You have teleported to character " + player.getName() + ".");
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java
index 4343b31b76..9d659190e1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java
@@ -1077,7 +1077,7 @@ public class CTF implements EventTask
{
if (player.isOnline())
{
- player.teleToLocation(_npcX, _npcY, _npcZ, false);
+ player.teleToLocation(_npcX, _npcY, _npcZ);
}
else
{
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/DM.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/DM.java
index 3797fbbc0f..179e3670cf 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/DM.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/DM.java
@@ -1001,7 +1001,7 @@ public class DM implements EventTask
{
if (player.isOnline())
{
- player.teleToLocation(_npcX, _npcY, _npcZ, false);
+ player.teleToLocation(_npcX, _npcY, _npcZ);
}
else
{
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java
index da9b80386e..3175eed0bd 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java
@@ -1013,7 +1013,7 @@ public class TvT implements EventTask
{
if (player.isOnline())
{
- player.teleToLocation(_npcX, _npcY, _npcZ, false);
+ player.teleToLocation(_npcX, _npcY, _npcZ);
}
else
{
@@ -2596,8 +2596,8 @@ public class TvT implements EventTask
playerToKick.setTitle(playerToKick._originalTitleTvT);
playerToKick.broadcastUserInfo();
playerToKick.sendMessage("You have been kicked from the TvT.");
- playerToKick.teleToLocation(_npcX, _npcY, _npcZ, false);
- playerToKick.teleToLocation((_npcX + Rnd.get(201)) - 100, (_npcY + Rnd.get(201)) - 100, _npcZ, false);
+ playerToKick.teleToLocation(_npcX, _npcY, _npcZ);
+ playerToKick.teleToLocation((_npcX + Rnd.get(201)) - 100, (_npcY + Rnd.get(201)) - 100, _npcZ);
}
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/ObjectPosition.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/ObjectPosition.java
index e8e841c1a7..e5fbed6950 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/ObjectPosition.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/ObjectPosition.java
@@ -69,7 +69,7 @@ public class ObjectPosition
LOGGER.warning("Object Id at bad coords: (x: " + getWorldPosition().getX() + ", y: " + getWorldPosition().getY() + ", z: " + getWorldPosition().getZ() + ").");
if (_activeObject instanceof PlayerInstance)
{
- ((PlayerInstance) _activeObject).teleToLocation(0, 0, 0, false);
+ ((PlayerInstance) _activeObject).teleToLocation(0, 0, 0);
((PlayerInstance) _activeObject).sendMessage("Error with your coords, Please ask a GM for help!");
}
else if (_activeObject instanceof Creature)
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 450b5a52b7..a4facf2609 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -347,7 +347,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
if ((pet != null) && (pos != null))
{
pet.setFollowStatus(false);
- pet.teleToLocation(pos.getX() + Rnd.get(-100, 100), pos.getY() + Rnd.get(-100, 100), pos.getZ(), false);
+ pet.teleToLocation(pos.getX() + Rnd.get(-100, 100), pos.getY() + Rnd.get(-100, 100), pos.getZ());
pet.setFollowStatus(true);
}
}
@@ -540,8 +540,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
* @param yValue the y
* @param zValue the z
* @param allowRandomOffset the allow random offset
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset)
+ public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset, boolean instant)
{
if (Config.TW_DISABLE_GK)
{
@@ -587,7 +588,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
z += 5;
// Send a Server->Client packet TeleportToLocationt to the Creature AND to all PlayerInstance in the _KnownPlayers of the Creature
- broadcastPacket(new TeleportToLocation(this, x, y, z));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, getHeading(), instant));
// remove the object from its old location
decayMe();
@@ -602,26 +603,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
revalidateZone(true);
}
- /**
- * Revalidate zone.
- * @param force the force
- */
- public void revalidateZone(boolean force)
+ public void teleToLocation(int x, int y, int z, boolean allowRandomOffset)
{
- final WorldRegion region = getWorldRegion();
- if (region == null)
- {
- return;
- }
-
- // This function is called too often from movement code.
- if (!force && (calculateDistanceSq3D(_lastZoneValidateLocation.getX(), _lastZoneValidateLocation.getY(), _lastZoneValidateLocation.getZ()) < (isNpc() && !isInCombat() ? Config.MAX_DRIFT_RANGE * Config.MAX_DRIFT_RANGE : 10000)))
- {
- return;
- }
- _lastZoneValidateLocation.setXYZ(getX(), getY(), getZ());
-
- region.revalidateZones(this);
+ teleToLocation(x, y, z, allowRandomOffset, false);
}
/**
@@ -671,6 +655,38 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
teleToLocation(MapRegionData.getInstance().getTeleToLocation(this, teleportWhere), true);
}
+ public void teleToLocationInstant(Location loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), false, true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, false, true);
+ }
+
+ /**
+ * Revalidate zone.
+ * @param force the force
+ */
+ public void revalidateZone(boolean force)
+ {
+ final WorldRegion region = getWorldRegion();
+ if (region == null)
+ {
+ return;
+ }
+
+ // This function is called too often from movement code.
+ if (!force && (calculateDistanceSq3D(_lastZoneValidateLocation.getX(), _lastZoneValidateLocation.getY(), _lastZoneValidateLocation.getZ()) < (isNpc() && !isInCombat() ? Config.MAX_DRIFT_RANGE * Config.MAX_DRIFT_RANGE : 10000)))
+ {
+ return;
+ }
+ _lastZoneValidateLocation.setXYZ(getX(), getY(), getZ());
+
+ region.revalidateZones(this);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
@@ -6512,7 +6528,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
{
LOGGER.warning("Player " + getName() + " at bad coords: (x: " + getX() + ", y: " + getY() + ", z: " + getZ() + ").");
((PlayerInstance) this).sendMessage("Error with your coordinates! Please reboot your game fully!");
- ((PlayerInstance) this).teleToLocation(80753, 145481, -3532, false); // Near Giran luxury shop
+ ((PlayerInstance) this).teleToLocation(80753, 145481, -3532); // Near Giran luxury shop
}
else
{
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java
index 1421b4a255..6f48dd72b5 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java
@@ -209,7 +209,7 @@ public class BoatInstance extends Creature
}
else
{
- player.teleToLocation(pathA.ntx, pathA.nty, pathA.ntz, false);
+ player.teleToLocation(pathA.ntx, pathA.nty, pathA.ntz);
}
}
}
@@ -242,7 +242,7 @@ public class BoatInstance extends Creature
}
else
{
- player.teleToLocation(pathB.ntx, pathB.nty, pathB.ntz, false);
+ player.teleToLocation(pathB.ntx, pathB.nty, pathB.ntz);
}
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java
index 1b9962fdc3..10c93c0ab6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java
@@ -107,7 +107,7 @@ public class CastleMagicianInstance extends NpcInstance
return;
}
- player.teleToLocation(clanLeader.getX(), clanLeader.getY(), clanLeader.getZ(), false);
+ player.teleToLocation(clanLeader.getX(), clanLeader.getY(), clanLeader.getZ());
return;
}
final String filename = "data/html/castlemagician/magician-nogate.htm";
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java
index 7b74273b6f..badf689022 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java
@@ -75,7 +75,7 @@ public class MonsterInstance extends Attackable
final Spawn mobSpawn = getSpawn();
if (!isInCombat() && !isAlikeDead() && !isDead() && (mobSpawn != null) && !isInsideRadius2D(mobSpawn.getX(), mobSpawn.getY(), mobSpawn.getZ(), Config.MAX_DRIFT_RANGE))
{
- teleToLocation(mobSpawn.getX(), mobSpawn.getY(), mobSpawn.getZ(), false);
+ teleToLocation(mobSpawn.getX(), mobSpawn.getY(), mobSpawn.getZ());
}
}, Config.MONSTER_RETURN_DELAY * 1000);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 04ef216c73..bd7c26b86a 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -5727,7 +5727,7 @@ public class PlayerInstance extends Playable
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
ThreadPool.schedule(() ->
{
- teleToLocation((TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, (TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)), false);
+ teleToLocation((TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, (TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)));
doRevive();
}, Config.TVT_REVIVE_DELAY);
}
@@ -5739,7 +5739,7 @@ public class PlayerInstance extends Playable
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
ThreadPool.schedule(() ->
{
- teleToLocation(TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)), false);
+ teleToLocation(TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)));
doRevive();
broadcastPacket(new SocialAction(getObjectId(), 15));
}, Config.TVT_REVIVE_DELAY);
@@ -5756,7 +5756,7 @@ public class PlayerInstance extends Playable
}
ThreadPool.schedule(() ->
{
- teleToLocation(CTF._teamsX.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsY.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsZ.get(CTF._teams.indexOf(_teamNameCTF)), false);
+ teleToLocation(CTF._teamsX.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsY.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsZ.get(CTF._teams.indexOf(_teamNameCTF)));
doRevive();
}, 20000);
}
@@ -5781,7 +5781,7 @@ public class PlayerInstance extends Playable
ThreadPool.schedule(() ->
{
final Location ploc = DM.getPlayersSpawnLocation();
- teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ(), false);
+ teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ());
doRevive();
}, Config.DM_REVIVE_DELAY);
}
@@ -5794,7 +5794,7 @@ public class PlayerInstance extends Playable
ThreadPool.schedule(() ->
{
final Location ploc = DM.getPlayersSpawnLocation();
- teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ(), false);
+ teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ());
doRevive();
}, 20000);
}
@@ -10958,7 +10958,7 @@ public class PlayerInstance extends Playable
sendPacket(new ObservationMode(x, y, z));
getKnownList().removeAllKnownObjects(); // reinit knownlist
setXYZ(x, y, z);
- teleToLocation(x, y, z, false);
+ teleToLocation(x, y, z);
broadcastUserInfo();
}
@@ -11004,7 +11004,7 @@ public class PlayerInstance extends Playable
_wasInvisible = getAppearance().isInvisible();
getAppearance().setInvisible();
- teleToLocation(x, y, z, false);
+ teleToLocation(x, y, z);
sendPacket(new ExOlympiadMode(3, this));
broadcastUserInfo();
}
@@ -12674,7 +12674,7 @@ public class PlayerInstance extends Playable
if (getTrainedBeast() != null)
{
getTrainedBeast().getAI().stopFollow();
- getTrainedBeast().teleToLocation(getPosition().getX() + Rnd.get(-100, 100), getPosition().getY() + Rnd.get(-100, 100), getPosition().getZ(), false);
+ getTrainedBeast().teleToLocation(getPosition().getX() + Rnd.get(-100, 100), getPosition().getY() + Rnd.get(-100, 100), getPosition().getZ());
getTrainedBeast().getAI().startFollow(this);
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java
index 6acaa3b2c4..af55ea1679 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java
@@ -376,24 +376,24 @@ class OlympiadGame
_playerOne.setTarget(null);
_playerTwo.setTarget(null);
- _playerOne.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2], false);
+ _playerOne.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2]);
// teleport summon to
if (_playerOne.getPet() != null)
{
final Summon summon = _playerOne.getPet();
if (summon instanceof SummonInstance)
{
- summon.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2], false);
+ summon.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2]);
}
}
- _playerTwo.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2], false);
+ _playerTwo.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2]);
// teleport summon to
if (_playerTwo.getPet() != null)
{
final Summon summon = _playerTwo.getPet();
if (summon instanceof SummonInstance)
{
- summon.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2], false);
+ summon.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2]);
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 659637446b..2dd0444fc7 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -18,10 +18,6 @@ package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.model.WorldObject;
-/**
- * format dddd sample 0000: 3a 69 08 10 48 02 c1 00 00 f7 56 00 00 89 ea ff :i..H.....V..... 0010: ff 0c b2 d8 61 ....a
- * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
- */
public class TeleportToLocation extends GameServerPacket
{
private final int _targetObjId;
@@ -29,29 +25,16 @@ public class TeleportToLocation extends GameServerPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- /**
- * @param obj
- * @param x
- * @param y
- * @param z
- */
- public TeleportToLocation(WorldObject obj, int x, int y, int z)
- {
- _targetObjId = obj.getObjectId();
- _x = x;
- _y = y;
- _z = z;
- _heading = obj.getPosition().getHeading();
- }
-
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -62,7 +45,7 @@ public class TeleportToLocation extends GameServerPacket
writeD(_x);
writeD(_y);
writeD(_z);
- writeD(0x00); // isValidation ??
- writeD(_heading); // nYaw
+ writeD(_instant ? 0x01 : 0x00);
+ writeD(_heading);
}
}
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java
index fe13afa173..aa5e11cf79 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/IceFairySirra.java
@@ -312,7 +312,7 @@ public class IceFairySirra extends Quest
{
for (PlayerInstance pc : player.getParty().getPartyMembers())
{
- pc.teleToLocation(113533, -126159, -3488, false);
+ pc.teleToLocation(113533, -126159, -3488);
if (_freyasZone == null)
{
LOGGER.warning("IceFairySirraManager: Failed to load zone");
diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java
index 6382a78591..59720810f4 100644
--- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java
+++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Orfen.java
@@ -183,7 +183,7 @@ public class Orfen extends Quest
npc.getSpawn().setX(55024);
npc.getSpawn().setY(17368);
npc.getSpawn().setZ(-5412);
- npc.teleToLocation(55024, 17368, -5412, false);
+ npc.teleToLocation(55024, 17368, -5412);
break;
}
default:
@@ -211,7 +211,7 @@ public class Orfen extends Quest
npc.getSpawn().setX(43577);
npc.getSpawn().setY(15985);
npc.getSpawn().setZ(-4396);
- npc.teleToLocation(43577, 15985, -4396, false);
+ npc.teleToLocation(43577, 15985, -4396);
startQuestTimer("ORFEN_REFRESH", 10000, npc, null);
}
else if (npc.isInsideRadius2D(attacker, 1000) && !npc.isInsideRadius2D(attacker, 300) && (Rnd.get(10) == 0))
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java
index f76299676c..39f38fc868 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/NpcWalkerAI.java
@@ -115,8 +115,8 @@ public class NpcWalkerAI extends CreatureAI implements Runnable
final int destinationX = _route.get(_currentPos).getMoveX();
final int destinationY = _route.get(_currentPos).getMoveY();
final int destinationZ = _route.get(_currentPos).getMoveZ();
+ getActor().teleToLocation(destinationX, destinationY, destinationZ);
- getActor().teleToLocation(destinationX, destinationY, destinationZ, false);
super.onEvtArrivedBlocked(location);
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java
index 628d571ea7..d0055aed53 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTeleport.java
@@ -418,7 +418,7 @@ public class AdminTeleport implements IAdminCommandHandler
}
}
- activeChar.teleToLocation(x, y, z, false);
+ activeChar.teleToLocation(x, y, z);
showTeleportWindow(activeChar);
return true;
@@ -482,7 +482,7 @@ public class AdminTeleport implements IAdminCommandHandler
private void teleportTo(PlayerInstance activeChar, int x, int y, int z)
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- activeChar.teleToLocation(x, y, z, false);
+ activeChar.teleToLocation(x, y, z);
BuilderUtil.sendSysMessage(activeChar, "You have been teleported to " + x + " " + y + " " + z);
}
@@ -548,7 +548,7 @@ public class AdminTeleport implements IAdminCommandHandler
final int y = player.getY();
final int z = player.getZ();
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- activeChar.teleToLocation(x, y, z, true);
+ activeChar.teleToLocation(x, y, z);
BuilderUtil.sendSysMessage(activeChar, "You have teleported to character " + player.getName() + ".");
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java
index 15168957c5..704441d59a 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/CTF.java
@@ -1077,7 +1077,7 @@ public class CTF implements EventTask
{
if (player.isOnline())
{
- player.teleToLocation(_npcX, _npcY, _npcZ, false);
+ player.teleToLocation(_npcX, _npcY, _npcZ);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/DM.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/DM.java
index e9ad699b23..96b35e6cd8 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/DM.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/DM.java
@@ -1001,7 +1001,7 @@ public class DM implements EventTask
{
if (player.isOnline())
{
- player.teleToLocation(_npcX, _npcY, _npcZ, false);
+ player.teleToLocation(_npcX, _npcY, _npcZ);
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java
index ce5c201c02..e8934274ba 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/events/TvT.java
@@ -1013,7 +1013,7 @@ public class TvT implements EventTask
{
if (player.isOnline())
{
- player.teleToLocation(_npcX, _npcY, _npcZ, false);
+ player.teleToLocation(_npcX, _npcY, _npcZ);
}
else
{
@@ -2600,8 +2600,8 @@ public class TvT implements EventTask
playerToKick.setTitle(playerToKick._originalTitleTvT);
playerToKick.broadcastUserInfo();
playerToKick.sendMessage("You have been kicked from the TvT.");
- playerToKick.teleToLocation(_npcX, _npcY, _npcZ, false);
- playerToKick.teleToLocation((_npcX + Rnd.get(201)) - 100, (_npcY + Rnd.get(201)) - 100, _npcZ, false);
+ playerToKick.teleToLocation(_npcX, _npcY, _npcZ);
+ playerToKick.teleToLocation((_npcX + Rnd.get(201)) - 100, (_npcY + Rnd.get(201)) - 100, _npcZ);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java
index e8e841c1a7..e5fbed6950 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java
@@ -69,7 +69,7 @@ public class ObjectPosition
LOGGER.warning("Object Id at bad coords: (x: " + getWorldPosition().getX() + ", y: " + getWorldPosition().getY() + ", z: " + getWorldPosition().getZ() + ").");
if (_activeObject instanceof PlayerInstance)
{
- ((PlayerInstance) _activeObject).teleToLocation(0, 0, 0, false);
+ ((PlayerInstance) _activeObject).teleToLocation(0, 0, 0);
((PlayerInstance) _activeObject).sendMessage("Error with your coords, Please ask a GM for help!");
}
else if (_activeObject instanceof Creature)
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java
index f6dcc8f7dc..f34b0ba0bb 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -349,7 +349,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
if ((pet != null) && (pos != null))
{
pet.setFollowStatus(false);
- pet.teleToLocation(pos.getX() + Rnd.get(-100, 100), pos.getY() + Rnd.get(-100, 100), pos.getZ(), false);
+ pet.teleToLocation(pos.getX() + Rnd.get(-100, 100), pos.getY() + Rnd.get(-100, 100), pos.getZ());
pet.setFollowStatus(true);
}
}
@@ -542,8 +542,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
* @param yValue the y
* @param zValue the z
* @param allowRandomOffset the allow random offset
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset)
+ public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset, boolean instant)
{
if (Config.TW_DISABLE_GK)
{
@@ -589,7 +590,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
z += 5;
// Send a Server->Client packet TeleportToLocationt to the Creature AND to all PlayerInstance in the _KnownPlayers of the Creature
- broadcastPacket(new TeleportToLocation(this, x, y, z));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, getHeading(), instant));
// remove the object from its old location
decayMe();
@@ -604,26 +605,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
revalidateZone(true);
}
- /**
- * Revalidate zone.
- * @param force the force
- */
- public void revalidateZone(boolean force)
+ public void teleToLocation(int x, int y, int z, boolean allowRandomOffset)
{
- final WorldRegion region = getWorldRegion();
- if (region == null)
- {
- return;
- }
-
- // This function is called too often from movement code.
- if (!force && (calculateDistanceSq3D(_lastZoneValidateLocation.getX(), _lastZoneValidateLocation.getY(), _lastZoneValidateLocation.getZ()) < (isNpc() && !isInCombat() ? Config.MAX_DRIFT_RANGE * Config.MAX_DRIFT_RANGE : 10000)))
- {
- return;
- }
- _lastZoneValidateLocation.setXYZ(getX(), getY(), getZ());
-
- region.revalidateZones(this);
+ teleToLocation(x, y, z, allowRandomOffset, false);
}
/**
@@ -673,6 +657,38 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
teleToLocation(MapRegionData.getInstance().getTeleToLocation(this, teleportWhere), true);
}
+ public void teleToLocationInstant(Location loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), false, true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, false, true);
+ }
+
+ /**
+ * Revalidate zone.
+ * @param force the force
+ */
+ public void revalidateZone(boolean force)
+ {
+ final WorldRegion region = getWorldRegion();
+ if (region == null)
+ {
+ return;
+ }
+
+ // This function is called too often from movement code.
+ if (!force && (calculateDistanceSq3D(_lastZoneValidateLocation.getX(), _lastZoneValidateLocation.getY(), _lastZoneValidateLocation.getZ()) < (isNpc() && !isInCombat() ? Config.MAX_DRIFT_RANGE * Config.MAX_DRIFT_RANGE : 10000)))
+ {
+ return;
+ }
+ _lastZoneValidateLocation.setXYZ(getX(), getY(), getZ());
+
+ region.revalidateZones(this);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
@@ -6559,7 +6575,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
{
LOGGER.warning("Player " + getName() + " at bad coords: (x: " + getX() + ", y: " + getY() + ", z: " + getZ() + ").");
((PlayerInstance) this).sendMessage("Error with your coordinates! Please reboot your game fully!");
- ((PlayerInstance) this).teleToLocation(80753, 145481, -3532, false); // Near Giran luxury shop
+ ((PlayerInstance) this).teleToLocation(80753, 145481, -3532); // Near Giran luxury shop
}
else
{
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java
index 1421b4a255..6f48dd72b5 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java
@@ -209,7 +209,7 @@ public class BoatInstance extends Creature
}
else
{
- player.teleToLocation(pathA.ntx, pathA.nty, pathA.ntz, false);
+ player.teleToLocation(pathA.ntx, pathA.nty, pathA.ntz);
}
}
}
@@ -242,7 +242,7 @@ public class BoatInstance extends Creature
}
else
{
- player.teleToLocation(pathB.ntx, pathB.nty, pathB.ntz, false);
+ player.teleToLocation(pathB.ntx, pathB.nty, pathB.ntz);
}
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java
index 1b9962fdc3..10c93c0ab6 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/CastleMagicianInstance.java
@@ -107,7 +107,7 @@ public class CastleMagicianInstance extends NpcInstance
return;
}
- player.teleToLocation(clanLeader.getX(), clanLeader.getY(), clanLeader.getZ(), false);
+ player.teleToLocation(clanLeader.getX(), clanLeader.getY(), clanLeader.getZ());
return;
}
final String filename = "data/html/castlemagician/magician-nogate.htm";
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java
index 7b74273b6f..badf689022 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/MonsterInstance.java
@@ -75,7 +75,7 @@ public class MonsterInstance extends Attackable
final Spawn mobSpawn = getSpawn();
if (!isInCombat() && !isAlikeDead() && !isDead() && (mobSpawn != null) && !isInsideRadius2D(mobSpawn.getX(), mobSpawn.getY(), mobSpawn.getZ(), Config.MAX_DRIFT_RANGE))
{
- teleToLocation(mobSpawn.getX(), mobSpawn.getY(), mobSpawn.getZ(), false);
+ teleToLocation(mobSpawn.getX(), mobSpawn.getY(), mobSpawn.getZ());
}
}, Config.MONSTER_RETURN_DELAY * 1000);
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index c103046708..26b0ce272b 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -5824,7 +5824,7 @@ public class PlayerInstance extends Playable
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
ThreadPool.schedule(() ->
{
- teleToLocation((TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, (TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)), false);
+ teleToLocation((TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, (TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)) + Rnd.get(201)) - 100, TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)));
doRevive();
}, Config.TVT_REVIVE_DELAY);
}
@@ -5836,7 +5836,7 @@ public class PlayerInstance extends Playable
sendMessage("You will be revived and teleported to team spot in " + (Config.TVT_REVIVE_DELAY / 1000) + " seconds!");
ThreadPool.schedule(() ->
{
- teleToLocation(TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)), false);
+ teleToLocation(TvT._teamsX.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsY.get(TvT._teams.indexOf(_teamNameTvT)), TvT._teamsZ.get(TvT._teams.indexOf(_teamNameTvT)));
doRevive();
broadcastPacket(new SocialAction(getObjectId(), 15));
}, Config.TVT_REVIVE_DELAY);
@@ -5853,7 +5853,7 @@ public class PlayerInstance extends Playable
}
ThreadPool.schedule(() ->
{
- teleToLocation(CTF._teamsX.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsY.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsZ.get(CTF._teams.indexOf(_teamNameCTF)), false);
+ teleToLocation(CTF._teamsX.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsY.get(CTF._teams.indexOf(_teamNameCTF)), CTF._teamsZ.get(CTF._teams.indexOf(_teamNameCTF)));
doRevive();
}, 20000);
}
@@ -5878,7 +5878,7 @@ public class PlayerInstance extends Playable
ThreadPool.schedule(() ->
{
final Location ploc = DM.getPlayersSpawnLocation();
- teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ(), false);
+ teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ());
doRevive();
}, Config.DM_REVIVE_DELAY);
}
@@ -5891,7 +5891,7 @@ public class PlayerInstance extends Playable
ThreadPool.schedule(() ->
{
final Location ploc = DM.getPlayersSpawnLocation();
- teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ(), false);
+ teleToLocation(ploc.getX(), ploc.getY(), ploc.getZ());
doRevive();
}, 20000);
}
@@ -11130,7 +11130,7 @@ public class PlayerInstance extends Playable
sendPacket(new ObservationMode(x, y, z));
getKnownList().removeAllKnownObjects(); // reinit knownlist
setXYZ(x, y, z);
- teleToLocation(x, y, z, false);
+ teleToLocation(x, y, z);
broadcastUserInfo();
}
@@ -11176,7 +11176,7 @@ public class PlayerInstance extends Playable
_wasInvisible = getAppearance().isInvisible();
getAppearance().setInvisible();
- teleToLocation(x, y, z, false);
+ teleToLocation(x, y, z);
sendPacket(new ExOlympiadMode(3, this));
broadcastUserInfo();
}
@@ -12984,7 +12984,7 @@ public class PlayerInstance extends Playable
if (getTrainedBeast() != null)
{
getTrainedBeast().getAI().stopFollow();
- getTrainedBeast().teleToLocation(getPosition().getX() + Rnd.get(-100, 100), getPosition().getY() + Rnd.get(-100, 100), getPosition().getZ(), false);
+ getTrainedBeast().teleToLocation(getPosition().getX() + Rnd.get(-100, 100), getPosition().getY() + Rnd.get(-100, 100), getPosition().getZ());
getTrainedBeast().getAI().startFollow(this);
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java
index 457e43d15f..a3dfba5c90 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGame.java
@@ -376,24 +376,24 @@ class OlympiadGame
_playerOne.setTarget(null);
_playerTwo.setTarget(null);
- _playerOne.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2], false);
+ _playerOne.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2]);
// teleport summon to
if (_playerOne.getPet() != null)
{
final Summon summon = _playerOne.getPet();
if (summon instanceof SummonInstance)
{
- summon.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2], false);
+ summon.teleToLocation(_stadiumPort[0] + 900, _stadiumPort[1], _stadiumPort[2]);
}
}
- _playerTwo.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2], false);
+ _playerTwo.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2]);
// teleport summon to
if (_playerTwo.getPet() != null)
{
final Summon summon = _playerTwo.getPet();
if (summon instanceof SummonInstance)
{
- summon.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2], false);
+ summon.teleToLocation(_stadiumPort[0] - 900, _stadiumPort[1], _stadiumPort[2]);
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 659637446b..2dd0444fc7 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -18,10 +18,6 @@ package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.model.WorldObject;
-/**
- * format dddd sample 0000: 3a 69 08 10 48 02 c1 00 00 f7 56 00 00 89 ea ff :i..H.....V..... 0010: ff 0c b2 d8 61 ....a
- * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
- */
public class TeleportToLocation extends GameServerPacket
{
private final int _targetObjId;
@@ -29,29 +25,16 @@ public class TeleportToLocation extends GameServerPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- /**
- * @param obj
- * @param x
- * @param y
- * @param z
- */
- public TeleportToLocation(WorldObject obj, int x, int y, int z)
- {
- _targetObjId = obj.getObjectId();
- _x = x;
- _y = y;
- _z = z;
- _heading = obj.getPosition().getHeading();
- }
-
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -62,7 +45,7 @@ public class TeleportToLocation extends GameServerPacket
writeD(_x);
writeD(_y);
writeD(_z);
- writeD(0x00); // isValidation ??
- writeD(_heading); // nYaw
+ writeD(_instant ? 0x01 : 0x00);
+ writeD(_heading);
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 25c96e50ff..48eb520990 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -73,7 +72,6 @@ public class Blink extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java
index 53041adad7..b38203681a 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java
@@ -24,7 +24,6 @@ import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Enemy Charge effect implementation.
@@ -92,9 +91,6 @@ public class EnemyCharge extends AbstractEffect
final int z = info.getEffected().getZ();
final Location destination = GeoEngine.getInstance().getValidLocation(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
info.getEffector().broadcastPacket(new FlyToLocation(info.getEffector(), destination, FlyType.CHARGE));
-
- // maybe is need force set X,Y,Z
- info.getEffector().setXYZ(destination);
- info.getEffector().broadcastPacket(new ValidateLocation(info.getEffector()));
+ info.getEffector().teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index 71fcae3db6..3e1698ba01 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,7 +86,6 @@ public class TeleportToTarget extends AbstractEffect
creature.broadcastPacket(new FlyToLocation(creature, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
creature.abortAttack();
creature.abortCast();
- creature.setXYZ(loc);
- creature.broadcastPacket(new ValidateLocation(creature));
+ creature.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java
index f1616cbeed..96d99ee20d 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.effects.EffectFlag;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -95,8 +94,6 @@ public class ThrowUp extends AbstractEffect
final int z = info.getEffected().getZ();
final Location destination = GeoEngine.getInstance().getValidLocation(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
info.getEffected().broadcastPacket(new FlyToLocation(info.getEffected(), destination, FlyType.THROW_UP));
- // TODO: Review.
- info.getEffected().setXYZ(destination);
- info.getEffected().broadcastPacket(new ValidateLocation(info.getEffected()));
+ info.getEffected().teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 6e405e1cd0..8a8c72080b 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -680,8 +680,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param headingValue
* @param instanceId
* @param randomOffset
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, int instanceId, int randomOffset)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, int instanceId, int randomOffset, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -713,7 +714,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send a Server->Client packet TeleportToLocationt to the Creature AND to all PlayerInstance in the _KnownPlayers of the Creature
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -738,52 +739,52 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z, int heading, int instanceId, boolean randomOffset)
{
- teleToLocation(x, y, z, heading, instanceId, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(x, y, z, heading, instanceId, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(int x, int y, int z, int heading, int instanceId)
{
- teleToLocation(x, y, z, heading, instanceId, 0);
+ teleToLocation(x, y, z, heading, instanceId, 0, false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
{
- teleToLocation(x, y, z, heading, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(x, y, z, heading, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, -1, 0);
+ teleToLocation(x, y, z, heading, -1, 0, false);
}
public void teleToLocation(int x, int y, int z, boolean randomOffset)
{
- teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, -1, 0);
+ teleToLocation(x, y, z, 0, -1, 0, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset, false);
}
public void teleToLocation(ILocational loc, int instanceId, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset, false);
}
public void teleToLocation(ILocational loc, boolean randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(ILocational loc)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0, false);
}
public void teleToLocation(TeleportWhereType teleportWhere)
@@ -791,6 +792,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceId(), 0, true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceId(), 0, true);
+ }
+
private boolean canUseRangeWeapon()
{
if (isTransformed())
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 8fed320f50..b8ad391281 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -902,7 +902,7 @@ public abstract class Summon extends Playable
public synchronized void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index ca56651a12..6c5c1c0313 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,26 +27,29 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.TELEPORT_TO_LOCATION.writeId(packet);
+
packet.writeD(_targetObjId);
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
- packet.writeD(_heading); // nYaw
+ packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(_heading);
return true;
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 25c96e50ff..48eb520990 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -73,7 +72,6 @@ public class Blink extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java
index 53041adad7..b38203681a 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/EnemyCharge.java
@@ -24,7 +24,6 @@ import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Enemy Charge effect implementation.
@@ -92,9 +91,6 @@ public class EnemyCharge extends AbstractEffect
final int z = info.getEffected().getZ();
final Location destination = GeoEngine.getInstance().getValidLocation(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
info.getEffector().broadcastPacket(new FlyToLocation(info.getEffector(), destination, FlyType.CHARGE));
-
- // maybe is need force set X,Y,Z
- info.getEffector().setXYZ(destination);
- info.getEffector().broadcastPacket(new ValidateLocation(info.getEffector()));
+ info.getEffector().teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index 71fcae3db6..3e1698ba01 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.effects.EffectType;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,7 +86,6 @@ public class TeleportToTarget extends AbstractEffect
creature.broadcastPacket(new FlyToLocation(creature, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
creature.abortAttack();
creature.abortCast();
- creature.setXYZ(loc);
- creature.broadcastPacket(new ValidateLocation(creature));
+ creature.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java
index f1616cbeed..96d99ee20d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/ThrowUp.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.effects.EffectFlag;
import org.l2jmobius.gameserver.model.skills.BuffInfo;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -95,8 +94,6 @@ public class ThrowUp extends AbstractEffect
final int z = info.getEffected().getZ();
final Location destination = GeoEngine.getInstance().getValidLocation(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
info.getEffected().broadcastPacket(new FlyToLocation(info.getEffected(), destination, FlyType.THROW_UP));
- // TODO: Review.
- info.getEffected().setXYZ(destination);
- info.getEffected().broadcastPacket(new ValidateLocation(info.getEffected()));
+ info.getEffected().teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Duel.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Duel.java
index 85bbbd0e18..6b01393987 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Duel.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/Duel.java
@@ -627,13 +627,13 @@ public class Duel
final Location spawn1 = spawns.get(Rnd.get(spawns.size() / 2));
for (PlayerInstance temp : _playerA.getParty().getMembers())
{
- temp.teleToLocation(spawn1.getX(), spawn1.getY(), spawn1.getZ(), 0, _duelInstanceId, 0);
+ temp.teleToLocation(spawn1.getX(), spawn1.getY(), spawn1.getZ(), 0, _duelInstanceId, 0, false);
}
final Location spawn2 = spawns.get(Rnd.get(spawns.size() / 2, spawns.size()));
for (PlayerInstance temp : _playerB.getParty().getMembers())
{
- temp.teleToLocation(spawn2.getX(), spawn2.getY(), spawn2.getZ(), 0, _duelInstanceId, 0);
+ temp.teleToLocation(spawn2.getX(), spawn2.getY(), spawn2.getZ(), 0, _duelInstanceId, 0, false);
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 675e7e0bed..c9be1e1e32 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -681,8 +681,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param headingValue
* @param instanceId
* @param randomOffset
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, int instanceId, int randomOffset)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, int instanceId, int randomOffset, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -714,7 +715,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send a Server->Client packet TeleportToLocationt to the Creature AND to all PlayerInstance in the _KnownPlayers of the Creature
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -739,52 +740,52 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z, int heading, int instanceId, boolean randomOffset)
{
- teleToLocation(x, y, z, heading, instanceId, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(x, y, z, heading, instanceId, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(int x, int y, int z, int heading, int instanceId)
{
- teleToLocation(x, y, z, heading, instanceId, 0);
+ teleToLocation(x, y, z, heading, instanceId, 0, false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
{
- teleToLocation(x, y, z, heading, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(x, y, z, heading, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, -1, 0);
+ teleToLocation(x, y, z, heading, -1, 0, false);
}
public void teleToLocation(int x, int y, int z, boolean randomOffset)
{
- teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, -1, 0);
+ teleToLocation(x, y, z, 0, -1, 0, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset, false);
}
public void teleToLocation(ILocational loc, int instanceId, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset, false);
}
public void teleToLocation(ILocational loc, boolean randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
}
public void teleToLocation(ILocational loc)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0, false);
}
public void teleToLocation(TeleportWhereType teleportWhere)
@@ -792,6 +793,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceId(), 0, true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceId(), 0, true);
+ }
+
private boolean canUseRangeWeapon()
{
if (isTransformed())
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Summon.java
index c50618d10e..dd11f35ba8 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -902,7 +902,7 @@ public abstract class Summon extends Playable
public synchronized void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index ca56651a12..6c5c1c0313 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,26 +27,29 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.TELEPORT_TO_LOCATION.writeId(packet);
+
packet.writeD(_targetObjId);
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
- packet.writeD(_heading); // nYaw
+ packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(_heading);
return true;
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java
index dff2fac97e..8a47fb6db5 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 4b09eca1d7..f81763e046 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java
index dff2fac97e..8a47fb6db5 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 4b09eca1d7..f81763e046 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 740b976689..c074c8577f 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 4b09eca1d7..f81763e046 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java
index e6334f06a3..0286dd74d8 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -759,8 +759,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -809,7 +810,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -842,17 +843,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +880,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +890,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,6 +923,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Summon.java
index be89eb6407..97315aaca1 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java
index e6334f06a3..0286dd74d8 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -759,8 +759,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -809,7 +810,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -842,17 +843,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +880,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +890,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,6 +923,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Summon.java
index be89eb6407..97315aaca1 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 762fd8bce4..5005beeb90 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -759,8 +759,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -809,7 +810,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -842,17 +843,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +880,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +890,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,6 +923,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 122aa8bea5..025ac75c4f 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
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 e4e937ef41..d160490e1b 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
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java
index dff2fac97e..8a47fb6db5 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -758,8 +758,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -808,7 +809,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -841,17 +842,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -878,7 +879,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -888,7 +889,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -921,6 +922,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 4b09eca1d7..f81763e046 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 3a93b7eb58..cef4c4ff5e 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -759,8 +759,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -812,7 +813,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -845,17 +846,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -882,7 +883,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -892,7 +893,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -925,6 +926,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Summon.java
index b728a4d008..83c01f65aa 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/Blink.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/Blink.java
index 22697e8e20..9728e3a3e2 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/Blink.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/Blink.java
@@ -26,7 +26,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -92,8 +91,6 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
index e4e937ef41..d160490e1b 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/BlinkSwap.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* This Blink effect switches the location of the caster and the target.
@@ -55,15 +54,12 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(effectedLoc);
- effector.broadcastPacket(new ValidateLocation(effector));
+ effector.teleToLocationInstant(effectedLoc);
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(effectorLoc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effectorLoc);
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
index 55c2e78d8a..612b686f5e 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/FlyAway.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Throw Up effect implementation.
@@ -60,8 +59,6 @@ public class FlyAway extends AbstractEffect
final Location destination = GeoEngine.getInstance().getValidLocation(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceWorld());
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.THROW_UP));
- effected.setXYZ(destination);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(destination);
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
index 89ad8670dc..284a8aef38 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/KnockBack.java
@@ -33,7 +33,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -141,9 +140,7 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.setXYZ(loc);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(loc);
}
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/PullBack.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
index 38fe2fe9d0..83aee45ed9 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/PullBack.java
@@ -25,7 +25,6 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* An effect that pulls effected target back to the effector.
@@ -76,9 +75,7 @@ public class PullBack extends AbstractEffect
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
- effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
- effected.broadcastPacket(new ValidateLocation(effected), false);
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
}
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
index 338375d841..73f5e0ddf8 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToNpc.java
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
/**
* Teleport player/party to summoned npc effect implementation.
@@ -95,9 +94,7 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.setXYZ(location);
- effected.broadcastPacket(new ValidateLocation(effected));
- effected.revalidateZone(true);
+ effected.teleToLocationInstant(location);
}
else
{
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
index 813e496c47..2813bfe22e 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToSummon.java
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -87,14 +86,12 @@ public class TeleportToSummon extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = summon.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
index c9dc34ac22..44b4f91cee 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/scripts/handlers/effecthandlers/TeleportToTarget.java
@@ -27,7 +27,6 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation.FlyType;
-import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
import org.l2jmobius.gameserver.util.Util;
/**
@@ -76,14 +75,12 @@ public class TeleportToTarget extends AbstractEffect
final int y = (int) (py + (25 * Math.sin(ph)));
final int z = effected.getZ();
- final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z,effector.getInstanceWorld());
+ final Location loc = GeoEngine.getInstance().getValidLocation(effector.getX(), effector.getY(), effector.getZ(), x, y, z, effector.getInstanceWorld());
effector.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effector.broadcastPacket(new FlyToLocation(effector, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.setXYZ(loc);
- effector.broadcastPacket(new ValidateLocation(effector));
- effected.revalidateZone(true);
+ effector.teleToLocationInstant(loc);
}
}
diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java
index 8534b777e3..d527b109e6 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Creature.java
@@ -759,8 +759,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
* @param zValue
* @param headingValue
* @param instanceValue
+ * @param instant
*/
- public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue, boolean instant)
{
int x = xValue;
int y = yValue;
@@ -812,7 +813,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
z += 5;
// Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
// remove the object from its old location
decayMe();
@@ -845,17 +846,17 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld());
+ teleToLocation(x, y, z, 0, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance);
+ teleToLocation(x, y, z, 0, instance, false);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld());
+ teleToLocation(x, y, z, heading, getInstanceWorld(), false);
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -882,7 +883,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
- teleToLocation(x, y, z, heading, instance);
+ teleToLocation(x, y, z, heading, instance, false);
}
public void teleToLocation(ILocational loc)
@@ -892,7 +893,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
public void teleToLocation(ILocational loc, Instance instance)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance, false);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -925,6 +926,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, teleportWhere), true, instance);
}
+ public void teleToLocationInstant(ILocational loc)
+ {
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), getHeading() /* Use the current heading */, getInstanceWorld(), true);
+ }
+
+ public void teleToLocationInstant(int x, int y, int z)
+ {
+ teleToLocation(x, y, z, getHeading(), getInstanceWorld(), true);
+ }
+
/**
* Launch a physical attack against a target (Simple, Bow, Pole or Dual).
*
diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Summon.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Summon.java
index 6ed43c885f..ffdae9291a 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Summon.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/actor/Summon.java
@@ -890,7 +890,7 @@ public abstract class Summon extends Playable
public void onTeleported()
{
super.onTeleported();
- sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading(), false));
}
@Override
diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
index 7847ef46dd..d6dcd01604 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/TeleportToLocation.java
@@ -27,14 +27,16 @@ public class TeleportToLocation implements IClientOutgoingPacket
private final int _y;
private final int _z;
private final int _heading;
+ private final boolean _instant;
- public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading, boolean instant)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
+ _instant = instant;
}
@Override
@@ -46,7 +48,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(0x00); // isValidation ??
+ packet.writeD(_instant ? 0x01 : 0x00);
packet.writeD(_heading);
packet.writeD(0x00); // Unknown
return true;