Module:User:NickTheRed37/DropsTable

-- Drops table module. -- Created by Naista2002 on October 21, 2014 p = {}

function p.makeTable(f) local args = f   if f == mw.getCurrentFrame then args = require('Module:ProcessArgs').merge(true) end local id = args.id   local settings = args.settings local aliases = mw.loadData('Module:' .. settings .. '/Aliases') local data = mw.loadData('Module:' .. settings .. '/Data') id = aliases[id:lower] or id   local idData = data[id] or error("ID not recognized: " .. id) local fortune = settings == 'Mob' and 'Looting' or 'Fortune' local tb = '{| class="wikitable collapsible collapsed" style="text-align: center"' tb = tb .. ' ! rowspan=2 | Drops !! rowspan=2 | Chance !! colspan=3 | ' .. fortune tb = tb .. ' |- ! I !! II !! III ' for i, d in ipairs(idData) do       tb = tb .. ' |- | ' .. d.amount .. ' | ' .. d.chance tb = tb .. ' | ' .. d.for1 .. ' | ' .. d.for2 .. ' | ' .. d.for3 end return tb .. '|}' end

return p