Browse Source

guard minion spawn timer scaling off barracks rank

master
FatBoy-DOTC 2 years ago
parent
commit
92a0af8dbb
  1. 9
      src/engine/ai/MobileFSM.java
  2. 6
      src/engine/objects/Mob.java

9
src/engine/ai/MobileFSM.java

@ -315,7 +315,7 @@ public class MobileFSM { @@ -315,7 +315,7 @@ public class MobileFSM {
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){
if(mob.npcOwner.isAlive() == false || ((Mob)mob.npcOwner).despawned == true){
//minions don't respawn while guard captain is dead
if(mob.isAlive() == false){
if(mob.isAlive() == false) {
mob.deathTime = System.currentTimeMillis();
return;
}
@ -551,7 +551,6 @@ public class MobileFSM { @@ -551,7 +551,6 @@ public class MobileFSM {
public static void GuardMinionLogic(Mob mob) {
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) {
CheckForPlayerGuardAggro(mob);
return;
}
if(mob.npcOwner.getCombatTarget() != null)
mob.setCombatTarget(mob.npcOwner.getCombatTarget());
@ -643,7 +642,11 @@ public class MobileFSM { @@ -643,7 +642,11 @@ public class MobileFSM {
public static Boolean GuardCanAggro(Mob mob, PlayerCharacter target) {
if (mob.getGuild().getNation().equals(target.getGuild().getNation()))
return false;
if(mob.building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true){
if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) {
if(((Mob)mob.npcOwner).building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true){
return true;
}
} else if(mob.building.getCity().cityOutlaws.contains(target.getObjectUUID()) == true){
return true;
}
//first check condemn list for aggro allowed (allies button is checked)

6
src/engine/objects/Mob.java

@ -804,7 +804,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -804,7 +804,7 @@ public class Mob extends AbstractIntelligenceAgent {
guardCaptain.siegeMinionMap.put(mob, slot);
mob.deathTime = System.currentTimeMillis();
mob.npcOwner = guardCaptain;
mob.spawnTime = (int)(-2.500 * guardCaptain.building.getRank() + 22.5);
mob.spawnTime = (int)(-2.500 * guardCaptain.building.getRank() + 22.5) * 60;
mob.BehaviourType = Enum.MobBehaviourType.GuardMinion;
//add mob to zone set of captain
guardCaptain.getParentZone().zoneMobSet.add(mob);
@ -1305,7 +1305,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1305,7 +1305,7 @@ public class Mob extends AbstractIntelligenceAgent {
this.timeToSpawnSiege = System.currentTimeMillis() + 60 * 15 * 1000;
if(this.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) {
this.spawnTime = (int) (-2.500 * ((Mob) this.npcOwner).building.getRank() + 22.5);
this.spawnTime = (int) (-2.500 * ((Mob) this.npcOwner).building.getRank() + 22.5) * 60;
}
if (this.isPet()) {
@ -1391,9 +1391,9 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1391,9 +1391,9 @@ public class Mob extends AbstractIntelligenceAgent {
this.stopMovement(this.lastBindLoc);
NPCManager.applyRuneSetEffects(this);
this.recalculateStats();
this.setHealth(this.healthMax);
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z);
MovementManager.translocate(this,this.bindLoc, this.region);
if (!this.isSiege && !this.isPlayerGuard && contract == null)
loadInventory();

Loading…
Cancel
Save