diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AbstractAI.java index e0d7820da7..e99f81ad49 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -479,15 +479,12 @@ abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _accessor.moveTo(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - // Mobius: Solves moving to wrong Z when not using geodata, - // but probably is not accurate and you should use geodata. - // _accessor.moveTo(pawn.getX(), pawn.getY(), _actor.getZ(), offset); - - if (!_actor.isMoving()) - { - _actor.sendPacket(ActionFailed.STATIC_PACKET); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // _actor.sendPacket(ActionFailed.STATIC_PACKET); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn instanceof Creature) diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java index d264b1ea55..09134489c7 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -667,8 +667,8 @@ public class AttackableAI extends CreatureAI } } - final Creature originalAttackTarget = getAttackTarget(); // Check if target is dead or if timeout is expired to stop this attack + final Creature originalAttackTarget = getAttackTarget(); if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || ((originalAttackTarget instanceof PlayerInstance) && (((PlayerInstance) originalAttackTarget).isInOfflineMode() || !((PlayerInstance) originalAttackTarget).isOnline())) || (_attackTimeout < GameTimeController.getGameTicks())) { // Stop hating this target after the attack timeout or if target is dead @@ -684,6 +684,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, originalAttackTarget)) + { + moveTo(originalAttackTarget.getX(), originalAttackTarget.getY(), originalAttackTarget.getZ()); + return; + } + // Call all WorldObject of its Faction inside the Faction Range if (((NpcInstance) _actor).getFactionId() != null) { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java index e0d7820da7..e99f81ad49 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -479,15 +479,12 @@ abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _accessor.moveTo(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - // Mobius: Solves moving to wrong Z when not using geodata, - // but probably is not accurate and you should use geodata. - // _accessor.moveTo(pawn.getX(), pawn.getY(), _actor.getZ(), offset); - - if (!_actor.isMoving()) - { - _actor.sendPacket(ActionFailed.STATIC_PACKET); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // _actor.sendPacket(ActionFailed.STATIC_PACKET); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn instanceof Creature) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java index d264b1ea55..09134489c7 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -667,8 +667,8 @@ public class AttackableAI extends CreatureAI } } - final Creature originalAttackTarget = getAttackTarget(); // Check if target is dead or if timeout is expired to stop this attack + final Creature originalAttackTarget = getAttackTarget(); if ((originalAttackTarget == null) || originalAttackTarget.isAlikeDead() || ((originalAttackTarget instanceof PlayerInstance) && (((PlayerInstance) originalAttackTarget).isInOfflineMode() || !((PlayerInstance) originalAttackTarget).isOnline())) || (_attackTimeout < GameTimeController.getGameTicks())) { // Stop hating this target after the attack timeout or if target is dead @@ -684,6 +684,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, originalAttackTarget)) + { + moveTo(originalAttackTarget.getX(), originalAttackTarget.getY(), originalAttackTarget.getZ()); + return; + } + // Call all WorldObject of its Faction inside the Faction Range if (((NpcInstance) _actor).getFactionId() != null) { diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 93f6ad0ffa..77ec12c63e 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -533,11 +533,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc0b2925b5..06b262f62b 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -835,6 +835,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, originalAttackTarget)) + { + moveTo(originalAttackTarget); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 93f6ad0ffa..77ec12c63e 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -533,11 +533,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc0b2925b5..06b262f62b 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -835,6 +835,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, originalAttackTarget)) + { + moveTo(originalAttackTarget); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java index c0d4d5fc50..4e274b1de3 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AbstractAI.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AbstractAI.java index 627db8ec5c..9a114c4565 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AbstractAI.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AbstractAI.java @@ -470,11 +470,12 @@ public abstract class AbstractAI implements Ctrl // Calculate movement data for a move to location action and add the actor to movingObjects of GameTimeController _actor.moveToLocation(_actor.isPlayable() ? pawn : null, pawn.getX(), pawn.getY(), pawn.getZ(), offset); - if (!_actor.isMoving()) - { - clientActionFailed(); - return; - } + // May result to make monsters stop moving. + // if (!_actor.isMoving()) + // { + // clientActionFailed(); + // return; + // } // Send a Server->Client packet MoveToPawn/CharMoveToLocation to the actor and all PlayerInstance in its _knownPlayers if (pawn.isCreature()) diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AttackableAI.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AttackableAI.java index dc29d4cf6e..a6710909d3 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AttackableAI.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/ai/AttackableAI.java @@ -685,6 +685,13 @@ public class AttackableAI extends CreatureAI return; } + // Actor should be able to see target. + if (!GeoEngine.getInstance().canSeeTarget(_actor, target)) + { + moveTo(target); + return; + } + final int collision = npc.getTemplate().getCollisionRadius(); // Handle all WorldObject of its Faction inside the Faction Range