Here is how we did it some years ago - This was for a game with lots of items
We had a Webinterface on which we could add items to a Boss / Mob. The Lootable could be exported and looked kind of like this:
[bossID].table
[tr][td]tdID[/td][td]lnItemID[/td][td]tdDropChance[/td][/tr]
[tr][td]0[/td][td]1262[/td][td]0.01[/td][/tr]
[tr][td]1[/td][td]1337[/td][td]0.50[/td][/tr]
Every time a boss was loaded (start of level) , a random number between 1 and 100 was drawn for each item on the list.
DropChance was multiplied by the random number. If it was >= 1 we added it to a Collection.
Every Boss/Mobb had a chance to drop say 3 -6 items.
We would than randomly pick (random.nextInt(3) + 3) items from that Collection and wait for the boss to go down.
In the loottable were always enough dropChance = 1.0 items to guarantee something would drop.
Crazy times… 