forked from MagicBane/Server
34 lines
988 B
Java
34 lines
988 B
Java
|
|
package engine.mobileAI.MobBehaviours;
|
||
|
|
|
||
|
|
import engine.gameManager.ZoneManager;
|
||
|
|
import engine.mobileAI.utilities.MovementUtilities;
|
||
|
|
import engine.objects.Mob;
|
||
|
|
import org.pmw.tinylog.Logger;
|
||
|
|
|
||
|
|
public class Pet {
|
||
|
|
|
||
|
|
public static void run(Mob pet){
|
||
|
|
|
||
|
|
try {
|
||
|
|
|
||
|
|
if(StaticBehaviours.EarlyExit(pet))
|
||
|
|
return;
|
||
|
|
|
||
|
|
if (pet.getOwner() == null && pet.isNecroPet() == false && pet.isSiege() == false)
|
||
|
|
if (ZoneManager.getSeaFloor().zoneMobSet.contains(pet))
|
||
|
|
pet.killCharacter("no owner");
|
||
|
|
|
||
|
|
if(!pet.isSiege())
|
||
|
|
pet.BehaviourType.canRoam = true;
|
||
|
|
|
||
|
|
|
||
|
|
if (MovementUtilities.canMove(pet) && pet.BehaviourType.canRoam)
|
||
|
|
StaticBehaviours.CheckMobMovement(pet);
|
||
|
|
|
||
|
|
StaticBehaviours.CheckForAttack(pet);
|
||
|
|
} catch (Exception e) {
|
||
|
|
Logger.info(pet.getObjectUUID() + " " + pet.getName() + " Failed At: PetLogic" + " " + e.getMessage());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|