Module:ItemSacrifies

local getData = require('Module:Iteminfo').getItemStat local info = require('Module:Iteminfo').info

local tr = require('Module:Tr')

local unused = require('Module:Iteminfo/idSets').getIdSet('Unused')

local na local no_item local lang

local l10n_info = { ["en"] = { ["id"] = "ID", ["item"] = "Item", ["research"] = "Research", ["deprecated"] = "(Deprecated)", },	["ru"] = { ["item"] = "Предмет", ["research"] = "Исследование", ["deprecated"] = "(Отсутствует)" },	["vi"] = { ["item"] = "Vật phẩm", } }

local l10n_table

local function l10n(key) return l10n_table[key] or l10n_info['en'][key] or '' end

local replaceName = { [115] = "Shadow Orb (item)", [669] = "Fish (item)", [989] = 'Enchanted Sword (item)', [1435] = "The Destroyer (item)", [1475] = "Darkness (Painting)", [2436] = "Jellyfish (bait)", [2437] = "Jellyfish (bait)", [2438] = "Jellyfish (bait)", [3062] = "Crimson Heart (item)", [4633] = "Oasis (Painting)", [4725] = "Graveyard (Painting)", }

local function row(id) local result = ' ' .. id .. ' '	local name = getData(id, 'name') local sac = getData(id, 'sacrifices') local linkName = '' if unused[id] then result = result .. ' ' .. no_item .. ' ' .. ' ' .. na .. ' '	else linkName = replaceName[id] or name if lang == 'en' then result = result .. ' ' .. name .. ' ' else result = result .. ' ' .. tr.translate(name, lang) .. ' ' end result = result .. ' ' .. (sac ~= 0 and sac or na) .. ' '	end return result end

return { main = function(frame) lang = frame:expandTemplate{ title = 'lang' } l10n_table = l10n_info[lang] or l10n_info['en'] na = frame:expandTemplate{ title = 'na' } no_item = ' ~ ' .. l10n('deprecated') .. '' local result = { ' ' return table.concat(result, '\n') end, }