Documentation for this module may be created at Module:Weapon/doc
local weapons_table = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title='Template:Weapons.json'})
local p = {}
p.getWeapon = function(frame)
local weapon = frame.args[1]
local txt = nil
for i=1, #weapons_table, 1 do
if weapons_table[i]['name'] == npc then
path = weapon[i]['path']
type = weapon[i]['type']
name = weapon[i]['name']
quality = weapon[i]['quality']
damage = weapon[i]['damage']
speed = weapon[i]['speed']
critchance = weapon[i]['critchance']
txt = txt .. frame:expandTemplate{ title = 'Infobox weapon', args = {title = name} }
end
end
return txt
end
return p