Module:Boss pets calculator

local p = {}

function p.main(frame) local pet = 0 local args = frame:getParent.args for i=1,1000000 do   local petRNG = math.random(1, args.denominator) if petRNG <= math.min(math.floor(args.killCount / args.threshold) + 1, 10) then pet = pet + 1 end end local averageKills = 1000000 / pet local s = "" .. "The selected boss pet was acquired " .. string.format("%.0f", averageKills) .. " times on average, across a simulation of " .. string.format("%.0f", kills) .. " boss kills." .. " " return s end