Module:Zone

require('Module:LoadLib')(_G)

local p = {}

local data = { ['hub island'] = { ['village'] = 'village', ['farmhouse'] = 'farmhouse', ['mountain'] = 'mountain', ['fashion shop'] = 'fashion shop', ['community center'] = 'community center', ['election room'] = 'election room', ['farm'] = 'farm', ['colosseum'] = 'colosseum', ['fisherman\'s hut'] = 'fisherman\'s hut', ['ruins'] = 'ruins', ['forest'] = 'forest', ['coal mine'] = 'coal mine', ['blacksmith'] = 'blacksmith', ['library'] = 'library', ['flower house'] = 'flower house', ['tavern'] = 'tavern', ['builder\'s house'] = 'builder\'s house', ['bank'] = 'bank', ['auction house'] = 'auction house', ['graveyard'] = 'graveyard', ['high level'] = 'high level', ['bazaar alley'] = 'bazaar alley', ['wilderness'] = 'wilderness', ['dark auction'] = 'dark auction', ['wizard tower'] = 'wizard tower', ['catacombs enterance'] = 'catacombs enterance', },	['deep caverns'] = { ['deep caverns'] = 'deep caverns', ['gunpowder mines'] = 'gunpowder mines', ['lapis quarry'] = 'lapis quarry', ['pigmen\'s den'] = 'pigmen\'s den', ['slimehill'] = 'slimehill', ['diamond reserve'] = 'diamond reserve', ['obsidian sanctuary'] = 'obsidian sanctuary', ['dwarven mines'] = 'dwarven mines', },	['jerry\'s workshop'] = { ['jerry\'s workshop'] = 'jerry\'s workshop', ['jerry pond'] = 'jerry pond', },	['the end'] = { ['the end'] = 'the end', ['dragon\'s nest'] = 'dragon\'s nest', },	['the park'] = { ['birch park'] = 'birch park', ['spruce woods'] = 'spruce woods', ['dark thicket'] = 'dark thicket', ['savanna woodland'] = 'savanna woodland', ['jungle island'] = 'jungle island', ['howling cave'] = 'howling cave', },	['dwarven mines'] = { ['dwarven mines'] = 'dwarven mines', ['the lift'] = 'the lift', ['dwarven village'] = 'dwarven village', ['palace bridge'] = 'palace bridge', ['royal palace'] = 'royal palace', ['royal quarters'] = 'royal quarters', ['barrack of heroes'] = 'barrack of heroes', ['grand library'] = 'grand library', ['lava springs'] = 'lava springs', ['forge basin'] = 'forge basin', ['the forge'] = 'the forge', ['rampart\'s quarry'] = 'rampart\'s quarry', ['upper mines'] = 'upper mines', ['cliffside veins'] = 'cliffside veins', ['divan\'s gateway'] = 'divan\'s gateway', ['great ice wall'] = 'great ice wall', ['aristocrat passage'] = 'aristocrat passage', ['royal mines'] = 'royal mines', ['goblin burrows'] = 'goblin burrows', ['far reserve'] = 'far reserve', ['miner\'s guild'] = 'miner\'s guild', ['hanging terrace'] = 'hanging terrace', ['c&c minecarts co.'] = 'c&c minecarts co.', ['gates to the mines'] = 'gates to the mines', ['the mist'] = 'the mist', },	['mushroom desert'] = { ['mushroom desert'] = 'mushroom desert', ['oasis'] = 'oasis', ['desert settlement'] = 'desert settlement', ['trappers den'] = 'trappers den', ['shepherds keep'] = 'shepherds keep', ['jake\'s house'] = 'jake\'s house', ['mushroom gorge'] = 'mushroom gorge', ['overgrown mushroom cave'] = 'overgrown mushroom cave', ['glowing mushroom cave'] = 'glowing mushroom cave', },	['the catacombs'] = { ['catacombs entrance'] = 'catacombs entrance', ['floor 1'] = 'floor 1', ['floor 2'] = 'floor 2', ['floor 3'] = 'floor 3', ['floor 4'] = 'floor 4', ['floor 5'] = 'floor 5', ['floor 6'] = 'floor 6', ['floor 7'] = 'floor 7', },	['the barn'] = 'the barn', ['windmill'] = 'windmill', ['spider\'s den'] = 'spider\'s den', ['blazing fortress'] = 'blazing fortress', ['private island'] = 'your island', ['gold mine'] = 'gold mine', ['private island'] = 'private island', ['limbo'] = 'limbo', ['dungeon hub'] = 'dungeon hub', ['void sepulture'] = 'void sepulture', }

local aliases = { -- Hub Island ['village'] = 'village', ['farmhouse'] = 'farmhouse', ['mountain'] = 'mountain', ['fashion shop'] = 'fashion shop', ['community center'] = 'community center', ['election room'] = 'election room', ['farm'] = 'farm', ['colosseum'] = 'colosseum', ['fisherman\'s hut'] = 'fisherman\'s hut', ['ruins'] = 'ruins', ['forest'] = 'forest', ['coal mine'] = 'coal mine', ['blacksmith'] = 'blacksmith', ['library'] = 'library', ['flower house'] = 'flower house', ['tavern'] = 'tavern', ['builder\'s house'] = 'builder\'s house', ['bank'] = 'bank', ['auction house'] = 'auction house', ['graveyard'] = 'graveyard', ['high level'] = 'high level', ['bazaar alley'] = 'bazaar alley', ['wilderness'] = 'wilderness', ['dark auction'] = 'dark auction', ['wizard tower'] = 'wizard tower', ['catacombs enterance'] = 'catacombs enterance',

-- Deep Caverns ['deep caverns'] = 'deep caverns', ['gunpowder mines'] = 'gunpowder mines', ['lapis quarry'] = 'lapis quarry', ['pigmen\'s den'] = 'pigmen\'s den', ['slimehill'] = 'slimehill', ['diamond reserve'] = 'diamond reserve', ['obsidian sanctuary'] = 'obsidian sanctuary', ['dwarven mines'] = 'dwarven mines',

-- Jerry's Workshop ['jerry\'s workshop'] = 'jerry\'s workshop', ['jerry pond'] = 'jerry pond',

-- The End ['the end'] = 'the end', ['dragon\'s nest'] = 'dragon\'s nest',

-- The Park ['birch park'] = 'birch park', ['spruce woods'] = 'spruce woods', ['dark thicket'] = 'dark thicket', ['savanna woodland'] = 'savanna woodland', ['jungle island'] = 'jungle island', ['howling cave'] = 'howling cave',

-- Dwarven Mines ['dwarven mines'] = 'dwarven mines', ['the lift'] = 'the lift', ['dwarven village'] = 'dwarven village', ['palace bridge'] = 'palace bridge', ['royal palace'] = 'royal palace', ['royal quarters'] = 'royal quarters', ['barrack of heroes'] = 'barrack of heroes', ['grand library'] = 'grand library', ['lava springs'] = 'lava springs', ['forge basin'] = 'forge basin', ['the forge'] = 'the forge', ['rampart\'s quarry'] = 'rampart\'s quarry', ['upper mines'] = 'upper mines', ['cliffside veins'] = 'cliffside veins', ['divan\'s gateway'] = 'divan\'s gateway', ['great ice wall'] = 'great ice wall', ['aristocrat passage'] = 'aristocrat passage', ['royal mines'] = 'royal mines', ['goblin burrows'] = 'goblin burrows', ['far reserve'] = 'far reserve', ['miner\'s guild'] = 'miner\'s guild', ['hanging terrace'] = 'hanging terrace', ['c&c minecarts co.'] = 'c&c minecarts co.', ['c&c minecart\'s co.'] = 'c&c minecarts co.', ['cc minecarts'] = 'c&c minecarts co.', ['gates to the mines'] = 'gates to the mines', ['the mist'] = 'the mist', -- Mushroom Desert ['mushroom desert'] = 'mushroom desert', ['oasis'] = 'oasis', ['desert settlement'] = 'desert settlement', ['trappers den'] = 'trappers den', ['shepherds keep'] = 'shepherds keep', ['jake\'s house'] = 'jake\'s house', ['mushroom gorge'] = 'mushroom gorge', ['overgrown mushroom cave'] = 'overgrown mushroom cave', ['glowing mushroom cave'] = 'glowing mushroom cave',

-- The Catacombs ['catacombs entrance'] = 'catacombs entrance', ['floor 1'] = 'floor 1', ['floor 2'] = 'floor 2', ['floor 3'] = 'floor 3', ['floor 4'] = 'floor 4', ['floor 5'] = 'floor 5', ['floor 6'] = 'floor 6', ['floor 7'] = 'floor 7', ['f1'] = 'floor 1', ['f2'] = 'floor 2', ['f3'] = 'floor 3', ['f4'] = 'floor 4', ['f5'] = 'floor 5', ['f6'] = 'floor 6', ['f7'] = 'floor 7',

-- Other areas ['the barn'] = 'the barn', ['windmill'] = 'windmill', ['spider\'s den'] = 'spider\'s den', ['blazing fortress'] = 'blazing fortress', ['private island'] = 'your island', ['gold mine'] = 'gold mine', ['private island'] = 'private island', ['limbo'] = 'limbo', ['dungeon hub'] = 'dungeon hub', ['void sepulture'] = 'void sepulture', }

local colors = { -- Hub Island ['village'] = 'aqua', ['farmhouse'] = 'aqua', ['mountain'] = 'aqua', ['fashion shop'] = 'aqua', ['community center'] = 'aqua', ['election room'] = 'aqua', ['farm'] = 'aqua', ['colosseum'] = 'aqua', ['fisherman\'s hut'] = 'aqua', ['ruins'] = 'aqua', ['forest'] = 'aqua', ['coal mine'] = 'aqua', ['blacksmith'] = 'aqua', ['library'] = 'aqua', ['flower house'] = 'aqua', ['tavern'] = 'aqua', ['builder\'s house'] = 'aqua', ['bank'] = 'orange', ['auction house'] = 'orange', ['graveyard'] = 'red', ['high level'] = 'red', ['bazaar alley'] = 'yellow', ['wilderness'] = 'dark green', ['dark auction'] = 'dark purple', ['wizard tower'] = 'light purple', -- Deep Caverns ['deep caverns'] = 'aqua', ['gunpowder mines'] = 'aqua', ['lapis quarry'] = 'aqua', ['pigmen\'s den'] = 'aqua', ['slimehill'] = 'aqua', ['diamond reserve'] = 'aqua', ['obsidian sanctuary'] = 'aqua', ['dwarven mines'] = 'dark green', -- Jerry's Workshop ['jerry\'s workshop'] = 'red', ['jerry pond'] = 'aqua', -- The End ['the end'] = 'light purple', ['dragon\'s nest'] = 'dark purple', -- The Park ['birch park'] = 'green', ['spruce woods'] = 'green', ['dark thicket'] = 'green', ['savanna woodland'] = 'green', ['jungle island'] = 'green', ['howling cave'] = 'aqua', -- Dwarven Mines ['dwarven mines'] = 'dark green', ['the lift'] = 'aqua', ['dwarven village'] = 'aqua', ['palace bridge'] = 'aqua', ['royal palace'] = 'aqua', ['royal quarters'] = 'aqua', ['barrack of heroes'] = 'aqua', ['grand library'] = 'aqua', ['lava springs'] = 'aqua', ['forge basin'] = 'aqua', ['the forge'] = 'aqua', ['rampart\'s quarry'] = 'aqua', ['upper mines'] = 'aqua', ['cliffside veins'] = 'aqua', ['divan\'s gateway'] = 'aqua', ['great ice wall'] = 'aqua', ['aristocrat passage'] = 'aqua', ['royal mines'] = 'aqua', ['goblin burrows'] = 'aqua', ['far reserve'] = 'aqua', ['miner\'s guild'] = 'aqua', ['hanging terrace'] = 'aqua', ['c&c minecarts co.'] = 'aqua', ['gates to the mines'] = 'aqua', ['the mist'] = 'dark gray', -- Mushroom Desert ['mushroom desert'] = 'aqua', ['oasis'] = 'aqua', ['desert settlement'] = 'yellow', ['trappers den'] = 'aqua', ['shepherds keep'] = 'aqua', ['jake\'s house'] = 'aqua', ['mushroom gorge'] = 'aqua', ['overgrown mushroom cave'] = 'green', ['glowing mushroom cave'] = 'green', -- The Catacombs ['catacombs enterance'] = 'red', ['floor 1'] = 'dark gray', ['floor 2'] = 'red', ['floor 3'] = 'red', ['floor 4'] = 'red', ['floor 5'] = 'red', ['floor 6'] = 'red', ['floor 7'] = 'red', -- Other areas ['the barn'] = 'aqua', ['windmill'] = 'aqua', ['spider\'s den'] = 'red', ['blazing fortress'] = 'red', ['gold mine'] = 'gold', ['private island'] = 'green', ['limbo'] = 'aqua', ['dungeon hub'] = 'red', ['void sepulture'] = 'light purple', }

local alt = { ['catacombs entrance'] = 'the catacombs - entrance', ['floor 1'] = 'the catacombs - floor 1', ['floor 2'] = 'the catacombs - floor 2', ['floor 3'] = 'the catacombs - floor 3', ['floor 4'] = 'the catacombs - floor 4', ['floor 5'] = 'the catacombs - floor 5', ['floor 6'] = 'the catacombs - floor 6', ['floor 7'] = 'the catacombs - floor 7', }

- -- Template: Zone -- -- Creates a colored zone link. - function p.zone(frame) return p._zone(getArgs(frame)[1]) end - -- function: _zone(zone: string) -- -- Creates a Colored string based off of the Skyblock Zone. - function p._zone(zone) local zone = aliases[zone:lower] or formattedError('Invalid zone %q', 2, zone) local formattedZone = string.ucfirst(alt[zone] or zone) return string.makeLink(formattedZone, colorText(colors[zone], { '⏣ ', formattedZone })) end

return p