Guest User

Untitled

a guest
Jun 19th, 2014
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private Item chooseRandItem(int slot, int tier, Random rand) {
  2. List<Item> itemList = Arrays.asList((Item[])items.keySet().toArray());
  3. Collections.shuffle(mats);
  4. Item chosen = itemList.get(rand.nextInt());
  5.  
  6. if (items.containsKey(chosen)) {
  7. int randNum = rand.nextInt(100);
  8. int chance = items.get(chosen) - (tier - 1) * 5;
  9. if (randNum < chance) {
  10. chooseRandItem(slot, tier, rand);
  11. return null;
  12. }
  13. return chosen;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment