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 tb = '{| class="wikitable collapsible collapsed" style="text-align: center"' tb = tb .. ' ! Drops !! Chance !! Amount !! Fortune I !! Fortune II !! Fortune III' for i, d in ipairs(idData) do       tb = tb .. ' |- | | ' .. d.chance .. ' | ' .. d.amount tb = tb .. ' | ' .. d.for1 .. ' | ' .. d.for2 .. ' | ' .. d.for3 end return tb .. '|}' end

return p