loot manager for glass runes and contracts
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user