FANDOM


local getTable = function(data)
    local ret = {}
    ret.getValue = function(key, value)
        index = data.headers[value]
        row = data.records[key]
        return (index and row and row[index]) or "???"
    end
    return ret
end
 
local p = {}
 
-- For cross Module calls. Returns an object with "getValue"
p.getWeapon = function()
    return getTable(require("Module:WeaponInfo"))
end
 
p.getArmor = function()
    return getTable(require("Module:ArmorInfo"))
end
 
p.getPet = function()
    return getTable(require("Module:PetInfo"))
end
 
p.getBoss = function()
    return getTable(require("Module:BossInfo"))
end
 
-- For mainspace calls
p.Weapon = function(frame)
    return p.getWeapon().getValue(frame.args[1], frame.args[2])
end
 
p.Armor = function(frame)
    return p.getArmor().getValue(frame.args[1], frame.args[2])
end
 
p.Pet = function(frame)
    return p.getPet().getValue(frame.args[1], frame.args[2])
end
 
p.Boss = function(frame)
    return p.getBoss().getValue(frame.args[1], frame.args[2])
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.