Module:User:NickTheRed37/DropsTable - minecraft.fandom.com
Jump to navigation
Jump to search
Treść tej podstrony pochodzi z artykułu „Module:User:NickTheRed37/DropsTable” w domenie minecraft.fandom.com na licencji CC BY-NC-SA 3.0
This module has no documentation. If you know how to use this module, please create it.
-- 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"\n'
tb = tb .. '! rowspan=2 | Drops !! rowspan=2 | Chance !! colspan=3 | ' .. fortune .. '\n'
tb = tb .. '|-\n! I !! II !! III'
for i, d in ipairs(idData) do
tb = tb .. '\n|-\n| ' .. d.amount .. ' {{' .. d.tp .. 'Link|' .. d.name .. '}} || ' .. d.chance
tb = tb .. ' || ' .. d.for1 .. ' || ' .. d.for2 .. ' || ' .. d.for3
end
return tb .. '\n|}'
end
return p