Module:Item spawns

local p = {} --p stands for package

p.items = mw.loadJsonData( "Module:Item infobox/itemData.json" ) p.lootPools = mw.loadJsonData( "Module:Item spawns/lootPoolData.json" ) p.containers = mw.loadJsonData( "Module:Item spawns/containerData.json" )

local args = mw.getCurrentFrame.args

for k, v in pairs(p.items) do   if args[1] == v["inGameName"] then p.item = k       break end end

function p.main( frame ) local encodedName = mw.uri.encode(p.items[p.item]["inGameName"]) local par = nil; if args[2] == 'hide text' then par = '' else par = mw.html.create( "p" ) par:wikitext("\'\'\'" .. p.items[p.item]["inGameName"] .. "\'\'\' can be found in many locations of Fortuna III. Find all of its spawns on our Interactive Map: " .. mw.text.nowiki( "[" ) .. "BS" ..mw.text.nowiki( "] [" ) .."CF".. mw.text.nowiki( "] [" ) .. "TI" .. mw.text.nowiki( "]") .. ". Specifically, it can be found in the following Loot Containers, depending on the tier. This list does not include non-container or special spawns." ) :addClass( "plainlinks") end local tab = " " return tostring(par) .. tostring (tab) end

-- thanks http://lua-users.org/wiki/SimpleRound function round(num, numDecimalPlaces) local mult = 10^(numDecimalPlaces or 0) return math.floor(num * mult + 0.5) / mult end

return p