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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 54c45d9e14..e4759b6e05 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 54c45d9e14..e4759b6e05 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 fade6a2140..f3759cf259 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 fade6a2140..f3759cf259 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 6d8d0cef30..8979c5a98a 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 6d8d0cef30..8979c5a98a 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 6d8d0cef30..8979c5a98a 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 2f9f91736f..919cda941e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 88b3fc8cae..2c3bbe56d7 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 1a87fe47b3..ad18df7166 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 88b3fc8cae..2c3bbe56d7 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 1a87fe47b3..ad18df7166 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 3f7293d2db..14809ac499 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,6 +41,7 @@ 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;
/**
@@ -186,7 +187,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 88b3fc8cae..2c3bbe56d7 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 1a87fe47b3..ad18df7166 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ packet.writeD(0x00); // Unknown.
return true;
}
}
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 a4facf2609..4a7d962ba9 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
@@ -540,9 +540,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset)
{
if (Config.TW_DISABLE_GK)
{
@@ -560,15 +559,15 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
}
}
- // Stop movement
+ // Abort any client actions, casting and remove target.
stopMove(null, false);
abortAttack();
abortCast();
-
- setTeleporting(true);
setTarget(null);
- // Remove from world regions zones
+ setTeleporting(true);
+
+ // Remove from world regions zones.
final WorldRegion region = getWorldRegion();
if (region != null)
{
@@ -577,6 +576,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
+ // Remove the object from its old location.
+ decayMe();
+
+ // Adjust position a bit.
int x = xValue;
int y = yValue;
int z = zValue;
@@ -587,15 +590,13 @@ 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, getHeading(), instant));
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, getHeading()));
- // remove the object from its old location
- decayMe();
-
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
getPosition().setXYZ(x, y, z);
- if (!(this instanceof PlayerInstance))
+
+ if (!isPlayer())
{
onTeleported();
}
@@ -603,11 +604,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
revalidateZone(true);
}
- public void teleToLocation(int x, int y, int z, boolean allowRandomOffset)
- {
- teleToLocation(x, y, z, allowRandomOffset, false);
- }
-
/**
* Tele to location.
* @param x the x
@@ -655,16 +651,6 @@ 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
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 7f27a041f0..26911af582 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -111,10 +111,6 @@ public class ValidatePosition extends GameClientPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 2dd0444fc7..87f54fcb89 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
@@ -25,16 +25,14 @@ public class TeleportToLocation extends GameServerPacket
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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -45,7 +43,7 @@ public class TeleportToLocation extends GameServerPacket
writeD(_x);
writeD(_y);
writeD(_z);
- writeD(_instant ? 0x01 : 0x00);
+ writeD(0x00); // Fade 0, Instant 1.
writeD(_heading);
}
}
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 f34b0ba0bb..f86b9bcfc9 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
@@ -542,9 +542,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, boolean allowRandomOffset)
{
if (Config.TW_DISABLE_GK)
{
@@ -562,15 +561,15 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
}
}
- // Stop movement
+ // Abort any client actions, casting and remove target.
stopMove(null, false);
abortAttack();
abortCast();
-
- setTeleporting(true);
setTarget(null);
- // Remove from world regions zones
+ setTeleporting(true);
+
+ // Remove from world regions zones.
final WorldRegion region = getWorldRegion();
if (region != null)
{
@@ -579,6 +578,10 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
+ // Remove the object from its old location.
+ decayMe();
+
+ // Adjust position a bit.
int x = xValue;
int y = yValue;
int z = zValue;
@@ -589,15 +592,13 @@ 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, getHeading(), instant));
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, getHeading()));
- // remove the object from its old location
- decayMe();
-
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
getPosition().setXYZ(x, y, z);
- if (!(this instanceof PlayerInstance))
+
+ if (!isPlayer())
{
onTeleported();
}
@@ -605,11 +606,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
revalidateZone(true);
}
- public void teleToLocation(int x, int y, int z, boolean allowRandomOffset)
- {
- teleToLocation(x, y, z, allowRandomOffset, false);
- }
-
/**
* Tele to location.
* @param x the x
@@ -657,16 +653,6 @@ 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
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 7f27a041f0..26911af582 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -111,10 +111,6 @@ public class ValidatePosition extends GameClientPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 2dd0444fc7..87f54fcb89 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
@@ -25,16 +25,14 @@ public class TeleportToLocation extends GameServerPacket
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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -45,7 +43,7 @@ public class TeleportToLocation extends GameServerPacket
writeD(_x);
writeD(_y);
writeD(_z);
- writeD(_instant ? 0x01 : 0x00);
+ writeD(0x00); // Fade 0, Instant 1.
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 48eb520990..25c96e50ff 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,6 +26,7 @@ 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;
/**
@@ -72,6 +73,7 @@ public class Blink extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
}
}
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 b38203681a..91862f331b 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,6 +24,7 @@ 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.
@@ -91,6 +92,7 @@ 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));
- info.getEffector().teleToLocationInstant(destination);
+ info.getEffector().setXYZ(destination);
+ info.getEffector().broadcastPacket(new ValidateLocation(info.getEffector()));
}
}
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 3e1698ba01..71fcae3db6 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,6 +27,7 @@ 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;
/**
@@ -86,6 +87,7 @@ public class TeleportToTarget extends AbstractEffect
creature.broadcastPacket(new FlyToLocation(creature, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
creature.abortAttack();
creature.abortCast();
- creature.teleToLocationInstant(loc);
+ creature.setXYZ(loc);
+ creature.broadcastPacket(new ValidateLocation(creature));
}
}
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 96d99ee20d..587f7cae1c 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,6 +25,7 @@ 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.
@@ -94,6 +95,7 @@ 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));
- info.getEffected().teleToLocationInstant(destination);
+ info.getEffected().setXYZ(destination);
+ info.getEffected().broadcastPacket(new ValidateLocation(info.getEffected()));
}
}
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 8a8c72080b..2cd0b067e3 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,55 +680,56 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, int instanceId, int randomOffset)
{
int x = xValue;
int y = yValue;
int z = zValue;
int heading = headingValue;
- setInstanceId(instanceId);
-
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
}
+ // Abort any client actions, casting and remove target.
stopMove(null);
abortAttack();
abortCast();
+ setTarget(null);
setTeleporting(true);
- setTarget(null);
getAI().setIntention(AI_INTENTION_ACTIVE);
+ // Remove the object from its old location.
+ decayMe();
+
+ // Adjust position a bit.
if (Config.OFFSET_ON_TELEPORT_ENABLED && (randomOffset > 0))
{
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
-
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, instant));
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
- // remove the object from its old location
- decayMe();
+ // Change instance id.
+ setInstanceId(instanceId);
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleports
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
@@ -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, false);
+ teleToLocation(x, y, z, heading, instanceId, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(int x, int y, int z, int heading, int instanceId)
{
- teleToLocation(x, y, z, heading, instanceId, 0, false);
+ teleToLocation(x, y, z, heading, instanceId, 0);
}
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, false);
+ teleToLocation(x, y, z, heading, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, -1, 0, false);
+ teleToLocation(x, y, z, heading, -1, 0);
}
public void teleToLocation(int x, int y, int z, boolean randomOffset)
{
- teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
+ teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, -1, 0, false);
+ teleToLocation(x, y, z, 0, -1, 0);
}
public void teleToLocation(ILocational loc, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset);
}
public void teleToLocation(ILocational loc, int instanceId, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset);
}
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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(ILocational loc)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0);
}
public void teleToLocation(TeleportWhereType teleportWhere)
@@ -792,16 +793,6 @@ 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 b8ad391281..8fed320f50 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 709397b56d..7da080ac56 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 6c5c1c0313..7ac753ba7b 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,7 +46,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
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 48eb520990..25c96e50ff 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,6 +26,7 @@ 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;
/**
@@ -72,6 +73,7 @@ public class Blink extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, destination, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
}
}
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 b38203681a..91862f331b 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,6 +24,7 @@ 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.
@@ -91,6 +92,7 @@ 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));
- info.getEffector().teleToLocationInstant(destination);
+ info.getEffector().setXYZ(destination);
+ info.getEffector().broadcastPacket(new ValidateLocation(info.getEffector()));
}
}
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 3e1698ba01..71fcae3db6 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,6 +27,7 @@ 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;
/**
@@ -86,6 +87,7 @@ public class TeleportToTarget extends AbstractEffect
creature.broadcastPacket(new FlyToLocation(creature, loc.getX(), loc.getY(), loc.getZ(), FlyType.DUMMY));
creature.abortAttack();
creature.abortCast();
- creature.teleToLocationInstant(loc);
+ creature.setXYZ(loc);
+ creature.broadcastPacket(new ValidateLocation(creature));
}
}
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 96d99ee20d..587f7cae1c 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,6 +25,7 @@ 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.
@@ -94,6 +95,7 @@ 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));
- info.getEffected().teleToLocationInstant(destination);
+ info.getEffected().setXYZ(destination);
+ info.getEffected().broadcastPacket(new ValidateLocation(info.getEffected()));
}
}
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 6b01393987..85bbbd0e18 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, false);
+ temp.teleToLocation(spawn1.getX(), spawn1.getY(), spawn1.getZ(), 0, _duelInstanceId, 0);
}
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, false);
+ temp.teleToLocation(spawn2.getX(), spawn2.getY(), spawn2.getZ(), 0, _duelInstanceId, 0);
}
}
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 c9be1e1e32..0c58228015 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,55 +681,56 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, int instanceId, int randomOffset)
{
int x = xValue;
int y = yValue;
int z = zValue;
int heading = headingValue;
- setInstanceId(instanceId);
-
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
}
+ // Abort any client actions, casting and remove target.
stopMove(null);
abortAttack();
abortCast();
+ setTarget(null);
setTeleporting(true);
- setTarget(null);
getAI().setIntention(AI_INTENTION_ACTIVE);
+ // Remove the object from its old location.
+ decayMe();
+
+ // Adjust position a bit.
if (Config.OFFSET_ON_TELEPORT_ENABLED && (randomOffset > 0))
{
x += Rnd.get(-randomOffset, randomOffset);
y += Rnd.get(-randomOffset, randomOffset);
}
-
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, instant));
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
- // remove the object from its old location
- decayMe();
+ // Change instance id.
+ setInstanceId(instanceId);
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleports
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
@@ -740,52 +741,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, false);
+ teleToLocation(x, y, z, heading, instanceId, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(int x, int y, int z, int heading, int instanceId)
{
- teleToLocation(x, y, z, heading, instanceId, 0, false);
+ teleToLocation(x, y, z, heading, instanceId, 0);
}
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, false);
+ teleToLocation(x, y, z, heading, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, -1, 0, false);
+ teleToLocation(x, y, z, heading, -1, 0);
}
public void teleToLocation(int x, int y, int z, boolean randomOffset)
{
- teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0, false);
+ teleToLocation(x, y, z, 0, -1, (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, -1, 0, false);
+ teleToLocation(x, y, z, 0, -1, 0);
}
public void teleToLocation(ILocational loc, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), randomOffset);
}
public void teleToLocation(ILocational loc, int instanceId, int randomOffset)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instanceId, randomOffset);
}
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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), (randomOffset) ? Config.MAX_OFFSET_ON_TELEPORT : 0);
}
public void teleToLocation(ILocational loc)
{
- teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), loc.getInstanceId(), 0);
}
public void teleToLocation(TeleportWhereType teleportWhere)
@@ -793,16 +794,6 @@ 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 dd11f35ba8..c50618d10e 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 709397b56d..7da080ac56 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 6c5c1c0313..7ac753ba7b 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,7 +46,7 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 8a47fb6db5..b4ffc3688f 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 f81763e046..4b09eca1d7 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 8a47fb6db5..b4ffc3688f 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 f81763e046..4b09eca1d7 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 c074c8577f..efa0272c71 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 f81763e046..4b09eca1d7 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 0286dd74d8..51d63e116e 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,9 +759,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -786,7 +785,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -806,54 +805,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -880,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -890,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -923,16 +922,6 @@ 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 97315aaca1..be89eb6407 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 0286dd74d8..51d63e116e 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,9 +759,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -786,7 +785,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -806,54 +805,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -880,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -890,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -923,16 +922,6 @@ 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 97315aaca1..be89eb6407 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 5005beeb90..fa71b739e9 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,9 +759,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -786,7 +785,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -806,54 +805,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -880,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -890,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -923,16 +922,6 @@ 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 025ac75c4f..122aa8bea5 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 8a47fb6db5..b4ffc3688f 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,9 +758,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -785,7 +784,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -805,54 +804,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -879,7 +878,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -889,7 +888,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -922,16 +921,6 @@ 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 f81763e046..4b09eca1d7 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 cef4c4ff5e..810c3d465f 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,9 +759,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -786,7 +785,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -809,54 +808,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -883,7 +882,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -893,7 +892,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -926,16 +925,6 @@ 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 83c01f65aa..b728a4d008 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ 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 9728e3a3e2..22697e8e20 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,6 +26,7 @@ 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;
/**
@@ -91,6 +92,8 @@ public class Blink extends AbstractEffect
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, destination, _flyType, _flySpeed, _flyDelay, _animationSpeed));
- effected.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 d160490e1b..e4e937ef41 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,6 +25,7 @@ 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.
@@ -54,12 +55,15 @@ public class BlinkSwap extends AbstractEffect
effector.broadcastPacket(new FlyToLocation(effector, effectedLoc, FlyType.DUMMY));
effector.abortAttack();
effector.abortCast();
- effector.teleToLocationInstant(effectedLoc);
+ effector.setXYZ(effectedLoc);
+ effector.broadcastPacket(new ValidateLocation(effector));
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
effected.broadcastPacket(new FlyToLocation(effected, effectorLoc, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(effectorLoc);
+ effected.setXYZ(effectorLoc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 612b686f5e..55c2e78d8a 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,6 +25,7 @@ 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.
@@ -59,6 +60,8 @@ 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.teleToLocationInstant(destination);
+ effected.setXYZ(destination);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
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 284a8aef38..89ad8670dc 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,6 +33,7 @@ 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;
/**
@@ -140,7 +141,9 @@ public class KnockBack extends AbstractEffect
{
effected.setHeading(Util.calculateHeadingFrom(effected, effector));
}
- effected.teleToLocationInstant(loc);
+ effected.setXYZ(loc);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
}
}
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 83aee45ed9..38fe2fe9d0 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,6 +25,7 @@ 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.
@@ -75,7 +76,9 @@ 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.teleToLocationInstant(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
+ 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);
}
}
}
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 73f5e0ddf8..338375d841 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,6 +29,7 @@ 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.
@@ -94,7 +95,9 @@ public class TeleportToNpc extends AbstractEffect
effected.broadcastPacket(new FlyToLocation(effected, location, FlyType.DUMMY));
effected.abortAttack();
effected.abortCast();
- effected.teleToLocationInstant(location);
+ effected.setXYZ(location);
+ effected.broadcastPacket(new ValidateLocation(effected));
+ effected.revalidateZone(true);
}
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 2813bfe22e..813e496c47 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,6 +28,7 @@ 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;
/**
@@ -86,12 +87,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 44b4f91cee..c9dc34ac22 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,6 +27,7 @@ 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;
/**
@@ -75,12 +76,14 @@ 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.teleToLocationInstant(loc);
+ effector.setXYZ(loc);
+ effector.broadcastPacket(new ValidateLocation(effector));
+ effected.revalidateZone(true);
}
}
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 d527b109e6..887c723c83 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,9 +759,8 @@ 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, boolean instant)
+ public void teleToLocation(int xValue, int yValue, int zValue, int headingValue, Instance instanceValue)
{
int x = xValue;
int y = yValue;
@@ -786,7 +785,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
}
}
- // Prepare creature for teleport
+ // Prepare creature for teleport.
if (_isPendingRevive)
{
doRevive();
@@ -809,54 +808,54 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
getAI().setIntention(AI_INTENTION_ACTIVE);
- // Adjust position a bit
- z += 5;
-
- // Send teleport packet to player and visible players
- broadcastPacket(new TeleportToLocation(this, x, y, z, heading, instant));
-
- // remove the object from its old location
+ // Remove the object from its old location.
decayMe();
- // Change instance world
+ // Adjust position a bit.
+ z += 5;
+
+ // Send teleport packet where needed.
+ broadcastPacket(new TeleportToLocation(this, x, y, z, heading));
+
+ // Change instance world.
if (getInstanceWorld() != instance)
{
setInstance(instance);
}
- // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion
+ // Set the x,y,z position of the WorldObject and if necessary modify its _worldRegion.
setXYZ(x, y, z);
-
- // temporary fix for heading on teleport
+ // Also adjust heading.
if (heading != 0)
{
setHeading(heading);
}
- // Send teleport finished packet to player
+ // Send teleport finished packet to player.
sendPacket(new ExTeleportToLocationActivate(this));
- // allow recall of the detached characters
+ // Allow recall of the detached characters.
if (!isPlayer() || ((getActingPlayer().getClient() != null) && getActingPlayer().getClient().isDetached()))
{
onTeleported();
}
+
revalidateZone(true);
}
public void teleToLocation(int x, int y, int z)
{
- teleToLocation(x, y, z, 0, getInstanceWorld(), false);
+ teleToLocation(x, y, z, 0, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, Instance instance)
{
- teleToLocation(x, y, z, 0, instance, false);
+ teleToLocation(x, y, z, 0, instance);
}
public void teleToLocation(int x, int y, int z, int heading)
{
- teleToLocation(x, y, z, heading, getInstanceWorld(), false);
+ teleToLocation(x, y, z, heading, getInstanceWorld());
}
public void teleToLocation(int x, int y, int z, int heading, boolean randomOffset)
@@ -883,7 +882,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, false);
+ teleToLocation(x, y, z, heading, instance);
}
public void teleToLocation(ILocational loc)
@@ -893,7 +892,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, false);
+ teleToLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getHeading(), instance);
}
public void teleToLocation(ILocational loc, int randomOffset)
@@ -926,16 +925,6 @@ 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 ffdae9291a..6ed43c885f 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(), false));
+ sendPacket(new TeleportToLocation(this, getX(), getY(), getZ(), getHeading()));
}
@Override
diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
index 30068134e3..f3bef9f573 100644
--- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
+++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/ValidatePosition.java
@@ -121,10 +121,6 @@ public class ValidatePosition implements IClientIncomingPacket
player.stopMove(null);
}
}
- else
- {
- player.setXYZ(_x, _y, _z);
- }
player.sendPacket(new ValidateLocation(player));
}
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 d6dcd01604..943b5078b6 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,16 +27,14 @@ 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, boolean instant)
+ public TeleportToLocation(WorldObject obj, int x, int y, int z, int heading)
{
_targetObjId = obj.getObjectId();
_x = x;
_y = y;
_z = z;
_heading = heading;
- _instant = instant;
}
@Override
@@ -48,9 +46,9 @@ public class TeleportToLocation implements IClientOutgoingPacket
packet.writeD(_x);
packet.writeD(_y);
packet.writeD(_z);
- packet.writeD(_instant ? 0x01 : 0x00);
+ packet.writeD(0x00); // Fade 0, Instant 1.
packet.writeD(_heading);
- packet.writeD(0x00); // Unknown
+ packet.writeD(0x00); // Unknown.
return true;
}
}