diff --git a/src/engine/objects/Blueprint.java b/src/engine/objects/Blueprint.java index cccc0061..222de372 100644 --- a/src/engine/objects/Blueprint.java +++ b/src/engine/objects/Blueprint.java @@ -360,6 +360,10 @@ this.maxRank = rs.getInt("MaxRank"); return 3; } + if(bg != null && bg.equals(BuildingGroup.TOL) && currentRank == 8){ + return 5; + } + if (this.maxRank == 1 && currentRank == 1) return getMaxSlots(); diff --git a/src/engine/objects/Realm.java b/src/engine/objects/Realm.java index e97a4533..385b433c 100644 --- a/src/engine/objects/Realm.java +++ b/src/engine/objects/Realm.java @@ -10,10 +10,14 @@ package engine.objects; import engine.Enum; +import engine.InterestManagement.InterestManager; import engine.InterestManagement.RealmMap; +import engine.InterestManagement.WorldGrid; import engine.db.archive.DataWarehouse; import engine.db.archive.RealmRecord; +import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.NPCManager; import engine.gameManager.PowersManager; import engine.net.ByteBufferWriter; import engine.powers.PowersBase; @@ -379,6 +383,16 @@ public class Realm { public void abandonRealm() { + for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(this.getRulingCity().loc,1750,MBServerStatics.MASK_BUILDING)){ + Building wall = (Building)awo; + if(wall.getBlueprint() != null && wall.getBlueprint().getBuildingGroup() != null && wall.getBlueprint().isWallPiece()){ + float currentHealthRatio = wall.getCurrentHitpoints()/wall.healthMax; + float newMax = wall.getBlueprint().getMaxHealth(1); + wall.setMaxHitPoints(newMax); + wall.setHealth(wall.healthMax * currentHealthRatio); + } + } + // Push event to warehouse RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.LOST); @@ -406,6 +420,17 @@ public class Realm { this.configure(); this.updateDatabase(); + for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc,1750,MBServerStatics.MASK_BUILDING)){ + Building wall = (Building)awo; + if(wall.getBlueprint() != null && wall.getBlueprint().getBuildingGroup() != null && wall.getBlueprint().isWallPiece()){ + float currentHealthRatio = wall.getCurrentHitpoints()/wall.healthMax; + float newMax = wall.healthMax * 1.1f; + wall.setMaxHitPoints(newMax); + wall.setHealth(wall.healthMax * currentHealthRatio); + } + } + + // Push event to warehouse RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.CAPTURE);