Anonymous

Module:CombatAreas: Difference between revisions

From Melvor Idle
getExpansionIcon: Implement
(getMonsterAreas: Add handling for Lair of the Spider Queen random monster pool)
(getExpansionIcon: Implement)
(One intermediate revision by the same user not shown)
Line 57: Line 57:


     return resultArray
     return resultArray
end
--Returns the expansion icon for the area if it has one
function p.getExpansionIcon(frame)
local areaName = frame.args ~= nil and frame.args[1] or frame
local area = p.getArea(areaName)
if area == nil then
return "ERROR: No area named " .. areaName .. " exists in the data module[[Category:Pages with script errors]]"
end
return Icons.getExpansionIcon(area.id)
end
end


Line 96: Line 107:


if area.unlockRequirement ~= nil then
if area.unlockRequirement ~= nil then
        addReqsToArray(resultArray, area.unlockRequirement)
-- Avoid repeating the same requirements twice, can happen for some dungeons e.g. Impending Darkness
if area.entryRequirements == nil or mw.dumpObject(area.unlockRequirement) ~= mw.dumpObject(area.entryRequirements) then
        addReqsToArray(resultArray, area.unlockRequirement)
        end
end
end