Module:Enemy List: Difference between revisions
Deal with pages that have a {{LocationList}} of the variant category
(Remove quest monsters instead of only keeping them) |
(Deal with pages that have a {{LocationList}} of the variant category) |
||
Line 88:
'?Experience',
'?Quest',
'?Variant of#-',
'sort=Profession Level A',
'order=asc'
Line 93 ⟶ 94:
data = Array.filter(data, function(monster)
return monster.Quest == nil and monster.Name ~= 'Training Dummy'
end)
local location_cache = {}
for _, monster in ipairs(data) do
monster['Album XP'] = album_xp_data[monster['Profession Level A']]
if monster['Location JSON'] == nil and monster['Variant of'] ~= nil then
local variant_cat = monster['Variant of']
if location_cache[variant_cat] == nil then
local of_variant = mw.smw.ask{
'[['..variant_cat..']]',
'?Location JSON'
}
location_cache[variant_cat] = of_variant and of_variant[1]['Location JSON']
end
monster['Location JSON'] = location_cache[variant_cat]
end
monster['Location JSON'] = mw.text.jsonDecode(monster['Location JSON'] or '{}')
end
|