RuneScape Wiki
Advertisement
RuneScape Wiki

Documentation for this module may be created at Module:Bulwark calculator/doc

-- <pre>
local p = {}

function p.main(frame)
    local args = frame:getParent(frame).args
    local shieldTier = tonumber(args.shieldTier)
    local debilitateNoBulwark = 13 --debil lasts 13 ticks (7.8s) without a shield and no bulwark
    
    --length of debilitate from equipping a shield
    if shieldTier >= 10 then
        debilitateNoBulwark = debilitateNoBulwark + math.floor(1 + shieldTier/10)
    end
    
    local debilitate = debilitateNoBulwark
    local res = "Length of Debilitate with Bulwark" .. "<br/>"
    
    --bulwark perk ranks[0,1,2,3]. Rank 0 is equivalent to not using the perk
    local bulwark = {0,0,0,0}
    local increasedTicks = 0
    
    for perkRank = 0,3 do
        increasedTicks = math.max(perkRank,math.floor(debilitate * .06 *perkRank))
        bulwark[perkRank] = debilitate + increasedTicks
        
        res = res .. "Rank " .. perkRank .. " : " .. string.format("%2.1f",bulwark[perkRank]*.6) .. "s or " .. bulwark[perkRank] .. " ticks" .. " (+" .. bulwark[perkRank] - debilitateNoBulwark .. ")" ..  "<br/>"
    end
    
    return res
end

return p