Do you think there is a more efficient way to write this code? It seems quite impractical and takes up a lot of space. Essentially, it's about the random chance of obtaining a rarity, like acquiring an Uncommon sword.
if (Math.random() * 100 < 100 / (19.37 / NewData.PriceDivider)) {
Rarity = Rarities.uncommon;
Embed.addField("Rarity", Rarity, true);
Embed.setColor("GREEN");
} else if (Math.random() * 100 < 100 / (5.18 / NewData.PriceDivider)) {
Rarity = Rarities.common;
Embed.addField("Rarity", Rarity, true);
Embed.setColor("GREY");
} else if (Math.random() * 100 < 100) {
Rarity = Rarities.basic;
Embed.addField("Rarity", Rarity, true);
Embed.setColor("GREY");
}