From 49c956d2bfa3f8d9828f57cbc322f4eb03a85bd9 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 13 Mar 2025 21:01:58 -0500 Subject: [PATCH] hellgates maybe? round 2 --- src/engine/gameManager/HellgateManager.java | 11 +++++++---- src/engine/objects/Hellgate.java | 12 ++++++++---- src/engine/objects/Mob.java | 13 +++++++++---- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/engine/gameManager/HellgateManager.java b/src/engine/gameManager/HellgateManager.java index 5d00b80e..472f196d 100644 --- a/src/engine/gameManager/HellgateManager.java +++ b/src/engine/gameManager/HellgateManager.java @@ -49,9 +49,10 @@ public class HellgateManager { mob.atrHandOne = 1800; mob.defenseRating = 2200; mob.setFirstName("Hellgate Commander"); - WorldGrid.addObject(mob,realLoc.x,realLoc.z); InterestManager.setObjectDirty(mob); + WorldGrid.addObject(mob,realLoc.x,realLoc.z); WorldGrid.updateObject(mob); + mob.runAfterLoad(); LootManager.GenerateStrongholdLoot(mob,true,false); hellgate.mini_bosses.add(mob); mob.setObjectUUID(mob.getObjectUUID() - (10000 + offsetUID)); @@ -76,6 +77,7 @@ public class HellgateManager { WorldGrid.addObject(minion,offset.x,offset.z); InterestManager.setObjectDirty(minion); WorldGrid.updateObject(minion); + minion.runAfterLoad(); LootManager.GenerateStrongholdLoot(minion,false,false); hellgate.mobs.add(minion); minion.setObjectUUID(minion.getObjectUUID() - (10000 + offsetUID)); @@ -93,6 +95,7 @@ public class HellgateManager { WorldGrid.addObject(mob,hellgate.parent.getLoc().x,hellgate.parent.getLoc().z); InterestManager.setObjectDirty(mob); WorldGrid.updateObject(mob); + mob.runAfterLoad(); LootManager.GenerateStrongholdLoot(mob,false,true); hellgate.boss = mob; mob.setObjectUUID(mob.getObjectUUID() - (10000 + offsetUID)); @@ -157,8 +160,8 @@ public class HellgateManager { mobWithoutID.level = (short) level; // Set the parent zone and parentZoneID - mobWithoutID.parentZone = null; - mobWithoutID.parentZoneID = 0; + mobWithoutID.parentZone = ZoneManager.getZoneByUUID(993); + mobWithoutID.parentZoneID = 993; // Avoid database actions and directly return the created mobWithoutID mobWithoutID.setObjectTypeMask(MBServerStatics.MASK_MOB | mobWithoutID.getTypeMasks()); @@ -167,7 +170,7 @@ public class HellgateManager { } public static void pulseHellgates(){ - if(HellgateManager.hellgates == null){ + if(HellgateManager.hellgates == null || HellgateManager.hellgates.isEmpty()){ HellgateManager.hellgates = new ArrayList<>(); Hellgate hellgate = new Hellgate(993); HellgateManager.hellgates.add(hellgate); diff --git a/src/engine/objects/Hellgate.java b/src/engine/objects/Hellgate.java index 7cecd982..b90ea77b 100644 --- a/src/engine/objects/Hellgate.java +++ b/src/engine/objects/Hellgate.java @@ -24,10 +24,14 @@ public class Hellgate { } this.parent = parentZone; this.entrances = new ArrayList<>(); - entrances.add(ZoneManager.getZoneByUUID(994).getLoc()); - entrances.add(ZoneManager.getZoneByUUID(996).getLoc()); - entrances.add(ZoneManager.getZoneByUUID(997).getLoc()); - entrances.add(ZoneManager.getZoneByUUID(998).getLoc()); + Zone entrance1 = ZoneManager.getZoneByUUID(994); + Zone entrance2 = ZoneManager.getZoneByUUID(996); + Zone entrance3 = ZoneManager.getZoneByUUID(997); + Zone entrance4 = ZoneManager.getZoneByUUID(998); + //entrances.add(ZoneManager.getZoneByUUID(994).getLoc()); + //entrances.add(ZoneManager.getZoneByUUID(996).getLoc()); + //entrances.add(ZoneManager.getZoneByUUID(997).getLoc()); + //entrances.add(ZoneManager.getZoneByUUID(998).getLoc()); this.mobs = new ArrayList<>(); this.mini_bosses = new ArrayList<>(); this.completionTime = 0L; diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 31dab8b4..67bc9487 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -142,6 +142,7 @@ public class Mob extends AbstractIntelligenceAgent { if (building != null && building.getOwner() != null) { this.lastName = "the " + contract.getName(); } + this.gridObjectType = GridObjectType.DYNAMIC; clearStatic(); } @@ -2003,11 +2004,15 @@ public class Mob extends AbstractIntelligenceAgent { //skip for pets if (this.isPet() == false && (this.agentType.equals(AIAgentType.PET)) == false && this.isNecroPet() == false) { - if (this.getMobBase().notEnemy.size() > 0) - this.notEnemy.addAll(this.getMobBase().notEnemy); + try { + if (this.getMobBase().notEnemy.size() > 0) + this.notEnemy.addAll(this.getMobBase().notEnemy); + + if (this.getMobBase().enemy.size() > 0) + this.enemy.addAll(this.getMobBase().enemy); + }catch(Exception ignored){ - if (this.getMobBase().enemy.size() > 0) - this.enemy.addAll(this.getMobBase().enemy); + } } try {