FANDOM


local p = {}
 
local commas = require('Module:Addcommas')._add
local tables = require('Module:Tables')
 
local xps = {
	250, 276, 308, 340, 373, 416, 492, 508, 777, 614,
	680, 752, 822, 916, 1008, 1046, 1096, 1140, 1192, 1240,
	1298, 1348, 1408, 1470, 1536, 1596, 1621, 1656, 1812, 1892,
	1973, 2056, 2144, 2237, 2332, 2434, 2540, 2648, 2766, 2882,
	3008, 3138, 3272, 3414, 3558, 3716, 3882, 4050, 4220, 4404,
	4593, 4800, 4998, 5218, 5448, 5688, 5940, 6184, 6466, 6737,
	7030, 7342, 7645, 8018, 8432, 8686, 9076, 9516, 9880, 10371,
	10772, 11237, 11786, 12328, 12855, 13358, 13980, 14587, 15169, 15920,
	16664, 17390, 18087, 19048, 19674, 20132, 21502, 22370, 23690, 24486,
	25806, 26458, 27714, 28944, 30130, 32258, 33390, 34408
}
 
function p.main(frame)
	local args = frame:getParent().args
	multiplier = args.multiplier or 1
	cols = tonumber(args.cols)
	local xptable = mw.html.create('table'):addClass('wikitable'):css({['text-align'] = 'center'})
	rows = math.ceil(99 / cols)
	data = {{{text = 'Skill level', tag = 'th'}, {text = 'Experience', tag = 'th'}}}
	for i=2,cols do
		data[1][3*i-3] = {text = '', tag = 'th', attr = {rowspan = rows + 1}}
		data[1][3*i-2] = {text = 'Skill level', tag = 'th'}
		data[1][3*i-1] = {text = 'Experience', tag = 'th'}
	end
	for i=1,rows do
		data[i+1] = {}
		for j=1,cols do
			level = (j-1) * rows + i
			if level < 99 then
				xp = commas(math.floor(xps[level] * multiplier / 4))
				if level == 98 then
					level = '98+'
				end
				data[i+1][j*3-2] = {text = level}
				data[i+1][j*3-1] = {text = xp}
				data[i+1][j*3] = false
			end
		end
	end
	tables._table(xptable, data)
	return tostring(xptable)
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.