Module:Mob

-- local p = {}

local getArgs = require('Module:Arguments').getArgs local string = require(Module:String) local _error = string._error local mobSprite = require(Module:Sprite)._mobSprite local format = require(Module:Format)

function p.mobSpawnsTable(frame) local args = getArgs(frame) local list = { {   		mob = args[1] or args.mob, spots = args[2] or args.spots, time = args[3] or args.time, max = args[4] or args.max, },   }    local i = 2 while args['mob'..i] do   	list[i] = { mob = args['mob'..i], spots = args['spots'..i], time = args['time'..i], max = args['max'..i], }   	i = i + 1 end return p._mobSpawnsTable(list) end

function p._mobSpawnsTable(list) local wikitable = mw.html.create('table'):addClass('wikitable') :tag('tr') :tag('th'):wikitext('Mob'):done :tag('th'):wikitext(format._makeAbbr('The number of spots in the location where this mob can spawn in.' ,'Spawn Spots')):done :tag('th'):wikitext(format._makeAbbr('The time, after which a new mob spawns in every spot.', 'Spawn Delay')):done :tag('th'):wikitext(format._makeAbbr('The maximum number of mobs that can exist in each spot at a time.', 'Max per spot')):done :done --if true then return tostring(wikitable) end for i, mob in ipairs( list ) do		wikitable:tag('tr') :tag('td'):wikitext(mobSprite(mob.mob, nil, true)):done :tag('td'):wikitext(mob.spots):done :tag('td'):wikitext(mob.time):done :tag('td'):wikitext(mob.max):done :done end return tostring(wikitable) end

return p