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)) 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;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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