Module:ArmorChance
Appearance
Documentation for this module may be created at Module:ArmorChance/doc
local p = {}
function p.table(frame)
local level = tonumber(frame.args.level or frame.args[1]) or 1
if level < 1 then
level = 1
end
local output = {
'{| class="wikitable"',
'|+ Liver Pull Chance by Character Level',
'! Armor Type<br>(not Armor Class)',
'! Percentage'
}
for armorType = 10, 1, -1 do
local chance = (level * 10) - ((10 - armorType) * 7)
if chance < 0 then
chance = 0
end
table.insert(output, '|-')
table.insert(output, '| ' .. armorType)
table.insert(output, '| ' .. chance .. '%')
end
table.insert(output, '|}')
return table.concat(output, '\n')
end
return p