|
|
@ -911,12 +911,13 @@ public class MobAI { |
|
|
|
|
|
|
|
|
|
|
|
private static void CheckToSendMobHome(Mob mob) { |
|
|
|
private static void CheckToSendMobHome(Mob mob) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
if(mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1)){ |
|
|
|
if(mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1)){ |
|
|
|
if(mob.loc.distanceSquared(mob.getOwner().loc) > 60 * 60) |
|
|
|
if(mob.loc.distanceSquared(mob.getOwner().loc) > 60 * 60) |
|
|
|
mob.teleport(mob.getOwner().loc); |
|
|
|
mob.teleport(mob.getOwner().loc); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
try { |
|
|
|
|
|
|
|
if (mob.BehaviourType.isAgressive) { |
|
|
|
if (mob.BehaviourType.isAgressive) { |
|
|
|
|
|
|
|
|
|
|
|
if (mob.isPlayerGuard()) { |
|
|
|
if (mob.isPlayerGuard()) { |
|
|
@ -1353,9 +1354,9 @@ public class MobAI { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void RecoverHealth(Mob mob){ |
|
|
|
public static void RecoverHealth(Mob mob) { |
|
|
|
//recover health
|
|
|
|
//recover health
|
|
|
|
|
|
|
|
try { |
|
|
|
if (mob.getTimestamps().containsKey("HEALTHRECOVERED") == false) |
|
|
|
if (mob.getTimestamps().containsKey("HEALTHRECOVERED") == false) |
|
|
|
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); |
|
|
|
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); |
|
|
|
|
|
|
|
|
|
|
@ -1369,5 +1370,8 @@ public class MobAI { |
|
|
|
if (mob.getHealth() > mob.getHealthMax()) |
|
|
|
if (mob.getHealth() > mob.getHealthMax()) |
|
|
|
mob.setHealth(mob.getHealthMax()); |
|
|
|
mob.setHealth(mob.getHealthMax()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: RecoverHealth" + " " + e.getMessage()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |