Module:TabbedPOI

local p = {}

function p.main(frame) local args = require("Dev:Arguments").getArgs(frame) local NPCList = {} -- this table stores the NPC list local index = 0 local NPC, NPCcp, NPCnote while true do		index = index + 1 NPC = args['NPC' .. index] -- parameter if (not NPC) or (string.len(NPC) == 0) then break end NPCcp = args['NPC' .. index .. 'cp'] or '' -- parameter NPCnote = args['NPC' .. index .. 'note'] or '' -- parameter table.insert(NPCList, '* ' .. NPCcp .. ' ' .. '' .. NPC .. ' ' .. NPCnote) end index = 0 local EnemyList = {} -- this table stores the enemy list local Enemy, Enemycp, Enemynote while true do		index = index + 1 Enemy = args['Enemy' .. index] -- parameter if (not Enemy) or (string.len(Enemy) == 0) then break end Enemycp = args['Enemy' .. index .. 'cp'] or '' -- parameter Enemynote = args['Enemy' .. index .. 'note'] or '' -- parameter table.insert(EnemyList, '* ' .. Enemycp .. ' ' .. '' .. Enemy .. ' ' .. Enemynote) end index = 0 local BossList = {} -- this table stores the bosses list local Boss, Bosscp, Bossnote while true do		index = index + 1 Boss = args['Boss' .. index] -- parameter if (not Boss) or (string.len(Boss) == 0) then break end Bosscp = args['Boss' .. index .. 'cp'] or '' -- parameter Bossnote = args['Boss' .. index .. 'note'] or '' -- parameter table.insert(BossList, '* ' .. Bosscp .. ' ' .. '' .. Boss .. ' ' .. Bossnote) end index = 0 local LootList = {} -- this table stores the Loot list local Loot_Filename, Lootcp, Lootnote while true do		index = index + 1 Loot_Filename = args['Loot' .. index .. '_FileName'] -- parameter if (not Loot_Filename) or (string.len(Loot_Filename) == 0) then break end Lootcp = args['Loot' .. index .. 'cp'] or '' -- parameter Lootname = args['Loot' .. index .. '_Name'] or Loot_Filename -- parameter Lootamount = args['Loot' .. index .. '_Amount'] or ''-- parameter Lootdesc = args['Loot' .. index .. '_Description'] or ''-- parameter table.insert(LootList, '|style="width:16%;"| \n |style="width:84%;" | ' .. Lootcp .. ' ' .. Lootname .. ' ' .. ((Lootamount ~= ) and ('x ' .. Lootamount) or ) .. ((Lootdesc ~= ) and (' ' .. Lootdesc) or ) .. ' ') end local result = {} table.insert(result, '

')	table.insert(result, ' ')	table.insert(result, ' ')	if (#NPCList > 0) or (#EnemyList > 0) then		table.insert(result, '|-|' .. (args['Title1'] or 'Inhabitants') .. '=')		table.insert(result, '{| class="article-table" style="width:100%;"')		table.insert(result, '| style="width:50%; vertical-align:text-top;"|  Characters  ')		table.insert(result, ' 10) and '2' or '1') ..';">')		if #NPCList > 0 then			table.insert(result, table.concat(NPCList, '\n'))		else			table.insert(result, '* None')		end		table.insert(result, ' ')		table.insert(result, '| style="width:50%; vertical-align:text-top;"|  Enemies  ')		table.insert(result, ' 10) and '2' or '1') ..';">')		if #EnemyList > 0 then			table.insert(result, table.concat(EnemyList, '\n'))		elseif args['Unnamed'] or (string.len(args['Unnamed']) > 0) then			table.insert(result, '* See the gallery below for the list of enemies')		else			table.insert(result, '* None')		end		if #BossList > 0 then			table.insert(result, ' Bosses') table.insert(result, table.concat(BossList, '\n')) end table.insert(result, ' ') end if #LootList > 0 then table.insert(result, '|-|' .. (args['Title2'] or 'Points of Interest') .. '=') table.insert(result, '{| class="article-table loot-table" style="width:100%;"') table.insert(result, table.concat(LootList, '\n|-\n')) table.insert(result, '|}') end table.insert(result, ' ') table.insert(result, ' ') return frame:preprocess(table.concat(result, '\n')) end

return p