Module:Drops

-- Rewrite of Module:DropsLine -- Rewrite of Module:Get drop info local Drops = {}

-- Libraries of functions --

-- Loads high frequency functions local HF = require('Module:HF')

-- Parses invocation and template parameters, trims whitespace, and removes blanks. local getArgs = require('Dev:Arguments').getArgs

-- Language functions for the default language local lang = mw.language.getContentLanguage

-- Smarter boolean logic local yesno = require( 'Dev:Yesno' )

-- Wikitext lists local L = require( 'Dev:List' )

-- support local IDL = require( 'Module:ItemDropsLine' ).main local _IDL = require( 'Module:ItemDropsLine' )._main

-- Local functions (used only in this Module) --

local function categories(...) local name,quantity,rarity = unpack(...) local cats = {} name = name:lower quantity = quantity:lower if name:find('effigy') then table.insert(cats, HF.Category('Effigy dropping monsters')) elseif name:find('clue scroll') then table.insert(cats, HF.Category('Clue scroll dropping monsters')) elseif name:find('rare drop table') then table.insert(cats, HF.Category('Monsters with access to the rare drop table')) end if not rarities[rarity:lower] then table.insert(cats, HF.Category('Needs drop rarity added')) end if quantity:find('unknown') then table.insert(cats, HF.Category('Needs drop quantity added')) end return table.concat(cats) end - -- Internal functions (used in this and other Modules) -- - -- function Drops.DML (frame) local args = getArgs(frame, { parentOnly = true }) local listfor = args[1] or mw.title.getCurrentTitle.fullText local head = frame:newTemplateParserValue{ title = "ItemDropsTableHead", args = { listfor } }	local foot = frame:newTemplateParserValue{ title = "ItemDropsEnd" } local results = mw.smw.ask{ HF.Link(("Drops item::%s"):format(listfor)), '?=monster', 'userparam='..(listfor), 'namedargs=yes', 'searchlabel=', 'limit='..(args['limit'] or 50), 'sort='..(args['sort'] or ''), 'order='..(args['order'] or '') }	if not results then return HF.Category('Empty drop lists') end local output = {} --[==[	 :''This list was created dynamically. For help, see the FAQ.''
 * To force an update of this list, click .

--]==]

for _,item in ipairs(results) do		table.insert(output, _IDL) end return ( head and head:expand or '' ) .. table.concat(output) .. ( foot and foot:expand or '' ) end

- -- Output (send it back to whatever called it) -- - return Drops