Module:DropRateCalc: Difference between revisions
Jump to navigation
Jump to search
ThroatPDiddy (talk | contribs) (use for dynamic calcs on drop pages) |
ThroatPDiddy (talk | contribs) (match drop rate calc page) |
||
| Line 2: | Line 2: | ||
local buffs = { | local buffs = { | ||
{label = "Base", | {label = "Base", reduction = 0}, | ||
{label = "Donator", | {label = "Donator", reduction = 0.15}, | ||
{label = "Super | {label = "Super donator", reduction = 0.25}, | ||
{label = "Extreme | {label = "Extreme donator", reduction = 0.30}, | ||
{label = "Legendary | {label = "Legendary donator", reduction = 0.35}, | ||
{label = "Royal | {label = "Royal donator", reduction = 0.40}, | ||
{label = "Divine | {label = "Divine donator", reduction = 0.45}, | ||
} | } | ||
| Line 16: | Line 16: | ||
local cells = {} | local cells = {} | ||
for _, tier in ipairs(buffs) do | for _, tier in ipairs(buffs) do | ||
table.insert(cells, "1/" .. math.floor(base | table.insert(cells, "1/" .. math.floor(base * (1 - tier.reduction) + 0.5)) | ||
end | end | ||
return table.concat(cells, " || ") | return table.concat(cells, " || ") | ||
Revision as of 19:27, 18 July 2026
Need to test if Larran's keys are buffed, specifically for Template:CallistoDrops and the other bosses like that.
local p = {}
local buffs = {
{label = "Base", reduction = 0},
{label = "Donator", reduction = 0.15},
{label = "Super donator", reduction = 0.25},
{label = "Extreme donator", reduction = 0.30},
{label = "Legendary donator", reduction = 0.35},
{label = "Royal donator", reduction = 0.40},
{label = "Divine donator", reduction = 0.45},
}
function p.calc(frame)
local base = tonumber(frame.args[1])
if not base then return "Invalid base rate" end
local cells = {}
for _, tier in ipairs(buffs) do
table.insert(cells, "1/" .. math.floor(base * (1 - tier.reduction) + 0.5))
end
return table.concat(cells, " || ")
end
return p