Browse Source

pets follow owners through teleporting

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

Loading…
Cancel
Save