No edit summary |
No edit summary |
||
| Line 26: | Line 26: | ||
function p.loot_table2(name,loot) | function p.loot_table2(name,loot) | ||
result = [[{{{!}} class="article-table" style="width:45%" | result = [[{{{!}} class="article-table" style="width:45%" | ||
! colspan="4" |]] .. '[[File:' .. name:gsub(' ', ''):gsub('%(', ''):gsub('%)', '') .. 'Monster.png' .. | ! colspan="4" |]] .. '[[File:' .. name:gsub(' ', ''):gsub('%(', ''):gsub('%)', '') .. 'Monster.png' .. '{{!}}30px{{!}}link=]]' .. [['''Loot Table''']] .. '[[File:' .. name:gsub(' ', ''):gsub('%(', ''):gsub('%)', '') .. 'Monster.png' .. '{{!}}30px{{!}}link=]]' .. [[ | ||
}}]] | |||
end | end | ||
Revision as of 22:03, 16 January 2025
Documentation for this module may be created at Module:Loot Table/doc
u = require("Module:Util")
local p = {}
function p.floor(number)
return number - number % 1
end
function p.loot_table(frame)
result = [[<div class="loot-table" style="display:inline"]] .. (frame.args['name'] and (frame.args['name'] ~= '') and (' title="'.. frame.args['name'] .. '"') or '') .. [[>
{{{!}} class="article-table" style="width:52%"
! Item
! Amount Dropped
! Rarity
]] .. frame.args[1] .. [[
{{!}}}
</div>]]
if string.match(result, '*') then
result = result .. [[
''* Can only be obtained once.'']]
end
return result
end
function p.loot_table2(name,loot)
result = [[{{{!}} class="article-table" style="width:45%"
! colspan="4" |]] .. '[[File:' .. name:gsub(' ', ''):gsub('%(', ''):gsub('%)', '') .. 'Monster.png' .. '{{!}}30px{{!}}link=]]' .. [['''Loot Table''']] .. '[[File:' .. name:gsub(' ', ''):gsub('%(', ''):gsub('%)', '') .. 'Monster.png' .. '{{!}}30px{{!}}link=]]' .. [[
}}]]
end
function p.loot_table_row(frame)
return [[{{!}}- class="]] .. u.r(frame.args[3]) .. [["
{{!}}]] .. '[[' .. [[File: ]] .. (frame.args['image'] or frame.args[1]:gsub(' ', ''):gsub('%(', ''):gsub('%)', '')) .. [[.png{{!}}40px{{!}}link=]] .. frame.args[1] .. ']]' .. [[
{{!}}]] .. frame.args[2] .. [[
{{!}}data-base="]] .. frame.args[3] .. [["{{!}}1/]] .. frame.args[3] .. (frame.args[4] and frame.args[4] ~= '' and '*' or '') .. [[
]]
end
p.lt = p.loot_table
p.ltr = p.loot_table_row
p.lt2 = p.loot_table2
return p