Browse Source

loot manager for glass runes and contracts

lakebane-new
FatBoy-DOTC 5 months ago
parent
commit
90d6911d41
  1. 17
      src/engine/gameManager/LootManager.java

17
src/engine/gameManager/LootManager.java

@ -502,19 +502,10 @@ public enum LootManager { @@ -502,19 +502,10 @@ public enum LootManager {
}
public static ItemBase rollRandomItem(int itemTable, int min){
ItemTableEntry itemTableEntry = null;
List<ItemTableEntry> itemTableEntryList;
itemTableEntryList = LootManager._itemTables.get(itemTable);
int maxRoll = 320;
int roll = ThreadLocalRandom.current().nextInt(min,maxRoll + 1);
for (ItemTableEntry iteration : itemTableEntryList)
if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
itemTableEntry = iteration;
if(itemTableEntry != null && itemTableEntry.cacheID != 0) {
return ItemBase.getItemBase(itemTableEntry.cacheID);
int roll = ThreadLocalRandom.current().nextInt(min,321);
ItemTableEntry ite = ItemTableEntry.rollTable(itemTable, roll);
if(ite != null) {
return ItemBase.getItemBase(ite.cacheID);
}else{
return null;
}

Loading…
Cancel
Save