Documentation for this module may be created at Module:Memoria level experience/doc

local PrintTable = require('Module:PrintTable')

local p = {}

function row_attr(lv)
    local value = 'style="text-align: right; '
    if lv == 30 or lv == 35 or lv == 40 or lv == 50 then
        value = value .. 'font-weight: bold; background-color: rgba(128, 128, 128, 0.3);'
    end
    
    return value .. '"' 
end

function cell_transformer(value)
    if value == '' then
        return value
    end
    return '{{formatnum:' .. value .. '}}'
end

function preprocess(frame, string)
    if frame ~= nil then 
        return frame:preprocess(string)
    else
        return string
    end
end
 
function p.main(frame)
    local data = {}
    -- 1: "Level" 2: "Exp to next" 3: "Accum. exp to level"
    
    local expList = {0, 100,210,330,460,600,760,950,1180,1460,1800,2210,2690,3240,3860,4550,5310,6140,7040,8010,9050,10160,11340,12590,13910,15300,16760,18290,19890,21560,23300,25110,26990,28940,30960,33050,35210,37440,39740,42110,44550,47060,49640,52290,55010,57800,60660,63590,66590,69660}
    
    for lv = 1, #expList do
        local row = {}
        row[1] = lv
        row[3] = expList[lv]
        
        if lv == #expList then
            row[2] = ''
        else
            row[2] = expList[lv + 1] - expList[lv]
        end
        data[lv] = row

    end
   
    return preprocess(frame, PrintTable(data, row_attr, nil, cell_transformer))
end
 
return p
Community content is available under CC-BY-SA unless otherwise noted.