From d5e69446c78862cc7d75da8b5e0f6273cab249e8 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 2 Mar 2025 21:29:01 -0600 Subject: [PATCH] admin building creation --- .../client/handlers/PlaceAssetMsgHandler.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 9d96dfb3..99158058 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -1027,6 +1027,10 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { private boolean placeCityWalls(PlayerCharacter player, ClientConnection origin, PlaceAssetMsg msg) { + if(player.getAccount().status.equals(AccountStatus.ADMIN)){ + adminCreateBuildings(player,msg); + return false; + } // Member variables Zone serverZone; @@ -1165,7 +1169,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { return true; } - private Building createStructure(PlayerCharacter playerCharacter, PlacementInfo buildingInfo, Zone currentZone) { + private static Building createStructure(PlayerCharacter playerCharacter, PlacementInfo buildingInfo, Zone currentZone) { Blueprint blueprint; Building newMesh; @@ -1387,4 +1391,14 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { return true; } + + public static void adminCreateBuildings(PlayerCharacter pc, PlaceAssetMsg msg){ + //handled for building dungeon layouts + Zone zone = ZoneManager.getZoneByZoneID(993); + for(PlacementInfo placement : msg.getPlacementInfo()){ + Building building = createStructure(pc,placement,zone); + if(building != null) + building.setProtectionState(ProtectionState.NPC); + } + } } \ No newline at end of file