forked from MagicBane/Server
guard recall off city grid
This commit is contained in:
@@ -506,13 +506,8 @@ public class MobileFSM {
|
||||
CheckForRespawn(mob);
|
||||
return;
|
||||
}
|
||||
if (mob.getLoc().distanceSquared2D(mob.npcOwner.getLoc()) > sqr(2000)) {
|
||||
MovementManager.translocate(mob,((Mob)mob.npcOwner).building.getLoc(),null);
|
||||
mob.setAggroTargetID(0);
|
||||
mob.setCombatTarget(null);
|
||||
}
|
||||
CheckToSendMobHome(mob);
|
||||
if(mob.npcOwner.isAlive() == false){
|
||||
CheckToSendMobHome(mob);
|
||||
CheckForPlayerGuardAggro(mob);
|
||||
CheckMobMovement(mob);
|
||||
if(mob.getCombatTarget() != null){
|
||||
@@ -599,7 +594,6 @@ public class MobileFSM {
|
||||
}
|
||||
mob.updateLocation();
|
||||
if (mob.isPet() == false && mob.isSummonedPet() == false && mob.isNecroPet() == false) {
|
||||
|
||||
if (mob.getCombatTarget() == null) {
|
||||
patrol(mob);
|
||||
} else {
|
||||
@@ -673,6 +667,12 @@ public class MobileFSM {
|
||||
mobAttack(mob);
|
||||
}
|
||||
private static void CheckToSendMobHome(Mob mob) {
|
||||
if(mob.isPlayerGuard() && ZoneManager.getCityAtLocation(mob.getLoc()).equals(mob.getGuild().getOwnedCity()) == false){
|
||||
PowersBase recall = PowersManager.getPowerByToken(-1994153779);
|
||||
PowersManager.useMobPower(mob, mob, recall, 40);
|
||||
mob.setAggroTargetID(0);
|
||||
mob.setCombatTarget(null);
|
||||
}
|
||||
if (mob.getLoc().distanceSquared2D(mob.getBindLoc()) > sqr(2000)) {
|
||||
PowersBase recall = PowersManager.getPowerByToken(-1994153779);
|
||||
PowersManager.useMobPower(mob, mob, recall, 40);
|
||||
|
||||
@@ -319,11 +319,13 @@ public enum NPCManager {
|
||||
slot += guardCaptain.siegeMinionMap.size() + 1;
|
||||
|
||||
guardCaptain.siegeMinionMap.put(mob, slot);
|
||||
mob.setInBuildingLoc(guardCaptain.building, guardCaptain);
|
||||
mob.setBindLoc(loc.add(mob.inBuildingLoc));
|
||||
//mob.setInBuildingLoc(guardCaptain.building, guardCaptain);
|
||||
//mob.setBindLoc(loc.add(mob.inBuildingLoc));
|
||||
mob.deathTime = System.currentTimeMillis();
|
||||
mob.spawnTime = 900;
|
||||
mob.npcOwner = guardCaptain;
|
||||
mob.setBindLoc(guardCaptain.building.getLoc());
|
||||
MovementManager.translocate(mob,guardCaptain.building.getLoc(),null);
|
||||
mob.BehaviourType = Enum.MobBehaviourType.GuardMinion;
|
||||
return mob;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.ai.utilities.MovementUtilities;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.*;
|
||||
import engine.job.JobContainer;
|
||||
@@ -248,7 +249,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
if (NPC.ISGuardCaptain(contract.getContractID())) {
|
||||
this.spawnTime = 60 * 15;
|
||||
this.isPlayerGuard = true;
|
||||
this.nameOverride = contract.getName();
|
||||
this.nameOverride = contract.getName() + " Captain";
|
||||
}
|
||||
|
||||
int guildID = rs.getInt("mob_guildUID");
|
||||
|
||||
Reference in New Issue
Block a user