Module:DunItem

local getArgs = require('Module:Arguments').getArgs local p = {}

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args) local IS = require("Module:IS").main local item = IS({args[1]}) or nil local name = args[1] or '??' local loc = args[2] or '??' local tile = args[3] or '??' local visibility = args[4] or '??' local sprite = args["sprite"] or nil local row = mw.html.create local cells = mw.html.create if name == "Shards" then item = IS({"Yellow Shard", "Items/Tutor Items"}) elseif name == "Gummis" then item = IS({"Blue Gummi", "Items/Gummis"}) elseif string.match(name, "[{<].*$") then item = string.gsub(name, "(.-)[{<].*", "%1") item = IS({item}) end

if sprite then item = IS({sprite}) end cells :tag('td'):wikitext(item) :done :tag('td'):wikitext(name) :done :tag('td'):wikitext(loc) :done :tag('td'):wikitext(tile) :done :tag('td'):wikitext(visibility) :done

row :tag('tr') :node(cells)

return tostring(row) end

return p