From 6d73e12c5c0e3949decb0965d87060d3849c0ca5 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 24 Apr 2023 16:23:13 -0400 Subject: [PATCH] Slot added to stored procedures. --- src/engine/db/handlers/dbMobHandler.java | 3 ++- src/engine/db/handlers/dbNPCHandler.java | 3 ++- src/engine/objects/Mob.java | 4 ++++ src/engine/objects/NPC.java | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index 815558c5..d4e115f5 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -28,7 +28,7 @@ public class dbMobHandler extends dbHandlerBase { public Mob ADD_MOB(Mob toAdd) { - prepareCallable("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); + prepareCallable("CALL `mob_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); setLong(1, toAdd.getParentZoneID()); setInt(2, toAdd.getMobBaseID()); setInt(3, toAdd.getGuildUUID()); @@ -45,6 +45,7 @@ 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); diff --git a/src/engine/db/handlers/dbNPCHandler.java b/src/engine/db/handlers/dbNPCHandler.java index bd3b539e..4bca6e4e 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,6 +43,7 @@ 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 93d2166e..097d82c4 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -102,6 +102,8 @@ public class Mob extends AbstractIntelligenceAgent { private DateTime upgradeDateTime = null; private boolean lootSync = false; + public int slot = -1; + /** * No Id Constructor */ @@ -276,6 +278,8 @@ 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 7ab4632e..18d463ce 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -94,7 +94,7 @@ public class NPC extends AbstractCharacter { private String nameOverride = ""; private int equipmentSetID = 0; public int runeSetID = 0; - private int slot; + public int slot; private Regions region = null; public Vector3fImmutable inBuildingLoc = Vector3fImmutable.ZERO;