forked from MagicBane/Server
playerGuard = true.
This commit is contained in:
@@ -56,20 +56,20 @@ public class aiInfoCmd extends AbstractDevCmd {
|
||||
Mob mob = (Mob) target;
|
||||
output = "Mob AI Information:" + newline;
|
||||
output += mob.getName() + newline;
|
||||
if (mob.BehaviourType != null) {
|
||||
output += "BehaviourType: " + mob.BehaviourType.toString() + newline;
|
||||
if (mob.BehaviourType.BehaviourHelperType != null) {
|
||||
output += "Behaviour Helper Type: " + mob.BehaviourType.BehaviourHelperType.toString() + newline;
|
||||
if (mob.behaviourType != null) {
|
||||
output += "BehaviourType: " + mob.behaviourType.toString() + newline;
|
||||
if (mob.behaviourType.BehaviourHelperType != null) {
|
||||
output += "Behaviour Helper Type: " + mob.behaviourType.BehaviourHelperType.toString() + newline;
|
||||
} else {
|
||||
output += "Behaviour Helper Type: NULL" + newline;
|
||||
}
|
||||
output += "Wimpy: " + mob.BehaviourType.isWimpy + newline;
|
||||
output += "Agressive: " + mob.BehaviourType.isAgressive + newline;
|
||||
output += "Can Roam: " + mob.BehaviourType.canRoam + newline;
|
||||
output += "Calls For Help: " + mob.BehaviourType.callsForHelp + newline;
|
||||
output += "Responds To Call For Help: " + mob.BehaviourType.respondsToCallForHelp + newline;
|
||||
} else {
|
||||
output += "BehaviourType: NULL" + newline;
|
||||
}
|
||||
output += "Wimpy: " + mob.behaviourType.isWimpy + newline;
|
||||
output += "Agressive: " + mob.behaviourType.isAgressive + newline;
|
||||
output += "Can Roam: " + mob.behaviourType.canRoam + newline;
|
||||
output += "Calls For Help: " + mob.behaviourType.callsForHelp + newline;
|
||||
output += "Responds To Call For Help: " + mob.behaviourType.respondsToCallForHelp + newline;
|
||||
} else {
|
||||
output += "BehaviourType: NULL" + newline;
|
||||
}
|
||||
output += "Aggro Range: " + mob.getAggroRange() + newline;
|
||||
output += "Player Aggro Map Size: " + mob.playerAgroMap.size() + newline;
|
||||
|
||||
@@ -96,7 +96,7 @@ public class MobAI {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mob.BehaviourType.callsForHelp)
|
||||
if (mob.behaviourType.callsForHelp)
|
||||
MobCallForHelp(mob);
|
||||
|
||||
if (!MovementUtilities.inRangeDropAggro(mob, target)) {
|
||||
@@ -165,7 +165,7 @@ public class MobAI {
|
||||
|
||||
if (playercity != null)
|
||||
for (Mob guard : playercity.getParent().zoneMobSet)
|
||||
if (guard.BehaviourType != null && guard.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
if (guard.behaviourType != null && guard.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
if (guard.getCombatTarget() == null && !guard.getGuild().equals(mob.getGuild()))
|
||||
guard.setCombatTarget(mob);
|
||||
|
||||
@@ -260,7 +260,7 @@ public class MobAI {
|
||||
|
||||
//guard captains inherit barracks patrol points dynamically
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) {
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) {
|
||||
|
||||
Building barracks = mob.building;
|
||||
|
||||
@@ -280,7 +280,7 @@ public class MobAI {
|
||||
|
||||
MovementUtilities.aiMove(mob, mob.destination, true);
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet())
|
||||
|
||||
//make sure mob is out of combat stance
|
||||
@@ -312,9 +312,9 @@ public class MobAI {
|
||||
|
||||
int contractID;
|
||||
|
||||
if(mob.BehaviourType.equals(Enum.MobBehaviourType.GuardMinion))
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardMinion))
|
||||
contractID = mob.npcOwner.contract.getContractID();
|
||||
else
|
||||
else
|
||||
contractID = mob.contract.getContractID();
|
||||
|
||||
if(Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false)
|
||||
@@ -350,7 +350,7 @@ public class MobAI {
|
||||
ArrayList<Integer> purgeTokens;
|
||||
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget();
|
||||
|
||||
if (mob.BehaviourType.callsForHelp)
|
||||
if (mob.behaviourType.callsForHelp)
|
||||
MobCallForHelp(mob);
|
||||
|
||||
// Generate a list of tokens from the mob powers for this mobile.
|
||||
@@ -433,7 +433,7 @@ public class MobAI {
|
||||
ArrayList<Integer> purgeTokens;
|
||||
AbstractCharacter target = (AbstractCharacter) mob.getCombatTarget();
|
||||
|
||||
if (mob.BehaviourType.callsForHelp)
|
||||
if (mob.behaviourType.callsForHelp)
|
||||
MobCallForHelp(mob);
|
||||
|
||||
// Generate a list of tokens from the mob powers for this mobile.
|
||||
@@ -564,7 +564,7 @@ public class MobAI {
|
||||
Zone mobCamp = mob.getParentZone();
|
||||
|
||||
for (Mob helper : mobCamp.zoneMobSet) {
|
||||
if (helper.BehaviourType.respondsToCallForHelp && helper.BehaviourType.BehaviourHelperType.equals(mob.BehaviourType)) {
|
||||
if (helper.behaviourType.respondsToCallForHelp && helper.behaviourType.BehaviourHelperType.equals(mob.behaviourType)) {
|
||||
helper.setCombatTarget(mob.getCombatTarget());
|
||||
callGotResponse = true;
|
||||
}
|
||||
@@ -608,7 +608,7 @@ public class MobAI {
|
||||
|
||||
if (mob.despawned && mob.isPlayerGuard) {
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardMinion)) {
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardMinion)) {
|
||||
if (mob.npcOwner.isAlive() == false || ((Mob) mob.npcOwner).despawned == true) {
|
||||
|
||||
//minions don't respawn while guard captain is dead
|
||||
@@ -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.equals(Enum.MobBehaviourType.Pet1) == false)
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.Pet1) == false)
|
||||
CheckToSendMobHome(mob);
|
||||
|
||||
return;
|
||||
@@ -646,7 +646,7 @@ public class MobAI {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1) == false)
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.Pet1) == false)
|
||||
CheckToSendMobHome(mob);
|
||||
|
||||
if (mob.getCombatTarget() != null) {
|
||||
@@ -673,7 +673,7 @@ public class MobAI {
|
||||
}
|
||||
}
|
||||
|
||||
switch (mob.BehaviourType) {
|
||||
switch (mob.behaviourType) {
|
||||
case GuardCaptain:
|
||||
GuardCaptainLogic(mob);
|
||||
break;
|
||||
@@ -782,7 +782,7 @@ public class MobAI {
|
||||
|
||||
mob.updateLocation();
|
||||
|
||||
switch (mob.BehaviourType) {
|
||||
switch (mob.behaviourType) {
|
||||
|
||||
case Pet1:
|
||||
if (mob.getOwner() == null)
|
||||
@@ -894,7 +894,7 @@ public class MobAI {
|
||||
return;
|
||||
|
||||
if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false &&
|
||||
mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1) == false) {
|
||||
mob.behaviourType.equals(Enum.MobBehaviourType.Pet1) == false) {
|
||||
|
||||
mob.setCombatTarget(null);
|
||||
return;
|
||||
@@ -910,10 +910,10 @@ public class MobAI {
|
||||
private static void CheckToSendMobHome(Mob mob) {
|
||||
|
||||
try {
|
||||
if (mob.BehaviourType.isAgressive) {
|
||||
if (mob.behaviourType.isAgressive) {
|
||||
|
||||
if (mob.isPlayerGuard()) {
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain))
|
||||
CheckForPlayerGuardAggro(mob);
|
||||
} else {
|
||||
CheckForAggro(mob);
|
||||
@@ -933,7 +933,7 @@ public class MobAI {
|
||||
PowersManager.useMobPower(mob, mob, recall, 40);
|
||||
mob.setCombatTarget(null);
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain) && mob.isAlive()) {
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain) && mob.isAlive()) {
|
||||
|
||||
//guard captain pulls his minions home with him
|
||||
|
||||
@@ -1014,7 +1014,7 @@ public class MobAI {
|
||||
if ((aggroMob.agentType.equals(Enum.AIAgentType.GUARD)))
|
||||
continue;
|
||||
|
||||
if (aggroMob.BehaviourType.equals(Enum.MobBehaviourType.Pet1))
|
||||
if (aggroMob.behaviourType.equals(Enum.MobBehaviourType.Pet1))
|
||||
continue;
|
||||
|
||||
if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50))
|
||||
@@ -1107,7 +1107,7 @@ public class MobAI {
|
||||
if (ZoneManager.getSeaFloor().zoneMobSet.contains(mob))
|
||||
mob.killCharacter("no owner");
|
||||
|
||||
if (MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam)
|
||||
if (MovementUtilities.canMove(mob) && mob.behaviourType.canRoam)
|
||||
CheckMobMovement(mob);
|
||||
|
||||
CheckForAttack(mob);
|
||||
@@ -1157,7 +1157,7 @@ public class MobAI {
|
||||
if (mob.getCombatTarget() != null && mob.playerAgroMap.containsKey(mob.getCombatTarget().getObjectUUID()) == false)
|
||||
mob.setCombatTarget(null);
|
||||
|
||||
if (mob.BehaviourType.isAgressive) {
|
||||
if (mob.behaviourType.isAgressive) {
|
||||
|
||||
AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob);
|
||||
|
||||
@@ -1165,7 +1165,7 @@ public class MobAI {
|
||||
mob.setCombatTarget(newTarget);
|
||||
else {
|
||||
if (mob.getCombatTarget() == null) {
|
||||
if (mob.BehaviourType == Enum.MobBehaviourType.HamletGuard)
|
||||
if (mob.behaviourType == Enum.MobBehaviourType.HamletGuard)
|
||||
SafeGuardAggro(mob); //safehold guard
|
||||
else
|
||||
CheckForAggro(mob); //normal aggro
|
||||
@@ -1175,12 +1175,12 @@ public class MobAI {
|
||||
|
||||
//check if mob can move for patrol or moving to target
|
||||
|
||||
if (mob.BehaviourType.canRoam)
|
||||
if (mob.behaviourType.canRoam)
|
||||
CheckMobMovement(mob);
|
||||
|
||||
//check if mob can attack if it isn't wimpy
|
||||
|
||||
if (!mob.BehaviourType.isWimpy && mob.getCombatTarget() != null)
|
||||
if (!mob.behaviourType.isWimpy && mob.getCombatTarget() != null)
|
||||
CheckForAttack(mob);
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -1245,7 +1245,7 @@ public class MobAI {
|
||||
if (mob.getGuild().getNation().equals(target.getGuild().getNation()))
|
||||
return false;
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardMinion)) {
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardMinion)) {
|
||||
if (((Mob) mob.npcOwner).building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true) {
|
||||
return true;
|
||||
}
|
||||
@@ -1330,7 +1330,7 @@ public class MobAI {
|
||||
|
||||
MovementUtilities.aiMove(mob, mob.destination, true);
|
||||
|
||||
if (mob.BehaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) {
|
||||
if (mob.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) {
|
||||
for (Entry<Mob, Integer> minion : mob.siegeMinionMap.entrySet()) {
|
||||
|
||||
//make sure mob is out of combat stance
|
||||
|
||||
+19
-15
@@ -71,7 +71,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
public int bootySet = 0;
|
||||
public EnumBitSet<MonsterType> notEnemy;
|
||||
public EnumBitSet<Enum.MonsterType> enemy;
|
||||
public MobBehaviourType BehaviourType;
|
||||
public MobBehaviourType behaviourType;
|
||||
public ArrayList<Vector3fImmutable> patrolPoints;
|
||||
public int lastPatrolPointIndex = 0;
|
||||
public long stopPatrolTime = 0;
|
||||
@@ -144,7 +144,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.parentZone = parent;
|
||||
this.parentZoneUUID = (parent != null) ? parent.getObjectUUID() : 0;
|
||||
this.ownerUID = owner.getObjectUUID();
|
||||
this.BehaviourType = Enum.MobBehaviourType.Pet1;
|
||||
this.behaviourType = Enum.MobBehaviourType.Pet1;
|
||||
clearStatic();
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.firstName = rs.getString("mob_name");
|
||||
|
||||
if (rs.getString("fsm").length() > 1)
|
||||
this.BehaviourType = MobBehaviourType.valueOf(rs.getString("fsm"));
|
||||
this.behaviourType = MobBehaviourType.valueOf(rs.getString("fsm"));
|
||||
|
||||
if (this.isPet() || this.isSiege || (this.isPlayerGuard && this.contract == null))
|
||||
this.currentID = (--Mob.staticID);
|
||||
@@ -659,8 +659,10 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
minionMobile.deathTime = System.currentTimeMillis();
|
||||
minionMobile.npcOwner = guardCaptain;
|
||||
minionMobile.spawnTime = (int) (-2.500 * guardCaptain.building.getRank() + 22.5) * 60;
|
||||
minionMobile.BehaviourType = Enum.MobBehaviourType.GuardMinion;
|
||||
minionMobile.behaviourType = Enum.MobBehaviourType.GuardMinion;
|
||||
minionMobile.isPlayerGuard = true;
|
||||
minionMobile.guardedCity = guardCaptain.guardedCity;
|
||||
|
||||
minionMobile.parentZoneUUID = guardCaptain.parentZoneUUID;
|
||||
minionMobile.bindLoc = guardCaptain.bindLoc;
|
||||
|
||||
@@ -732,8 +734,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
owner.getSiegeMinionMap().put(mob, slot);
|
||||
|
||||
mob.setNpcOwner(owner);
|
||||
mob.BehaviourType = MobBehaviourType.Pet1;
|
||||
mob.BehaviourType.canRoam = false;
|
||||
mob.behaviourType = MobBehaviourType.Pet1;
|
||||
mob.behaviourType.canRoam = false;
|
||||
return mob;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1058,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.hasLoot = false;
|
||||
this.playerAgroMap.clear();
|
||||
|
||||
if (this.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal())
|
||||
if (this.behaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal())
|
||||
this.spawnTime = (int) (-2.500 * ((Mob) this.npcOwner).building.getRank() + 22.5) * 60;
|
||||
|
||||
if (this.isPet()) {
|
||||
@@ -1146,7 +1148,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.recalculateStats();
|
||||
this.setHealth(this.healthMax);
|
||||
|
||||
if (this.building == null && this.npcOwner != null && ((Mob) this.npcOwner).BehaviourType.ordinal() == MobBehaviourType.GuardCaptain.ordinal())
|
||||
if (this.building == null && this.npcOwner != null && ((Mob) this.npcOwner).behaviourType.ordinal() == MobBehaviourType.GuardCaptain.ordinal())
|
||||
this.building = ((Mob) this.npcOwner).building;
|
||||
else if (this.building != null)
|
||||
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z);
|
||||
@@ -1706,7 +1708,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
else
|
||||
this.contract = DbManager.ContractQueries.GET_CONTRACT(this.contractUUID);
|
||||
|
||||
if (this.contract != null && NPC.ISGuardCaptain(contract.getContractID())) {
|
||||
// Guard captaiin AI
|
||||
|
||||
if (NPC.ISGuardCaptain(contract.getContractID())) {
|
||||
this.spawnTime = 60 * 15;
|
||||
this.isPlayerGuard = true;
|
||||
}
|
||||
@@ -1714,7 +1718,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
// Load AI for wall archers
|
||||
|
||||
if (this.contract != null && NPC.ISWallArcher(this.contract)) {
|
||||
this.BehaviourType = MobBehaviourType.GuardWallArcher;
|
||||
this.behaviourType = MobBehaviourType.GuardWallArcher;
|
||||
this.isPlayerGuard = true;
|
||||
this.spawnTime = 450;
|
||||
}
|
||||
@@ -1854,7 +1858,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
if (this.contract != null && this.contract.getContractID() == 910) {
|
||||
this.isPlayerGuard = true;
|
||||
this.BehaviourType = MobBehaviourType.GuardCaptain;
|
||||
this.behaviourType = MobBehaviourType.GuardCaptain;
|
||||
this.spawnTime = 900;
|
||||
this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc);
|
||||
}
|
||||
@@ -1880,15 +1884,15 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.BehaviourType == null)
|
||||
this.BehaviourType = this.getMobBase().fsm;
|
||||
if (this.behaviourType == null)
|
||||
this.behaviourType = this.getMobBase().fsm;
|
||||
|
||||
if (this.isPlayerGuard() && this.contract != null)
|
||||
if (NPC.ISWallArcher(this.getContract())) {
|
||||
this.BehaviourType = MobBehaviourType.GuardWallArcher;
|
||||
this.behaviourType = MobBehaviourType.GuardWallArcher;
|
||||
this.spawnTime = 450;
|
||||
} else {
|
||||
this.BehaviourType = MobBehaviourType.GuardCaptain;
|
||||
this.behaviourType = MobBehaviourType.GuardCaptain;
|
||||
this.spawnTime = 900;
|
||||
this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user