Files
Server/src/engine/loot/GenTableEntry.java
T

46 lines
1.8 KiB
Java
Raw Normal View History

2023-08-06 17:44:30 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot;
2023-08-07 09:42:40 -04:00
import engine.gameManager.LootManager;
2023-08-06 17:44:30 -04:00
import java.sql.ResultSet;
import java.sql.SQLException;
2023-08-07 09:42:40 -04:00
import java.util.List;
2023-08-06 17:44:30 -04:00
public class GenTableEntry {
public int minRoll;
public int maxRoll;
public int itemTableID;
public int pModTable;
public int sModTable;
public GenTableEntry(ResultSet rs) throws SQLException {
this.minRoll = rs.getInt("minRoll");
this.maxRoll = rs.getInt("maxRoll");
this.itemTableID = rs.getInt("itemTableID");
this.pModTable = rs.getInt("pModTableID");
this.sModTable = rs.getInt("sModTableID");
}
2023-08-07 09:42:40 -04:00
public static GenTableEntry rollTable(int genTable, int roll, float dropRate) {
2023-08-07 09:42:40 -04:00
GenTableEntry genTableEntry = null;
List<GenTableEntry> genTableEntryList;
genTableEntryList = LootManager._genTables.get(genTable);
for (GenTableEntry iteration : genTableEntryList)
if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
genTableEntry = iteration;
return genTableEntry;
}
2023-08-06 17:44:30 -04:00
}