diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index d4e115f5..004d8de8 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -28,8 +28,8 @@ public class dbMobHandler extends dbHandlerBase { public Mob ADD_MOB(Mob toAdd) { - prepareCallable("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); - setLong(1, toAdd.getParentZoneID()); + prepareCallable("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); + setLong(1, toAdd.getParentZoneID()); setInt(2, toAdd.getMobBaseID()); setInt(3, toAdd.getGuildUUID()); setFloat(4, toAdd.getSpawnX()); @@ -45,7 +45,6 @@ public class dbMobHandler extends dbHandlerBase { setInt(11, toAdd.getBuildingID()); setInt(12, toAdd.getLevel()); setString(13, toAdd.getFirstName()); - setInt(14, toAdd.slot); int objectUUID = (int) getUUID(); if (objectUUID > 0) return GET_MOB(objectUUID); @@ -141,17 +140,6 @@ public class dbMobHandler extends dbHandlerBase { return getLargeObjectList(); } - public ArrayList GET_ALL_MOBS_FOR_BUILDING(int buildingID) { - prepareCallable("SELECT * FROM `obj_mob` WHERE `mob_buildingID` = ?"); - setInt(1, buildingID); - return getObjectList(); - } - - public ArrayList GET_ALL_MOBS() { - prepareCallable("SELECT `obj_mob`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mob` ON `obj_mob`.`UID` = `object`.`UID`;"); - return getObjectList(); - } - public Mob GET_MOB(final int objectUUID) { prepareCallable("SELECT `obj_mob`.*, `object`.`parent` FROM `object` INNER JOIN `obj_mob` ON `obj_mob`.`UID` = `object`.`UID` WHERE `object`.`UID` = ?;"); setLong(1, objectUUID); @@ -168,13 +156,6 @@ public class dbMobHandler extends dbHandlerBase { return executeUpdate(); } - public boolean UPDATE_MOB_BUILDING(int buildingID, int mobID) { - prepareCallable("UPDATE `object` INNER JOIN `obj_mob` On `object`.`UID` = `obj_mob`.`UID` SET `obj_mob`.`mob_buildingID`=? WHERE `obj_mob`.`UID`=?;"); - setInt(1, buildingID); - setInt(2, mobID); - return (executeUpdate() > 0); - } - public String SET_PROPERTY(final Mob m, String name, Object new_value) { prepareCallable("CALL mob_SETPROP(?,?,?)"); setLong(1, m.getObjectUUID()); diff --git a/src/engine/db/handlers/dbNPCHandler.java b/src/engine/db/handlers/dbNPCHandler.java index 4bca6e4e..bd3b539e 100644 --- a/src/engine/db/handlers/dbNPCHandler.java +++ b/src/engine/db/handlers/dbNPCHandler.java @@ -27,7 +27,7 @@ public class dbNPCHandler extends dbHandlerBase { } public NPC ADD_NPC(NPC toAdd, boolean isMob) { - prepareCallable("CALL `npc_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); + prepareCallable("CALL `npc_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); setLong(1, toAdd.getParentZoneID()); setString(2, toAdd.getName()); setInt(3, toAdd.getContractID()); @@ -43,7 +43,6 @@ public class dbNPCHandler extends dbHandlerBase { } else { setInt(11, 0); } - setInt(12, toAdd.slot); int objectUUID = (int) getUUID(); if (objectUUID > 0) { diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 097d82c4..f6e5d960 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -36,7 +36,6 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -102,8 +101,6 @@ public class Mob extends AbstractIntelligenceAgent { private DateTime upgradeDateTime = null; private boolean lootSync = false; - public int slot = -1; - /** * No Id Constructor */ @@ -278,8 +275,6 @@ public class Mob extends AbstractIntelligenceAgent { if (rs.getString("fsm").length() > 1) this.BehaviourType = MobBehaviourType.valueOf(rs.getString("fsm")); - this.slot = rs.getInt("slot"); - } catch (Exception e) { Logger.error(e + " " + this.dbID ); } diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 17af4da3..39ef163f 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -94,7 +94,6 @@ public class NPC extends AbstractCharacter { private String nameOverride = ""; private int equipmentSetID = 0; public int runeSetID = 0; - public int slot = -1; private Regions region = null; public Vector3fImmutable inBuildingLoc = Vector3fImmutable.ZERO; @@ -224,8 +223,6 @@ public class NPC extends AbstractCharacter { this.statAlt = rs.getFloat("npc_spawnY"); this.statLon = rs.getFloat("npc_spawnZ"); - this.slot = rs.getInt("npc_slot"); - if (this.contract != null) { this.symbol = this.contract.getIconID(); this.modTypeTable = this.contract.getNPCModTypeTable(); @@ -909,10 +906,7 @@ public class NPC extends AbstractCharacter { BuildingLocation buildingLocation = null; //-1 slot means no slot available in building. - if (this.slot != -1) - putSlot = this.slot; - else - putSlot = NPC.getBuildingSlot(this); + putSlot = NPC.getBuildingSlot(this); buildingLocation = buildingModel.getSlotLocation(putSlot); @@ -1556,7 +1550,6 @@ public class NPC extends AbstractCharacter { if (!DbManager.NPCQueries.UPDATE_SLOT(npc, slot)) return false; - npc.slot = slot; return true; }