Browse Source

Fidaltiy garbage removed from NPC class.

master
MagicBot 2 years ago
parent
commit
24b6820a1b
  1. 41
      src/engine/db/handlers/dbNPCHandler.java
  2. 2
      src/engine/devcmd/cmds/InfoCmd.java
  3. 40
      src/engine/objects/NPC.java

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

@ -243,48 +243,7 @@ public class dbNPCHandler extends dbHandlerBase {
closeCallable(); closeCallable();
} }
} }
public void LOAD_RUNES_FOR_FIDELITY_NPC(NPC npc) {
prepareCallable("SELECT static_zone_npc.npcID,static_zone_npc.loadNum, static_zone_npc.classID, static_zone_npc.professionID, static_zone_npc.extraRune, static_zone_npc.extraRune2 FROM static_zone_npc WHERE static_zone_npc.loadNum = ? AND static_zone_npc.npcID = ?");
setInt(1,npc.getParentZoneID());
setInt(2, npc.getFidalityID());
try {
ResultSet rs = executeQuery();
while (rs.next()) {
int classID = rs.getInt("classID");
int professionID = rs.getInt("professionID");
int extraRune = rs.getInt("extraRune");
int extraRune2 = rs.getInt("extraRune2");
npc.classID = classID;
npc.professionID = professionID;
npc.extraRune = extraRune;
npc.extraRune2 = extraRune2;
}
rs.close();
} catch (SQLException e) {
Logger.error( e.toString());
} finally {
closeCallable();
}
}
public boolean ADD_TO_PRODUCTION_LIST(final long ID,final long npcUID, final long itemBaseID, DateTime dateTime, String prefix, String suffix, String name, boolean isRandom, int playerID) { public boolean ADD_TO_PRODUCTION_LIST(final long ID,final long npcUID, final long itemBaseID, DateTime dateTime, String prefix, String suffix, String name, boolean isRandom, int playerID) {
prepareCallable("INSERT INTO `dyn_npc_production` (`ID`,`npcUID`, `itemBaseID`,`dateToUpgrade`, `isRandom`, `prefix`, `suffix`, `name`,`playerID`) VALUES (?,?,?,?,?,?,?,?,?)"); prepareCallable("INSERT INTO `dyn_npc_production` (`ID`,`npcUID`, `itemBaseID`,`dateToUpgrade`, `isRandom`, `prefix`, `suffix`, `name`,`playerID`) VALUES (?,?,?,?,?,?,?,?,?)");

2
src/engine/devcmd/cmds/InfoCmd.java

@ -382,8 +382,6 @@ public class InfoCmd extends AbstractDevCmd {
output += newline; output += newline;
output += "Slottable: " + targetNPC.getContract().getAllowedBuildings().toString(); output += "Slottable: " + targetNPC.getContract().getAllowedBuildings().toString();
output += newline; output += newline;
output += "Fidelity ID: " + targetNPC.getFidalityID();
output += newline;
output += "EquipSet: " + targetNPC.getEquipmentSetID(); output += "EquipSet: " + targetNPC.getEquipmentSetID();
output += newline; output += newline;
output += "Parent Zone LoadNum : " + targetNPC.getParentZone().getLoadNum(); output += "Parent Zone LoadNum : " + targetNPC.getParentZone().getLoadNum();

40
src/engine/objects/NPC.java

@ -89,7 +89,6 @@ public class NPC extends AbstractCharacter {
private int parentZoneID; private int parentZoneID;
public ArrayList<ProducedItem> forgedItems = new ArrayList<>(); public ArrayList<ProducedItem> forgedItems = new ArrayList<>();
private int fidalityID;
private int buildingLevel; private int buildingLevel;
private int buildingFloor; private int buildingFloor;
public HashMap<Integer, MobEquipment> equip = null; public HashMap<Integer, MobEquipment> equip = null;
@ -188,7 +187,6 @@ public class NPC extends AbstractCharacter {
this.gridObjectType = GridObjectType.STATIC; this.gridObjectType = GridObjectType.STATIC;
this.contract = DbManager.ContractQueries.GET_CONTRACT(contractID); this.contract = DbManager.ContractQueries.GET_CONTRACT(contractID);
this.fidalityID = (rs.getInt("fidalityID"));
this.equipmentSetID = rs.getInt("equipmentSet"); this.equipmentSetID = rs.getInt("equipmentSet");
this.runeSetID = rs.getInt("runeSet"); this.runeSetID = rs.getInt("runeSet");
@ -202,8 +200,7 @@ public class NPC extends AbstractCharacter {
int mobBaseOverride = rs.getInt("npc_raceID"); int mobBaseOverride = rs.getInt("npc_raceID");
if ((this.fidalityID != 0) || (mobBaseOverride != 0)) this.loadID = mobBaseOverride;
this.loadID = mobBaseOverride;
this.mobBase = MobBase.getMobBase(this.loadID); this.mobBase = MobBase.getMobBase(this.loadID);
this.level = rs.getByte("npc_level"); this.level = rs.getByte("npc_level");
@ -253,12 +250,6 @@ public class NPC extends AbstractCharacter {
int guildID = rs.getInt("npc_guildID"); int guildID = rs.getInt("npc_guildID");
if (this.fidalityID != 0){
if (this.building != null)
this.guild = this.building.getGuild();
else
this.guild = Guild.getGuild(guildID);
}else
if (this.building != null) if (this.building != null)
this.guild = this.building.getGuild(); this.guild = this.building.getGuild();
else else
@ -266,9 +257,8 @@ public class NPC extends AbstractCharacter {
if (guildID != 0 && (this.guild == null || this.guild.isEmptyGuild())) if (guildID != 0 && (this.guild == null || this.guild.isEmptyGuild()))
NPC.Oprhans.add(currentID); NPC.Oprhans.add(currentID);
else if(this.building == null && buildingID > 0) { else if(this.building == null && buildingID > 0)
NPC.Oprhans.add(currentID); NPC.Oprhans.add(currentID);
}
if (this.guild == null) if (this.guild == null)
this.guild = Guild.getErrantGuild(); this.guild = Guild.getErrantGuild();
@ -292,8 +282,8 @@ public class NPC extends AbstractCharacter {
this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID)); this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID));
if (this.fidalityID != 0)
this.nameOverride = rs.getString("npc_name"); this.nameOverride = rs.getString("npc_name");
}catch(Exception e){ }catch(Exception e){
Logger.error(e); Logger.error(e);
@ -367,7 +357,7 @@ public class NPC extends AbstractCharacter {
} }
//add this npc to building //add this npc to building
if (this.building != null && this.loadID != 0 && this.fidalityID == 0) { if (this.building != null && this.loadID != 0) {
if (building.getBlueprint() != null){ if (building.getBlueprint() != null){
@ -1175,9 +1165,6 @@ public class NPC extends AbstractCharacter {
if (ConfigManager.serverType.equals(ServerType.LOGINSERVER)) if (ConfigManager.serverType.equals(ServerType.LOGINSERVER))
return; return;
if (this.fidalityID != 0)
DbManager.NPCQueries.LOAD_RUNES_FOR_FIDELITY_NPC(this);
try{ try{
this.equip = loadEquipmentSet(this.equipmentSetID); this.equip = loadEquipmentSet(this.equipmentSetID);
@ -1621,10 +1608,6 @@ public class NPC extends AbstractCharacter {
return true; return true;
} }
public int getFidalityID() {
return fidalityID;
}
public int getBuildingLevel() { public int getBuildingLevel() {
return buildingLevel; return buildingLevel;
} }
@ -1650,21 +1633,12 @@ public class NPC extends AbstractCharacter {
if (buildingModel == null) if (buildingModel == null)
return -1; return -1;
if (npc.fidalityID != 0){ if (npc.building.getHirelings().containsKey(npc))
slot = (npc.building.getHirelings().get(npc));
if (npc.building.fidelityNpcs.get(npc.currentID) != null){
slot = npc.building.fidelityNpcs.get(npc.currentID);
}
} else{
if (npc.building.getHirelings().containsKey(npc))
slot = (npc.building.getHirelings().get(npc));
}
if (buildingModel.getNPCLocation(slot) == null) if (buildingModel.getNPCLocation(slot) == null)
return -1; return -1;
return slot; return slot;
} }

Loading…
Cancel
Save