Module:Sandbox/Items: Difference between revisions

no edit summary
No edit summary
No edit summary
 
Line 97: Line 97:
result = false
result = false
end
end
elseif (string.find(StatName, '^(.+)LevelRequired$') ~= nil or string.find(StatName, '^(.+)AbyssalLevel$') ~= nil) and item.equipRequirements ~= nil then
elseif string.find(StatName, '^(.+)LevelRequired$') ~= nil and item.equipRequirements ~= nil then
local skillName = nil
local skillName = Shared.titleCase(string.match(StatName, '^(.+)LevelRequired$'))
if string.find(StatName, '^(.+)AbyssalLevel$') then
skillName = Shared.titleCase(string.match(StatName, '^(.+)AbyssalLevel$'))
else
skillName = Shared.titleCase(string.match(StatName, '^(.+)LevelRequired$'))
end
if skillName ~= nil then
if skillName ~= nil then
local skillID = Constants.getSkillID(skillName)
local skillID = Constants.getSkillID(skillName)
Line 112: Line 107:
break
break
end
end
if requirement.type == "AbyssalLevel" and requirement.skillID == skillID then
end
result = requirement.abyssalLevel
end
end
elseif string.find(StatName, '^(.+)AbyssalLevel$') ~= nil and item.equipRequirements ~= nil then
local skillName = Shared.titleCase(string.match(StatName, '^(.+)AbyssalLevel$'))
if skillName ~= nil then
local skillID = Constants.getSkillID(skillName)
if skillID ~= nil then
for i, requirement in ipairs(item.equipRequirements) do
if requirement.type == 'AbyssalLevel' and requirement.skillID == skillID then
result = requirement.level
break
break
end
end