Leash range is capped.

This commit is contained in:
sigonasr2 2016-08-07 21:59:19 -05:00
parent ba133db087
commit 6f018ff69d
3 changed files with 11 additions and 1 deletions

Binary file not shown.

View File

@ -193,6 +193,16 @@ public class EliteMonster {
}
}
if (!storingenergy) {
if (l.getLocation().distanceSquared(m.getLocation())>4096) {
//Lose the target.
targetlist.remove(l);
if (targetlist.size()>0) {
m.setTarget(ChooseRandomTarget());
} else {
m.setTarget(null);
resetToSpawn();
}
} else
if (l.getLocation().distanceSquared(m.getLocation())>100 && !leaping) {
l.getWorld().playSound(l.getLocation(), Sound.ENTITY_CAT_HISS, 1.0f, 1.0f);
chasing=true;

View File

@ -142,7 +142,7 @@ public class MonsterController {
}
private static boolean meetsConditionsToBeElite(LivingEntity ent) {
if (Math.random()<=TwosideKeeper.ELITE_MONSTER_CHANCE && TwosideKeeper.LAST_ELITE_SPAWN+(72000*24)<TwosideKeeper.getServerTickTime() &&
if (Math.random()<=TwosideKeeper.ELITE_MONSTER_CHANCE && TwosideKeeper.LAST_ELITE_SPAWN+(72000*4)<TwosideKeeper.getServerTickTime() &&
((ent instanceof Zombie) || ((ent instanceof Skeleton) && ((Skeleton)ent).getSkeletonType()==SkeletonType.WITHER))
&& ent.getWorld().equals(Bukkit.getWorld("world"))) {
TwosideKeeper.log("Trying for an elite monster.", 4);