From 14af2f6efdbd1d018a73fe3b8130a496f8d6bb2a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 25 Aug 2023 14:01:47 -0400 Subject: [PATCH] Minion spawning re-enabled for refactoring. --- src/engine/db/handlers/dbMobHandler.java | 6 +++--- src/engine/server/world/WorldServer.java | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index 4986254e..423748ca 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -101,17 +101,17 @@ public class dbMobHandler extends dbHandlerBase { return row_count; } - public void LOAD_PATROL_POINTS(Mob captain) { + public void LOAD_GUARD_MINIONS(Mob guardCaptain) { try (Connection connection = DbManager.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_guards` WHERE `captainUID` = ?")) { - preparedStatement.setInt(1, captain.getObjectUUID()); + preparedStatement.setInt(1, guardCaptain.getObjectUUID()); ResultSet rs = preparedStatement.executeQuery(); while (rs.next()) { String name = rs.getString("name"); - Mob toCreate = Mob.createGuardMob(captain, captain.getGuild(), captain.getParentZone(), captain.building.getLoc(), captain.getLevel(), name); + Mob toCreate = Mob.createGuardMob(guardCaptain, guardCaptain.getGuild(), guardCaptain.getParentZone(), guardCaptain.building.getLoc(), guardCaptain.getLevel(), name); if (toCreate == null) return; diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index b73a68f2..62016ef7 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -595,9 +595,10 @@ public class WorldServer { m.setObjectTypeMask(MBServerStatics.MASK_MOB | m.getTypeMasks()); m.setLoc(m.getLoc()); - //ADD GUARDS HERE. - // if (m.building != null && m.building.getBlueprint() != null && m.building.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) - // DbManager.MobQueries.LOAD_PATROL_POINTS(m); + // Load Minions for Guard Captains here. + + if (m.building != null && m.building.getBlueprint() != null && m.building.getBlueprint().getBuildingGroup() == Enum.BuildingGroup.BARRACK) + DbManager.MobQueries.LOAD_GUARD_MINIONS(m); } //Handle npc's