_itemTableEntry created.
Class init cleaned up.
This commit is contained in:
@@ -30,12 +30,13 @@ public enum LootManager {
|
|||||||
// Newer tables
|
// Newer tables
|
||||||
|
|
||||||
public static HashMap<Integer, ArrayList<GenTableEntry>> _genTables = new HashMap<>();
|
public static HashMap<Integer, ArrayList<GenTableEntry>> _genTables = new HashMap<>();
|
||||||
|
public static HashMap<Integer, ArrayList<ItemTableEntry>> _itemTable = new HashMap<>();
|
||||||
|
|
||||||
//new tables
|
//new tables
|
||||||
public static final HashMap<Integer, GenTable> generalItemTables = new HashMap<>();
|
public static final HashMap<Integer, GenTable> generalItemTables = null;
|
||||||
public static final HashMap<Integer, ItemTable> itemTables = new HashMap<>();
|
public static final HashMap<Integer, ItemTable> itemTables = null;
|
||||||
public static final HashMap<Integer, ModTypeTable> modTypeTables = new HashMap<>();
|
public static final HashMap<Integer, ModTypeTable> modTypeTables = null;
|
||||||
public static final HashMap<Integer, ModTable> modTables = new HashMap<>();
|
public static final HashMap<Integer, ModTable> modTables = null;
|
||||||
|
|
||||||
// Drop Rates
|
// Drop Rates
|
||||||
|
|
||||||
@@ -52,6 +53,8 @@ public enum LootManager {
|
|||||||
|
|
||||||
// Load loot tables from database.
|
// Load loot tables from database.
|
||||||
|
|
||||||
|
_genTables = DbManager.LootQueries.LOAD_GEN_ITEM_TABLES();
|
||||||
|
|
||||||
DbManager.LootQueries.LOAD_ALL_GENTABLES();
|
DbManager.LootQueries.LOAD_ALL_GENTABLES();
|
||||||
DbManager.LootQueries.LOAD_ALL_ITEMTABLES();
|
DbManager.LootQueries.LOAD_ALL_ITEMTABLES();
|
||||||
DbManager.LootQueries.LOAD_ALL_MODTYPES();
|
DbManager.LootQueries.LOAD_ALL_MODTYPES();
|
||||||
@@ -440,15 +443,4 @@ public enum LootManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//call this on server startup to populate the tables
|
|
||||||
public static void populateLootTables() {
|
|
||||||
|
|
||||||
_genTables = DbManager.LootQueries.LOAD_GEN_ITEM_TABLES();
|
|
||||||
|
|
||||||
DbManager.LootQueries.populateGenTables();
|
|
||||||
DbManager.LootQueries.populateItemTables();
|
|
||||||
DbManager.LootQueries.populateModTables();
|
|
||||||
DbManager.LootQueries.populateModTypeTables();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
package engine.loot;
|
||||||
|
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class ItemTableEntry {
|
||||||
|
public int minRoll;
|
||||||
|
public int maxRoll;
|
||||||
|
public int cacheID;
|
||||||
|
public int minSpawn;
|
||||||
|
public int maxSpawn;
|
||||||
|
|
||||||
|
public ItemTableEntry(ResultSet rs) throws SQLException {
|
||||||
|
this.minRoll = rs.getInt("minRoll");
|
||||||
|
this.maxRoll = rs.getInt("maxRoll");
|
||||||
|
this.cacheID = rs.getInt("itemBaseUUID");
|
||||||
|
this.minSpawn = rs.getInt("minSpawn");
|
||||||
|
this.maxSpawn = rs.getInt("maxSpawn");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -340,8 +340,6 @@ public class WorldServer {
|
|||||||
Logger.info("Initializing Loot Manager");
|
Logger.info("Initializing Loot Manager");
|
||||||
LootManager.init();
|
LootManager.init();
|
||||||
|
|
||||||
//load old loot system (still needed for rolling for now)
|
|
||||||
LootManager.populateLootTables();
|
|
||||||
RuneBaseAttribute.LoadAllAttributes();
|
RuneBaseAttribute.LoadAllAttributes();
|
||||||
RuneBase.LoadAllRuneBases();
|
RuneBase.LoadAllRuneBases();
|
||||||
BaseClass.LoadAllBaseClasses();
|
BaseClass.LoadAllBaseClasses();
|
||||||
|
|||||||
Reference in New Issue
Block a user