local rarities = {"Basic", "Common", "Uncommon", "Rare", "Epic", "Legendary", "Mythical", "Divine", "Super", "Mega", "Ultra", "Omega", "Extreme", "Ultimate", "Insane", "Hyper", "Godly", "Unique", "Exotic", "Supreme", "Celestial", "Eternal", "Cosmic", "Heavenly", "Stellar", "Infinity", "Dimensional", "Reality"}
local signs = {"-", "", "+", "++"}
function inttoRarity(n)
if n > #rarities * #signs then return rarities[#rarities].."+"..((n-(#rarities*#signs))+2) end
local num = (math.ceil(n/4))
local signNum = (n % 4)
if signNum == 0 then
signNum = 4
end
return rarities[num]..signs[signNum]
end
function round3(n)
return math.floor(n/3)*3
end
function round100(n)
return math.floor(n*100)/100
end
function getRarityChance(n)
if n < 65 then
return 10^((n-1)/8)
else
return (2^(n-65))*100000000
end
end
local signs = {
"K",
"M",
"B",
"T",
"Qd",
"Qn",
"Sx",
"Sp",
"Oc",
"No",
"De",
"UDe",
}
function shorten(n)
if n >= 1000 then
local num = round100(n/10^round100(round3(math.floor(math.log10(n)))))
local sign = signs[round3(math.floor(math.log10(n)))/3]
return num..sign
else
return n
end
end
function getRNG(num, luck)
return num/luck
end
local luck = 1
local num = io.read()
for i = 1, (num-1) do
luck = luck + (math.sqrt(luck)/1.75)
end
local boost = 1
luck = luck * boost
for i = 1, ((#rarities*#signs)+1) do
local chance = round100(getRarityChance(i))
local rng = round100(getRNG(chance, luck))
print(inttoRarity(i).." Chance: 1/"..shorten(chance).." RNG: 1/"..shorten(rng))
end
To embed this project on your website, copy the following code and paste it into your website's HTML: