Module:AbilityData

Revision as of 17:35, 13 September 2024 by Saag (talk | contribs) (initial sandbox)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Deprecated

This module is being replaced by multiple modules in Module:Abilities. Any new functions should be created there


local p = {};
local data = mw.loadJsonData("Data:ItemData.json")

-- returns the table of a specific item
function get_json_item(name)
	for i,v in pairs(data) do
		if (v["Name"] == name) then
			return v
		end
	end
	return nil
end

--{{#invoke:ItemData|get_cost|ITEM_NAME}}--
p.test = function(frame)
	local item_name = frame.args[1]
	local item = get_json_item(item_name)

	return item
end

return p