forked from MagicBane/Server
_itemTableEntry created.
Class init cleaned up.
This commit is contained in:
@@ -30,12 +30,13 @@ public enum LootManager {
|
||||
// Newer tables
|
||||
|
||||
public static HashMap<Integer, ArrayList<GenTableEntry>> _genTables = new HashMap<>();
|
||||
public static HashMap<Integer, ArrayList<ItemTableEntry>> _itemTable = new HashMap<>();
|
||||
|
||||
//new tables
|
||||
public static final HashMap<Integer, GenTable> generalItemTables = new HashMap<>();
|
||||
public static final HashMap<Integer, ItemTable> itemTables = new HashMap<>();
|
||||
public static final HashMap<Integer, ModTypeTable> modTypeTables = new HashMap<>();
|
||||
public static final HashMap<Integer, ModTable> modTables = new HashMap<>();
|
||||
public static final HashMap<Integer, GenTable> generalItemTables = null;
|
||||
public static final HashMap<Integer, ItemTable> itemTables = null;
|
||||
public static final HashMap<Integer, ModTypeTable> modTypeTables = null;
|
||||
public static final HashMap<Integer, ModTable> modTables = null;
|
||||
|
||||
// Drop Rates
|
||||
|
||||
@@ -52,6 +53,8 @@ public enum LootManager {
|
||||
|
||||
// Load loot tables from database.
|
||||
|
||||
_genTables = DbManager.LootQueries.LOAD_GEN_ITEM_TABLES();
|
||||
|
||||
DbManager.LootQueries.LOAD_ALL_GENTABLES();
|
||||
DbManager.LootQueries.LOAD_ALL_ITEMTABLES();
|
||||
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");
|
||||
LootManager.init();
|
||||
|
||||
//load old loot system (still needed for rolling for now)
|
||||
LootManager.populateLootTables();
|
||||
RuneBaseAttribute.LoadAllAttributes();
|
||||
RuneBase.LoadAllRuneBases();
|
||||
BaseClass.LoadAllBaseClasses();
|
||||
|
||||
Reference in New Issue
Block a user