Check destination when L2AttackableAI thinkAttack moves L2Character.

This commit is contained in:
MobiusDev 2018-06-07 13:29:00 +00:00
parent a9da02ce4e
commit 2c2b31dee5
8 changed files with 23 additions and 33 deletions

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}

View File

@ -902,11 +902,8 @@ public class L2AttackableAI extends L2CharacterAI
{
final int newZ = npc.getZ() + 30;
// fixes monsters not avoiding obstacles
// if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceId()))
// {
moveTo(newX, newY, newZ);
// }
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceId()));
}
return;
}

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}

View File

@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
{
final int newZ = npc.getZ() + 30;
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
{
moveTo(newX, newY, newZ);
}
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
}
return;
}