Module:Raids loot

local p = {}

function p.main(frame) local args = frame:getParent.args return p._main(args.points) end

function p._main(points) local unique_rate = 0.8 * points / 570000 function make_row(items, rate) return string.format('\n|-\n| %s\n|style="text-align:right;"| %s', items, mw.ext.ParserFunctions.expr(1/(unique_rate*rate/84) .. ' round 2')) end local ret = { '{| class="wikitable"\n! Items\n! Chance (1 in x, each)', make_row('Arcane/Dextrous prayer scroll', 20), make_row('Dragon sword/harpoon/thrownaxe', 5), make_row('Twisted buckler, Dragon hunter crossbow', 4), make_row('Dinh\'s bulwark, Ancestral hat/robe top/robe bottom, Dragon claws', 3), make_row('Elder maul, Kodai insignia, Twisted bow', 2), '\n|}' }	return table.concat(ret, '') end

return p