Templates backfilled with modtable data
This commit is contained in:
@@ -193,9 +193,26 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void LOAD_TEMPLATE_MODTABLES() {
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_vendor_items`;");
|
||||
ResultSet rs = preparedStatement.executeQuery()) {
|
||||
|
||||
while (rs.next()) {
|
||||
int templateID = rs.getInt("templateID");
|
||||
int modTable = rs.getInt("modTable");
|
||||
ItemTemplate template = ItemTemplate.templates.get(templateID);
|
||||
template.modTable = modTable;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
}
|
||||
public Item GET_ITEM(final int itemUUID) {
|
||||
|
||||
Item item;
|
||||
|
||||
@@ -422,7 +422,6 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
writer.putInt(rollableSet.size());
|
||||
|
||||
for (int templateID : rollableSet) {
|
||||
ItemBase item = ItemBase.getItemBase(templateID);
|
||||
ItemTemplate template = ItemTemplate.templates.get(templateID);
|
||||
writer.put((byte) 1);
|
||||
writer.putInt(0);
|
||||
@@ -430,10 +429,10 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
writer.putInt(template.item_value);
|
||||
writer.putInt(600);
|
||||
writer.put((byte) 1);
|
||||
writer.put((byte) item.getModTable());
|
||||
writer.put((byte) item.getModTable());
|
||||
writer.put((byte) item.getModTable());
|
||||
writer.put((byte) item.getModTable());//EffectItemType
|
||||
writer.put((byte) template.modTable);
|
||||
writer.put((byte) template.modTable);
|
||||
writer.put((byte) template.modTable);
|
||||
writer.put((byte) template.modTable);//EffectItemType
|
||||
}
|
||||
|
||||
List<MobLoot> itemList = npc.getRolling();
|
||||
|
||||
@@ -640,7 +640,6 @@ public class ItemFactory {
|
||||
ModTableEntry prefixEntry = null;
|
||||
ModTableEntry suffixEntry = null;
|
||||
|
||||
ItemBase ib = ItemBase.getItemBase(templateID);
|
||||
ItemTemplate template = ItemTemplate.templates.get(templateID);
|
||||
|
||||
if (template == null)
|
||||
@@ -654,7 +653,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
itemModTable = (byte) ib.getModTable();
|
||||
itemModTable = (byte) template.modTable;
|
||||
|
||||
if (!vendor.getItemModTable().contains(itemModTable)) {
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ public class ItemTemplate {
|
||||
public static HashMap<String, Integer> item_power_grant = new HashMap<>();
|
||||
public HashMap<String, int[]> item_power_action = new HashMap<>();
|
||||
public HashMap<Enum.ResourceType, Integer> item_resource_cost = new HashMap<>();
|
||||
public int modTable;
|
||||
|
||||
// Deed related fields
|
||||
|
||||
|
||||
@@ -263,9 +263,6 @@ public class LoginServer {
|
||||
Logger.info("Initializing Blueprint data.");
|
||||
Blueprint.loadAllBlueprints();
|
||||
|
||||
Logger.info("Loading Item Templates");
|
||||
DbManager.ItemQueries.LOAD_ITEM_TEMPLATES();
|
||||
|
||||
Logger.info("Loading Kits");
|
||||
DbManager.KitQueries.GET_ALL_KITS();
|
||||
|
||||
|
||||
@@ -343,6 +343,9 @@ public class WorldServer {
|
||||
Logger.info("Loading Item Templates");
|
||||
DbManager.ItemQueries.LOAD_ITEM_TEMPLATES();
|
||||
|
||||
Logger.info("Back fill template modTables");
|
||||
DbManager.ItemQueries.LOAD_TEMPLATE_MODTABLES();
|
||||
|
||||
Logger.info("Loading ItemBases");
|
||||
ItemBase.loadAllItemBases();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user