Module:Items: Difference between revisions

63 bytes removed ,  8 September 2023
getEquipRequirements: Support AoD (and other namespaces) for 'Completion' requirement type
m (Hotfix)
(getEquipRequirements: Support AoD (and other namespaces) for 'Completion' requirement type)
Line 457: Line 457:
result = result..'\r\n|style="text-align:right;"| '..req.count
result = result..'\r\n|style="text-align:right;"| '..req.count
elseif req.type == "Completion" then
elseif req.type == "Completion" then
local compName = ""
local ns = GameData.getEntityByID(GameData.namespaces, req.namespace)
if req.namespace == "melvorBaseGame" then
if ns == nil then
compName = "Base Game"
return '\r\n!style="text-align:right;" colspan=2|' .. Shared.printError('Invalid namespace for completion requirement "' .. req.namespace .. '"')
elseif req.namespace == "melvorTotH" then
compName = "Throne of the Herald"
else
else
return '\r\n!style="text-align:right;" colspan=2|' .. Shared.printError('Invalid namespace for completion requirement "' .. req.namespace .. '"')
result = '\r\n!style="text-align:right;"| ' .. ns.displayName .. ' Completion'
result = result .. '\r\n|style="text-align:right;"| ' .. req.percent .. '%'
end
end
result = '\r\n!style="text-align:right;"| '..compName..' Completion'
result = result..'\r\n|style="text-align:right;"| '..req.percent..'%'
else
else
return '\r\n!style="text-align:right;" colspan=2|' .. Shared.printError('Invalid equip requirement type "' .. req.type .. '"')
return '\r\n!style="text-align:right;" colspan=2|' .. Shared.printError('Invalid equip requirement type "' .. req.type .. '"')