loot manager for glass runes and contracts

This commit is contained in:
2024-06-15 19:44:37 -05:00
parent a46ad71bb0
commit 4f535ef5fe
2 changed files with 18 additions and 7 deletions
+13
View File
@@ -13,6 +13,7 @@ import engine.gameManager.LootManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
public class ItemTableEntry {
public int minRoll;
@@ -42,4 +43,16 @@ public class ItemTableEntry {
return itemTableEntry;
}
public static Integer getRandomItem(int itemTable) {
List<ItemTableEntry> itemTableEntryList;
itemTableEntryList = LootManager._itemTables.get(itemTable);
if(itemTableEntryList != null){
return (itemTableEntryList.get(ThreadLocalRandom.current().nextInt(0,itemTableEntryList.size() - 1))).cacheID;
}
return 0;
}
}