Browse Source

Table refactor to conform with sb.

master
MagicBot 1 year ago
parent
commit
42069fe170
  1. 12
      src/engine/db/handlers/dbLootTableHandler.java
  2. 6
      src/engine/objects/LootTable.java

12
src/engine/db/handlers/dbLootTableHandler.java

@ -30,7 +30,7 @@ public class dbLootTableHandler extends dbHandlerBase { @@ -30,7 +30,7 @@ public class dbLootTableHandler extends dbHandlerBase {
}
public void populateLootGroups() {
public void populateGenTables() {
int recordsRead = 0;
@ -41,7 +41,7 @@ public class dbLootTableHandler extends dbHandlerBase { @@ -41,7 +41,7 @@ public class dbLootTableHandler extends dbHandlerBase {
while (rs.next()) {
recordsRead++;
LootTable lootTable = LootTable.getLootGroup(rs.getInt("groupID"));
LootTable lootTable = LootTable.getLootGroup(rs.getInt("genTable"));
lootTable.addRow(rs.getFloat("minRoll"), rs.getFloat("maxRoll"), rs.getInt("lootTableID"), rs.getInt("pModTableID"), rs.getInt("sModTableID"), "");
}
@ -52,7 +52,7 @@ public class dbLootTableHandler extends dbHandlerBase { @@ -52,7 +52,7 @@ public class dbLootTableHandler extends dbHandlerBase {
Logger.info("read: " + recordsRead + " cached: " + LootTable.getLootGroups().size());
}
public void populateLootTables() {
public void populateItemTables() {
int recordsRead = 0;
@ -63,7 +63,7 @@ public class dbLootTableHandler extends dbHandlerBase { @@ -63,7 +63,7 @@ public class dbLootTableHandler extends dbHandlerBase {
while (rs.next()) {
recordsRead++;
LootTable lootTable = LootTable.getLootTable(rs.getInt("lootTable"));
LootTable lootTable = LootTable.getLootTable(rs.getInt("itemTable"));
lootTable.addRow(rs.getFloat("minRoll"), rs.getFloat("maxRoll"), rs.getInt("itemBaseUUID"), rs.getInt("minSpawn"), rs.getInt("maxSpawn"), "");
}
@ -96,7 +96,7 @@ public class dbLootTableHandler extends dbHandlerBase { @@ -96,7 +96,7 @@ public class dbLootTableHandler extends dbHandlerBase {
Logger.info("read: " + recordsRead + " cached: " + LootTable.getModTables().size());
}
public void populateModGroups() {
public void populateModTypeTables() {
int recordsRead = 0;
@ -107,7 +107,7 @@ public class dbLootTableHandler extends dbHandlerBase { @@ -107,7 +107,7 @@ public class dbLootTableHandler extends dbHandlerBase {
while (rs.next()) {
recordsRead++;
LootTable lootTable = LootTable.getModGroup(rs.getInt("modGroup"));
LootTable lootTable = LootTable.getModGroup(rs.getInt("modType"));
lootTable.addRow(rs.getFloat("minRoll"), rs.getFloat("maxRoll"), rs.getInt("subTableID"), 0, 0, "");
}

6
src/engine/objects/LootTable.java

@ -127,10 +127,10 @@ public class LootTable { @@ -127,10 +127,10 @@ public class LootTable {
//call this on server startup to populate the tables
public static void populateLootTables() {
DbManager.LootQueries.populateLootGroups();
DbManager.LootQueries.populateLootTables();
DbManager.LootQueries.populateGenTables();
DbManager.LootQueries.populateItemTables();
DbManager.LootQueries.populateModTables();
DbManager.LootQueries.populateModGroups();
DbManager.LootQueries.populateModTypeTables();
//preset chances for rune drops
populateStatRuneChances();

Loading…
Cancel
Save