|
|
@ -48,7 +48,12 @@ public class MobAI { |
|
|
|
mob.setCombatTarget(null); |
|
|
|
mob.setCombatTarget(null); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter){ |
|
|
|
|
|
|
|
if(((PlayerCharacter)target).getHidden() > 0){ |
|
|
|
|
|
|
|
mob.setCombatTarget(null); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) { |
|
|
|
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) { |
|
|
|
|
|
|
|
|
|
|
|
if (mob.isPlayerGuard() == false && MobCast(mob)) { |
|
|
|
if (mob.isPlayerGuard() == false && MobCast(mob)) { |
|
|
@ -736,7 +741,7 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
//Player is Dead, Mob no longer needs to attempt to aggro. Remove them from aggro map.
|
|
|
|
//Player is Dead, Mob no longer needs to attempt to aggro. Remove them from aggro map.
|
|
|
|
|
|
|
|
|
|
|
|
if (!loadedPlayer.isAlive()) { |
|
|
|
if (!loadedPlayer.isAlive() || loadedPlayer.getHidden() > 0) { |
|
|
|
loadedPlayers.remove(playerID); |
|
|
|
loadedPlayers.remove(playerID); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -978,7 +983,12 @@ public class MobAI { |
|
|
|
private static void chaseTarget(Mob mob) { |
|
|
|
private static void chaseTarget(Mob mob) { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
if (mob.combatTarget.getObjectType() == Enum.GameObjectType.PlayerCharacter){ |
|
|
|
|
|
|
|
if(((PlayerCharacter)mob.combatTarget).getHidden() > 0){ |
|
|
|
|
|
|
|
mob.setCombatTarget(null); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
float rangeSquared = mob.getRange() * mob.getRange(); |
|
|
|
float rangeSquared = mob.getRange() * mob.getRange(); |
|
|
|
float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc()); |
|
|
|
float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc()); |
|
|
|
|
|
|
|
|
|
|
|