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