Browse Source

pets follow owners through teleporting

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
fd03b263d1
  1. 15
      src/engine/mobileAI/MobAI.java

15
src/engine/mobileAI/MobAI.java

@ -625,7 +625,7 @@ public class MobAI { @@ -625,7 +625,7 @@ public class MobAI {
//check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
if (mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal())
CheckToSendMobHome(mob);
return;
@ -643,14 +643,9 @@ public class MobAI { @@ -643,14 +643,9 @@ public class MobAI {
if (mob.playerAgroMap.isEmpty()) {
if(mob.getCombatTarget() != null)
mob.setCombatTarget(null);
if(mob.isPet())
mob.teleport(mob.getOwner().loc);
return;
}
if (mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal())
CheckToSendMobHome(mob);
if (mob.getCombatTarget() != null) {
if (mob.getCombatTarget().isAlive() == false) {
@ -914,6 +909,11 @@ public class MobAI { @@ -914,6 +909,11 @@ public class MobAI {
private static void CheckToSendMobHome(Mob mob) {
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) {
@ -925,9 +925,6 @@ public class MobAI { @@ -925,9 +925,6 @@ public class MobAI {
}
}
if (mob.getCombatTarget() != null && CombatUtilities.inRange2D(mob, mob.getCombatTarget(), MobAIThread.AI_BASE_AGGRO_RANGE * 0.5f))
return;
if (mob.isPlayerGuard() && !mob.despawned) {
City current = ZoneManager.getCityAtLocation(mob.getLoc());

Loading…
Cancel
Save