var rarity =
[ "common ", "uncommon ", "rare "];
var weapons =
[ "sword ", "bow ", "staff "];
document.write (rarity[Math.floor( Math.random() * 3 )]);
document.write (weapons[Math.floor( Math.random() * 3 )]);
Here's a basic generator, but right now it's fully random, I want to control the rate of generation via probability.
like the probability of generating common is 60% or the probability of generating sword is 50%
I want to add the probability to both rarity and weapon var
also, is it possible to assign a universal probability of being generated to a group of items?