Check destination when L2AttackableAI thinkAttack moves L2Character.
This commit is contained in:
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -902,11 +902,8 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
|
|
||||||
// fixes monsters not avoiding obstacles
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
// if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceId()))
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceId()));
|
||||||
// {
|
|
||||||
moveTo(newX, newY, newZ);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -776,10 +776,9 @@ public class L2AttackableAI extends L2CharacterAI
|
|||||||
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
if (!npc.isInsideRadius(newX, newY, 0, collision, false, false))
|
||||||
{
|
{
|
||||||
final int newZ = npc.getZ() + 30;
|
final int newZ = npc.getZ() + 30;
|
||||||
if (GeoEngine.getInstance().canMoveToTarget(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()))
|
|
||||||
{
|
// Mobius: Verify destination. Prevents wall collision issues and fixes monsters not avoiding obstacles.
|
||||||
moveTo(newX, newY, newZ);
|
moveTo(GeoEngine.getInstance().canMoveToTargetLoc(npc.getX(), npc.getY(), npc.getZ(), newX, newY, newZ, npc.getInstanceWorld()));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user