forked from MagicBane/Server
guard minion spawn timer scaling off barracks rank
This commit is contained in:
@@ -315,7 +315,7 @@ public class MobileFSM {
|
|||||||
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){
|
if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){
|
||||||
if(mob.npcOwner.isAlive() == false || ((Mob)mob.npcOwner).despawned == true){
|
if(mob.npcOwner.isAlive() == false || ((Mob)mob.npcOwner).despawned == true){
|
||||||
//minions don't respawn while guard captain is dead
|
//minions don't respawn while guard captain is dead
|
||||||
if(mob.isAlive() == false){
|
if(mob.isAlive() == false) {
|
||||||
mob.deathTime = System.currentTimeMillis();
|
mob.deathTime = System.currentTimeMillis();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -551,7 +551,6 @@ public class MobileFSM {
|
|||||||
public static void GuardMinionLogic(Mob mob) {
|
public static void GuardMinionLogic(Mob mob) {
|
||||||
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) {
|
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null) {
|
||||||
CheckForPlayerGuardAggro(mob);
|
CheckForPlayerGuardAggro(mob);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if(mob.npcOwner.getCombatTarget() != null)
|
if(mob.npcOwner.getCombatTarget() != null)
|
||||||
mob.setCombatTarget(mob.npcOwner.getCombatTarget());
|
mob.setCombatTarget(mob.npcOwner.getCombatTarget());
|
||||||
@@ -643,7 +642,11 @@ public class MobileFSM {
|
|||||||
public static Boolean GuardCanAggro(Mob mob, PlayerCharacter target) {
|
public static Boolean GuardCanAggro(Mob mob, PlayerCharacter target) {
|
||||||
if (mob.getGuild().getNation().equals(target.getGuild().getNation()))
|
if (mob.getGuild().getNation().equals(target.getGuild().getNation()))
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
//first check condemn list for aggro allowed (allies button is checked)
|
//first check condemn list for aggro allowed (allies button is checked)
|
||||||
|
|||||||
@@ -804,7 +804,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
guardCaptain.siegeMinionMap.put(mob, slot);
|
guardCaptain.siegeMinionMap.put(mob, slot);
|
||||||
mob.deathTime = System.currentTimeMillis();
|
mob.deathTime = System.currentTimeMillis();
|
||||||
mob.npcOwner = guardCaptain;
|
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;
|
mob.BehaviourType = Enum.MobBehaviourType.GuardMinion;
|
||||||
//add mob to zone set of captain
|
//add mob to zone set of captain
|
||||||
guardCaptain.getParentZone().zoneMobSet.add(mob);
|
guardCaptain.getParentZone().zoneMobSet.add(mob);
|
||||||
@@ -1305,7 +1305,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
this.timeToSpawnSiege = System.currentTimeMillis() + 60 * 15 * 1000;
|
this.timeToSpawnSiege = System.currentTimeMillis() + 60 * 15 * 1000;
|
||||||
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);
|
this.spawnTime = (int) (-2.500 * ((Mob) this.npcOwner).building.getRank() + 22.5) * 60;
|
||||||
}
|
}
|
||||||
if (this.isPet()) {
|
if (this.isPet()) {
|
||||||
|
|
||||||
@@ -1391,9 +1391,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.stopMovement(this.lastBindLoc);
|
this.stopMovement(this.lastBindLoc);
|
||||||
NPCManager.applyRuneSetEffects(this);
|
NPCManager.applyRuneSetEffects(this);
|
||||||
this.recalculateStats();
|
this.recalculateStats();
|
||||||
|
|
||||||
this.setHealth(this.healthMax);
|
this.setHealth(this.healthMax);
|
||||||
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z);
|
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)
|
if (!this.isSiege && !this.isPlayerGuard && contract == null)
|
||||||
loadInventory();
|
loadInventory();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user