Module:CombatAreas/AreaTables: Difference between revisions

Add support for stronghold rewards in _getDungeonRewards
(getDungeonRewards: Better handling for abyss depths)
(Add support for stronghold rewards in _getDungeonRewards)
Line 176: Line 176:
if type(area.rewardItemIDs) == 'table' then
if type(area.rewardItemIDs) == 'table' then
table.insert(itemLists, area.rewardItemIDs)
table.insert(itemLists, area.rewardItemIDs)
elseif area.type == 'stronghold' then
-- This won't show which tier each reward comes from
-- but there doesn't seem to be an easy way to do that
local enhancementList = {}
for tier, tierData in pairs(area.tiers) do
if type(tierData.rewards) == 'table' and type(tierData.rewards.items) == 'table' then
for i, reward in ipairs(tierData.rewards.items) do
table.insert(enhancementList, reward.id)
end
end
end
if not Shared.tableIsEmpty(enhancementList) then
table.insert(itemLists, enhancementList)
end
end
end
if area.eventID ~= nil then
if area.eventID ~= nil then
Line 205: Line 219:
end
end


if area.type == 'dungeon' or area.type == 'abyssDepth' then
if area.type == 'dungeon' or area.type == 'abyssDepth' or area.type == 'stronghold' then
return p._getDungeonRewards(area, asList)
return p._getDungeonRewards(area, asList)
else
else