Unconnected
Maybe you could store your items into 'groups' of data.
Give each group a percentage:
001-042 = group: junk items
043-066 = group: common items
067-081 = group: uncommon items
082-092 = group: rare items.
093-098 = group: epic items.
099-100 = group: legendary items.
Roll a random number 1-100. Say the result = 72. This falls into the 'uncommon' item group. You can now choose a random item from the 'uncommon' group.
You might need to scale those numbers a little.