diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 0dd2190689..86442bef40 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -480,7 +480,7 @@ public abstract class AbstractAI implements Ctrl // return; // } - // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers + // Send a Server->Client packet MoveToPawn/MoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) { if (_actor.isOnGeodataPath()) @@ -514,7 +514,7 @@ public abstract class AbstractAI implements Ctrl } /** - * Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast).
+ * Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet MoveToLocation (broadcast).
* Caution: Low level function, used by AI subclasses * @param x * @param y @@ -532,7 +532,7 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeTaskManager _actor.moveToLocation(x, y, z, 0); - // Send a Server->Client packet CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers + // Send a Server->Client packet MoveToLocation to the actor and all PlayerInstance in its _knownPlayers _actor.broadcastMoveToLocation(); } else @@ -679,7 +679,7 @@ public abstract class AbstractAI implements Ctrl } /** - * Update the state of this actor client side by sending Server->Client packet MoveToPawn/CharMoveToLocation and AutoAttackStart to the PlayerInstance player.
+ * Update the state of this actor client side by sending Server->Client packet MoveToPawn/MoveToLocation and AutoAttackStart to the PlayerInstance player.
* Caution: Low level function, used by AI subclasses * @param player The PlayerIstance to notify with state of this Creature */ @@ -694,7 +694,7 @@ public abstract class AbstractAI implements Ctrl } else { - // Send a Server->Client packet CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers + // Send a Server->Client packet MoveToLocation to the actor and all PlayerInstance in its _knownPlayers player.sendPacket(new MoveToLocation(_actor)); } } diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java index bac6414b95..4e4c1bfe39 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -526,7 +526,7 @@ public class AttackableAI extends CreatureAI y1 = (leader.getY() - y1) + minRadius; } - // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast) + // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet MoveToLocation (broadcast) moveTo(x1, y1, leader.getZ()); } else if (Rnd.get(RANDOM_WALK_RATE) == 0) @@ -574,7 +574,7 @@ public class AttackableAI extends CreatureAI z1 = npc.getZ(); } - // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast) + // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet MoveToLocation (broadcast) final Location moveLoc = _actor.isFlying() ? new Location(x1, y1, z1) : GeoEngine.getInstance().getValidLocation(npc.getX(), npc.getY(), npc.getZ(), x1, y1, z1, npc.getInstanceWorld()); moveTo(moveLoc.getX(), moveLoc.getY(), moveLoc.getZ()); } diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java index eb3310a5ef..26cdeebf6c 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/CreatureAI.java @@ -350,7 +350,7 @@ public class CreatureAI extends AbstractAI * */ @Override @@ -379,7 +379,7 @@ public class CreatureAI extends AbstractAI // Abort the attack of the Creature and send Server->Client ActionFailed packet _actor.abortAttack(); - // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast) + // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet MoveToLocation (broadcast) moveTo(loc.getX(), loc.getY(), loc.getZ()); } diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/PlayerAI.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/PlayerAI.java index 859a70cce4..9241b52a33 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/PlayerAI.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/ai/PlayerAI.java @@ -219,7 +219,7 @@ public class PlayerAI extends PlayableAI * */ @Override @@ -248,7 +248,7 @@ public class PlayerAI extends PlayableAI // Abort the attack of the Creature and send Server->Client ActionFailed packet _actor.abortAttack(); - // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet CharMoveToLocation (broadcast) + // Move the actor to Location (x,y,z) server side AND client side by sending Server->Client packet MoveToLocation (broadcast) moveTo(loc.getX(), loc.getY(), loc.getZ()); } diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index 75d7d0ebcd..09ba7c317b 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -3142,6 +3142,16 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe // Set the timer of last position update to now m._moveTimestamp = gameTicks; + // Broadcast MoveToLocation when Playable tries to reach a Playable target (once per second). + if (isPlayable()) + { + final WorldObject target = _target; + if ((target != null) && target.isPlayable() && ((gameTicks % 10) == 0) && (calculateDistance3D(target) > 150)) + { + broadcastPacket(new MoveToLocation(this)); + } + } + if (distFraction > 1) { ThreadPool.execute(() -> getAI().notifyEvent(CtrlEvent.EVT_ARRIVED)); @@ -3282,7 +3292,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe *
  • Add the Creature to movingObjects of the GameTimeTaskManager
  • *
  • Create a task to notify the AI that Creature arrives at a check point of the movement
  • * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: * - * Caution: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.
    + * Caution: This method DOESN'T send Server->Client packet MoveToPawn/MoveToLocation.
    *
    * Example of use: *