Module:Enemy List: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Remove quest monsters instead of only keeping them) |
(Deal with pages that have a {{LocationList}} of the variant category) |
||
Line 88: | Line 88: | ||
'?Experience', |
'?Experience', |
||
'?Quest', |
'?Quest', |
||
'?Variant of#-', |
|||
'sort=Profession Level A', |
'sort=Profession Level A', |
||
'order=asc' |
'order=asc' |
||
Line 93: | Line 94: | ||
data = Array.filter(data, function(monster) |
data = Array.filter(data, function(monster) |
||
return monster.Quest == nil |
return monster.Quest == nil and monster.Name ~= 'Training Dummy' |
||
end) |
end) |
||
local location_cache = {} |
|||
for _, monster in ipairs(data) do |
for _, monster in ipairs(data) do |
||
monster['Album XP'] = album_xp_data[monster['Profession Level A']] |
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 '{}') |
monster['Location JSON'] = mw.text.jsonDecode(monster['Location JSON'] or '{}') |
||
end |
end |