Module:ListOfDrops

local cargo = mw.ext.cargo local link = require('Module:Item').go local tr = require('Module:Tr').translate

local currentFrame local lang local na

local cargoData = cargo.query('Drops', 'name, item, quantity, rate, custom, isfromnpc', {	orderBy = "item ASC",	limit = 5000, })

local function returnRow(data) if data['isfromnpc'] == '0' then return end local item = data['custom'] and data['custom'] or link(currentFrame, {data['item'], tr(data['item'], lang), small = 'y'}) local quantity = data['quantity'] or na local result = '|-\n| ' .. item .. ' \n| ' .. data['name'] .. ' \n| '.. quantity .. ' \n| ' .. data['rate'] .. ' '	return result end

local result

return { main = function(frame) currentFrame = frame lang = currentFrame:expandTemplate{ title = 'lang'} na = currentFrame:expandTemplate{ title = 'na'} result = {'{| class="terraria lined sortable"', '! Item !! Entity !! Quantity !! data-sort-type="number" | Chance' } for _,v in ipairs(cargoData) do			result[#result + 1] = returnRow(v) end result[#result + 1] = '|}' return table.concat(result, '\n') end }