Attackables should be able to see and move to target.

This commit is contained in:
MobiusDevelopment
2021-03-28 21:49:55 +00:00
parent 061bc41de8
commit 94700077b3
46 changed files with 301 additions and 125 deletions

View File

@@ -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())

View File

@@ -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