Module:DropRateCalc: Difference between revisions

From Roat Pkz
Jump to navigation Jump to search
(use for dynamic calcs on drop pages)
 
(match drop rate calc page)
Line 2: Line 2:


local buffs = {
local buffs = {
     {label = "Base", mult = 1.00},
     {label = "Base", reduction = 0},
     {label = "Donator", mult = 1.15},
     {label = "Donator", reduction = 0.15},
     {label = "Super Donator", mult = 1.25},
     {label = "Super donator", reduction = 0.25},
     {label = "Extreme Donator",mult = 1.30},
     {label = "Extreme donator", reduction = 0.30},
     {label = "Legendary Donator", mult = 1.35},
     {label = "Legendary donator", reduction = 0.35},
     {label = "Royal Donator", mult = 1.40},
     {label = "Royal donator", reduction = 0.40},
     {label = "Divine Donator", mult = 1.45},
     {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 / tier.mult + 0.5))
         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