|
|
@ -502,20 +502,11 @@ public enum LootManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static ItemBase rollRandomItem(int itemTable, int min){ |
|
|
|
public static ItemBase rollRandomItem(int itemTable, int min){ |
|
|
|
ItemTableEntry itemTableEntry = null; |
|
|
|
int roll = ThreadLocalRandom.current().nextInt(min,321); |
|
|
|
List<ItemTableEntry> itemTableEntryList; |
|
|
|
ItemTableEntry ite = ItemTableEntry.rollTable(itemTable, roll); |
|
|
|
|
|
|
|
if(ite != null) { |
|
|
|
itemTableEntryList = LootManager._itemTables.get(itemTable); |
|
|
|
return ItemBase.getItemBase(ite.cacheID); |
|
|
|
int maxRoll = 320; |
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|