FANDOM


-- <pre>
 
local lang = mw.getContentLanguage()
 
local p = {}
 
local MAX_LEVEL = 888
local LEVELS_PER_TABLE = 50
 
function getExpForLevel(pLevel)
    if pLevel >= 1 and pLevel < 29 then
        return 32 + (pLevel - 1)*(pLevel + 2)
    elseif pLevel >= 29 and pLevel < 59 then
        return 900 + 5*(pLevel-29)*(pLevel+30)
    else
        return 14250 + 15*(pLevel-59)*(pLevel+60)
    end
end
 
function getExpForLevelRecursive(pNum, pLevel)
    if pLevel == 0 then
        return 32
    elseif pLevel >= 1 and pLevel < 29 then
        return pNum + 2*(pLevel+1)
    elseif pLevel >= 29 and pLevel < 59 then
        return pNum + 10*(pLevel+1)
    else
        return pNum + 15*(pLevel+1)
    end
end
 
function p.tables(pFrame)
    --local args = pFrame.arguments
    local t = {}
 
    local tPrevNum = 28
    local tTotal = 0
 
    t[#t+1] = '<tabber>'
    for i = 0, (MAX_LEVEL-1) do
        if (i)%LEVELS_PER_TABLE == 0 then
            if not i == 0 then t[#t+1] = '|}' end
            t[#t+1] = '|-| '..(i+1)..' to '..(i + (LEVELS_PER_TABLE) < MAX_LEVEL and i + (LEVELS_PER_TABLE) or MAX_LEVEL)..'='
            t[#t+1] = '{| class="wikitable"'
            t[#t+1] = '! Level'
            t[#t+1] = '! Experience<br />Needed'
            t[#t+1] = '! Experience<br />in total'
        end
        t[#t+1] = '|-'
        t[#t+1] = '|'..(i+1)
        tPrevNum = getExpForLevelRecursive(tPrevNum, i)
        t[#t+1] = '|'..lang:formatNum(tPrevNum)
        tTotal = tTotal + tPrevNum
        t[#t+1] = '|'..lang:formatNum(tTotal)
    end
    t[#t+1] = '</tabber>'
 
    return pFrame:preprocess( table.concat(t,"\n") )
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.