Browse Source

Slot added to stored procedures.

master
MagicBot 2 years ago
parent
commit
6d73e12c5c
  1. 3
      src/engine/db/handlers/dbMobHandler.java
  2. 3
      src/engine/db/handlers/dbNPCHandler.java
  3. 4
      src/engine/objects/Mob.java
  4. 2
      src/engine/objects/NPC.java

3
src/engine/db/handlers/dbMobHandler.java

@ -28,7 +28,7 @@ public class dbMobHandler extends dbHandlerBase { @@ -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 { @@ -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);

3
src/engine/db/handlers/dbNPCHandler.java

@ -27,7 +27,7 @@ public class dbNPCHandler extends dbHandlerBase { @@ -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 { @@ -43,6 +43,7 @@ public class dbNPCHandler extends dbHandlerBase {
} else {
setInt(11, 0);
}
setInt(12, toAdd.slot);
int objectUUID = (int) getUUID();
if (objectUUID > 0) {

4
src/engine/objects/Mob.java

@ -102,6 +102,8 @@ public class Mob extends AbstractIntelligenceAgent { @@ -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 { @@ -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 );
}

2
src/engine/objects/NPC.java

@ -94,7 +94,7 @@ public class NPC extends AbstractCharacter { @@ -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;

Loading…
Cancel
Save