diff --git a/src/engine/net/client/msg/LoadCharacterMsg.java b/src/engine/net/client/msg/LoadCharacterMsg.java index abe292ad..706026e9 100644 --- a/src/engine/net/client/msg/LoadCharacterMsg.java +++ b/src/engine/net/client/msg/LoadCharacterMsg.java @@ -71,14 +71,13 @@ public class LoadCharacterMsg extends ClientNetMsg { protected void _serialize(ByteBufferWriter writer) throws SerializationException { if (absChar != null && absChar.getObjectType() == GameObjectType.NPC) { - NPC npc = (NPC)absChar; + NPC npc = (NPC) absChar; - - if (npc.getBuilding() != null){ - writer.putInt(npc.getBuildingLevel()); - writer.putInt(npc.getBuildingFloor()); - }else{ + if (npc.getRegion() != null) { + writer.putInt(npc.getRegion().getLevel()); + writer.putInt(npc.getRegion().getRoom()); + } else { writer.putInt(-1); writer.putInt(-1); } diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 7fe202b8..85eb4787 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -85,8 +85,7 @@ public class NPC extends AbstractCharacter { private int parentZoneID; public ArrayList forgedItems = new ArrayList<>(); - private int buildingLevel; - private int buildingFloor; + public HashMap equip = null; private String nameOverride = ""; private int equipmentSetID = 0; @@ -262,9 +261,6 @@ public class NPC extends AbstractCharacter { if (this.upgradeDateTime != null) submitUpgradeJob(); - this.buildingFloor = (rs.getInt("npc_buildingFloor")); - this.buildingLevel = (rs.getInt("npc_buildingLevel")); - if (this.contract != null) this.nameOverride = rs.getString("npc_name") + " the " + this.getContract().getName(); else @@ -388,14 +384,6 @@ public class NPC extends AbstractCharacter { // Configure region and floor/level for this NPC this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); - - if (this.region != null) { - this.buildingFloor = region.getRoom(); - this.buildingLevel = region.getLevel(); - } else { - this.buildingFloor = -1; - this.buildingLevel = -1; - } } if (this.mobBase != null) { @@ -1456,14 +1444,6 @@ public class NPC extends AbstractCharacter { return true; } - public int getBuildingLevel() { - return buildingLevel; - } - - public int getBuildingFloor() { - return buildingFloor; - } - public HashMap getEquip() { return equip; }