--## Version: 1.1.15 ## Author: Jassade
if GetLocale() == "zhCN" then
  CanOpenerLocal = "|cffff6699[物品]|r一键开启";
elseif GetLocale() == "zhTW" then
  CanOpenerLocal = "|cffff6699[物品]|r一键开启";
else
  CanOpenerLocal = "Can Opener";
end

local CanOpenerGlobal = {}
local shouldUpdateBags = false;

------------------------------------------------
-- Global Settings
------------------------------------------------
CanOpenerGlobal.DebugMode = false;

------------------------------------------------
-- Debug Methods
------------------------------------------------
local canOut;

canOut = function(msg, premsg)
	premsg = premsg or CanOpenerLocal;  --"[Can Opener]"
	if type(msg) == "table" then
		canOutTable(msg, nil, premsg);
	else
		print("|cC0FFEE69" .. premsg .. "|r " .. msg);
	end
end
CanOpenerGlobal.CanOut = canOut;

local colors = {
	LIGHTBLUE = 'ff00ccff',
	LIGHTRED = 'ffff6060',
	SPRINGGREEN = 'ff00FF7F',
	GREENYELLOW = 'ffADFF2F',
	BLUE = 'ff0000ff',
	PURPLE = 'ffDA70D6',
	GREEN = 'ff00ff00',
	RED = 'ffff0000',
	GOLD = 'ffffcc00',
	GOLD2 = 'ffFFC125',
	GREY = 'ff888888',
	WHITE = 'ffffffff',
	SUBWHITE = 'ffbbbbbb',
	MAGENTA = 'ffff00ff',
	YELLOW = 'ffffff00',
	ORANGEY = 'ffFF4500',
	CHOCOLATE = 'ffCD661D',
	CYAN = 'ff00ffff',
	IVORY = 'ff8B8B83',
	LIGHTYELLOW = 'ffFFFFE0',
	SEXGREEN = 'ff71C671',
	SEXTEAL = 'ff388E8E',
	SEXPINK = 'ffC67171',
	SEXBLUE = 'ff00E5EE',
	SEXHOTPINK = 'ffFF6EB4',
	CANOPENERBUMBER = 'c0ffee69'
};
CanOpenerGlobal.Colors = colors;

local function colorizeText(text, color)
	return "|c" .. colors[color] .. text .. "|r";
end
CanOpenerGlobal.ColorizeText = colorizeText;

local function posOrNegColor(test, positiveText, negativeText)
    local color = test and "SPRINGGREEN" or "LIGHTRED"
    local text = test and positiveText or negativeText
    return colorizeText(text, color)
end
CanOpenerGlobal.PosOrNegColor = posOrNegColor;

------------------------------------------------
-- Event Module Registration
------------------------------------------------
CanOpenerGlobal._eventStrategies = {};
CanOpenerGlobal._eventSettings = {};
CanOpenerGlobal._eventSlashCommands = {};

function CanOpenerGlobal.RegisterStrategy(name, filterFn)
	table.insert(CanOpenerGlobal._eventStrategies, { name = name, filterFn = filterFn })
end

function CanOpenerGlobal.RegisterEventSetting(varName, displayName, tooltip, defaultValue)
	table.insert(CanOpenerGlobal._eventSettings, {
		varName = varName,
		displayName = displayName,
		tooltip = tooltip,
		defaultValue = defaultValue,
	})
end

function CanOpenerGlobal.RegisterEventSlashCommand(cmd, varName, description)
	CanOpenerGlobal._eventSlashCommands[cmd:lower()] = {
		varName = varName,
		description = description,
	}
end

------------------------------------------------
-- Saved Variable Management
------------------------------------------------
local function initSavedVariables()
	ShiGuangPerDB = {
		CanOpenerEnable = true,
		CanOpenerShowRousing = true,
		CanOpenerShowLevelRestrictedItems = true,
		CanOpenerShowLockboxes = false,
		CanOpenerShowOnlyOneButton = false,
		CanOpenerPosition = {"TOPRIGHT", "TOPRIGHT", -80, -260},
		CanOpenerExcludedItems = {},
	};
end
local function UpdateSavedVars()
	-- Added Excluded Items
	if ShiGuangPerDB.CanOpenerExcludedItems == nil then
		ShiGuangPerDB.CanOpenerExcludedItems = {};
	end
	if ShiGuangPerDB.CanOpenerShowLockboxes == nil then
		ShiGuangPerDB.CanOpenerShowLockboxes = false;
	end
	-- Apply defaults for any event-registered settings
	for _, setting in ipairs(CanOpenerGlobal._eventSettings) do
		if ShiGuangPerDB[setting.varName] == nil then
			ShiGuangPerDB[setting.varName] = setting.defaultValue
		end
	end
end
local function resetSavedVariables()
	initSavedVariables();
	CanOpenerGlobal.Frame:Hide();
	CanOpenerGlobal.Frame:Show();
	CanOpenerGlobal.ForceButtonRefresh();
end
CanOpenerGlobal.ResetSavedVariables = resetSavedVariables;

------------------------------------------------
-- Event actions
------------------------------------------------
local function addon_Loaded(addOnName)
	if addOnName == "OrzUI" then
		CanOpenerGlobal.Frame:UnregisterEvent("ADDON_LOADED");
		if ShiGuangPerDB.CanOpenerEnable == nil then ShiGuangPerDB.CanOpenerEnable = true; end
		if ShiGuangPerDB.CanOpenerShowRousing == nil then ShiGuangPerDB.CanOpenerShowRousing = true; end
		if ShiGuangPerDB.CanOpenerShowLevelRestrictedItems == nil then ShiGuangPerDB.CanOpenerShowLevelRestrictedItems = true; end
		if ShiGuangPerDB.CanOpenerPosition == nil then ShiGuangPerDB.CanOpenerPosition = {"TOPRIGHT", "TOPRIGHT", -80, -260}; end
		if ShiGuangPerDB.CanOpenerExcludedItems == nil then ShiGuangPerDB.CanOpenerExcludedItems = {}; end
		UpdateSavedVars();
        InitSettingsMenu();
	end
end

local function bag_update(bagID)
	if (CanOpenerGlobal.BagIndicies.Backpack <= bagID and bagID <= CanOpenerGlobal.BagIndicies.ReagentBag) then
		shouldUpdateBags = true;
	end
end

local function bag_update_delayed()
	if not CanOpenerGlobal.LockDown and shouldUpdateBags then
		shouldUpdateBags = false;
		CanOpenerGlobal.RefreshButtons();
	end
end

local function player_entering_world(isInitialLogin, isReloadingUi)
	CanOpenerGlobal.Frame:Show();
end

local function player_leaving_world()
end

local function player_regen_disabled()
	CanOpenerGlobal.Frame:Hide();
	CanOpenerGlobal.LockDown = true;
end

local function player_regen_enabled()
	CanOpenerGlobal.LockDown = false;
	bag_update_delayed();
	CanOpenerGlobal.Frame:Show();
end

CanOpenerGlobal.Events = {
	["ADDON_LOADED"] = addon_Loaded,
	["BAG_UPDATE"] = bag_update,
	["BAG_UPDATE_DELAYED"] = bag_update_delayed,
	["PLAYER_ENTERING_WORLD"] = player_entering_world,
	["PLAYER_LEAVING_WORLD"] = player_leaving_world,
	["PLAYER_REGEN_DISABLED"] = player_regen_disabled,
	["PLAYER_REGEN_ENABLED"] = player_regen_enabled,
};

CanOpenerGlobal.ForceButtonRefresh = function()
	shouldUpdateBags = true;
	bag_update_delayed();
end
------------------------------------------------
-- Enums
------------------------------------------------
CanOpenerGlobal.BagIndicies = {
	["Backpack"] = 0,
	["Bag_1"] = 1,
	["Bag_2"] = 2,
	["Bag_3"] = 3,
	["Bag_4"] = 4,
	["ReagentBag"] = 5,
};

CanOpenerGlobal.openables = {}
local openables = CanOpenerGlobal.openables

local classicIDs = {
    5335,  -- A Sack of Coins
    5523,  -- Small Barnacled Clam
    5524,  -- Thick-Shelled Clam
    5738,  -- Covert Ops Pack
    6307,  -- Message in a Bottle
    6351,  -- Dented Crate
    6352,  -- Waterlogged Crate
    6353,  -- Small Chest
    6356,  -- Battered Chest
    6357,  -- Sealed Crate
    6643,  -- Bloated Smallfish
    6645,  -- Bloated Mud Snapper
    6647,  -- Bloated Catfish
    6715,  -- Ruined Jumper Cables
    6755,  -- A Small Container of Gems
    6827,  -- Box of Supplies
    7190,  -- Scorched Rocket Boots
    7209,  -- Tazan's Satchel
    7870,  -- Thaumaturgy Vessel Lockbox
    7973,  -- Big-Mouth Clam
    8049,  -- Gnarlpine Necklace
    8366,  -- Bloated Trout
    8484,  -- Gadgetzan Water Co. Care Package
    8647,  -- Egg Crate
    9265,  -- Cuergo's Hidden Treasure
    9276,  -- Pirate's Footlocker
    9363,  -- Sparklematic-Wrapped Box
    9539,  -- Box of Rations
    9540,  -- Box of Spells
    9541,  -- Box of Goodies
    10456,  -- A Bulging Coin Purse
    10479,  -- Kovic's Trading Satchel
    10569,  -- Hoard of the Black Dragonflight
    10695,  -- Box of Empty Vials
    10752,  -- Emerald Encrusted Chest
    10773,  -- Hakkari Urn
    10834,  -- Felhound Tracker Kit
    11024,  -- Evergreen Herb Casing
    11107,  -- A Small Pack
    11422,  -- Goblin Engineer's Renewal Gift
    11423,  -- Gnome Engineer's Renewal Gift
    11568,  -- Torwa's Pouch
    11617,  -- Eridan's Supplies
    11883,  -- A Dingy Fanny Pack
    11887,  -- Cenarion Circle Cache
    11912,  -- Package of Empty Ooze Containers
    11937,  -- Fat Sack of Coins
    11938,  -- Sack of Gems
    11955,  -- Bag of Empty Ooze Containers
    11966,  -- Small Sack of Coins
    12122,  -- Kum'isha's Junk
    12339,  -- Vaelan's Gift
    12849,  -- Demon Kissed Sack
    13874,  -- Heavy Crate
    13881,  -- Bloated Redgill
    13891,  -- Bloated Salmon
    15102,  -- Un'Goro Tested Sample
    15103,  -- Corrupt Tested Sample
    15699,  -- Small Brown-Wrapped Package
    15876,  -- Nathanos' Chest
    15902,  -- A Crazy Grab Bag
    16885,  -- Heavy Junkbox
    17685,  -- Smokywood Pastures Sampler
    17962,  -- Blue Sack of Gems
    17963,  -- Green Sack of Gems
    17964,  -- Gray Sack of Gems
    17965,  -- Yellow Sack of Gems
    17969,  -- Red Sack of Gems
    18804,  -- Lord Grayson's Satchel
    19035,  -- Lard's Special Picnic Basket
    19150,  -- Sentinel Basic Care Package
    19151,  -- Sentinel Standard Care Package
    19152,  -- Sentinel Advanced Care Package
    19153,  -- Outrider Advanced Care Package
    19154,  -- Outrider Basic Care Package
    19155,  -- Outrider Standard Care Package
    19296,  -- Greater Darkmoon Prize
    19297,  -- Lesser Darkmoon Prize
    19298,  -- Minor Darkmoon Prize
    19422,  -- Darkmoon Faire Fortune
    19425,  -- Mysterious Lockbox
    20228,  -- Defiler's Advanced Care Package
    20229,  -- Defiler's Basic Care Package
    20230,  -- Defiler's Standard Care Package
    20231,  -- Arathor Advanced Care Package
    20233,  -- Arathor Basic Care Package
    20236,  -- Arathor Standard Care Package
    20469,  -- Decoded True Believer Clippings
    20601,  -- Sack of Spoils
    20602,  -- Chest of Spoils
    20603,  -- Bag of Spoils
    20708,  -- Tightly Sealed Trunk
    20766,  -- Slimy Bag
    20767,  -- Scum Covered Bag
    20768,  -- Oozing Bag
    20805,  -- Followup Logistics Assignment
    20808,  -- Combat Assignment
    20809,  -- Tactical Assignment
    21042,  -- Narain's Special Kit
    21113,  -- Watertight Trunk
    21131,  -- Followup Combat Assignment
    21132,  -- Logistics Assignment
    21133,  -- Followup Tactical Assignment
    21150,  -- Iron Bound Trunk
    21156,  -- Scarab Bag
    21164,  -- Bloated Rockscale Cod
    21191,  -- Carefully Wrapped Present
    21216,  -- Smokywood Pastures Extra-Special Gift
    21228,  -- Mithril Bound Trunk
    21266,  -- Logistics Assignment
    21315,  -- Smokywood Satchel
    21386,  -- Followup Logistics Assignment
    21509,  -- Ahn'Qiraj War Effort Supplies
    21510,  -- Ahn'Qiraj War Effort Supplies
    21511,  -- Ahn'Qiraj War Effort Supplies
    21512,  -- Ahn'Qiraj War Effort Supplies
    21513,  -- Ahn'Qiraj War Effort Supplies
    21528,  -- Colossal Bag of Loot
    21740,  -- Small Rocket Recipes
    21741,  -- Cluster Rocket Recipes
    21742,  -- Large Rocket Recipes
    21743,  -- Large Cluster Rocket Recipes
    21746,  -- Lucky Red Envelope
    21812,  -- Box of Chocolates
    21975,  -- Pledge of Adoration: Stormwind
    21980,  -- Gift of Adoration: Ironforge
    21981,  -- Gift of Adoration: Stormwind
    22137,  -- Ysida's Satchel
    22154,  -- Pledge of Adoration: Ironforge
    22155,  -- Pledge of Adoration: Darnassus
    22157,  -- Pledge of Adoration: Undercity
    22171,  -- Gift of Friendship: Thunder Bluff
    22320,  -- Mux's Quality Goods
    22568,  -- Sealed Craftsman's Writ
    22648,  -- Hive'Ashi Dossier
    22649,  -- Hive'Regal Dossier
    22650,  -- Hive'Zora Dossier
    22746,  -- Buccaneer's Uniform
    23022,  -- Curmudgeon's Payoff
}
for _, id in ipairs(classicIDs) do openables[id] = {} end

openables[4632] = { lockbox = true }  -- Ornate Bronze Lockbox
openables[4633] = { lockbox = true }  -- Heavy Bronze Lockbox
openables[4634] = { lockbox = true }  -- Iron Lockbox
openables[4636] = { lockbox = true }  -- Strong Iron Lockbox
openables[4637] = { lockbox = true }  -- Steel Lockbox
openables[4638] = { lockbox = true }  -- Reinforced Steel Lockbox
openables[5758] = { lockbox = true }  -- Mithril Lockbox
openables[5759] = { lockbox = true }  -- Thorium Lockbox
openables[5760] = { lockbox = true }  -- Eternium Lockbox
openables[6354] = { lockbox = true }  -- Small Locked Chest
openables[6355] = { lockbox = true }  -- Sturdy Locked Chest
openables[12033] = { lockbox = true }  -- Thaurissan Family Jewels
openables[13875] = { lockbox = true }  -- Ironbound Locked Chest
openables[13918] = { lockbox = true }  -- Reinforced Locked Chest
openables[16882] = { lockbox = true }  -- Battered Junkbox
openables[16883] = { lockbox = true }  -- Worn Junkbox
openables[16884] = { lockbox = true }  -- Sturdy Junkbox

local tbcIDs = {
    21979,  -- Gift of Adoration: Darnassus
    22156,  -- Pledge of Adoration: Orgrimmar
    22158,  -- Pledge of Adoration: Thunder Bluff
    22159,  -- Pledge of Friendship: Darnassus
    22160,  -- Pledge of Friendship: Ironforge
    22161,  -- Pledge of Friendship: Orgrimmar
    22162,  -- Pledge of Friendship: Thunder Bluff
    22163,  -- Pledge of Friendship: Undercity
    22164,  -- Gift of Adoration: Orgrimmar
    22165,  -- Gift of Adoration: Thunder Bluff
    22166,  -- Gift of Adoration: Undercity
    22167,  -- Gift of Friendship: Darnassus
    22168,  -- Gift of Friendship: Ironforge
    22169,  -- Gift of Friendship: Orgrimmar
    22170,  -- Gift of Friendship: Stormwind
    22172,  -- Gift of Friendship: Undercity
    22178,  -- Pledge of Friendship: Stormwind
    23846,  -- Nolkai's Box
    23921,  -- Bulging Sack of Silver
    24336,  -- Fireproof Satchel
    24402,  -- Package of Identified Plants
    24476,  -- Jaggal Clam
    25419,  -- Unmarked Bag of Gems
    25422,  -- Bulging Sack of Gems
    25423,  -- Bag of Premium Gems
    25424,  -- Gem-Stuffed Envelope
    27446,  -- Mr. Pinchy's Gift
    27481,  -- Heavy Supply Crate
    27511,  -- Inscribed Scrollcase
    27513,  -- Curious Crate
    30260,  -- Voren'thal's Package
    30320,  -- Bundle of Nether Spikes
    30650,  -- Dertrok's Wand Case
    31408,  -- Offering of the Sha'tar
    31522,  -- Primal Mooncloth Supplies
    31800,  -- Outcast's Cache
    31955,  -- Arelion's Knapsack
    32064,  -- Protectorate Treasure Cache
    32462,  -- Morthis' Materials
    32624,  -- Large Iron Metamorphosis Geode
    32625,  -- Small Iron Metamorphosis Geode
    32626,  -- Large Copper Metamorphosis Geode
    32627,  -- Small Copper Metamorphosis Geode
    32628,  -- Large Silver Metamorphosis Geode
    32629,  -- Large Gold Metamorphosis Geode
    32630,  -- Small Gold Metamorphosis Geode
    32631,  -- Small Silver Metamorphosis Geode
    32724,  -- Sludge-Covered Object
    32777,  -- Kronk's Grab Bag
    32835,  -- Ogri'la Care Package
    33045,  -- Renn's Supplies
    33844,  -- Barrel of Fish
    33857,  -- Crate of Meat
    33926,  -- Sealed Scroll Case
    33928,  -- Hollowed Bone Decanter
    34077,  -- Crudely Wrapped Gift
    34583,  -- Aldor Supplies Package
    34584,  -- Scryer Supplies Package
    34585,  -- Scryer Supplies Package
    34587,  -- Aldor Supplies Package
    34592,  -- Aldor Supplies Package
    34593,  -- Scryer Supplies Package
    34594,  -- Scryer Supplies Package
    34595,  -- Aldor Supplies Package
    34846,  -- Black Sack of Gems
    34863,  -- Bag of Fishing Treasures
    35232,  -- Shattered Sun Supplies
    35286,  -- Bloated Giant Sunfish
    35313,  -- Bloated Barbed Gill Trout
    35348,  -- Bag of Fishing Treasures
    35512,  -- Pocket Full of Snow
    35945,  -- Brilliant Glass
    37586,  -- Handful of Treats
}
for _, id in ipairs(tbcIDs) do openables[id] = {} end

openables[29569] = { lockbox = true }  -- Strong Junkbox
openables[31952] = { lockbox = true }  -- Khorium Lockbox


local wotlkIDs = {
    34119,  -- Black Conrad's Treasure
    34871,  -- Crafty's Sack
    35792,  -- Mage Hunter Personal Effects
    36781,  -- Darkwater Clam
    37168,  -- Mysterious Tarot
    39418,  -- Ornately Jeweled Box
    39883,  -- Cracked Egg
    41426,  -- Magically Wrapped Gift
    41888,  -- Small Velvet Bag
    43346,  -- Large Satchel of Spoils
    43347,  -- Satchel of Spoils
    43556,  -- Patroller's Pack
    44113,  -- Small Spice Bag
    44142,  -- Strange Tarot
    44161,  -- Arcane Tarot
    44163,  -- Shadowy Tarot
    44475,  -- Reinforced Crate
    44663,  -- Abandoned Adventurer's Satchel
    44700,  -- Brooding Darkwater Clam
    44718,  -- Ripe Disgusting Jar
    44751,  -- Hyldnir Spoils
    44943,  -- Icy Prism
    44951,  -- Box of Bombs
    45072,  -- Brightly Colored Egg
    45328,  -- Bloated Slippery Eel
    45724,  -- Champion's Purse
    45875,  -- Sack of Ulduar Spoils
    45878,  -- Large Sack of Ulduar Spoils
    45909,  -- Giant Darkwater Clam
    46007,  -- Bag of Fishing Treasures
    46110,  -- Alchemist's Cache
    46740,  -- Winter Veil Gift
    46809,  -- Bountiful Cookbook
    46810,  -- Bountiful Cookbook
    46812,  -- Northrend Mystery Gem Pouch
    49294,  -- Ashen Sack of Gems
    49631,  -- Standard Apothecary Serving Kit
    49926,  -- Brazie's Black Book of Secrets
    50160,  -- Lovely Dress Box
    50161,  -- Dinner Suit Box
    51316,  -- Unsealed Chest
    51999,  -- Satchel of Helpful Goods
    52000,  -- Satchel of Helpful Goods
    52001,  -- Satchel of Helpful Goods
    52002,  -- Satchel of Helpful Goods
    52003,  -- Satchel of Helpful Goods
    52004,  -- Satchel of Helpful Goods
    52005,  -- Satchel of Helpful Goods
    52006,  -- Sack of Frosty Treasures
    52676,  -- Cache of the Ley-Guardian
    54535,  -- Keg-Shaped Treasure Chest
    54536,  -- Satchel of Chilled Goods
    54537,  -- Heart-Shaped Box
}
for _, id in ipairs(wotlkIDs) do openables[id] = {} end

openables[43575] = { lockbox = true }  -- Reinforced Junkbox
openables[43622] = { lockbox = true }  -- Froststeel Lockbox
openables[43624] = { lockbox = true }  -- Titanium Lockbox
openables[45986] = { lockbox = true }  -- Tiny Titanium Lockbox


local cataIDs = {
    49369,  -- Red Blizzcon Bag
    50238,  -- Cracked Un'Goro Coconut
    50409,  -- Spark's Fossil Finding Kit
    52274,  -- Earthen Ring Supplies
    52304,  -- Fire Prism
    52340,  -- Abyssal Clam
    52344,  -- Earthen Ring Supplies
    54516,  -- Loot-Filled Pumpkin
    57540,  -- Coldridge Mountaineer's Pouch
    60681,  -- Cannary's Cache
    61387,  -- Hidden Stash
    62062,  -- Bulging Sack of Gold
    64491,  -- Royal Reward
    64657,  -- Canopic Jar
    65513,  -- Crate of Tasty Meat
    66943,  -- Treasures from Grim Batol
    67248,  -- Satchel of Helpful Goods
    67250,  -- Satchel of Helpful Goods
    67414,  -- Bag of Shiny Things
    67443,  -- Winter Veil Gift
    67495,  -- Strange Bloated Stomach
    67539,  -- Tiny Treasure Chest
    67597,  -- Sealed Crate
    68384,  -- Moonkin Egg
    68598,  -- Very Fat Sack of Coins
    68689,  -- Imported Supplies
    68795,  -- Stendel's Bane
    68813,  -- Satchel of Freshly-Picked Herbs
    69817,  -- Hive Queen's Honeycomb
    69818,  -- Giant Sack
    69822,  -- Master Chef's Groceries
    69823,  -- Gub's Catch
    69886,  -- Bag of Coins
    69903,  -- Satchel of Exotic Mysteries
    69999,  -- Moat Monster Feeding Kit
    70719,  -- Water-Filled Gills
    70931,  -- Scrooge's Payoff
    71631,  -- Zen'Vorka's Cache
    77956,  -- Spectral Mount Crate
    78897,  -- Pouch o' Tokens
    78898,  -- Sack o' Tokens
    78899,  -- Pouch o' Tokens
    78900,  -- Pouch o' Tokens
    78901,  -- Pouch o' Tokens
    78902,  -- Pouch o' Tokens
    78903,  -- Pouch o' Tokens
    78904,  -- Pouch o' Tokens
    78905,  -- Sack o' Tokens
    78906,  -- Sack o' Tokens
    78907,  -- Sack o' Tokens
    78908,  -- Sack o' Tokens
    78909,  -- Sack o' Tokens
    78910,  -- Sack o' Tokens
    78930,  -- Sealed Crate
}
for _, id in ipairs(cataIDs) do openables[id] = {} end

openables[63349] = { lockbox = true }  -- Flame-Scarred Junkbox
openables[68729] = { lockbox = true }  -- Elementium Lockbox


local mopIDs = {
    72201,  -- Plump Intestines
    77501,  -- Blue Blizzcon Bag
    85223,  -- Enigma Seed Pack
    85224,  -- Basic Seed Pack
    85225,  -- Basic Seed Pack
    85226,  -- Basic Seed Pack
    85227,  -- Special Seed Pack
    85271,  -- Secret Stash
    85272,  -- Tree Seed Pack
    85274,  -- Gro-Pack
    85275,  -- Chee Chee's Goodie Bag
    85276,  -- Celebration Gift
    85277,  -- Nicely Packed Lunch
    85497,  -- Chirping Package
    85498,  -- Songbell Seed Pack
    86428,  -- Old Man Thistle's Treasure
    86595,  -- Bag of Helpful Things
    86623,  -- Blingtron 4000 Gift Package
    87217,  -- Small Bag of Goods
    87218,  -- Big Bag of Arms
    87219,  -- Huge Bag of Herbs
    87220,  -- Big Bag of Mysteries
    87221,  -- Big Bag of Jewels
    87222,  -- Big Bag of Linens
    87223,  -- Big Bag of Skins
    87224,  -- Big Bag of Wonders
    87225,  -- Big Bag of Food
    87391,  -- Plundered Treasure
    87533,  -- Crate of Dwarven Archaeology Fragments
    87534,  -- Crate of Draenei Archaeology Fragments
    87535,  -- Crate of Fossil Archaeology Fragments
    87536,  -- Crate of Night Elf Archaeology Fragments
    87537,  -- Crate of Nerubian Archaeology Fragments
    87538,  -- Crate of Orc Archaeology Fragments
    87539,  -- Crate of Tol'vir Archaeology Fragments
    87540,  -- Crate of Troll Archaeology Fragments
    87541,  -- Crate of Vrykul Archaeology Fragments
    87701,  -- Sack of Raw Tiger Steaks
    87702,  -- Sack of Mushan Ribs
    87703,  -- Sack of Raw Turtle Meat
    87704,  -- Sack of Raw Crab Meat
    87705,  -- Sack of Wildfowl Breasts
    87706,  -- Sack of Green Cabbages
    87707,  -- Sack of Juicycrunch Carrots
    87708,  -- Sack of Mogu Pumpkins
    87709,  -- Sack of Scallions
    87710,  -- Sack of Red Blossom Leeks
    87712,  -- Sack of Witchberries
    87713,  -- Sack of Jade Squash
    87714,  -- Sack of Striped Melons
    87715,  -- Sack of Pink Turnips
    87716,  -- Sack of White Turnips
    87721,  -- Sack of Jade Lungfish
    87722,  -- Sack of Giant Mantis Shrimp
    87723,  -- Sack of Emperor Salmon
    87724,  -- Sack of Redbelly Mandarin
    87725,  -- Sack of Tiger Gourami
    87726,  -- Sack of Jewel Danio
    87727,  -- Sack of Reef Octopus
    87728,  -- Sack of Krasarang Paddlefish
    87729,  -- Sack of Golden Carp
    87730,  -- Sack of Crocolisk Belly
    88496,  -- Sealed Crate
    89125,  -- Sack of Pet Supplies
    89427,  -- Ancient Mogu Treasure
    89428,  -- Ancient Mogu Treasure
    89607,  -- Crate of Leather
    89608,  -- Crate of Ore
    89609,  -- Crate of Dust
    89610,  -- Pandaria Herbs
    89613,  -- Cache of Treasures
    89804,  -- Cache of Mogu Riches
    89807,  -- Amber Encased Treasure Pouch
    89808,  -- Dividends of the Everlasting Spring
    89810,  -- Bounty of a Sundered Land
    89856,  -- Amber Encased Treasure Pouch
    89857,  -- Dividends of the Everlasting Spring
    89858,  -- Cache of Mogu Riches
    89991,  -- Pandaria Fireworks
    90041,  -- Spoils of Theramore
    90155,  -- Golden Chest of the Golden King
    90156,  -- Golden Chest of the Betrayer
    90157,  -- Golden Chest of Windfury
    90158,  -- Golden Chest of the Elemental Triad
    90159,  -- Golden Chest of the Silent Assassin
    90160,  -- Golden Chest of the Light
    90161,  -- Golden Chest of the Holy Warrior
    90162,  -- Golden Chest of the Regal Lord
    90163,  -- Golden Chest of the Howling Beast
    90164,  -- Golden Chest of the Cycle
    90395,  -- Facets of Research
    90397,  -- Facets of Research
    90398,  -- Facets of Research
    90399,  -- Facets of Research
    90400,  -- Facets of Research
    90401,  -- Facets of Research
    90406,  -- Facets of Research
    90537,  -- Winner's Reward
    90621,  -- Hero's Purse
    90622,  -- Hero's Purse
    90623,  -- Hero's Purse
    90624,  -- Hero's Purse
    90625,  -- Treasures of the Vale
    90626,  -- Hero's Purse
    90627,  -- Hero's Purse
    90628,  -- Hero's Purse
    90629,  -- Hero's Purse
    90630,  -- Hero's Purse
    90631,  -- Hero's Purse
    90632,  -- Hero's Purse
    90633,  -- Hero's Purse
    90634,  -- Hero's Purse
    90635,  -- Hero's Purse
    90735,  -- Goodies from Nomi
    90839,  -- Cache of Sha-Touched Gold
    90840,  -- Marauder's Gleaming Sack of Gold
    90892,  -- Winter Veil Gift
    91086,  -- Darkmoon Pet Supplies
    92718,  -- Brawler's Purse
    92744,  -- Heavy Sack of Gold
    92788,  -- Ride Ticket Book
    92789,  -- Ride Ticket Book
    92790,  -- Ride Ticket Book
    92791,  -- Ride Ticket Book
    92792,  -- Ride Ticket Book
    92793,  -- Ride Ticket Book
    92794,  -- Ride Ticket Book
    92813,  -- Greater Cache of Treasures
    92960,  -- Silkworm Cocoon
    93146,  -- Pandaren Spirit Pet Supplies
    93147,  -- Pandaren Spirit Pet Supplies
    93148,  -- Pandaren Spirit Pet Supplies
    93149,  -- Pandaren Spirit Pet Supplies
    93198,  -- Tome of the Tiger
    93199,  -- Tome of the Crane
    93200,  -- Tome of the Serpent
    93360,  -- Serpent's Cache
    93724,  -- Darkmoon Game Prize
    94158,  -- Big Bag of Zandalari Supplies
    94159,  -- Small Bag of Zandalari Supplies
    94207,  -- Fabled Pandaren Pet Supplies
    94219,  -- Arcane Trove
    94220,  -- Sunreaver Bounty
    94296,  -- Cracked Primal Egg
    94553,  -- Notes on Lightning Steel
    94566,  -- Fortuitous Coffer
    95343,  -- Treasures of the Thunder King
    95469,  -- Serpent's Heart
    95601,  -- Shiny Pile of Refuse
    95602,  -- Stormtouched Cache
    95617,  -- Dividends of the Everlasting Spring
    95618,  -- Cache of Mogu Riches
    95619,  -- Amber Encased Treasure Pouch
    97153,  -- Spoils of the Thunder King
    97948,  -- Surplus Supplies
    97949,  -- Surplus Supplies
    97950,  -- Surplus Supplies
    97951,  -- Surplus Supplies
    97952,  -- Surplus Supplies
    97953,  -- Surplus Supplies
    97954,  -- Surplus Supplies
    97955,  -- Surplus Supplies
    97956,  -- Surplus Supplies
    97957,  -- Surplus Supplies
    98095,  -- Brawler's Pet Supplies
    98096,  -- Large Sack of Coins
    98097,  -- Huge Sack of Coins
    98098,  -- Bulging Sack of Coins
    98099,  -- Giant Sack of Coins
    98100,  -- Humongous Sack of Coins
    98101,  -- Enormous Sack of Coins
    98102,  -- Overflowing Sack of Coins
    98103,  -- Gigantic Sack of Coins
    98133,  -- Greater Cache of Treasures
    98560,  -- Arcane Trove
    98562,  -- Sunreaver Bounty
    103535,  -- Bulging Bag of Charms
    103624,  -- Treasures of the Vale
    103632,  -- Lucky Box of Greatness
    104034,  -- Purse of Timeless Coins
    104035,  -- Giant Purse of Timeless Coins
    104112,  -- Curious Ticking Parcel
    104114,  -- Curious Ticking Parcel
    104198,  -- Mantid Artifact Hunter's Kit
    104258,  -- Glowing Green Ash
    104260,  -- Satchel of Savage Mysteries
    104261,  -- Glowing Blue Ash
    104263,  -- Glinting Pile of Stone
    104268,  -- Pristine Stalker Hide
    104271,  -- Coalesced Turmoil
    104272,  -- Celestial Treasure Box
    104273,  -- Flame-Scarred Cache of Offerings
    104275,  -- Twisted Treasures of the Vale
    104292,  -- Partially-Digested Meal
    104296,  -- Ordon Ceremonial Robes
    104319,  -- Winter Veil Gift
    105713,  -- Twisted Treasures of the Vale
    105714,  -- Coalesced Turmoil
    105751,  -- Kor'kron Shaman's Treasure
    106130,  -- Big Bag of Herbs
}
for _, id in ipairs(mopIDs) do openables[id] = {} end

openables[88165] = { lockbox = true }  -- Vine-Cracked Junkbox
openables[88567] = { lockbox = true }  -- Ghost Iron Lockbox

local wodIDs = {
    107077,  -- Bag of Transformers
    107270,  -- Bound Traveler's Scroll
    107271,  -- Frozen Envelope
    108738,  -- Giant Draenor Clam
    108740,  -- Stolen Weapons
    110278,  -- Engorged Stomach
    110678,  -- Darkmoon Ticket Fanny Pack
    111598,  -- Gold Strongbox
    111599,  -- Silver Strongbox
    111600,  -- Bronze Strongbox
    112108,  -- Cracked Egg
    112623,  -- Pack of Fishing Supplies
    113258,  -- Blingtron 5000 Gift Package
    114028,  -- Small Pouch of Coins
    114634,  -- Icy Satchel of Helpful Goods
    114641,  -- Icy Satchel of Helpful Goods
    114648,  -- Scorched Satchel of Helpful Goods
    114655,  -- Scorched Satchel of Helpful Goods
    114662,  -- Tranquil Satchel of Helpful Goods
    114669,  -- Tranquil Satchel of Helpful Goods
    114970,  -- Small Pouch of Coins
    116062,  -- Greater Darkmoon Pet Supplies
    116111,  -- Small Pouch of Coins
    116129,  -- Desiccated Orc's Coin Pouch
    116202,  -- Pet Care Package
    116376,  -- Small Pouch of Coins
    116404,  -- Pilgrim's Bounty
    116761,  -- Winter Veil Gift
    116764,  -- Small Pouch of Coins
    116980,  -- Invader's Forgotten Treasure
    117386,  -- Crate of Pandaren Archaeology Fragments
    117387,  -- Crate of Mogu Archaeology Fragments
    117388,  -- Crate of Mantid Archaeology Fragments
    117392,  -- Loot-Filled Pumpkin
    117393,  -- Keg-Shaped Treasure Chest
    117394,  -- Satchel of Chilled Goods
    117414,  -- Stormwind Guard Armor Package
    118065,  -- Gleaming Ashmaul Strongbox
    118066,  -- Ashmaul Strongbox
    118093,  -- Dented Ashmaul Strongbox
    118094,  -- Dented Ashmaul Strongbox
    118193,  -- Mysterious Shining Lockbox
    118529,  -- Cache of Highmaul Treasures
    118530,  -- Cache of Highmaul Treasures
    118531,  -- Cache of Highmaul Treasures
    118697,  -- Big Bag of Pet Supplies
    118706,  -- Cracked Goren Egg
    118759,  -- Alchemy Experiment
    118924,  -- Cache of Arms
    118925,  -- Plundered Booty
    118926,  -- Huge Pile of Skins
    118927,  -- Maximillian's Laundry
    118928,  -- Faintly-Sparkling Cache
    118929,  -- Sack of Mined Ore
    118930,  -- Bag of Everbloom Herbs
    118931,  -- Leonid's Bag of Supplies
    119000,  -- Highmaul Lockbox
    119036,  -- Box of Storied Treasures
    119037,  -- Supply of Storied Rarities
    119040,  -- Cache of Mingled Treasures
    119041,  -- Strongbox of Mysterious Treasures
    119042,  -- Crate of Valuable Treasures
    119043,  -- Trove of Smoldering Treasures
    119188,  -- Unclaimed Payment
    119189,  -- Unclaimed Payment
    119190,  -- Unclaimed Payment
    119191,  -- Jewelcrafting Payment
    119195,  -- Jewelcrafting Payment
    119196,  -- Jewelcrafting Payment
    119197,  -- Jewelcrafting Payment
    119198,  -- Jewelcrafting Payment
    119199,  -- Jewelcrafting Payment
    119200,  -- Jewelcrafting Payment
    119201,  -- Jewelcrafting Payment
    119330,  -- Steel Strongbox
    120142,  -- Coliseum Champion's Spoils
    120146,  -- Smuggled Sack of Gold
    120147,  -- Bloody Gold Purse
    120151,  -- Gleaming Ashmaul Strongbox
    120170,  -- Partially-Digested Bag
    120184,  -- Ashmaul Strongbox
    120312,  -- Bulging Sack of Coins
    120319,  -- Invader's Damaged Cache
    120320,  -- Invader's Abandoned Sack
    120322,  -- Klinking Stacked Card Deck
    120323,  -- Bulging Stacked Card Deck
    120324,  -- Bursting Stacked Card Deck
    120325,  -- Overflowing Stacked Card Deck
    120334,  -- Satchel of Cosmic Mysteries
    120353,  -- Steel Strongbox
    120354,  -- Gold Strongbox
    120355,  -- Silver Strongbox
    120356,  -- Bronze Strongbox
    122163,  -- Routed Invader's Crate of Spoils
    122191,  -- Bloody Stack of Invitations
    122478,  -- Scouting Report: Frostfire Ridge
    122479,  -- Scouting Report: Shadowmoon Valley
    122480,  -- Scouting Report: Gorgrond
    122481,  -- Scouting Report: Talador
    122482,  -- Scouting Report: Spires of Arak
    122483,  -- Scouting Report: Nagrand
    122484,  -- Blackrock Foundry Spoils
    122485,  -- Blackrock Foundry Spoils
    122486,  -- Blackrock Foundry Spoils
    122535,  -- Traveler's Pet Supplies
    122607,  -- Savage Satchel of Cooperation
    122613,  -- Stash of Dusty Music Rolls
    122718,  -- Clinking Present
    123857,  -- Runic Pouch
    123858,  -- Follower Retraining Scroll Case
    123975,  -- Greater Bounty Spoils
    124054,  -- Time-Twisted Anomaly
    124670,  -- Sealed Darkmoon Crate
    126901,  -- Gold Strongbox
    126902,  -- Silver Strongbox
    126903,  -- Bronze Strongbox
    126904,  -- Steel Strongbox
    126905,  -- Steel Strongbox
    126906,  -- Gold Strongbox
    126907,  -- Silver Strongbox
    126908,  -- Bronze Strongbox
    126909,  -- Gold Strongbox
    126910,  -- Silver Strongbox
    126911,  -- Bronze Strongbox
    126912,  -- Steel Strongbox
    126913,  -- Steel Strongbox
    126914,  -- Gold Strongbox
    126915,  -- Silver Strongbox
    126916,  -- Bronze Strongbox
    126917,  -- Ashmaul Strongbox
    126918,  -- Ashmaul Strongbox
    126919,  -- Champion's Strongbox
    126920,  -- Champion's Strongbox
    126921,  -- Ashmaul Strongbox
    126922,  -- Ashmaul Strongbox
    126923,  -- Champion's Strongbox
    126924,  -- Champion's Strongbox
    127141,  -- Bloated Thresher
    127148,  -- Silas' Secret Stash
    127395,  -- Ripened Strange Fruit
    127751,  -- Fel-Touched Pet Supplies
    127831,  -- Challenger's Strongbox
    127853,  -- Iron Fleet Treasure Chest
    127854,  -- Iron Fleet Treasure Chest
    127855,  -- Iron Fleet Treasure Chest
    128025,  -- Rattling Iron Cage
    128213,  -- Dented Ashmaul Strongbox
    128214,  -- Dented Ashmaul Strongbox
    128652,  -- Gently Shaken Gift
    128653,  -- Winter Veil Gift
    128803,  -- Savage Satchel of Cooperation
    129928,  -- Frigid Timewarped Prism
    120301,  -- 要塞 护甲升级徽记
    120302,  -- 要塞 武器升级徽记
}
for _, id in ipairs(wodIDs) do openables[id] = {} end

openables[106895] = { lockbox = true }  -- Iron-Bound Junkbox
openables[116920] = { lockbox = true }  -- True Steel Lockbox


local legionIDs = {
    123961,  -- Recipe List: Leysmithing
    123962,  -- Recipe List: Hardened Leystone
    123963,  -- Recipe List: Masterwork Demonsteel
    126947,  -- Nal'ryssa's Spare Mining Supplies
    129746,  -- Oddly-Shaped Stomach
    130186,  -- Intern Items - BJI
    132892,  -- Blingtron 6000 Gift Package
    133549,  -- Muck-Covered Shoes
    133721,  -- Message in a Beer Bottle
    133803,  -- Common Bag of Loot
    133804,  -- Faded Bag of Loot
    135539,  -- Crate of Battlefield Goods
    135540,  -- Crate of Battlefield Goods
    135541,  -- Crusader's Crate of Battlefield Goods
    135542,  -- Icy Crate of Battlefield Goods
    135543,  -- Rival's Crate of Battlefield Goods
    135544,  -- Tranquil Crate of Helpful Goods - Reuse Me
    135545,  -- Savage Crate of Battlefield Goods
    135546,  -- Fel-Touched Crate of Battlefield Goods
    136359,  -- Shaman's Pouch
    136362,  -- Ancient War Remnants
    136383,  -- Ravencrest Cache
    137414,  -- Pet Tournament Purse
    137560,  -- Dreamweaver Provisions
    137561,  -- Highmountain Tribute
    137562,  -- Valarjar Cache
    137563,  -- Farondis Lockbox
    137564,  -- Nightfallen Hoard
    137565,  -- Warden's Field Kit
    137590,  -- Pile of Silk
    137591,  -- Pile of Skins
    137592,  -- Pile of Ore
    137593,  -- Pile of Herbs
    137594,  -- Pile of Gems
    137600,  -- Pile of Pants
    137608,  -- Growling Sac
    138098,  -- Iron-Bound Crate of Battlefield Goods
    138469,  -- Champion's Strongbox
    138470,  -- Silver Strongbox
    138471,  -- Bronze Strongbox
    138472,  -- Steel Strongbox
    138473,  -- Steel Strongbox
    138474,  -- Champion's Strongbox
    138475,  -- Silver Strongbox
    138476,  -- Bronze Strongbox
    139048,  -- Small Legion Chest
    139049,  -- Large Legion Chest
    139137,  -- Hag's Belongings
    139284,  -- Anniversary Gift
    139341,  -- Winter Veil Gift
    139343,  -- Gently Shaken Gift
    139381,  -- Keystone Container
    139382,  -- Keystone Container
    139383,  -- Keystone Container
    139416,  -- Bloated Sewersucker
    139467,  -- Satchel of Spoils
    139484,  -- Cache of Nightmarish Treasures
    139486,  -- Cache of Nightmarish Treasures
    139487,  -- Cache of Nightmarish Treasures
    139488,  -- Cache of Nightmarish Treasures
    139771,  -- Seething Essence
    139777,  -- Strange Crate
    139879,  -- Crate of Champion Equipment
    140148,  -- Cache of Nightborne Treasures
    140150,  -- Cache of Nightborne Treasures
    140152,  -- Cache of Nightborne Treasures
    140154,  -- Cache of Nightborne Treasures
    140200,  -- Immaculate Nightshard Curio
    140220,  -- Scavenged Cloth
    140221,  -- Found Sack of Gems
    140222,  -- Harvested Goods
    140224,  -- Butchered Meat
    140225,  -- Salvaged Armor
    140226,  -- Mana-Tinged Pack
    140227,  -- Bloodhunter's Quarry
    140591,  -- Shattered Satchel of Cooperation
    140601,  -- Sixtrigger Resource Crate
    140997,  -- Alliance Strongbox
    140998,  -- Horde Strongbox
    141069,  -- Skyhold Chest of Riches
    141155,  -- Challenger's Spoils
    141156,  -- Haunted Ravencrest Keepsake
    141157,  -- Nightborne Rucksack
    141158,  -- Despoiled Keeper's Cache
    141159,  -- Watertight Salvage Bag
    141160,  -- Seaweed-Encrusted Satchel
    141161,  -- Cache of the Black Dragon
    141162,  -- Unmarked Suramar Vault Crate
    141163,  -- Bag of Confiscated Materials
    141164,  -- Violet Hold Contraband Locker
    141165,  -- Challenger's Spoils
    141166,  -- Haunted Ravencrest Keepsake
    141167,  -- Nightborne Rucksack
    141168,  -- Despoiled Keeper's Cache
    141169,  -- Watertight Salvage Bag
    141170,  -- Seaweed-Encrusted Satchel
    141171,  -- Cache of the Black Dragon
    141172,  -- Unmarked Suramar Vault Crate
    141173,  -- Bag of Confiscated Materials
    141174,  -- Violet Hold Contraband Locker
    141175,  -- Challenger's Spoils
    141176,  -- Haunted Ravencrest Keepsake
    141177,  -- Nightborne Rucksack
    141178,  -- Despoiled Keeper's Cache
    141179,  -- Watertight Salvage Bag
    141180,  -- Seaweed-Encrusted Satchel
    141181,  -- Cache of the Black Dragon
    141182,  -- Unmarked Suramar Vault Crate
    141183,  -- Bag of Confiscated Materials
    141184,  -- Violet Hold Contraband Locker
    141344,  -- Tribute of the Broken Isles
    141350,  -- Kirin Tor Chest
    142023,  -- Adventurer's Footlocker
    142113,  -- Crate of Arakkoa Archaeology Fragments
    142114,  -- Crate of Draenor Clans Archaeology Fragments
    142115,  -- Crate of Ogre Archaeology Fragments
    142342,  -- Glittering Pack
    142350,  -- Challenger's Purse
    142381,  -- Oath of Fealty
    142447,  -- Torn Sack of Pet Supplies
    143606,  -- Satchel of Battlefield Spoils
    143607,  -- Soldier's Footlocker
    143948,  -- Chilled Satchel of Vegetables
    144291,  -- Tadpole Gift
    144330,  -- Sprocket Container
    144345,  -- Pile of Pet Goodies
    144373,  -- Claw-Marked Brawler's Purse
    144374,  -- Groovy Brawler's Purse
    144375,  -- Feathered Brawler's Purse
    144376,  -- Agile Brawler's Purse
    144377,  -- Beginning Brawler's Purse
    144378,  -- Gorestained Brawler's Purse
    144379,  -- Murderous Brawler's Purse
    146317,  -- Mr. Smite's Supplies
    146799,  -- BUILDING CONTRIBUTION REWARD ITEM [NYI]
    146899,  -- Highmountain Supplies
    146900,  -- Nightfallen Cache
    146901,  -- Valarjar Strongbox
    146948,  -- Tribute of the Broken Isles
    147361,  -- Legionfall Chest
    147432,  -- Champion Equipment
    147446,  -- Brawler's Footlocker
    147518,  -- Cache of Fel Treasures
    147519,  -- Cache of Fel Treasures
    147520,  -- Cache of Fel Treasures
    147521,  -- Cache of Fel Treasures
    147573,  -- Trial of Style Reward: First Place
    147574,  -- Trial of Style Reward: Second Place
    147575,  -- Trial of Style Reward: Third Place
    147576,  -- Trial of Style Consolation Prize
    147729,  -- Netherchunk
    147876,  -- Anniversary Gift
    147905,  -- Chest of Champion Equipment
    147907,  -- Heart-Shaped Carton
    149503,  -- Stolen Gift
    149504,  -- Smokywood Pastures Special Present
    149574,  -- Loot-Stuffed Pumpkin
    149752,  -- Keg-Shaped Treasure Box
    149753,  -- Knapsack of Chilled Goods
    150924,  -- Greater Tribute of the Broken Isles
    151221,  -- Gooey Brawler's Purse
    151222,  -- Leather Brawler's Purse
    151223,  -- Booming Brawler's Purse
    151224,  -- Bitten Brawler's Purse
    151225,  -- Wet Brawler's Purse
    151229,  -- Brawler's Music Box
    151230,  -- Croc-Skin Brawler's Purse
    151231,  -- Brawler's Egg
    151232,  -- Brawler's Package
    151233,  -- Blingin' Brawler's Bag
    151235,  -- Filthy Brawler's Purse
    151238,  -- Dark Brawler's Purse
    151264,  -- Clunky Brawler's Purse
    151345,  -- Gently Shaken Gift
    151350,  -- Winter Veil Gift
    151482,  -- Time-Lost Wallet
    151550,  -- Time-Lost Keepsake Box
    151551,  -- Time-Lost Keepsake Box
    151552,  -- Time-Lost Keepsake Box
    151553,  -- Time-Lost Keepsake Box
    151554,  -- Time-Lost Keepsake Box
    151557,  -- Champion's Strongbox
    151558,  -- Champion's Strongbox
    151638,  -- Leprous Sack of Pet Supplies
    152102,  -- Farondis Chest
    152103,  -- Dreamweaver Cache
    152104,  -- Highmountain Supplies
    152105,  -- Nightfallen Cache
    152106,  -- Valarjar Strongbox
    152107,  -- Warden's Supply Kit
    152922,  -- Brittle Krokul Chest
    153116,  -- Wyrmtongue Cache of Herbs
    153117,  -- Wyrmtongue Cache of Supplies
    153118,  -- Wyrmtongue Cache of Shiny Things
    153119,  -- Wyrmtongue Cache of Finery
    153120,  -- Wyrmtongue Cache of Minerals
    153121,  -- Wyrmtongue Cache of Skins
    153122,  -- Wyrmtongue Cache of Magic
    153132,  -- Coffer of Argus Equipment
    153191,  -- Cracked Fel-Spotted Egg
    153202,  -- Argunite Cluster
    153248,  -- Light's Fortune
    153501,  -- Cache of Antoran Treasures
    153502,  -- Cache of Antoran Treasures
    153503,  -- Cache of Antoran Treasures
    153504,  -- Cache of Antoran Treasures
    154991,  -- Brawler's Footlocker
    154992,  -- Brawler's Footlocker
    156682,  -- Otherworldly Satchel of Helpful Goods
    156683,  -- Satchel of Helpful Goods
    156688,  -- Icy Satchel of Helpful Goods
    156689,  -- Scorched Satchel of Helpful Goods
    156698,  -- Tranquil Satchel of Helpful Goods
    156707,  -- Bret's Satchel of Helpful Goods
    156836,  -- Bulging Package
    157822,  -- Dreamweaver Provisions
    157824,  -- Valarjar Cache
    157827,  -- Warden's Field Kit
    157828,  -- Kirin Tor Chest
}
for _, id in ipairs(legionIDs) do openables[id] = {} end

openables[121331] = { lockbox = true }  -- Leystone Lockbox


local bfaIDs = {
    152578,  -- Sack of Herbs
    152580,  -- Pile of Cloth
    152581,  -- Bag of Jewels
    152868,  -- Anglin' Art's Mudfish Bait
    153574,  -- Plain Hat Box
    159783,  -- Kane's Coin Purse
    160054,  -- War-Torn Satchel of Cooperation
    160268,  -- Bag of Armor (DNT)
    160322,  -- Pile of Ore
    160324,  -- Grumbling Sac
    160439,  -- Adventurer's Footlocker
    160485,  -- An Unforgettable Luncheon
    160514,  -- Maokka's Box
    160578,  -- Anglin' Art's Bag o' Fish
    160831,  -- Cracking Cobra Egg
    161083,  -- Satchel of Plundered Jewels
    161084,  -- Recovered Stormsong Produce
    161878,  -- Tiny Coin Purse
    162637,  -- Anniversary Gift
    162644,  -- Winter Veil Gift
    162974,  -- Gently Shaken Gift
    163059,  -- Spoils of Jani
    163139,  -- Carefully Wrapped Hat Box
    163141,  -- Spooky Hat Box
    163142,  -- Ironbound Hat Box
    163144,  -- Striped Hat Box
    163146,  -- Fancy Hat Box
    163148,  -- Luxurious Hat Box
    163611,  -- Seafarer's Coin Pouch
    163612,  -- Wayfinder's Satchel
    163613,  -- Sack of Plunder
    163633,  -- Captain Gulnaku's Treasure
    163734,  -- Bulging Coin Purse
    163825,  -- Plundered Supplies
    163826,  -- Raider's Supply Cache
    164251,  -- Champion's Strongbox
    164252,  -- Champion's Strongbox
    164253,  -- Steel Strongbox
    164254,  -- Steel Strongbox
    164257,  -- Cache of Uldir Treasures
    164258,  -- Cache of Uldir Treasures
    164259,  -- Cache of Uldir Treasures
    164260,  -- Cache of Uldir Treasures
    164261,  -- Steel Strongbox
    164262,  -- Steel Strongbox
    164263,  -- Steel Strongbox
    164264,  -- Steel Strongbox
    164625,  -- Crate of Demon Archaeology Fragments
    164626,  -- Crate of Highborne Archaeology Fragments
    164627,  -- Crate of Highmountain Tauren Archaeology Fragments
    164931,  -- Rumbler's Purse
    164938,  -- G.G. Gearbox
    164939,  -- Overstuffed Silkweave Purse
    164940,  -- Mysterious Satchel
    165711,  -- Gold Strongbox
    165712,  -- Silver Strongbox
    165713,  -- Bronze Strongbox
    165714,  -- Gold Strongbox
    165715,  -- Silver Strongbox
    165716,  -- Bronze Strongbox
    165717,  -- Steel Strongbox
    165718,  -- Steel Strongbox
    165729,  -- Cache of Dazar'alor Treasures
    165730,  -- Cache of Dazar'alor Treasures
    165731,  -- Cache of Dazar'alor Treasures
    165732,  -- Cache of Dazar'alor Treasures
    166290,  -- Voldunai Supplies
    166292,  -- Zandalari Empire Supplies
    166294,  -- Storm's Wake Supplies
    166295,  -- Proudmoore Admiralty Supplies
    166297,  -- Order of Embers Supplies
    166298,  -- Champions of Azeroth Supplies
    166299,  -- Honorbound Supplies
    166300,  -- 7th Legion Supplies
    166505,  -- Relinquished Azerite Spaulders
    166508,  -- Relinquished Azerite Spaulders
    166509,  -- Relinquished Azerite Spaulders
    166510,  -- Relinquished Azerite Helm
    166511,  -- Relinquished Azerite Helm
    166512,  -- Relinquished Azerite Helm
    166513,  -- Relinquished Azerite Chestpiece
    166514,  -- Relinquished Azerite Chestpiece
    166515,  -- Relinquished Azerite Chestpiece
    166529,  -- Relinquished Azerite Spaulders
    166530,  -- Relinquished Azerite Spaulders
    166531,  -- Relinquished Azerite Spaulders
    166532,  -- Relinquished Azerite Helm
    166533,  -- Relinquished Azerite Helm
    166534,  -- Relinquished Azerite Helm
    166535,  -- Relinquished Azerite Chestpiece
    166536,  -- Relinquished Azerite Chestpiece
    166537,  -- Relinquished Azerite Chestpiece
    166741,  -- Nomi's Grocery Tote
    167696,  -- Build-a-Computer Kit
    168057,  -- Rustbolt Requisitions
    168124,  -- Cache of War Resources
    168162,  -- Chronal Cache of Cloth
    168204,  -- Small Metal Box
    168263,  -- Mundane Recycling Requisition
    168264,  -- Recycling Requisition
    168266,  -- Strange Recycling Requisition
    168394,  -- Box of Assorted Parts
    168395,  -- Irradiated Box of Assorted Parts
    168488,  -- Seafarer's Lost Coin Pouch
    168494,  -- Blueprint: Rustbolt Resistance Insignia
    168740,  -- Blingtron 7000 Gift Package
    168833,  -- Experimental Adventurer Augmentation
    169113,  -- Advanced Adventurer Augmentation
    169133,  -- Crystallized Jelly
    169137,  -- Extraordinary Adventurer Augmentation
    169335,  -- Relinquished Azerite Spaulders
    169336,  -- Relinquished Azerite Spaulders
    169337,  -- Relinquished Azerite Spaulders
    169338,  -- Relinquished Azerite Helm
    169339,  -- Relinquished Azerite Helm
    169340,  -- Relinquished Azerite Helm
    169341,  -- Relinquished Azerite Chestpiece
    169342,  -- Relinquished Azerite Chestpiece
    169343,  -- Relinquished Azerite Chestpiece
    169430,  -- Unclaimed Black Market Container
    169471,  -- Cogfrenzy's Construction Toolkit
    169477,  -- Benthic Girdle
    169478,  -- Benthic Bracers
    169479,  -- Benthic Helm
    169480,  -- Benthic Chestguard
    169481,  -- Benthic Cloak
    169482,  -- Benthic Leggings
    169483,  -- Benthic Treads
    169484,  -- Benthic Spaulders
    169485,  -- Benthic Gauntlets
    169666,  -- Unopened Stratholme Supply Crate
    169838,  -- Azeroth Mini: Starter Pack
    169848,  -- Azeroth Mini Pack: Bondo's Yard
    169850,  -- Azeroth Mini Pack: Mechagon
    169903,  -- Nazjatar Survival Pack
    169904,  -- Ankoan Commendation Crate
    169905,  -- Faintly Glowing Supplies
    169908,  -- Cleverly Concealed Supplies
    169909,  -- Poen's Neat Things
    169910,  -- Vim's Scavenged Supplies
    169911,  -- Liberated Naga Cache
    169915,  -- Poen's Stashed Supplies
    169916,  -- Brew-Soaked Supplies
    169917,  -- Mysterious Azshari Chest
    169919,  -- Unshackled Commendation Crate
    169920,  -- Neri's Spare Supplies
    169921,  -- Spine Guarded Supplies
    169922,  -- Vim's Gift of Appreciation
    169939,  -- Ankoan Supplies
    169940,  -- Unshackled Supplies
    170061,  -- Rustbolt Supplies
    170065,  -- Re-Procedurally Generated Punchcard
    170073,  -- Dented Ashmaul Strongbox
    170074,  -- Dented Ashmaul Strongbox
    170185,  -- Intact Naga Skeleton
    170188,  -- Barnacled Bag of Goods
    170190,  -- Mardivas' Bag of Containing
    170195,  -- Voidcaster's Supply Bag
    170473,  -- Jingling Sack
    170489,  -- Mardivas's Handmade Handbag
    170502,  -- Waterlogged Toolbox
    170539,  -- Plundered Supplies
    171305,  -- Salvaged Cache of Goods
    171988,  -- Adventurer's Footlocker
    172014,  -- Anniversary Gift
    172021,  -- Marks of Sanctification Purse
    172224,  -- Winter Veil Gift
    172225,  -- Gently Shaken Gift
    173372,  -- Cache of the Black Empire
    173734,  -- Mysterious Crate
    173949,  -- Dread Chain Salvage
    173950,  -- Crestfall Salvage
    173983,  -- Vulpera Satchel of Salvage
    173987,  -- Elemental Salvage
    173988,  -- Havenswood Salvage
    173989,  -- Jorundall Salvage
    173990,  -- Molten Cay Salvage
    173991,  -- Rotting Mire Salvage
    173992,  -- Skittering Hollow Salvage
    173993,  -- Snowblossom Salvage
    173994,  -- Un'gol Ruins Salvage
    173995,  -- Venture Co. 'Salvage'
    173996,  -- Verdant Wilds Salvage
    173997,  -- Whispering Reef Salvage
    174039,  -- Crate of Cursed Mementos
    174181,  -- Bag of Herbs
    174182,  -- Bag of Ore
    174183,  -- Bag of Leather
    174184,  -- Bag of Cloth
    174194,  -- Bag of Enchanting
    174195,  -- Bag of Gems
    174358,  -- Unopened Blackrock Supply Crate
    174483,  -- Rajani Supplies
    174484,  -- Uldum Accord Supplies
    174529,  -- Crate of Coalescing Visions
    174630,  -- Relinquished Azerite Spaulders
    174633,  -- Relinquished Azerite Helm
    174634,  -- Relinquished Azerite Helm
    174635,  -- Relinquished Azerite Helm
    174637,  -- Relinquished Azerite Chestpiece
    174638,  -- Relinquished Azerite Chestpiece
    174642,  -- Corrupted Ny'alotha Raid Item
    174958,  -- Cache of the Fallen Mogu
    174959,  -- Cache of the Mantid Swarm
    174960,  -- Cache of the Aqir Swarm
    174961,  -- Cache of the Amathet
}
for _, id in ipairs(bfaIDs) do openables[id] = {} end

openables[169475] = { lockbox = true }  -- Barnacled Lockbox
openables[174636] = { lockbox = true }  -- Relinquished Azerite Chestpiece


local slIDs = {
    151060,  -- Keystone Container
    171209,  -- Blooded Satchel
    171210,  -- Satchel of Nature's Bounty
    171211,  -- Venthyr's Coin Purse
    174652,  -- Satchel of Forgotten Heirlooms
    175095,  -- Book of Tickets
    175135,  -- Atticus's Spare Supplies
    178078,  -- Reborn Spirit Cache
    178128,  -- Pouch of Shinies
    178513,  -- Anniversary Gift
    178528,  -- Winter Veil Gift
    178529,  -- Gently Shaken Gift
    178965,  -- Small Gardener's Satchel
    178966,  -- Gardener's Satchel
    178967,  -- Large Gardener's Satchel
    178968,  -- Weekly Gardener's Satchel
    178969,  -- Test Container
    179380,  -- Redelev Purse
    180085,  -- Kyrian Keepsake
    180128,  -- Harvester's Elite Bounty Purse
    180355,  -- Ornate Pyx
    180378,  -- Forgemaster's Crate
    180379,  -- Exquisitely Woven Rug
    180380,  -- Lace Draperies
    180386,  -- Herbalist's Pouch
    180442,  -- Bag of Sin Stones
    180646,  -- Supplies of the Undying Army
    180647,  -- Ascended Supplies
    180648,  -- Court of Harvesters Supplies
    180649,  -- Wild Hunt Supplies
    180875,  -- Carriage Cargo
    180974,  -- Novice's Satchel
    180975,  -- Journeyman's Satchel
    180976,  -- Artisan's Satchel
    180977,  -- Spirit-Tender's Satchel
    180979,  -- Artisan's Large Satchel
    180980,  -- Journeyman's Large Satchel
    180981,  -- Novice's Large Satchel
    180983,  -- Artisan's Stuffed Satchel
    180984,  -- Journeyman's Stuffed Satchel
    180985,  -- Novice's Stuffed Satchel
    180988,  -- Journeyman's Overflowing Satchel
    180989,  -- Novice's Overflowing Satchel
    181372,  -- Tribute of the Ascended
    181475,  -- Bounty of the Grove Wardens
    181476,  -- Tribute of the Wild Hunt
    181556,  -- Tribute of the Court
    181557,  -- Favor of the Court
    181732,  -- Tribute of the Ambitious
    181733,  -- Tribute of the Duty-Bound
    181739,  -- Bag of Soul Ash
    181741,  -- Tribute of the Paragon
    181767,  -- Small Coin Purse
    181778,  -- Sack of Shinies
    181779,  -- A "Wrapped" Weapon
    181780,  -- An Undelivered Tradesman's Shipment
    182114,  -- Assorted Parts and 'Things'
    182590,  -- Vinewormed Coin Pouch
    182591,  -- Vinecovered Infused Rubies
    183424,  -- Stitched Satchel of Maldraxxi Goods
    183429,  -- Stitched Satchel of Venthyr Goods
    183699,  -- Exquisite Ingredients
    183701,  -- Cleansing Rite Materials
    183702,  -- Nature's Splendor
    183703,  -- Bonesmith's Satchel
    183834,  -- Crate of Drust Archaeology Fragments
    183835,  -- Crate of Zandalari Archaeology Fragments
    183882,  -- Collection of Random Bits
    183883,  -- Bulging Collection of Random Bits
    183884,  -- Pocketful of Assorted Nuggets
    183885,  -- Sika's Spare Ore Pouch
    183886,  -- Sika's Rare Ore Pouch
    184045,  -- Martial Tithe of the Court of Harvesters
    184046,  -- Undying Army Weapon Cache
    184047,  -- Ascended Chest of Arms
    184048,  -- Weapon Satchel of the Wild Hunt
    184103,  -- Cracked Blight-Touched Egg
    184158,  -- Oozing Necroray Egg
    184395,  -- Fallen Adventurer's Cache
    184444,  -- Supplies for the Path
    184522,  -- Veiled Satchel of Cooperation
    184584,  -- Byron Test Callings Box
    184589,  -- Bag of Potions
    184627,  -- Sacrificial Red Envelope
    184630,  -- Adventurer's Tailoring Cache
    184631,  -- Adventurer's Enchanting Cache
    184632,  -- Champion's Fish Cache
    184633,  -- Champion's Meat Cache
    184634,  -- Adventurer's Herbalism Cache
    184635,  -- Adventurer's Mining Cache
    184636,  -- Adventurer's Skinning Cache
    184637,  -- Hero's Meat Cache
    184638,  -- Hero's Fish Cache
    184639,  -- Champion's Tailoring Cache
    184640,  -- Champion's Skinning Cache
    184641,  -- Champion's Mining Cache
    184642,  -- Champion's Herbalism Cache
    184643,  -- Champion's Enchanting Cache
    184644,  -- Hero's Tailoring Cache
    184645,  -- Hero's Skinning Cache
    184646,  -- Hero's Mining Cache
    184647,  -- Hero's Herbalism Cache
    184648,  -- Hero's Enchanting Cache
    184810,  -- Plundered Supplies
    184811,  -- Artemede's Bounty
    184812,  -- Apolon's Bounty
    184843,  -- Salvaged Supplies
    184866,  -- Grummlepouch
    184868,  -- Cache of Nathrian Treasures
    184869,  -- Cache of Nathrian Treasures
    185765,  -- Shipment of Heavy Callous Hide
    185832,  -- Shipment of Elethium Ore
    185833,  -- Shipment of Lightless Silk
    185834,  -- Orboreal Distinguishment
    185906,  -- Anniversary Gift
    185963,  -- Diviner's Rune Chit
    185972,  -- Tormentor's Cache
    185990,  -- Harvester's War Chest
    185991,  -- War Chest of the Wild Hunt
    185992,  -- War Chest of the Undying Army
    185993,  -- Ascended War Chest
    186196,  -- Death's Advance War Chest
    186531,  -- Cache of Sanctum Treasures
    186533,  -- Cache of Sanctum Treasures
    186650,  -- Death's Advance Supplies
    186680,  -- Gold Filled Boot
    186688,  -- Gold Filled Wash Bucket
    186690,  -- Gold Filled Barrel
    186691,  -- Gold Filled Satchel
    186692,  -- Gold Filled Helmet
    186693,  -- Gold Filled Wheelbarrow
    186694,  -- Shaded Bag of Ore
    186705,  -- Gold Filled Chalice
    186706,  -- Gold Filled Hat
    186707,  -- Gold Filled Crate
    186708,  -- Gold Filled Paint Brush Cup
    186970,  -- Feeder's Hand and Key
    186971,  -- Feeder's Hand
    187028,  -- Supplies of the Archivists' Codex
    187029,  -- Mysterious Gift from Ve'nari
    187182,  -- Hatching Corpsefly Egg
    187254,  -- Arrangement of Anima
    187278,  -- Talon-Pierced Mawsworn Lockbox
    187346,  -- Lost Memento
    187351,  -- Stygic Cluster
    187354,  -- Abandoned Broker Satchel
    187440,  -- Feather-Stuffed Helm
    187494,  -- Byron Test Relic Fragments Box
    187502,  -- Byron Test Relic Fragments Box (Immediate)
    187503,  -- Bundle of Archived Research
    187520,  -- Gently Shaken Gift
    187543,  -- Death's Advance War Chest
    187551,  -- Small Korthian Supply Chest
    187561,  -- Winter Veil Gift
    187569,  -- Brokers' Tailoring Mote of Potentiation
    187570,  -- Brokers' Skinning Mote of Potentiation
    187571,  -- Brokers' Mining Mote of Potentiation
    187572,  -- Brokers' Herbalism Mote of Potentiation
    187573,  -- Brokers' Enchanting Mote of Potentiation
    187574,  -- Brokers' Overflowing Bucket
    187575,  -- Korthian Fishing Cache
    187576,  -- Korthian Skinning Cache
    187577,  -- Korthian Meat Cache
    187596,  -- Broken Isles Meat Delivery
    187597,  -- Broken Isles Fish Delivery
    187598,  -- Broken Isles Cloth Delivery
    187599,  -- Broken Isles Herb Delivery
    187600,  -- Broken Isles Ore Delivery
    187601,  -- Broken Isles Leather Delivery
    187604,  -- Broken Isles Enchantment Delivery
    187605,  -- Broken Isles Gem Delivery
    187659,  -- Adventurer's Footlocker
    187710,  -- Anniversary Gift
    187780,  -- Enlightened Broker Supplies
    187781,  -- Olea Cache
    187787,  -- Ephemera Orb
    187817,  -- Korthite Crystal Geode
    188796,  -- Cypher Test Item
    189428,  -- 9.2 Pet Battle Playtest Bag of Goodies
    189452,  -- 9.2 Mount Crafting Bag of Goodies
    190178,  -- Pouch of Protogenic Provisions
    190382,  -- Warped Pocket Dimension
    190610,  -- Tribute of the Enlightened Elders
    190655,  -- Cache of Sepulcher Treasures
    190656,  -- Cache of Sepulcher Treasures
    190823,  -- Firim's Mysterious Cache
    191030,  -- Cosmic Flux Parcel
    191040,  -- Cache of Sepulcher Treasures
    191041,  -- Cache of Sepulcher Treasures
    191139,  -- Tribute of the Enlightened Elders
    191301,  -- Treatise on Patterns in the Purpose
    191302,  -- Bottled Night Sky
    191303,  -- Overflowing Chest of Riches
    191701,  -- Bag of Explored Souls
    192093,  -- Gently Shaken Gift
    192094,  -- Winter Veil Gift
    192437,  -- Cache of Fated Treasures
    192438,  -- Cache of Fated Treasures
}
for _, id in ipairs(slIDs) do openables[id] = {} end

openables[179311] = { lockbox = true }  -- Synvir Lockbox
openables[180522] = { lockbox = true }  -- Phaedrum Lockbox
openables[180532] = { lockbox = true }  -- Oxxein Lockbox
openables[180533] = { lockbox = true }  -- Solenium Lockbox
openables[186160] = { lockbox = true }  -- Locked Artifact Case
openables[186161] = { lockbox = true }  -- Stygian Lockbox
openables[188787] = { lockbox = true }  -- Locked Broker Luggage


local dfIDs = {
    189765,  -- Maruuk Centaur Supply Satchel
    190233,  -- Maruuk Centaur Supplies
    191203,  -- Dragonscale Expedition Supplies
    192111,  -- Renewed Proto-Drake: Red Scales
    192131,  -- Valdrakken Weapon Chain
    192132,  -- Draconium Blade Sharpener
    192890,  -- Keeper's Glory
    192891,  -- Earthwarden's Prize
    192892,  -- Timewatcher's Patience
    192893,  -- Jeweled Dragon's Heart
    193205,  -- Ohuna Companion Color: Brown
    193376,  -- Adenedal's Tidy Purse
    193891,  -- Experimental Substance
    193897,  -- Reawakened Catalyst
    193898,  -- Umbral Bone Needle
    193899,  -- Primalweave Spindle
    193900,  -- Prismatic Focusing Shard
    193901,  -- Primal Dust
    193902,  -- Eroded Titan Gizmo
    193903,  -- Watcher Power Core
    193904,  -- Phoenix Feather Quill
    193905,  -- Iskaaran Trading Ledger
    193907,  -- Chipped Tyrstone
    193909,  -- Ancient Gem Fragments
    193910,  -- Molted Dragon Scales
    193913,  -- Preserved Animal Parts
    194034,  -- Renewed Proto-Drake
    194039,  -- Heated Ore Sample
    194062,  -- Unyielding Stone Chunk
    194072,  -- Sack of Gold
    194087,  -- Ohuna Companion Color: Red
    194088,  -- Ohuna Companion Color: Dark
    194089,  -- Bakar Companion Color: Orange
    194090,  -- Bakar Companion Color: White
    194091,  -- Bakar Companion Color: Golden Brown
    194093,  -- Bakar Companion Color: Brown
    194094,  -- Bakar Companion Color: Black
    194095,  -- Ohuna Companion Color: Sepia
    194419,  -- Life Pool Herb Pouch
    194741,  -- Earthbound Tome
    194750,  -- Professional Equipment
    194838,  -- Highland Drake Manuscript: Spined Head
    196961,  -- Cliffside Wylderdrake: Armor
    196962,  -- Cliffside Wylderdrake: Silver and Purple Armor
    196963,  -- Cliffside Wylderdrake: Silver and Blue Armor
    196964,  -- Cliffside Wylderdrake: Gold and Black Armor
    196965,  -- Cliffside Wylderdrake: Bronze and Teal Armor
    196966,  -- Cliffside Wylderdrake: Gold and Orange Armor
    196967,  -- Cliffside Wylderdrake: Gold and White Armor
    196968,  -- Cliffside Wylderdrake: Steel and Yellow Armor
    196969,  -- Cliffside Wylderdrake: Finned Back
    196970,  -- Cliffside Wylderdrake: Spiked Back
    196971,  -- Cliffside Wylderdrake: Spiked Brow
    196972,  -- Cliffside Wylderdrake: Plated Brow
    196973,  -- Cliffside Wylderdrake: Dual Horned Chin
    196974,  -- Cliffside Wylderdrake: Four-Horned Chin
    196975,  -- Cliffside Wylderdrake: Head Fin
    196976,  -- Cliffside Wylderdrake: Head Mane
    196977,  -- Cliffside Wylderdrake: Split Head Horns
    196978,  -- Cliffside Wylderdrake: Small Head Spikes
    196979,  -- Cliffside Wylderdrake: Curled Head Horns
    196980,  -- Cliffside Wylderdrake: Triple Head Horns
    196981,  -- Cliffside Wylderdrake: Conical Head
    196982,  -- Cliffside Wylderdrake: Ears
    196983,  -- Cliffside Wylderdrake: Maned Jaw
    196984,  -- Cliffside Wylderdrake: Finned Jaw
    196985,  -- Cliffside Wylderdrake: Horned Jaw
    196986,  -- Cliffside Wylderdrake: Black Hair
    196987,  -- Cliffside Wylderdrake: Blonde Hair
    196988,  -- Cliffside Wylderdrake: Red Hair
    196989,  -- Cliffside Wylderdrake: White Hair
    196990,  -- Cliffside Wylderdrake: Helm
    196991,  -- Cliffside Wylderdrake: Black Horns
    196992,  -- Cliffside Wylderdrake: Heavy Horns
    196993,  -- Cliffside Wylderdrake: Sleek Horns
    196994,  -- Cliffside Wylderdrake: Short Horns
    196995,  -- Cliffside Wylderdrake: Spiked Horns
    196996,  -- Cliffside Wylderdrake: Branched Horns
    196997,  -- Cliffside Wylderdrake: Split Horns
    196998,  -- Cliffside Wylderdrake: Hook Horns
    196999,  -- Cliffside Wylderdrake: Swept Horns
    197000,  -- Cliffside Wylderdrake: Coiled Horns
    197001,  -- Cliffside Wylderdrake: Finned Cheek
    197002,  -- Cliffside Wylderdrake: Flared Cheek
    197003,  -- Cliffside Wylderdrake: Spiked Cheek
    197004,  -- Cliffside Wylderdrake: Spiked Legs
    197005,  -- Cliffside Wylderdrake: Horned Nose
    197006,  -- Cliffside Wylderdrake: Plated Nose
    197007,  -- Cliffside Wylderdrake: Wide Stripes Pattern
    197008,  -- Cliffside Wylderdrake: Narrow Stripes Pattern
    197009,  -- Cliffside Wylderdrake: Scaled Pattern
    197010,  -- Cliffside Wylderdrake: Red Scales
    197011,  -- Cliffside Wylderdrake: Green Scales
    197012,  -- Cliffside Wylderdrake: Blue Scales
    197013,  -- Cliffside Wylderdrake: Black Scales
    197014,  -- Cliffside Wylderdrake: White Scales
    197015,  -- Cliffside Wylderdrake: Dark Skin Variation
    197016,  -- Cliffside Wylderdrake: Maned Tail
    197017,  -- Cliffside Wylderdrake: Large Tail Spikes
    197018,  -- Cliffside Wylderdrake: Finned Tail
    197019,  -- Cliffside Wylderdrake: Blunt Spiked Tail
    197022,  -- Cliffside Wylderdrake: Finned Neck
    197023,  -- Cliffside Wylderdrake: Maned Neck
    197090,  -- Highland Drake: Gold and Black Armor
    197091,  -- Highland Drake: Silver and Blue Armor
    197093,  -- Highland Drake: Silver and Purple Armor
    197094,  -- Highland Drake: Gold and Red Armor
    197095,  -- Highland Drake: Gold and White Armor
    197096,  -- Highland Drake: Steel and Yellow Armor
    197097,  -- Highland Drake: Spined Back
    197098,  -- Highland Drake: Finned Back
    197099,  -- Highland Drake: Armor
    197100,  -- Highland Drake: Crested Brow
    197101,  -- Highland Drake: Bushy Brow
    197102,  -- Highland Drake: Horned Chin
    197103,  -- Highland Drake: Maned Chin
    197104,  -- Highland Drake: Tapered Chin
    197105,  -- Highland Drake: Spined Chin
    197106,  -- Highland Drake: Finned Head
    197107,  -- Highland Drake: Triple Finned Head
    197108,  -- Highland Drake: Spined Head
    197109,  -- Highland Drake: Spiked Head
    197110,  -- Highland Drake: Plated Head
    197111,  -- Highland Drake: Maned Head
    197112,  -- Highland Drake: Single Horned Head
    197113,  -- Highland Drake: Swept Spiked Head
    197114,  -- Highland Drake: Multi-Horned Head
    197115,  -- Highland Drake: Thorned Jaw
    197116,  -- Highland Drake: Ears
    197117,  -- Highland Drake: Black Hair
    197118,  -- Highland Drake: Brown Hair
    197119,  -- Highland Drake: Helm
    197120,  -- Highland Drake: Ornate Helm
    197121,  -- Highland Drake: Tan Horns
    197122,  -- Highland Drake: Heavy Horns
    197123,  -- Highland Drake: Thorn Horns
    197124,  -- Highland Drake: Swept Horns
    197125,  -- Highland Drake: Coiled Horns
    197126,  -- Highland Drake: Hooked Horns
    197127,  -- Highland Drake: Grand Thorn Horns
    197128,  -- Highland Drake: Curled Back Horns
    197129,  -- Highland Drake: Sleek Horns
    197130,  -- Highland Drake: Stag Horns
    197131,  -- Highland Drake: Hairy Cheek
    197132,  -- Highland Drake: Spiked Cheek
    197133,  -- Highland Drake: Spined Cheek
    197134,  -- Highland Drake: Spiked Legs
    197135,  -- Highland Drake: Toothy Mouth
    197136,  -- Highland Drake: Tapered Nose
    197137,  -- Highland Drake: Spined Nose
    197138,  -- Highland Drake: Striped Pattern
    197139,  -- Highland Drake: Large Spotted Pattern
    197140,  -- Highland Drake: Small Spotted Pattern
    197141,  -- Highland Drake: Scaled Pattern
    197142,  -- Highland Drake: Black Scales
    197143,  -- Highland Drake: Green Scales
    197144,  -- Highland Drake: Red Scales
    197145,  -- Highland Drake: Bronze Scales
    197146,  -- Highland Drake: White Scales
    197147,  -- Highland Drake: Heavy Scales
    197148,  -- Highland Drake: Vertical Finned Tail
    197149,  -- Highland Drake: Club Tail
    197150,  -- Highland Drake: Spiked Club Tail
    197151,  -- Highland Drake: Spiked Tail
    197152,  -- Highland Drake: Hooked Tail
    197153,  -- Highland Drake: Bladed Tail
    197154,  -- Highland Drake: Spined Neck
    197155,  -- Highland Drake: Finned Neck
    197156,  -- Highland Drake: Bronze and Green Armor
    197346,  -- Renewed Proto-Drake: Gold and Black Armor
    197347,  -- Renewed Proto-Drake: Silver and Blue Armor
    197348,  -- Renewed Proto-Drake: Black and Red Armor
    197349,  -- Renewed Proto-Drake: Gold and White Armor
    197350,  -- Renewed Proto-Drake: Silver and Purple Armor
    197351,  -- Renewed Proto-Drake: Gold and Red Armor
    197352,  -- Renewed Proto-Drake: Steel and Yellow Armor
    197353,  -- Renewed Proto-Drake: Bronze and Pink Armor
    197356,  -- Renewed Proto-Drake: Hairy Back
    197357,  -- Renewed Proto-Drake: Armor
    197358,  -- Renewed Proto-Drake: Curved Spiked Brow
    197359,  -- Renewed Proto-Drake: Hairy Brow
    197360,  -- Renewed Proto-Drake: Spined Brow
    197361,  -- Renewed Proto-Drake: Spiked Crest
    197362,  -- Renewed Proto-Drake: Spined Crest
    197363,  -- Renewed Proto-Drake: Maned Crest
    197364,  -- Renewed Proto-Drake: Short Spiked Crest
    197365,  -- Renewed Proto-Drake: Finned Crest
    197366,  -- Renewed Proto-Drake: Dual Horned Crest
    197367,  -- Renewed Proto-Drake: Gray Hair
    197368,  -- Renewed Proto-Drake: Blue Hair
    197369,  -- Renewed Proto-Drake: Brown Hair
    197370,  -- Renewed Proto-Drake: Red Hair
    197371,  -- Renewed Proto-Drake: Green Hair
    197372,  -- Renewed Proto-Drake: Purple Hair
    197373,  -- Renewed Proto-Drake: Helm
    197374,  -- Renewed Proto-Drake: Swept Horns
    197375,  -- Renewed Proto-Drake: Curled Horns
    197376,  -- Renewed Proto-Drake: Ears
    197377,  -- Renewed Proto-Drake: Bovine Horns
    197378,  -- Renewed Proto-Drake: Subtle Horns
    197379,  -- Renewed Proto-Drake: Impaler Horns
    197380,  -- Renewed Proto-Drake: Curved Horns
    197381,  -- Renewed Proto-Drake: Gradient Horns
    197382,  -- Renewed Proto-Drake: White Horns
    197383,  -- Renewed Proto-Drake: Heavy Horns
    197384,  -- Renewed Proto-Drake: Thick Spined Jaw
    197385,  -- Renewed Proto-Drake: Horned Jaw
    197386,  -- Renewed Proto-Drake: Spiked Jaw
    197387,  -- Renewed Proto-Drake: Thin Spined Jaw
    197388,  -- Renewed Proto-Drake: Finned Jaw
    197389,  -- Renewed Proto-Drake: Green Scales
    197390,  -- Renewed Proto-Drake: Blue Scales
    197391,  -- Renewed Proto-Drake: Bronze Scales
    197392,  -- Renewed Proto-Drake: Black Scales
    197393,  -- Renewed Proto-Drake: White Scales
    197394,  -- Renewed Proto-Drake: Predator Pattern
    197395,  -- Renewed Proto-Drake: Harrier Pattern
    197396,  -- Renewed Proto-Drake: Skyterror Pattern
    197397,  -- Renewed Proto-Drake: Heavy Scales
    197398,  -- Renewed Proto-Drake: Snub Snout
    197399,  -- Renewed Proto-Drake: Razor Snout
    197400,  -- Renewed Proto-Drake: Shark Snout
    197401,  -- Renewed Proto-Drake: Beaked Snout
    197402,  -- Renewed Proto-Drake: Spiked Club Tail
    197403,  -- Renewed Proto-Drake: Club Tail
    197404,  -- Renewed Proto-Drake: Finned Tail
    197405,  -- Renewed Proto-Drake: Maned Tail
    197406,  -- Renewed Proto-Drake: Spined Tail
    197407,  -- Renewed Proto-Drake: Spiked Throat
    197408,  -- Renewed Proto-Drake: Finned Throat
    197577,  -- Windborne Velocidrake: Bronze and Green Armor
    197578,  -- Windborne Velocidrake: Silver and Blue Armor
    197579,  -- Windborne Velocidrake: Steel and Orange Armor
    197580,  -- Windborne Velocidrake: Gold and Red Armor
    197581,  -- Windborne Velocidrake: Silver and Purple Armor
    197582,  -- Windborne Velocidrake: White and Pink Armor
    197583,  -- Windborne Velocidrake: Exposed Finned Back
    197584,  -- Windborne Velocidrake: Finned Back
    197585,  -- Windborne Velocidrake: Maned Back
    197586,  -- Windborne Velocidrake: Spiked Back
    197587,  -- Windborne Velocidrake: Feathered Back
    197588,  -- Windborne Velocidrake: Armor
    197589,  -- Windborne Velocidrake: Large Head Fin
    197592,  -- Windborne Velocidrake: Spined Head
    197593,  -- Windborne Velocidrake: Feathery Head
    197594,  -- Windborne Velocidrake: Small Ears
    197595,  -- Windborne Velocidrake: Finned Ears
    197596,  -- Windborne Velocidrake: Horned Jaw
    197597,  -- Windborne Velocidrake: Black Fur
    197598,  -- Windborne Velocidrake: Gray Hair
    197599,  -- Windborne Velocidrake: Red Hair
    197600,  -- Windborne Velocidrake: Helm
    197601,  -- Windborne Velocidrake: Wavy Horns
    197602,  -- Windborne Velocidrake: Cluster Horns
    197603,  -- Windborne Velocidrake: Curved Horns
    197604,  -- Windborne Velocidrake: Ox Horns
    197605,  -- Windborne Velocidrake: Curled Horns
    197606,  -- Windborne Velocidrake: Swept Horns
    197607,  -- Windborne Velocidrake: Split Horns
    197608,  -- Windborne Velocidrake: Gray Horns
    197609,  -- Windborne Velocidrake: White Horns
    197610,  -- Windborne Velocidrake: Yellow Horns
    197611,  -- Windborne Velocidrake: Black Scales
    197612,  -- Windborne Velocidrake: Blue Scales
    197613,  -- Windborne Velocidrake: Bronze Scales
    197614,  -- Windborne Velocidrake: Red Scales
    197615,  -- Windborne Velocidrake: Teal Scales
    197616,  -- Windborne Velocidrake: White Scales
    197617,  -- Windborne Velocidrake: Heavy Scales
    197618,  -- Windborne Velocidrake: Long Snout
    197619,  -- Windborne Velocidrake: Hooked Snout
    197620,  -- Windborne Velocidrake: Beaked Snout
    197621,  -- Windborne Velocidrake: Exposed Finned Tail
    197622,  -- Windborne Velocidrake: Finned Tail
    197623,  -- Windborne Velocidrake: Spiked Tail
    197624,  -- Windborne Velocidrake: Club Tail
    197625,  -- Windborne Velocidrake: Feathery Tail
    197626,  -- Windborne Velocidrake: Exposed Finned Neck
    197627,  -- Windborne Velocidrake: Finned Neck
    197628,  -- Windborne Velocidrake: Plated Neck
    197629,  -- Windborne Velocidrake: Spiked Neck
    197630,  -- Windborne Velocidrake: Feathered Neck
    197634,  -- Windborne Velocidrake: Windswept Pattern
    197635,  -- Windborne Velocidrake: Reaver Pattern
    197636,  -- Windborne Velocidrake: Shrieker Pattern
    198166,  -- Suspiciously Ticking Crate
    198167,  -- Suspiciously Ticking Crate
    198168,  -- Suspiciously Ticking Crate
    198169,  -- Suspiciously Silent Crate
    198170,  -- Suspiciously Silent Crate
    198171,  -- Suspiciously Silent Crate
    198172,  -- Bundle of Fireworks
    198395,  -- Dull Spined Clam
    198438,  -- Draconic Recipe in a Bottle
    198439,  -- Aged Recipe in a Bottle
    198538,  -- Magically Bound Message
    198599,  -- Experimental Decay Sample
    198606,  -- Blacksmith's Writ
    198607,  -- Scribe's Glyphs
    198608,  -- Alchemy Notes
    198609,  -- Tailoring Examples
    198610,  -- Enchanter's Script
    198611,  -- Engineering Details
    198612,  -- Jeweler's Cuts
    198613,  -- Leatherworking Designs
    198614,  -- Soggy Clump of Darkmoon Cards
    198656,  -- Painter's Pretty Jewel
    198658,  -- Decay-Infused Tanning Oil
    198659,  -- Forgetful Apprentice's Tome
    198660,  -- Fragmented Key
    198662,  -- Intriguing Bolt of Blue Cloth
    198663,  -- Frostforged Potion
    198664,  -- Crystalline Overgrowth
    198667,  -- Spare Djaradin Tools
    198669,  -- How to Train Your Whelpling
    198670,  -- Lofty Malygite
    198675,  -- Lava-Infused Seed
    198680,  -- Decaying Brackenhide Blanket
    198682,  -- Alexstraszite Cluster
    198683,  -- Treated Hides
    198685,  -- Well-Insulated Mug
    198686,  -- Frosted Parchment
    198687,  -- Closely Guarded Shiny
    198689,  -- Stormbound Horn
    198690,  -- Decayed Scales
    198692,  -- Noteworthy Scrap of Carpet
    198693,  -- Dusty Darkmoon Card
    198694,  -- Enriched Earthen Shard
    198696,  -- Wind-Blessed Hide
    198697,  -- Contraband Concoction
    198699,  -- Mysterious Banner
    198702,  -- Itinerant Singed Fabric
    198703,  -- Sign Language Reference Sheet
    198704,  -- Pulsing Earth Rune
    198710,  -- Canteen of Suspicious Water
    198711,  -- Poacher's Pack
    198790,  -- I.O.U.
    198798,  -- Flashfrozen Scroll
    198799,  -- Forgotten Arcane Tome
    198800,  -- Fractured Titanic Sphere
    198837,  -- Curious Hide Scraps
    198841,  -- Large Sample of Curious Hide
    198863,  -- Small Dragon Expedition Supply Pack
    198864,  -- Large Maruuk Centaur Supply Satchel
    198865,  -- Large Dragon Expedition Supply Pack
    198866,  -- Small Iskaaran Supply Pack
    198867,  -- Large Iskaaran Supply Pack
    198868,  -- Small Valdrakken Accord Supply Pack
    198869,  -- Large Valdrakken Accord Supply Pack
    198891,  -- Technique: Cliffside Wylderdrake: Conical Head
    198892,  -- Technique: Cliffside Wylderdrake: Red Hair
    198894,  -- Technique: Highland Drake: Black Hair
    198895,  -- Technique: Highland Drake: Spined Head
    198896,  -- Technique: Highland Drake: Spined Neck
    198899,  -- Technique: Renewed Proto-Drake: Predator Pattern
    198901,  -- Technique: Renewed Proto-Drake: Spined Crest
    198903,  -- Technique: Windborne Velocidrake: Spined Head
    198963,  -- Decaying Phlegm
    198964,  -- Elementious Splinter
    198965,  -- Primeval Earth Fragment
    198966,  -- Molten Globule
    198967,  -- Primordial Aether
    198968,  -- Primalist Charm
    198969,  -- Keeper's Mark
    198970,  -- Infinitely Attachable Pair o' Docks
    198971,  -- Curious Djaradin Rune
    198972,  -- Draconic Glamour
    198973,  -- Incandescent Curio
    198974,  -- Elegantly Engraved Embellishment
    198975,  -- Ossified Hide
    198976,  -- Exceedingly Soft Skin
    198977,  -- Ohn'arhan Weave
    198978,  -- Stupidly Effective Stitchery
    199108,  -- Bag of Discount Goods
    199115,  -- Herbalism Field Notes
    199122,  -- Mining Field Notes
    199128,  -- Skinning Field Notes
    199192,  -- Dragon Racer's Purse
    199341,  -- Regurgitated Sac of Swog Treasures
    199342,  -- Weighted Sac of Swog Treasures
    199472,  -- Overflowing Dragon Expedition Supply Pack
    199473,  -- Overflowing Iskaaran Supply Pack
    199474,  -- Overflowing Maruuk Centaur Supply Satchel
    199475,  -- Overflowing Valdrakken Accord Supply Pack
    200069,  -- Obsidian Cache
    200070,  -- Obsidian Strongbox
    200072,  -- Dragonbane Keep Strongbox
    200073,  -- Valdrakken Treasures
    200094,  -- Caravan Strongbox
    200095,  -- Supply-Laden Soup Pot
    200156,  -- Amethyzarite Geode
    200285,  -- Dragonscale Expedition Insignia
    200287,  -- Iskaara Tuskarr Insignia
    200288,  -- Maruuk Centaur Insignia
    200289,  -- Valdrakken Accord Insignia
    200300,  -- Sack of Looted Treasures
    200452,  -- Dragonscale Expedition Insignia
    200453,  -- Iskaara Tuskarr Insignia
    200454,  -- Maruuk Centaur Insignia
    200455,  -- Valdrakken Accord Insignia
    200468,  -- Grand Hunt Spoils
    200477,  -- Stack of VIP Passes
    200513,  -- Grand Hunt Spoils
    200609,  -- Dragon Racing Purse - First Place
    200610,  -- Dragon Racing Purse - Second Place
    200611,  -- Dragon Racing Purse - Third Place
    200677,  -- Dreambloom Petal
    200678,  -- Dreambloom
    200931,  -- Encaged Fiery Soul
    200932,  -- Encaged Airy Soul
    200934,  -- Encaged Frosty Soul
    200936,  -- Encaged Earthen Soul
    200972,  -- Dusty Blacksmith's Diagrams
    200973,  -- Dusty Scribe's Runic Drawings
    200974,  -- Dusty Alchemist's Research
    200975,  -- Dusty Tailor's Diagrams
    200976,  -- Dusty Enchanter's Research
    200977,  -- Dusty Engineer's Scribblings
    200978,  -- Dusty Jeweler's Illustrations
    200979,  -- Dusty Leatherworker's Diagrams
    200980,  -- Dusty Herbalist's Notes
    200981,  -- Dusty Miner's Notes
    200982,  -- Dusty Skinner's Notes
    201003,  -- Furry Gloop
    201004,  -- Ancient Spear Shards
    201005,  -- Curious Ingots
    201006,  -- Draconic Flux
    201007,  -- Ancient Monument
    201008,  -- Molten Ingot
    201009,  -- Falconer Gauntlet Drawings
    201010,  -- Qalashi Weapon Diagram
    201011,  -- Spelltouched Tongs
    201012,  -- Enchanted Debris
    201013,  -- Faintly Enchanted Remains
    201014,  -- Boomthyr Rocket
    201015,  -- Counterfeit Darkmoon Deck
    201016,  -- Harmonic Crystal Harmonizer
    201017,  -- Igneous Gem
    201018,  -- Well-Danced Drum
    201019,  -- Ancient Dragonweave Bolt
    201020,  -- Silky Surprise
    201250,  -- Victorious Contender's Strongbox
    201251,  -- Pillaged Contender's Strongbox
    201252,  -- 10.0 Bronze PvP Chest (DNT)
    201268,  -- Rare Blacksmith's Diagrams
    201269,  -- Rare Scribe's Runic Drawings
    201270,  -- Rare Alchemist's Research
    201271,  -- Rare Tailor's Diagrams
    201272,  -- Rare Enchanter's Research
    201273,  -- Rare Engineer's Scribblings
    201274,  -- Rare Jeweler's Illustrations
    201275,  -- Rare Leatherworker's Diagrams
    201276,  -- Rare Herbalist's Notes
    201277,  -- Rare Miner's Notes
    201278,  -- Rare Skinner's Notes
    201279,  -- Ancient Blacksmith's Diagrams
    201280,  -- Ancient Scribe's Runic Drawings
    201281,  -- Ancient Alchemist's Research
    201282,  -- Ancient Tailor's Diagrams
    201283,  -- Ancient Enchanter's Research
    201284,  -- Ancient Engineer's Scribblings
    201285,  -- Ancient Jeweler's Illustrations
    201286,  -- Ancient Leatherworker's Diagrams
    201287,  -- Ancient Herbalist's Notes
    201288,  -- Ancient Miner's Notes
    201289,  -- Ancient Skinner's Notes
    201296,  -- Docile Airy Soul
    201297,  -- Docile Earthen Soul
    201298,  -- Docile Fiery Soul
    201299,  -- Docile Frosty Soul
    201300,  -- Iridescent Ore Fragments
    201301,  -- Iridescent Ore
    201326,  -- Draconic Satchel of Cooperation
    201343,  -- Bag of Cloth Armor Reagents
    201352,  -- Bag of Leather Reagents
    201353,  -- Bag of Mail Armor Reagents
    201354,  -- Bag of Plate Armor Reagents
    201439,  -- Renewed Dream
    201462,  -- Curiously-Shaped Stomach
    201700,  -- Notebook of Crafting Knowledge
    201705,  -- Notebook of Crafting Knowledge
    201706,  -- Notebook of Crafting Knowledge
    201708,  -- Notebook of Crafting Knowledge
    201709,  -- Notebook of Crafting Knowledge
    201710,  -- Notebook of Crafting Knowledge
    201715,  -- Notebook of Crafting Knowledge
    201716,  -- Notebook of Crafting Knowledge
    201717,  -- Notebook of Crafting Knowledge
    201718,  -- Notebook of Crafting Knowledge
    201728,  -- Vakril's Strongbox
    201736,  -- Technique: Cliffside Wylderdrake: Steel and Yellow Armor
    201737,  -- Technique: Highland Drake: Steel and Yellow Armor
    201738,  -- Technique: Renewed Proto-Drake: Steel and Yellow Armor
    201739,  -- Technique: Windborne Velocidrake: Steel and Orange Armor
    201754,  -- Obsidian Forgemaster's Cache
    201755,  -- Obsidian Forgemaster's Strongbox
    201756,  -- Bulging Coin Purse
    201757,  -- Plundered Supplies
    201779,  -- Merithra's Blessing
    201783,  -- Tutaqan's Commendation
    201790,  -- Renewed Proto-Drake: Embodiment of the Storm-Eater
    201792,  -- Highland Drake: Embodiment of the Crimson Gladiator
    201817,  -- Twilight Cache
    201818,  -- Twilight Strongbox
    201921,  -- Dragonscale Expedition Insignia
    201922,  -- Iskaara Tuskarr Insignia
    201923,  -- Maruuk Centaur Insignia
    201924,  -- Valdrakken Accord Insignia
    202011,  -- Elementally Charged Stone
    202014,  -- Infused Pollen
    202016,  -- Saturated Bone
    202048,  -- Queen's Gift
    202049,  -- Dreamer's Vision
    202050,  -- Keeper's Glory
    202051,  -- Earthwarden's Prize
    202052,  -- Timewatcher's Patience
    202054,  -- Queen's Gift
    202055,  -- Dreamer's Vision
    202056,  -- Keeper's Glory
    202057,  -- Earthwarden's Prize
    202058,  -- Timewatcher's Patience
    202079,  -- Cache of Vault Treasures
    202080,  -- Cache of Vault Treasures
    202092,  -- Iskaara Tuskarr Insignia
    202094,  -- Maruuk Centaur Insignia
    202097,  -- Bulging Box of Skins and Scales
    202098,  -- Crowded Crate of Mined Materials
    202099,  -- Stocked Sack of Hale Herbs
    202100,  -- Populous Pack of Castoff Cloth
    202101,  -- Topped Trunk of Disenchanted Detritus
    202102,  -- Immaculate Sac of Swog Treasures
    202122,  -- Primal Chaos Cluster
    202142,  -- Dragonbane Keep Strongbox
    202171,  -- Obsidian Flightstone
    202172,  -- Overflowing Satchel of Coins
    202183,  -- Small Rumble Purse
    202371,  -- Glowing Primalist Cache
    203210,  -- Dragonscale Supply Box
    203217,  -- Dragonscale Surplus Crate
    203218,  -- Iskaara Supply Pouch
    203220,  -- Iskaara Surplus Bag
    203221,  -- Maruuk Supply Sack
    203222,  -- Maruuk Surplus Bundle
    203223,  -- Valdrakken Supply Coffer
    203224,  -- Valdrakken Surplus Chest
    203323,  -- Winding Slitherdrake: Brown Hair
    203324,  -- Winding Slitherdrake: White Hair
    203325,  -- Winding Slitherdrake: Red Hair
    203327,  -- Winding Slitherdrake: Tan Horns
    203328,  -- Winding Slitherdrake: White Horns
    203338,  -- Winding Slitherdrake: Antler Horns
    203341,  -- Winding Slitherdrake: Long Jaw Horns
    203342,  -- Winding Slitherdrake: Triple Jaw Horns
    203343,  -- Winding Slitherdrake: Hairy Jaw
    203344,  -- Winding Slitherdrake: Single Jaw Horn
    203345,  -- Winding Slitherdrake: Split Jaw Horns
    203346,  -- Winding Slitherdrake: Curled Nose
    203347,  -- Winding Slitherdrake: Large Spiked Nose
    203348,  -- Winding Slitherdrake: Pointed Nose
    203349,  -- Winding Slitherdrake: Curved Nose Horn
    203350,  -- Winding Slitherdrake: Blue Scales
    203351,  -- Winding Slitherdrake: Bronze Scales
    203352,  -- Winding Slitherdrake: Green Scales
    203353,  -- Winding Slitherdrake: Red Scales
    203354,  -- Winding Slitherdrake: White Scales
    203355,  -- Winding Slitherdrake: Yellow Scales
    203476,  -- Primalist Cache
    203681,  -- Stormed Primalist Cache
    203699,  -- Tattered Gift Package
    203700,  -- Tattered Gift Package
    203724,  -- Field Medic's Hazard Payout
    203730,  -- Rustic Winterpelt Supplies
    203742,  -- Waterlogged Gurubashi Cache
    203774,  -- Big Bag o' Bijous
    203912,  -- Penny Pouch o' Paragons
    203959,  -- Gurubashi Tribute
    204346,  -- Arclight Rumble Foil Box
    204359,  -- Reach Racer's Purse
    204378,  -- Brimming Dragonscale Expedition Supply Pack
    204379,  -- Brimming Iskaaran Supply Pack
    204380,  -- Brimming Maruuk Centaur Supply Satchel
    204381,  -- Brimming Valdrakken Accord Supply Pack
    204383,  -- Sack of Oddities
    204403,  -- Sack of Sack of Oddities
    204636,  -- Snarfang's Stomach Sac
    204712,  -- Brimming Loamm Niffen Supply Satchel
    204721,  -- Whelpling's Small Chest
    204722,  -- Whelpling's Bountiful Chest
    204723,  -- Whelpling's Hefty Chest
    204724,  -- Drake's Small Chest
    204725,  -- Drake's Hefty Chest
    204726,  -- Drake's Bountiful Chest
    204911,  -- Propagated Spore
    205212,  -- Marrow-Ripened Slime
    205226,  -- Cavern Racer's Purse
    205247,  -- Clinking Dirt-Covered Pouch
    205248,  -- Clanging Dirt-Covered Pouch
    205249,  -- Pungent Niffen Incense
    205250,  -- Gift of the High Redolence
    205251,  -- Champion's Rock Bar
    205252,  -- Momento of Rekindled Bonds
    205253,  -- Farmhand's Abundant Harvest
    205254,  -- Honorary Explorer's Compass
    205288,  -- Buried Niffen Collection
    205342,  -- Loamm Niffen Insignia
    205346,  -- Hidden Niffen Treasure
    205347,  -- Gathered Niffen Resources
    205349,  -- Niffen Notebook of Engineering Knowledge
    205351,  -- Niffen Notebook of Enchanting Knowledge
    205352,  -- Niffen Notebook of Blacksmithing Knowledge
    205353,  -- Niffen Notebook of Alchemy Knowledge
    205354,  -- Niffen Notebook of Inscription Knowledge
    205355,  -- Niffen Notebook of Tailoring Knowledge
    205356,  -- Niffen Notebook of Mining Knowledge
    205367,  -- Indebted Researcher's Gift
    205368,  -- Thankful Researcher's Gift
    205369,  -- Appreciative Researcher's Gift
    205370,  -- Researcher's Gift
    205371,  -- Appreciative Researcher's Scrounged Goods
    205372,  -- Indebted Researcher's Scrounged Goods
    205373,  -- Researcher's Scrounged Goods
    205374,  -- Thankful Researcher's Scrounged Goods
    205423,  -- Shadowflame Residue Sack
    205682,  -- Large Shadowflame Residue Sack
    205877,  -- Adventurer's Footlocker
    205962,  -- Echoing Storm Flightstone
    205964,  -- Small Loammian Supply Pack
    205965,  -- Large Loammian Supply Pack
    205968,  -- Overflowing Loammian Supply Pack
    205970,  -- Azure Flightstone
    205983,  -- Scentsational Niffen Treasures
    205985,  -- Loamm Niffen Insignia
    205989,  -- Symbol of Friendship
    205991,  -- Shiny Token of Gratitude
    205992,  -- Regurgitated Half-Digested Fish
    205998,  -- Sign of Respect
    206006,  -- Earth-Warder's Thanks
    206028,  -- Chest of Gold
    206030,  -- Exquisitely Embroidered Banner
    206037,  -- Ruby Flightstone
    206039,  -- Enmity Bundle
    206135,  -- Heroic Dungeon Delver's Trophy Chest
    206136,  -- Heroic Dungeon Delver's Trophy Crest
    206271,  -- Malicia's Hoard
    207050,  -- Warmonger's Plate Gear Bag
    207051,  -- Warmonger's Plate Equipment Bag
    207052,  -- Jingoist's Plate Equipment Bag
    207053,  -- Jingoist's Plate Gear Bag
    207063,  -- Jingoist's Mail Equipment Bag
    207064,  -- Jingoist's Mail Gear Bag
    207065,  -- Warmonger's Mail Gear Bag
    207066,  -- Warmonger's Mail Equipment Bag
    207067,  -- Jingoist's Leather Gear Bag
    207068,  -- Jingoist's Leather Equipment Bag
    207069,  -- Warmonger's Leather Equipment Bag
    207070,  -- Warmonger's Leather Gear Bag
    207071,  -- Jingoist's Cloth Gear Bag
    207072,  -- Jingoist's Cloth Equipment Bag
    207073,  -- Warmonger's Cloth Equipment Bag
    207074,  -- Warmonger's Cloth Gear Bag
    207075,  -- Jingoist's Plate Armor Bag
    207076,  -- Warmonger's Plate Armor Bag
    207077,  -- Warmonger's Mail Armor Bag
    207078,  -- Jingoist's Mail Armor Bag
    207079,  -- Warmonger's Leather Armor Bag
    207080,  -- Jingoist's Leather Armor Bag
    207081,  -- Warmonger's Cloth Armor Bag
    207082,  -- Jingoist's Cloth Armor Bag
    207093,  -- Jingoist's Mail Suit Bag
    207094,  -- Warmonger's Leather Suit Bag
    207096,  -- Paracausal Chest
    207582,  -- Box of Tampered Reality
    207583,  -- Box of Collapsed Reality
    207584,  -- Box of Volatile Reality
    207594,  -- Looter's Purse
    208006,  -- Greater Paracausal Chest
    208015,  -- Stuffed Deviate Scale Pouch
    208028,  -- Knot Thimblejack's Cache
    208054,  -- A Mystery Box
    208090,  -- Contained Paracausality
    208091,  -- Cache of Timewarped Treasures
    208094,  -- Cache of Timewarped Treasures
    208095,  -- Cache of Timewarped Treasures
    208142,  -- Buried Satchel
    208211,  -- Anniversary Gift
    208390,  -- Bronze Archive Stone
    208691,  -- Argunite Cluster
    208878,  -- Adventurer's Footlocker
    208951,  -- Paracausal Cluster
    208952,  -- Soridormi's Letter of Commendation
    209024,  -- Loot-Filled Pumpkin
    209026,  -- Loot-Stuffed Pumpkin
    209036,  -- Cache of Amirdrassil Treasures
    209037,  -- Cache of Amirdrassil Treasures
    209831,  -- Wyrm's Bountiful Chest
    209832,  -- Crate of Dreambound Leather
    209835,  -- Crate of Dreambound Plate
    209871,  -- Winter Veil Gift
    210062,  -- Ironbound Satchel of Helpful Goods
    210063,  -- Invader's Satchel of Helpful Goods
    210180,  -- Emerald Flightstone
    210217,  -- Small Dreamy Bounty
    210218,  -- Plump Dreamy Bounty
    210219,  -- Gigantic Dreamy Bounty
    210224,  -- Small Emerald Bloom
    210225,  -- Medium Emerald Bloom
    210226,  -- Large Emerald Bloom
    210549,  -- Dream Racer's Purse
    210657,  -- Gently Shaken Gift
    210726,  -- Ruby Flightstone
    210758,  -- Honorable Satchel of Fabrics
    210759,  -- Honorable Satchel of Ore
    210760,  -- Honorable Satchel of Herbs
    210872,  -- Satchel of Dreams
    210982,  -- Thread of Power
    210983,  -- Thread of Stamina
    210984,  -- Thread of Critical Strike
    210985,  -- Thread of Haste
    210986,  -- Thread of Speed
    210987,  -- Thread of Leech
    210989,  -- Thread of Mastery
    210990,  -- Thread of Versatility
    210991,  -- Small Box of Vials
    210992,  -- Overflowing Dream Warden Trove
    211279,  -- Cache of Infinite Treasure
    211303,  -- Dryad's Supply Pouch
    211373,  -- Bag of Many Wonders
    211388,  -- Timerunner's Starter Kit
    211389,  -- Cache of Overblooming Treasures
    211394,  -- Harvested Dreamseed Cache
    211410,  -- Bloomed Wildling Cache
    211411,  -- Sprouting Dreamtrove
    211413,  -- Budding Dreamtrove
    211414,  -- Blossoming Dreamtrove
    211429,  -- Bundle of Love Tokens
    211430,  -- Bundle of Love Tokens
    212157,  -- An Invitation
    212458,  -- Awakened Flightstone
    212924,  -- Stolen Hearthstone Card
    212979,  -- Hearthstone Starter Pack
    213175,  -- Dusty Djaradin Tome
    213176,  -- Preserved Isles Tome
    213177,  -- Immaculate Tome
    213185,  -- Dusty Centaur Tome
    213186,  -- Dusty Niffen Tome
    213187,  -- Dusty Drakonid Tome
    213188,  -- Dusty Dracthyr Tome
    213189,  -- Preserved Dragonkin Tome
    213190,  -- Preserved Djaradin Tome
    213428,  -- Loot-Stuffed Basket
    213429,  -- Meticulous Archivist's Appendix
    213541,  -- Whelpling's Bountiful Chest
    215160,  -- The Big Dig Rig
    215363,  -- Cache of Embers
    215364,  -- Cache of Dreams
    216638,  -- Timerunner's Intro Kit
    216874,  -- Loot-Filled Basket
    217109,  -- Cache of Awakened Storms
    217110,  -- Cache of Awakened Embers
    217111,  -- Cache of Awakened Dreams
    217242,  -- Awakening Stone Wing
    217243,  -- Awakening Ruby Wing
    217382,  -- Ruby Flightstone
    217411,  -- Blackened Flightstone
    217412,  -- Blackened Flightstone
    217705,  -- Pirate's Booty
    217722,  -- Thread of Experience
    217728,  -- Cache of Awakened Treasures
    217729,  -- Cache of Awakened Treasures
    218130,  -- Adventurer's Footlocker
    219218,  -- Timerunner's Starter Kit
    219219,  -- Timerunner's Starter Kit
    219256,  -- Temporal Thread of Power
    219257,  -- Temporal Thread of Stamina
    219258,  -- Temporal Thread of Critical Strike
    219259,  -- Temporal Thread of Haste
    219260,  -- Temporal Thread of Speed
    219261,  -- Temporal Thread of Leech
    219262,  -- Temporal Thread of Mastery
    219263,  -- Temporal Thread of Versatility
    219264,  -- Temporal Thread of Experience
    219265,  -- Perpetual Thread of Power
    219266,  -- Perpetual Thread of Stamina
    219267,  -- Perpetual Thread of Critical Strike
    219268,  -- Perpetual Thread of Haste
    219269,  -- Perpetual Thread of Speed
    219270,  -- Perpetual Thread of Leech
    219273,  -- Perpetual Thread of Experience
    219274,  -- Infinite Thread of Power
    219275,  -- Infinite Thread of Stamina
    219276,  -- Infinite Thread of Critical Strike
    219277,  -- Infinite Thread of Haste
    219278,  -- Infinite Thread of Speed
    219279,  -- Infinite Thread of Leech
    219280,  -- Infinite Thread of Mastery
    219281,  -- Infinite Thread of Versatility
    219282,  -- Infinite Thread of Experience
    221509,  -- Timerunner's Weaponry
    223904,  -- Asynchronized Cogwheel Gem
    223905,  -- Asynchronized Meta Gem
    223906,  -- Asynchronized Tinker Gem
    223907,  -- Asynchronized Prismatic Gem
    223908,  -- Minor Bronze Cache
    223909,  -- Lesser Bronze Cache
    223910,  -- Bronze Cache
    223911,  -- Greater Bronze Cache
    223953,  -- Timerunner's Parting Pack
    224120,  -- Timerunner's Gem Box
    224296,  -- Basket of Draconic Flowers
    224547,  -- Timewarped Pouch
    226142,  -- Greater Spool of Eternal Thread
    226143,  -- Spool of Eternal Thread
    226144,  -- Lesser Spool of Eternal Thread
    226145,  -- Minor Spool of Eternal Thread
}
for _, id in ipairs(dfIDs) do openables[id] = {} end

openables[190315] = { isRousing = true, threshold = 10 }  -- Rousing Earth
openables[190320] = { isRousing = true, threshold = 10 }  -- Rousing Fire
openables[190322] = { isRousing = true, threshold = 10 }  -- Rousing Order
openables[190326] = { isRousing = true, threshold = 10 }  -- Rousing Air
openables[190328] = { isRousing = true, threshold = 10 }  -- Rousing Frost
openables[190330] = { isRousing = true, threshold = 10 }  -- Rousing Decay
openables[190451] = { isRousing = true, threshold = 10 }  -- Rousing Ire
openables[190954] = { lockbox = true }  -- Serevite Lockbox
openables[191296] = { lockbox = true }  -- Enchanted Lockbox
openables[194037] = { lockbox = true }  -- Heavy Chest
openables[198657] = { lockbox = true }  -- Forgotten Jewelry Box
openables[203743] = { lockbox = true }  -- Jostled Gurubashi Cache
openables[204075] = { threshold = 15 }  -- Whelpling's Shadowflame Crest Fragment
openables[204076] = { threshold = 15 }  -- Drake's Shadowflame Crest Fragment
openables[204077] = { threshold = 15 }  -- Wyrm's Shadowflame Crest Fragment
openables[204078] = { threshold = 15 }  -- Aspect's Shadowflame Crest Fragment
openables[204307] = { lockbox = true }  -- Ornate Bronze Lockbox
openables[204717] = { threshold = 2 }  -- Splintered Spark of Shadowflame
openables[194697] = { questId = 74108 }  -- Draconic Treatise on Alchemy
openables[198454] = { questId = 74109 }  -- Draconic Treatise on Blacksmithing
openables[194702] = { questId = 74110 }  -- Draconic Treatise on Enchanting
openables[198510] = { questId = 74111 }  -- Draconic Treatise on Engineering
openables[194704] = { questId = 74107 }  -- Draconic Treatise on Herbalism
openables[194699] = { questId = 74105 }  -- Draconic Treatise on Inscription
openables[194703] = { questId = 74112 }  -- Draconic Treatise on Jewelcrafting
openables[194700] = { questId = 74113 }  -- Draconic Treatise on Leatherworking
openables[194708] = { questId = 74106 }  -- Draconic Treatise on Mining
openables[201023] = { questId = 74114 }  -- Draconic Treatise on Skinning
openables[194698] = { questId = 74115 }  -- Draconic Treatise on Tailoring



local twwIDs = {
    213779,  -- Algari Amber Prism
    213780,  -- Algari Amber Prism
    213781,  -- Algari Amber Prism
    213782,  -- Algari Emerald Prism
    213783,  -- Algari Emerald Prism
    213784,  -- Algari Emerald Prism
    213785,  -- Algari Ruby Prism
    213786,  -- Algari Ruby Prism
    213787,  -- Algari Ruby Prism
    213788,  -- Algari Onyx Prism
    213789,  -- Algari Onyx Prism
    213790,  -- Algari Onyx Prism
    213791,  -- Algari Sapphire Prism
    213792,  -- Algari Sapphire Prism
    213793,  -- Algari Sapphire Prism
    217011,  -- Amateur Actor's Chest
    217012,  -- Novice Actor's Chest
    217013,  -- Expert Actor's Chest
    218309,  -- Gently Shaken Gift
    218311,  -- Winter Veil Gift
    218738,  -- Bizarrely Shaped Stomach
    219192,  -- Comprehensibly Organized Ideas
    220148,  -- Pale Huskfish
    220767,  -- Triumphant Satchel of Carved Harbinger Crests
    220773,  -- Celebratory Pack of Runed Harbinger Crests
    220776,  -- Glorious Cluster of Gilded Harbinger Crests
    221268,  -- Pouch of Weathered Harbinger Crests
    221269,  -- Crimson Valorstone
    221373,  -- Satchel of Carved Harbinger Crests
    221375,  -- Pack of Runed Harbinger Crests
    221502,  -- Adventurer's Warbound Battlegear Drop
    221503,  -- Explorer's Warbound Battlegear Drop
    222977,  -- Scorched Junk
    223619,  -- Bronze Celebration Goodie Bag
    223620,  -- 20th Anniversary Cache
    223621,  -- 20th Anniversary Cache
    223622,  -- 20th Anniversary Cache
    224007,  -- Uses for Leftover Husks (How to Take Them Apart)
    224023,  -- Herbal Embalming Techniques
    224024,  -- Theories of Bodily Transmutation, Chapter 8
    224027,  -- Bottomless Bag of Khaz Algar Herbs
    224028,  -- Bottomless Bag of Khaz Algar Ore
    224029,  -- Bottomless Bag of Khaz Algar Skins
    224030,  -- Bottomless Bag of Khaz Algar Alchemy Goods
    224031,  -- Bottomless Bag of Khaz Algar Blacksmithing Goods
    224032,  -- Bottomless Bag of Khaz Algar Enchanting Goods
    224033,  -- Bottomless Bag of Khaz Algar Engineering Goods
    224034,  -- Bottomless Bag of Khaz Algar Inscription Goods
    224035,  -- Bottomless Bag of Khaz Algar Jewelcrafting Goods
    224036,  -- And That's A Web-Wrap!
    224037,  -- Bottomless Bag of Khaz Algar Leatherworking Goods
    224038,  -- Smithing After Saronite
    224039,  -- Bottomless Bag of Khaz Algar Tailoring Goods
    224040,  -- Bottomless Bag of Khaz Algar Optional Goods
    224050,  -- Web Sparkles: Pretty and Powerful
    224052,  -- Clocks, Gears, Sprockets, and Legs
    224053,  -- Eight Views on Defense against Hostile Runes
    224054,  -- Emergent Crystals of the Surface-Dwellers
    224055,  -- A Rocky Start
    224056,  -- Uses for Leftover Husks (After You Take Them Apart)
    224100,  -- Bottomless Bag of Khaz Algar General Goods
    224156,  -- Bottomless Bag of Khaz Algar General Goods
    224264,  -- Deepgrove Petal
    224265,  -- Deepgrove Rose
    224556,  -- Glorious Contender's Strongbox
    224557,  -- Field Medic's Hazard Payout
    224573,  -- Crystal Satchel of Cooperation
    224583,  -- Slab of Slate
    224584,  -- Erosion-Polished Slate
    224586,  -- Box o' Booms
    224587,  -- Box o' Booms
    224588,  -- Box o' Booms
    224645,  -- Jewel-Etched Alchemy Notes
    224647,  -- Jewel-Etched Blacksmithing Notes
    224648,  -- Jewel-Etched Tailoring Notes
    224650,  -- Wax-Sealed Pouch
    224651,  -- Machine-Learned Mining Notes
    224652,  -- Jewel-Etched Enchanting Notes
    224653,  -- Machine-Learned Engineering Notes
    224654,  -- Machine-Learned Inscription Notes
    224655,  -- Void-Lit Jewelcrafting Notes
    224656,  -- Void-Lit Herbalism Notes
    224657,  -- Void-Lit Skinning Notes
    224658,  -- Void-Lit Leatherworking Notes
    224721,  -- Wax-Sealed Box
    224722,  -- Waxy Bundle of Resonance Crystals
    224723,  -- Waxy Bundle of Leather
    224724,  -- Waxy Bundle of Dust
    224725,  -- Waxy Bundle of Herbs
    224726,  -- Waxy Box of Rocks
    224780,  -- Toughened Tempest Pelt
    224784,  -- Pinnacle Cache
    224807,  -- Algari Skinner's Notes
    224817,  -- Algari Herbalist's Notes
    224818,  -- Algari Miner's Notes
    224835,  -- Deepgrove Roots
    224838,  -- Null Sliver
    224913,  -- Radiant Fuel Cache
    224941,  -- Radiant Fuel Cache
    225220,  -- Chitin Needle
    225221,  -- Spool of Webweave
    225222,  -- Stone-Leather Swatch
    225223,  -- Sturdy Nerubian Carapace
    225224,  -- Diaphanous Gem Shards
    225225,  -- Deepstone Fragment
    225226,  -- Striated Inkstone
    225227,  -- Wax-Sealed Records
    225228,  -- Rust-Locked Mechanism
    225229,  -- Earthen Induction Coil
    225230,  -- Crystalline Repository
    225231,  -- Powdered Fulgurance
    225232,  -- Coreway Billet
    225233,  -- Dense Bladestone
    225234,  -- Alchemical Sediment
    225235,  -- Deepstone Crucible
    225239,  -- Overflowing Council of Dornogal Trove
    225245,  -- Overflowing Trove of the Deeps
    225246,  -- Overflowing Hallowfall Trove
    225247,  -- Overflowing Severed Threads Trove
    225249,  -- Rattling Bag o' Gold
    225571,  -- The Weaver's Gratuity
    225572,  -- The General's War Chest
    225573,  -- The Vizier's Capital
    225896,  -- Void-Touched Valorstone
    226045,  -- The General's Trove
    226100,  -- The Vizier's Trove
    226101,  -- Chromie's Tour Goodie Bag
    226102,  -- Chromie's Tour Goodie Bag
    226103,  -- The Weaver's Trove
    226146,  -- Handful of Humming Shinies
    226147,  -- Bunch of Brave Rocks
    226148,  -- Wax-Sealed Weathered Crests
    226149,  -- Pile of Humming Shinies
    226150,  -- Gem-Studded Candelabra
    226151,  -- Wax-Coated Coffer Unlocker
    226152,  -- Wax-sealed Crests
    226153,  -- Big Pile of Humming Shinies
    226154,  -- Wax-Sealed Crafty Crest
    226193,  -- Cache of Nerubian Treasures
    226194,  -- Cache of Nerubian Treasures
    226195,  -- Resonance Crystal Cluster
    226196,  -- Silk Kej Pouch
    226198,  -- Resonance Crystal Agglomeration
    226199,  -- Silk Kej Purse
    226256,  -- Token of the Remembrancers
    226257,  -- Delver's Pouch of Valorstones
    226263,  -- Theater Troupe's Trove
    226264,  -- Radiant Cache
    226265,  -- Earthen Iron Powder
    226268,  -- Engraved Stirring Rod
    226269,  -- Chemist's Purified Water
    226270,  -- Sanctified Mortar and Pestle
    226271,  -- Nerubian Mixing Salts
    226272,  -- Dark Apothecary's Vial
    226273,  -- Awakened Mechanical Cache
    226276,  -- Ancient Earthen Anvil
    226277,  -- Dornogal Hammer
    226278,  -- Ringing Hammer Vise
    226279,  -- Earthen Chisels
    226280,  -- Holy Flame Forge
    226281,  -- Radiant Tongs
    226282,  -- Nerubian Smith's Kit
    226283,  -- Spiderling's Wire Brush
    226284,  -- Grinded Earthen Gem
    226285,  -- Silver Dornogal Rod
    226286,  -- Soot-Coated Orb
    226287,  -- Animated Enchanting Dust
    226288,  -- Essence of Holy Fire
    226289,  -- Enchanted Arathi Scroll
    226290,  -- Book of Dark Magic
    226291,  -- Void Shard
    226292,  -- Rock Engineer's Wrench
    226293,  -- Dornogal Spectacles
    226294,  -- Inert Mining Bomb
    226295,  -- Earthen Construct Blueprints
    226296,  -- Holy Firework Dud
    226297,  -- Arathi Safety Gloves
    226298,  -- Puppeted Mechanical Spider
    226299,  -- Emptied Venom Canister
    226300,  -- Ancient Flower
    226301,  -- Dornogal Gardening Scythe
    226302,  -- Earthen Digging Fork
    226303,  -- Fungarian Slicer's Knife
    226304,  -- Arathi Garden Trowel
    226305,  -- Arathi Herb Pruner
    226306,  -- Web-Entangled Lotus
    226307,  -- Tunneler's Shovel
    226308,  -- Dornogal Scribe's Quill
    226309,  -- Historian's Dip Pen
    226310,  -- Runic Scroll
    226311,  -- Blue Earthen Pigment
    226312,  -- Informant's Fountain Pen
    226313,  -- Calligrapher's Chiseled Marker
    226314,  -- Nerubian Texts
    226315,  -- Venomancer's Ink Well
    226316,  -- Gentle Jewel Hammer
    226317,  -- Earthen Gem Pliers
    226318,  -- Carved Stone File
    226319,  -- Jeweler's Delicate Drill
    226320,  -- Arathi Sizing Gauges
    226321,  -- Librarian's Magnifiers
    226322,  -- Ritual Caster's Crystal
    226323,  -- Nerubian Bench Blocks
    226324,  -- Earthen Lacing Tools
    226325,  -- Dornogal Craftsman's Flat Knife
    226326,  -- Underground Stropping Compound
    226327,  -- Earthen Awl
    226328,  -- Arathi Beveler Set
    226329,  -- Arathi Leather Burnisher
    226330,  -- Nerubian Tanning Mallet
    226331,  -- Curved Nerubian Skinning Knife
    226332,  -- Earthen Miner's Gavel
    226333,  -- Dornogal Chisel
    226334,  -- Earthen Excavator's Shovel
    226335,  -- Regenerating Ore
    226336,  -- Arathi Precision Drill
    226337,  -- Devout Archaeologist's Excavator
    226338,  -- Heavy Spider Crusher
    226339,  -- Nerubian Mining Supplies
    226340,  -- Dornogal Carving Knife
    226341,  -- Earthen Worker's Beams
    226342,  -- Artisan's Drawing Knife
    226343,  -- Fungarian's Rich Tannin
    226344,  -- Arathi Tanning Agent
    226345,  -- Arathi Craftsman's Spokeshave
    226346,  -- Nerubian's Slicking Iron
    226347,  -- Carapace Shiner
    226348,  -- Dornogal Seam Ripper
    226349,  -- Earthen Tape Measure
    226350,  -- Runed Earthen Pins
    226351,  -- Earthen Stitcher's Snips
    226352,  -- Arathi Rotary Cutter
    226353,  -- Royal Outfitter's Protractor
    226354,  -- Nerubian Quilt
    226355,  -- Nerubian's Pincushion
    226813,  -- Golden Valorstone
    226814,  -- Chest of Gold
    227407,  -- Faded Blacksmith's Diagrams
    227408,  -- Faded Scribe's Runic Drawings
    227409,  -- Faded Alchemist's Research
    227410,  -- Faded Tailor's Diagrams
    227411,  -- Faded Enchanter's Research
    227414,  -- Faded Leatherworker's Diagrams
    227415,  -- Faded Herbalist's Notes
    227416,  -- Faded Miner's Notes
    227417,  -- Faded Skinner's Notes
    227418,  -- Exceptional Blacksmith's Diagrams
    227419,  -- Exceptional Scribe's Runic Drawings
    227420,  -- Exceptional Alchemist's Research
    227421,  -- Exceptional Tailor's Diagrams
    227422,  -- Exceptional Enchanter's Research
    227423,  -- Exceptional Engineer's Scribblings
    227424,  -- Exceptional Jeweler's Illustrations
    227425,  -- Exceptional Leatherworker's Diagrams
    227426,  -- Exceptional Herbalist's Notes
    227427,  -- Exceptional Miner's Notes
    227428,  -- Exceptional Skinner's Notes
    227429,  -- Pristine Blacksmith's Diagrams
    227430,  -- Pristine Scribe's Runic Drawings
    227431,  -- Pristine Alchemist's Research
    227432,  -- Pristine Tailor's Diagrams
    227433,  -- Pristine Enchanter's Research
    227434,  -- Pristine Engineer's Scribblings
    227435,  -- Pristine Jeweler's Illustrations
    227436,  -- Pristine Leatherworker's Diagrams
    227437,  -- Pristine Herbalist's Notes
    227438,  -- Pristine Miner's Notes
    227439,  -- Pristine Skinner's Notes
    227450,  -- Sky Racer's Purse
    227659,  -- Fleeting Arcane Manifestation
    227661,  -- Gleaming Telluric Crystal
    227662,  -- Shimmering Dust
    227667,  -- Algari Enchanter's Folio
    227668,  -- Delver's Bounty
    227675,  -- Satchel of Surplus Herbs
    227676,  -- Satchel of Surplus Ore
    227677,  -- zzOld Do Not Use (DNT)
    227678,  -- zzOld Do Not Use (DNT)
    227679,  -- zzOld Do Not Use (DNT)
    227680,  -- zzOld Do Not Use (DNT)
    227681,  -- Satchel of Surplus Leather
    227682,  -- Satchel of Surplus Cloth
    227713,  -- Artisan's Consortium Payout
    227778,  -- Delver's Bounty
    227779,  -- Delver's Bounty
    227780,  -- Delver's Bounty
    227781,  -- Delver's Bounty
    227782,  -- Delver's Bounty
    227783,  -- Delver's Bounty
    227784,  -- Delver's Bounty
    227792,  -- Everyday Cache
    228220,  -- Waxy Bundle
    228337,  -- Satchel of Surplus Dust
    228361,  -- Seasoned Adventurer's Cache
    228724,  -- Flicker of Alchemy Knowledge
    228725,  -- Glimmer of Alchemy Knowledge
    228726,  -- Flicker of Blacksmithing Knowledge
    228727,  -- Glimmer of Blacksmithing Knowledge
    228728,  -- Flicker of Enchanting Knowledge
    228729,  -- Glimmer of Enchanting Knowledge
    228730,  -- Flicker of Engineering Knowledge
    228731,  -- Glimmer of Engineering Knowledge
    228732,  -- Flicker of Inscription Knowledge
    228733,  -- Glimmer of Inscription Knowledge
    228734,  -- Flicker of Jewelcrafting Knowledge
    228735,  -- Glimmer of Jewelcrafting Knowledge
    228736,  -- Flicker of Leatherworking Knowledge
    228737,  -- Glimmer of Leatherworking Knowledge
    228738,  -- Flicker of Tailoring Knowledge
    228739,  -- Glimmer of Tailoring Knowledge
    228741,  -- Lamplighter Supply Satchel
    228773,  -- Algari Alchemist's Notebook
    228774,  -- Algari Blacksmith's Journal
    228775,  -- Algari Engineer's Notepad
    228776,  -- Algari Scribe's Journal
    228777,  -- Algari Jewelcrafter's Notebook
    228778,  -- Algari Leatherworker's Journal
    228779,  -- Algari Tailor's Notebook
    228910,  -- Cache of Nerubian Treasures
    228916,  -- Algari Tailor's Satchel
    228917,  -- Satchel of Ore
    228918,  -- Satchel of Leather
    228919,  -- Satchel of Algari Herbs
    228920,  -- Satchel of Chitin
    228931,  -- Algari Enchanter's Satchel
    228932,  -- Algari Engineer's Satchel
    228933,  -- Algari Leatherworker's Satchel
    228959,  -- Pile of Unidentified Meat
    229005,  -- Cache of Earthen Treasures
    229006,  -- Cache of Earthen Treasures
    229129,  -- Cache of Delver's Spoils
    229130,  -- Cache of Delver's Spoils
    229354,  -- Algari Adventurer's Cache
    229355,  -- Chromie's Premium Goodie Bag
    229359,  -- Chromie's Goodie Bag
    230032,  -- Overflowing K'aresh Trust Trove
    231153,  -- Triumphant Satchel of Carved Undermine Crests
    231154,  -- Celebratory Pack of Runed Undermine Crests
    231264,  -- Glorious Cluster of Gilded Undermine Crests
    231267,  -- Pouch of Weathered Undermine Crests
    231269,  -- Satchel of Carved Undermine Crests
    231270,  -- Pack of Runed Undermine Crests
    232076,  -- Adventurer's Warbound Battlegear Drop
    232372,  -- Crate of Bygone Riches
    232382,  -- Golden Valorstone
    232463,  -- Overflowing Undermine Trove
    232465,  -- Darkfuse Trove
    232471,  -- Cache of Dark Iron Treasures
    232472,  -- Cache of Dark Iron Treasures
    232473,  -- Cache of Dark Iron Treasures
    232598,  -- Bag of Timewarped Badges
    232602,  -- Forged Gladiator's Coin Pouch
    232615,  -- Prized Gladiator's Coin Pouch
    232616,  -- Astral Gladiator's Coin Pouch
    232631,  -- Wrapped Spear
    232877,  -- Timely Goodie Bag
    232927,  -- [DNT] Small Surge Chest
    232928,  -- [DNT] Medium Surge Chest
    232929,  -- [DNT] Large Surge Chest
    233014,  -- Bronze Celebration Cache of Treasures
    233276,  -- Delver's Starter Kit
    233281,  -- Delver's Cosmetic Surprise Bag
    233557,  -- Sifted Pile of Scrap
    233558,  -- S.C.R.A.P. Scrubber Deluxe
    234413,  -- Satchel of Exotic Mysteries
    234425,  -- Forgotten Folio
    234744,  -- Blackwater's Trove
    234745,  -- Bilgewater's Trove
    234746,  -- Venture Co.'s Trove
    234816,  -- Overflowing Bag of Iron
    235052,  -- Weathered Mysterious Satchel
    235054,  -- Pristine Mysterious Satchel
    235151,  -- Distinguished Actor's Chest
    235258,  -- Bilgewater's Trove
    235259,  -- Bilgewater's Trove
    235260,  -- Blackwater's Trove
    235261,  -- Blackwater's Trove
    235262,  -- Steamwheedle's Trove
    235263,  -- Steamwheedle's Trove
    235264,  -- Venture Co.'s Trove
    235265,  -- Venture Co.'s Trove
    235505,  -- Satchel of Timewarped Badges
    235506,  -- Box of Timewarped Badges
    235548,  -- Earthen Landlubber's Cache
    235558,  -- Box of Darkfuse Miscellany
    235610,  -- Seasoned Adventurer's Cache
    235631,  -- [NOT USED] Mysterious Large Satchel of Goodies
    235639,  -- Seasoned Adventurer's Cache
    235911,  -- Weathered Mysterious Satchel
    236632,  -- Pouch of Voidbane Gems
    236756,  -- Socially Expected Tip Chest
    236757,  -- Generous Tip Chest
    236758,  -- Extravagant Tip Chest
    236877,  -- Crystallized Essence of Kaja'mite
    236944,  -- Weathered Mysterious Satchel
    236953,  -- Crimson Valorstone
    236954,  -- Void-Touched Valorstone
    237134,  -- Steamwheedle Trove
    237135,  -- Blackwater Trove
    237743,  -- Arathi Soldier's Coffer
    237759,  -- Arathi Cleric's Chest
    237760,  -- Arathi Champion's Spoils
    237812,  -- Cache of Infinite Treasure
    238207,  -- Nanny's Surge Dividends
    238208,  -- Nanny's Surge Dividends
    239004,  -- Radiant Service Satchel
    239118,  -- Pinnacle Cache
    239120,  -- Seasoned Adventurer's Cache
    239121,  -- Awakened Mechanical Cache
    239122,  -- The General's War Chest
    239124,  -- The Vizier's Capital
    239125,  -- The Weaver's Gratuity
    239126,  -- Radiant Cache
    239128,  -- Theater Troupe's Trove
    239224,  -- Cache of Infinite Treasure
    239303,  -- Cache of Infinite Treasure
    239440,  -- Dastardly Prize Purse
    239489,  -- Radiant Officer's Cache
    239546,  -- Confiscated Cultist's Bag
    239594,  -- Crimson Valorstone
    240175,  -- Crystallized Ethereal Voidsplinter
    240207,  -- Golden Valorstone
    240208,  -- Void-Touched Valorstone
    240926,  -- Pack of Runed Ethereal Crests
    240927,  -- Satchel of Carved Ethereal Crests
    240928,  -- Pouch of Weathered Ethereal Crests
    240929,  -- Glorious Cluster of Gilded Ethereal Crests
    240930,  -- Celebratory Pack of Runed Ethereal Crests
    240931,  -- Triumphant Satchel of Carved Ethereal Crests
    242386,  -- Lorewalker's Crate of Memorabilia
    243235,  -- Adventurer's Footlocker
    243291,  -- Bag of Brewfest Merchandise
    243292,  -- Bag of Brewfest Merchandise
    243293,  -- Bag of Brewfest Merchandise
    243347,  -- Keg of Curiosities
    243373,  -- Timerunner's Weaponry
    244335,  -- K'aresh Box of Valorstones
    244336,  -- K'aresh Box of Resonance Crystals
    244457,  -- Keystone Container
    244466,  -- Dagran's Pouch of Shards
    244696,  -- Overcharged Chest
    244842,  -- Fabled Veteran's Cache
    244865,  -- Pinnacle Cache
    244883,  -- Seasoned Undermine Adventurer's Cache
    245280,  -- Seasoned Khaz Algar Adventurer's Cache
    245553,  -- Heroic Cache of Infinite Treasure
    245589,  -- Hellcaller Chest
    245611,  -- Wriggling Pinnacle Cache
    245925,  -- Artifactium Sand
    246697,  -- Self-Assembling Homeware Kit
    246812,  -- Minor Bronze Cache
    246813,  -- Greater Bronze Cache
    246814,  -- Bronze Cache
    246815,  -- Lesser Bronze Cache
    246936,  -- Resonant Epoch Memento
    246937,  -- Perfected Epoch Memento
    247820,  -- Cache of K'areshi Treasures
    247821,  -- Cache of K'areshi Treasures
    248126,  -- Delver's Starter Kit
    248127,  -- Delver's Cosmetic Surprise Bag
    248247,  -- Cache of Infinite Power
    249891,  -- Mound of Artifactium Sand
    250763,  -- Theater Troupe's Trove
    250764,  -- Nanny's Surge Dividends
    250765,  -- Awakened Mechanical Cache
    250766,  -- Radiant Cache
    250767,  -- The General's War Chest
    250768,  -- The Vizier's Capital
    250769,  -- The Weaver's Gratuity
    250975,  -- Hellcaller Chest
    251821,  -- Cache of Infinite Power
    253357,  -- Felscorned Arsenal
    254847,  -- Minor Bronze Cache
    254848,  -- Minor Bronze Cache
    254849,  -- Minor Bronze Cache
    254850,  -- Minor Bronze Cache
    255676,  -- Phase Diver's Cache
    256763,  -- Cache from the Infinite's Armory
    264675,  -- Cache from the Infinite's Armory
}
for _, id in ipairs(twwIDs) do openables[id] = {} end

openables[219191] = { threshold = 15 }  -- Hastily Scrawled Notes
openables[220376] = { lockbox = true }  -- Bismuth Lockbox
openables[253224] = { threshold = 10 }  -- Mote of a Broken Time
openables[253227] = { threshold = 10 }  -- Flawless Thread of Time
openables[254267] = { threshold = 100 }  -- Fragmented Memento of Epoch Challenges
openables[222546] = { questId = 83725 }  -- Algari Treatise on Alchemy
openables[222554] = { questId = 83726 }  -- Algari Treatise on Blacksmithing
openables[222550] = { questId = 83727 }  -- Algari Treatise on Enchanting
openables[222621] = { questId = 83728 }  -- Algari Treatise on Engineering
openables[222552] = { questId = 83729 }  -- Algari Treatise on Herbalism
openables[222548] = { questId = 83730 }  -- Algari Treatise on Inscription
openables[222551] = { questId = 83731 }  -- Algari Treatise on Jewelcrafting
openables[222549] = { questId = 83732 }  -- Algari Treatise on Leatherworking
openables[222553] = { questId = 83733 }  -- Algari Treatise on Mining
openables[222649] = { questId = 83734 }  -- Algari Treatise on Skinning
openables[222547] = { questId = 83735 }  -- Algari Treatise on Tailoring
openables[232499] = { questId = 85734 }  -- Undermine Treatise on Alchemy
openables[232500] = { questId = 85735 }  -- Undermine Treatise on Blacksmithing
openables[232501] = { questId = 85736 }  -- Undermine Treatise on Enchanting
openables[232502] = { questId = 85745 }  -- Undermine Treatise on Tailoring
openables[232503] = { questId = 85738 }  -- Undermine Treatise on Herbalism
openables[232504] = { questId = 85740 }  -- Undermine Treatise on Jewelcrafting
openables[232505] = { questId = 85741 }  -- Undermine Treatise on Leatherworking
openables[232506] = { questId = 85744 }  -- Undermine Treatise on Skinning
openables[232507] = { questId = 85737 }  -- Undermine Treatise on Engineering
openables[232508] = { questId = 85739 }  -- Undermine Treatise on Inscription
openables[232509] = { questId = 85742 }  -- Undermine Treatise on Mining


local midnightIDs = {
    237496,  -- Igneous Rock Specimen
    237506,  -- Septarian Nodule
    237507,  -- Cloudy Quartz
    238465,  -- Thalassian Phoenix Plume
    238466,  -- Thalassian Phoenix Tail
    238467,  -- Thalassian Phoenix Ember
    238468,  -- Bloomed Bud
    238469,  -- Sweeping Harvester's Scythe
    238470,  -- Simple Leaf Pruners
    238471,  -- Lightbloom Root
    238472,  -- A Spade
    238473,  -- Harvester's Sickle
    238474,  -- Peculiar Lotus
    238475,  -- Planting Shovel
    238531,  -- Radiant Stomach
    238532,  -- Vial of Eversong Oddities
    238533,  -- Vial of Voidstorm Oddities
    238534,  -- Vial of Rootlands Oddities
    238535,  -- Vial of Zul'Aman Oddities
    238536,  -- Freshly Plucked Peacebloom
    238537,  -- Measured Ladle
    238538,  -- Pristine Potion
    238539,  -- Failed Experiment
    238540,  -- Deconstructed Forge Techniques
    238541,  -- Silvermoon Smithing Kit
    238542,  -- Carefully Racked Spear
    238543,  -- Metalworking Cheat Sheet
    238544,  -- Voidstorm Defense Spear
    238545,  -- Rutaani Floratender's Sword
    238546,  -- Sin'dorei Master's Forgemace
    238547,  -- Silvermoon Blacksmith's Hammer
    238548,  -- Enchanted Amani Mask
    238549,  -- Enchanted Sunfire Silk
    238550,  -- Pure Void Crystal
    238551,  -- Everblazing Sunmote
    238552,  -- Entropic Shard
    238553,  -- Primal Essence Orb
    238554,  -- Loa-Blessed Dust
    238555,  -- Sin'dorei Enchanting Rod
    238556,  -- One Engineer's Junk
    238557,  -- Miniaturized Transport Skiff
    238558,  -- Manual of Mistakes and Mishaps
    238559,  -- Expeditious Pylon
    238560,  -- Ethereal Stormwrench
    238561,  -- Offline Helper Bot
    238562,  -- What To Do When Nothing Works
    238563,  -- Handy Wrench
    238572,  -- Void-Touched Quill
    238573,  -- Leather-Bound Techniques
    238574,  -- Spare Ink
    238575,  -- Intrepid Explorer's Marker
    238576,  -- Leftover Sanguithorn Pigment
    238577,  -- Half-Baked Techniques
    238578,  -- Songwriter's Pen
    238579,  -- Songwriter's Quill
    238580,  -- Sin'dorei Masterwork Chisel
    238581,  -- Speculative Voidstorm Crystal
    238582,  -- Dual-Function Magnifiers
    238583,  -- Poorly Rounded Vial
    238584,  -- Shattered Glass
    238585,  -- Vintage Soul Gem
    238586,  -- Ethereal Gem Pliers
    238587,  -- Sin'dorei Gem Faceters
    238588,  -- Amani Leatherworker's Tool
    238589,  -- Ethereal Leatherworking Knife
    238590,  -- Prestigiously Racked Hide
    238591,  -- Bundle of Tanner's Trinkets
    238592,  -- Patterns: Beyond the Void
    238593,  -- Haranir Leatherworking Mallet
    238594,  -- Haranir Leatherworking Knife
    238595,  -- Artisan's Considered Order
    238596,  -- Miner's Guide to Voidstorm
    238597,  -- Spelunker's Lucky Charm
    238598,  -- Lost Voidstorm Satchel
    238599,  -- Solid Ore Punchers
    238600,  -- Glimmering Void Pearl
    238601,  -- Amani Expert's Chisel
    238602,  -- Star Metal Deposit
    238603,  -- Spare Expedition Torch
    238612,  -- A Child's Stuffy
    238613,  -- A Really Nice Curtain
    238614,  -- Sin'dorei Outfitter's Ruler
    238615,  -- Wooden Weaving Sword
    238616,  -- Book of Sin'dorei Stitches
    238617,  -- Satin Throw Pillow
    238618,  -- Particularly Enchanting Tablecloth
    238619,  -- Artisan's Cover Comb
    238625,  -- Fine Void-Tempered Hide
    238626,  -- Mana-Infused Bone
    238627,  -- Manafused Sample
    238628,  -- Lightbloom Afflicted Hide
    238629,  -- Cadre Skinning Knife
    238630,  -- Primal Hide
    238631,  -- Voidstorm Leather Sample
    238632,  -- Amani Tanning Oil
    238633,  -- Sin'dorei Tanning Oil
    238634,  -- Amani Skinning Knife
    238635,  -- Thalassian Skinning Knife
    239077,  -- Mound of Mildly-Meaningful Meat
    241131,  -- Amani Lapis Prism
    241132,  -- Amani Lapis Prism
    241133,  -- Tenebrous Amethyst Prism
    241134,  -- Tenebrous Amethyst Prism
    241135,  -- Sanguine Garnet Prism
    241136,  -- Sanguine Garnet Prism
    241137,  -- Harandar Peridot Prism
    241138,  -- Harandar Peridot Prism
    242650,  -- Box of Rocks
    245644,  -- Box of Rocks
    245647,  -- School of Gems
    245648,  -- School of Gems
    245650,  -- Bouquet of Herbs
    245651,  -- Bouquet of Herbs
    245755,  -- Thalassian Treatise on Alchemy
    245756,  -- Thalassian Treatise on Tailoring
    245757,  -- Thalassian Treatise on Inscription
    245758,  -- Thalassian Treatise on Leatherworking
    245759,  -- Thalassian Treatise on Enchanting
    245760,  -- Thalassian Treatise on Jewelcrafting
    245761,  -- Thalassian Treatise on Herbalism
    245762,  -- Thalassian Treatise on Mining
    245763,  -- Thalassian Treatise on Blacksmithing
    245809,  -- Thalassian Treatise on Engineering
    245828,  -- Thalassian Treatise on Skinning
    246320,  -- Flicker of Midnight Alchemy Knowledge
    246321,  -- Glimmer of Midnight Alchemy Knowledge
    246322,  -- Flicker of Midnight Blacksmithing Knowledge
    246323,  -- Glimmer of Midnight Blacksmithing Knowledge
    246324,  -- Flicker of Midnight Enchanting Knowledge
    246325,  -- Glimmer of Midnight Enchanting Knowledge
    246326,  -- Flicker of Midnight Engineering Knowledge
    246327,  -- Glimmer of Midnight Engineering Knowledge
    246328,  -- Flicker of Midnight Inscription Knowledge
    246329,  -- Glimmer of Midnight Inscription Knowledge
    246330,  -- Flicker of Midnight Jewelcrafting Knowledge
    246331,  -- Glimmer of Midnight Jewelcrafting Knowledge
    246332,  -- Flicker of Midnight Leatherworking Knowledge
    246333,  -- Glimmer of Midnight Leatherworking Knowledge
    246334,  -- Flicker of Midnight Tailoring Knowledge
    246335,  -- Glimmer of Midnight Tailoring Knowledge
    246585,  -- Artisan's Consortium Payout
    246751,  -- Triumphant Satchel of Champion Dawncrests
    246752,  -- Celebratory Pack of Hero Dawncrests
    246753,  -- Glorious Cluster of Myth Dawncrests
    246754,  -- Pouch of Veteran Dawncrests
    246755,  -- Satchel of Champion Dawncrests
    246756,  -- Pack of Hero Dawncrests
    250116,  -- Cache of Quel'Thalas Treasures
    250117,  -- Cache of Quel'Thalas Treasures
    250360,  -- Echo of Abundance: Skinning
    250443,  -- Echo of Abundance: Herbalism
    250444,  -- Echo of Abundance: Mining
    250445,  -- Echo of Abundance: Enchanting
    250750,  -- Pouch of Sprouted Clippings
    250753,  -- Bag of Cracked Orebits
    250754,  -- Bag of Wild Skinnings
    250755,  -- Pouch of Mystic Grindings
    250922,  -- Whisper of the Loa: Leatherworking
    250923,  -- Whisper of the Loa: Skinning
    250924,  -- Whisper of the Loa: Mining
    251286,  -- Bundle of Petrified Roots
    251287,  -- Generous Bundle of Petrified Roots
    251321,  -- Collection of Eversong Minerals
    251322,  -- Thalassian Leatherworker's Duffel
    251324,  -- Basket of Eversong Herbs
    251326,  -- Thalassian Enchanter's Purse
    251327,  -- Thalassian Tailor's Tote Bag
    251970,  -- Overflowing Amani Trove
    254677,  -- Apex Cache
    255157,  -- Abyss Angler's Fish Log
    255428,  -- Tolbani's Medicine Satchel
    255666,  -- Huge Bag of Midnight General Goods
    255678,  -- Huge Bag of Midnight Herbs
    255679,  -- Huge Bag of Midnight Minerals
    255682,  -- Huge Bag of Midnight Skins
    255683,  -- Huge Bag of Midnight Jewelcrafting Goods
    255684,  -- Huge Bag of Midnight Leatherworking Goods
    255686,  -- Huge Bag of Midnight Alchemy Goods
    255687,  -- Huge Bag of Midnight Optional Goods
    255689,  -- Huge Bag of Midnight Engineering Goods
    255690,  -- Huge Bag of Midnight Enchanting Goods
    255691,  -- Huge Bag of Midnight Tailoring Goods
    255703,  -- Huge Bag of Midnight Blacksmithing Goods
    255704,  -- Huge Bag of Midnight Inscription Goods
    256055,  -- Overflowing Hara'ti Trove
    257023,  -- Preyseeker's Adventurer Chest
    257026,  -- Preyseeker's Veteran Chest
    257599,  -- Skill Issue: Jewelcrafting
    257600,  -- Skill Issue: Enchanting
    257601,  -- Skill Issue: Tailoring
    257603,  -- Primalist Weapon
    258279,  -- [DNT] Big Pouch of Supplies
    258410,  -- Traditions of the Haranir: Herbalism
    258411,  -- Traditions of the Haranir: Inscription
    258534,  -- Illustrious Contender's Strongbox
    258620,  -- Field Medic's Hazard Payout
    258839,  -- Concealed Catalogue
    259086,  -- Void-Touched Satchel of Cooperation
    259188,  -- Lightbloomed Spore Sample
    259189,  -- Aged Cruor
    259190,  -- Thalassian Whestone
    259191,  -- Infused Quenching Oil
    259192,  -- Voidstorm Ashes
    259193,  -- Lost Thalassian Vellum
    259194,  -- Dance Gear
    259195,  -- Dawn Capacitor
    259196,  -- Brilliant Phoenix Ink
    259197,  -- Loa-Blessed Rune
    259198,  -- Void-Touched Eversong Diamond Fragments
    259199,  -- Harandar Stone Sample
    259200,  -- Amani Tanning Oil
    259201,  -- Thalassian Mana Oil
    259202,  -- Embroidered Memento
    259203,  -- Finely Woven Lynx Collar
    259334,  -- Overflowing Singularity Trove
    260173,  -- Crystallized Dawnlight Manaflux
    260193,  -- Fabled Veteran's Cache
    260534,  -- Master Alchemist's Surplus Reagents
    260536,  -- Master Smith's Surplus Reagents
    260537,  -- Master Enchanter's Surplus Reagents
    260538,  -- Master Engineer's Surplus Reagents
    260539,  -- Master Herbalist's Surplus Reagents
    260540,  -- Master Scribe's Surplus Reagents
    260541,  -- Master Jewelcrafter's Surplus Reagents
    260542,  -- Master Leatherworker's Surplus Reagents
    260543,  -- Master Miner's Surplus Reagents
    260544,  -- Master Skinner's Surplus Reagents
    260545,  -- Master Tailor's Surplus Reagents
    260940,  -- Victorious Stormarion Pinnacle Cache
    260979,  -- Victorious Stormarion Cache
    262346,  -- Preyseeker's Champion Chest
    262349,  -- Satchel of Compensation
    262432,  -- Weathered Lockbox
    262596,  -- Preyseeker's Satchel of Voidlight Marl
    262622,  -- Preyseeker's Satchel of Coffer Key Shards
    262623,  -- Preyseeker's Satchel of Adventurer Dawncrests
    262624,  -- Preyseeker's Satchel of Anguish
    262626,  -- Preyseeker's Box of Anguish
    262627,  -- Preyseeker's Box of Coffer Key Shards
    262629,  -- Preyseeker's Box of Veteran Dawncrests
    262630,  -- Preyseeker's Box of Voidlight Marl
    262631,  -- Preyseeker's Cache of Anguish
    262632,  -- Preyseeker's Cache of Coffer Key Shards
    262633,  -- Preyseeker's Cache of Champion Dawncrests
    262634,  -- Preyseeker's Cache of Voidlight Marl
    262635,  -- Cache of Delver's Spoils
    262644,  -- Beyond the Event Horizon: Blacksmithing
    262645,  -- Beyond the Event Horizon: Alchemy
    262646,  -- Beyond the Event Horizon: Engineering
    262662,  -- Thalassian Distinguishment
    262928,  -- Preyseeker's Adventurer Sack
    262936,  -- Preyseeker's Veteran Sack
    262938,  -- Preyseeker's Champion Sack
    263178,  -- Delver's Starter Kit
    263179,  -- Delver's Cosmetic Surprise Bag
    263400,  -- Cache of Delver's Spoils
    263433,  -- Overflowing Silvermoon Trove
    263454,  -- Thalassian Alchemist's Notebook
    263455,  -- Thalassian Blacksmith's Journal
    263456,  -- Thalassian Engineer's Notepad
    263457,  -- Thalassian Scribe's Journal
    263458,  -- Thalassian Jewelcrafter's Notebook
    263459,  -- Thalassian Leatherworker's Journal
    263460,  -- Thalassian Tailor's Notebook
    263461,  -- Thalassian Skinner's Notes
    263462,  -- Thalassian Herbalist's Notes
    263463,  -- Thalassian Miner's Notes
    263464,  -- Thalassian Enchanter's Folio
    263465,  -- Surplus Bag of Party Favors
    263466,  -- Overflowing Abundant Satchel
    263467,  -- Avid Learner's Supply Pack
    263468,  -- Stormarion Spoils
    263710,  -- Primalist Plate Helm
    263711,  -- Primalist Cloth Helm
    263712,  -- Primalist Mail Helm
    263713,  -- Primalist Leather Helm
    263714,  -- Primalist Trinket
    263715,  -- Primalist Plate Chestpiece
    263716,  -- Primalist Cloth Chestpiece
    263717,  -- Primalist Mail Chestpiece
    263718,  -- Primalist Leather Chestpiece
    263719,  -- Primalist Leather Leggings
    263720,  -- Primalist Mail Leggings
    263721,  -- Primalist Cloth Leggings
    263722,  -- Primalist Plate Leggings
    263724,  -- Primalist Plate Spaulders
    263725,  -- Primalist Cloth Spaulders
    263726,  -- Primalist Mail Spaulders
    263727,  -- Primalist Leather Spaulders
    263728,  -- Primalist Leather Bracers
    263729,  -- Primalist Mail Bracers
    263730,  -- Primalist Cloth Bracers
    263731,  -- Primalist Plate Bracers
    263732,  -- Primalist Plate Belt
    263733,  -- Primalist Cloth Belt
    263740,  -- Primalist Mail Belt
    263776,  -- Primalist Leather Belt
    263822,  -- Primalist Leather Boots
    263859,  -- Primalist Mail Boots
    263861,  -- Primalist Plate Boots
    263862,  -- Primalist Cloth Boots
    263863,  -- Primalist Cloth Gloves
    263864,  -- Primalist Plate Gloves
    263865,  -- Primalist Mail Gloves
    263866,  -- Primalist Leather Gloves
    263867,  -- Primalist Cloak
    263868,  -- Primalist Ring
    263869,  -- Primalist Necklace
    263928,  -- Cache of Void-Touched Armaments
    263929,  -- Cache of Void-Touched Armaments
    263934,  -- Chest of Gold
    263976,  -- Bundle of Adventurer Dawncrests
    263977,  -- Venerable Satchel of Veteran Dawncrests
    264274,  -- Fabled Adventurer's Cache
    264314,  -- Cache of Void-Touched Headgear
    264315,  -- Cache of Void-Touched Shoulderwear
    264316,  -- Cache of Void-Touched Cloaks
    264317,  -- Cache of Void-Touched Chestpieces
    264318,  -- Cache of Void-Touched Bracers
    264319,  -- Cache of Void-Touched Gloves
    264320,  -- Cache of Void-Touched Belts
    264321,  -- Cache of Void-Touched Legwear
    264322,  -- Cache of Void-Touched Boots
    264323,  -- Cache of Void-Touched Weapons
    264470,  -- Ash-Tied Offering
    264475,  -- Umbral Tin Lockbox
    264587,  -- Ani's Trinket Bag
    264652,  -- Delver's Pouch of Voidlight Marl
    264914,  -- Ranger's Cache
    264972,  -- Voidstorm Victuals
    264988,  -- Endgame Essentials
    265995,  -- Quel'Thalas Adventurer's Cache
    267299,  -- Slayer's Duellum Trove
    267653,  -- Glimmering Powder
    267654,  -- Swirling Arcane Essence
    267655,  -- Brimming Mana Shard
    268297,  -- Rattling Bag o' Gold
    268485,  -- Victorious Stormarion Pinnacle Cache
    268487,  -- Avid Learner's Supply Pack
    268488,  -- Overflowing Abundant Satchel
    268489,  -- Surplus Bag of Party Favors
    268490,  -- Apex Cache
    268545,  -- Aspiring Preyseeker's Chest
    269005,  -- Preyseeker's Glinting Coin Pouch
    269006,  -- Preyseeker's Gleaming Coin Pouch
    269007,  -- Preyseeker's Glittering Coin Pouch
    269234,  -- Overflowing Ritual Site Cache
    269701,  -- Surplus Bag of Party Favors
    269702,  -- Overflowing Abundant Satchel
    269703,  -- Avid Learner's Supply Pack
    269704,  -- Victorious Stormarion Cache
    270244,  -- Field Pouch
    270247,  -- Field Satchel
    270431,  -- Haranir Footlocker
    270932,  -- Wriggling Field Pouch
    270933,  -- Bulging Field Pouch
    270934,  -- Recruit's Field Pouch
    270987,  -- Recruit's Field Satchel
    271221,  -- Wriggling Recruit's Field Pouch
    271222,  -- Bulging Recruit's Field Pouch
    272125,  -- Recruit's Cache
    273152,  -- Delve Gearbox
    273153,  -- Delve Gearbox
    273154,  -- Delve Gearbox
    273155,  -- Delve Gearbox
    273156,  -- Delve Gearbox
    274069,  -- Warbound Pack of Hero Dawncrests
    274070,  -- Warbound Pack of Champion Dawncrests
    274071,  -- Warbound Pack of Veteran Dawncrests
    274578,  -- Offering of Unalloyed Abundance
    271631,  -- 圣光守卫者的奖赏
    275690,  -- 圣光守卫者的奖赏
    275691,  -- 圣光守卫者的奖赏
    276388,  -- 圣光守卫者的奖赏
}
for _, id in ipairs(midnightIDs) do openables[id] = {} end

openables[245755] = {questId = 95127 } -- Thalassian Treatise on Alchemy
openables[245756] = {questId = 95137 } -- Thalassian Treatise on Tailoring
openables[245757] = {questId = 95131 } -- Thalassian Treatise on Inscription
openables[245758] = {questId = 95134 } -- Thalassian Treatise on Leatherworking
openables[245759] = {questId = 95129 } -- Thalassian Treatise on Enchanting
openables[245760] = {questId = 95133 } -- Thalassian Treatise on Jewelcrafting
openables[245761] = {questId = 95130 } -- Thalassian Treatise on Herbalism
openables[245762] = {questId = 95135 } -- Thalassian Treatise on Mining
openables[245763] = {questId = 95128 } -- Thalassian Treatise on Blacksmithing
openables[245809] = {questId = 95138 } -- Thalassian Treatise on Engineering
openables[245828] = {questId = 95136 } -- Thalassian Treatise on Skinning
openables[246447] = { threshold = 5 }  -- Apprentice's Scribbles
openables[246448] = { threshold = 5 }  -- Artisan's Ledger
openables[246449] = { threshold = 5 }  -- Mentor's Helpful Handiwork
openables[247719] = { threshold = 5 }  -- Multicraft Matrix
openables[247725] = { threshold = 5 }  -- Resourceful Rebar
openables[260630] = { threshold = 5 }  -- Ingenious Identifier
openables[268650] = { threshold = 5 }  -- Ascendant Voidshard
openables[271341] = { threshold = 5 }  -- Ascendant Voidshard

local function createStrategy(filterFn)
    return { shouldFilter = filterFn }
end

local CriteriaContext = {}
CriteriaContext.__index = CriteriaContext

function CriteriaContext:evaluateAll(itemID, cacheDetails, count)
    for _, strategy in ipairs(self.strategies) do
        if strategy.shouldFilter(itemID, cacheDetails, count) then
            return false
        end
    end
    return true
end

-- Define filter strategies
local skipRousing = createStrategy(function(itemID, cacheDetails, count)
    return not ShiGuangPerDB.CanOpenerShowRousing and cacheDetails.isRousing
end)

local threshold = createStrategy(function(itemID, cacheDetails, count)
    return (cacheDetails.threshold or 1) > count
end)

local levelRequirement = createStrategy(function(itemID, cacheDetails, count)
    local _,_,_,_,itemMinLevel = C_Item.GetItemInfo(itemID)
    if not itemMinLevel then
        return false
    end
    return not ShiGuangPerDB.CanOpenerShowLevelRestrictedItems and itemMinLevel > UnitLevel("player")
end)

local questTimeGate = createStrategy(function(itemID, cacheDetails, count)
    return cacheDetails.questId and C_QuestLog.IsQuestFlaggedCompleted(cacheDetails.questId)
end)

-- 1804 = Pick Lock (Rogue), 312916 = Skeleton Pinkie (Mechagnome)
local lockbox = createStrategy(function(itemID, cacheDetails, count)
    if not cacheDetails.lockbox then return false end
    if ShiGuangPerDB.CanOpenerShowLockboxes then return false end
    return not (IsSpellKnown(1804) or IsSpellKnown(312916))
end)

-- Build strategy list
local strategies = { skipRousing, threshold, levelRequirement, questTimeGate, lockbox }

-- Drain event-registered strategies
for _, entry in ipairs(CanOpenerGlobal._eventStrategies) do
    table.insert(strategies, createStrategy(entry.filterFn))
end

CanOpenerGlobal.CriteriaContext = setmetatable({ strategies = strategies }, CriteriaContext)


local function RegisterBooleanSetting(category, varName, displayName, tooltip, defaultValue)
    local setting = Settings.RegisterProxySetting(
        category,
        CanOpenerLocal .. varName,
        Settings.VarType.Boolean,
        displayName,
        defaultValue,
        function() return ShiGuangPerDB[varName] end,
        function(value)
            ShiGuangPerDB[varName] = value
            CanOpenerGlobal.ForceButtonRefresh()
        end
    )
    Settings.CreateCheckbox(category, setting, tooltip)
end

-- Initialize the settings for the addon
function InitSettingsMenu()
    local category = Settings.RegisterVerticalLayoutCategory(CanOpenerLocal)

    RegisterBooleanSetting(category, "CanOpenerShowRousing", "显示增益物品",
        "If Checked, Rousing Elements will be shown.", true)

    RegisterBooleanSetting(category, "CanOpenerShowLevelRestrictedItems", "显示等级限制物品",
        "If Checked, items with a level requirement higher than your character's level will be shown.", true)

    RegisterBooleanSetting(category, "CanOpenerShowLockboxes", "显示锁住的物品",
        "If Checked, locked items will always be shown. Otherwise they only show for characters with Pick Lock (Rogue) or Skeleton Pinkie (Mechagnome). Enable this if you open lockboxes another way (e.g. Blacksmithing skeleton keys).", false)

    RegisterBooleanSetting(category, "showOnlyOneButton", "Show Single Item At A Time",
        "If Checked, only one item will be shown at a time.", false)

    -- Drain event-registered settings
    for _, setting in ipairs(CanOpenerGlobal._eventSettings) do
        RegisterBooleanSetting(category, setting.varName, setting.displayName, setting.tooltip, setting.defaultValue)
    end

    local ignoreFrame = CreateFrame("Frame", "CanOpener_IgnoreFrame", UIParent)
    ignoreFrame:Hide()
    ignoreFrame.name = IGNORE_LIST  --"Ignore Lists"

    Settings.RegisterCanvasLayoutSubcategory(category, ignoreFrame, IGNORE_LIST)  --"Ignore Lists"

    do
        local title = ignoreFrame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
        title:SetPoint("TOPLEFT", 10, -10)
        title:SetText(IGNORE_LIST)   --"Ignore Lists"

        local charHeader = ignoreFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
        charHeader:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -15)
        charHeader:SetText("当前角色的忽略列表")

        local charScroll = CreateFrame("ScrollFrame", "CanOpener_CharacterIgnoreScroll", ignoreFrame, "UIPanelScrollFrameTemplate")
        charScroll:SetSize(300, 200)
        charScroll:SetPoint("TOPLEFT", charHeader, "BOTTOMLEFT", 0, -10)

        local charContent = CreateFrame("Frame", "CanOpener_CharacterIgnoreContent", charScroll)
        charContent:SetSize(300, 200)
        charScroll:SetScrollChild(charContent)

        local rowPool = {}

        local function RefreshCharIgnoreList()
            -- Return existing rows to pool
            for _, child in ipairs({ charContent:GetChildren() }) do
                child:Hide()
                table.insert(rowPool, child)
            end

            local y = -10
            for itemID in pairs(ShiGuangPerDB.CanOpenerExcludedItems or {}) do
                local row = table.remove(rowPool)
                if not row then
                    row = CreateFrame("Frame", nil, charContent)
                    row:SetSize(280, 30)

                    row.icon = row:CreateTexture(nil, "ARTWORK")
                    row.icon:SetSize(30, 30)
                    row.icon:SetPoint("LEFT")

                    row.label = row:CreateFontString(nil, "OVERLAY", "GameFontNormal")
                    row.label:SetPoint("LEFT", row.icon, "RIGHT", 10, 0)

                    row.removeBtn = CreateFrame("Button", nil, row, "UIPanelButtonTemplate")
                    row.removeBtn:SetSize(60, 20)
                    row.removeBtn:SetPoint("RIGHT")
                    row.removeBtn:SetText("Remove")
                end

                row:SetPoint("TOPLEFT", 10, y)
                row.icon:SetTexture(C_Item.GetItemIconByID(itemID) or "Interface\\Icons\\INV_Misc_QuestionMark")
                local itemName = C_Item.GetItemNameByID(itemID) or ("Item " .. itemID)
                row.label:SetText(itemName)
                row.removeBtn:SetScript("OnClick", function()
                    ShiGuangPerDB.CanOpenerExcludedItems[itemID] = nil
                    RefreshCharIgnoreList()
                    CanOpenerGlobal.CanOut("已从忽略列表中移除物品 " .. itemID .. "。")
                    CanOpenerGlobal.ForceButtonRefresh()
                end)
                row:Show()

                y = y - 35
            end
        end
        RefreshCharIgnoreList()
    end
    Settings.RegisterAddOnCategory(category)
end

local buttons = {};

------------------------------------------------
-- Slash Commands
------------------------------------------------
local function toggleSavedVar(varName, description)
	ShiGuangPerDB[varName] = not ShiGuangPerDB[varName];
	CanOpenerGlobal.ForceButtonRefresh();
	CanOpenerGlobal.CanOut(": " .. description .. " " ..
		CanOpenerGlobal.PosOrNegColor(ShiGuangPerDB[varName], "will", "will not") .. " be shown");
end

local function slashHandler(msg)
	local command, rest = msg:match("^(%S*)%s*(.-)$")
	command = command:lower()

	if (command == "rousing") then
		toggleSavedVar("CanOpenerShowRousing", "Elemental Rousings");
	elseif (command == "levelrestricted") then
		toggleSavedVar("CanOpenerShowLevelRestrictedItems", "Level-Restricted Items");
	elseif (command == "lockbox") then
		toggleSavedVar("CanOpenerShowLockboxes", "Lockboxes");
	elseif (command == "single") then
		toggleSavedVar("CanOpenerShowOnlyOneButton", "Single button");
	elseif (command == "reset") then
		CanOpenerGlobal.CanOut(": Resetting settings and CanOpenerPosition.");
		CanOpenerGlobal.ResetSavedVariables();
	elseif command == "ignore" and rest then
		local itemID = tonumber(rest)
		if itemID then
			ShiGuangPerDB.CanOpenerExcludedItems[itemID] = true
			CanOpenerGlobal.CanOut(": Ignoring item ID " .. itemID)
		else
			CanOpenerGlobal.CanOut(": Invalid item ID.")
		end
	elseif command == "unignore" and rest then
		local itemID = tonumber(rest)
		if itemID and ShiGuangPerDB.CanOpenerExcludedItems[itemID] then
			ShiGuangPerDB.CanOpenerExcludedItems[itemID] = nil
			CanOpenerGlobal.CanOut(": Removed item ID " .. itemID .. " from ignore list.")
		else
			CanOpenerGlobal.CanOut(": Item ID not found in ignore list.")
		end
	elseif command == "list" then
		CanOpenerGlobal.CanOut(": Ignored Items List:")
		CanOpenerGlobal.CanOut(ShiGuangPerDB.CanOpenerExcludedItems);
	elseif CanOpenerGlobal._eventSlashCommands[command] then
		local entry = CanOpenerGlobal._eventSlashCommands[command]
		toggleSavedVar(entry.varName, entry.description);
	else
        CanOpenerGlobal.CanOut("Commands for |cffffa500/CanOpener|r :");
        local rousingState = CanOpenerGlobal.PosOrNegColor(ShiGuangPerDB.CanOpenerShowRousing, "On", "Off");
        CanOpenerGlobal.CanOut("  |cffffa500 rousing|r - Toggle showing Elemental Rousings (" .. rousingState .. ")");
        local levelRestrictedState = CanOpenerGlobal.PosOrNegColor(ShiGuangPerDB.CanOpenerShowLevelRestrictedItems, "On", "Off");
        CanOpenerGlobal.CanOut("  |cffffa500 levelrestricted|r - Toggle showing level-restricted items (" .. levelRestrictedState .. ")");
        local lockboxState = CanOpenerGlobal.PosOrNegColor(ShiGuangPerDB.CanOpenerShowLockboxes, "On", "Off");
        CanOpenerGlobal.CanOut("  |cffffa500 lockbox|r - Toggle showing lockboxes (" .. lockboxState .. ")");
		local singleButtonState = CanOpenerGlobal.PosOrNegColor(ShiGuangPerDB.CanOpenerShowOnlyOneButton, "On", "Off");
        CanOpenerGlobal.CanOut("  |cffffa500 single|r - Toggle showing single button (" .. singleButtonState .. ")");
        for cmd, entry in pairs(CanOpenerGlobal._eventSlashCommands) do
            local state = CanOpenerGlobal.PosOrNegColor(ShiGuangPerDB[entry.varName], "On", "Off");
            CanOpenerGlobal.CanOut("  |cffffa500 " .. cmd .. "|r - Toggle showing " .. entry.description .. " (" .. state .. ")");
        end
        CanOpenerGlobal.CanOut("  |cffffa500 ignore|r <itemID> - Ignore a specific item");
        CanOpenerGlobal.CanOut("  |cffffa500 unignore|r <itemID> - Remove an item from the ignore list");
        CanOpenerGlobal.CanOut("  |cffffa500 list|r - Show ignored items");
        CanOpenerGlobal.CanOut("  |cffffa500 reset|r - Reset all settings!");
    end
end

SlashCmdList.CanOpener = function(msg) slashHandler(msg) end;
SLASH_CanOpener1 = "/CanOpener";
SLASH_CanOpener2 = "/CO";

------------------------------------------------
-- Main Frame
------------------------------------------------
local frame = CreateFrame("Frame", "CanOpener_Frame", UIParent);
frame.ButtonCount = 0;
CanOpenerGlobal.Frame = frame;
--frame:ClearAllPoints();
--frame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -80, -260);

frame:Hide();
frame:SetWidth(120);
frame:SetHeight(52);
frame:SetClampedToScreen(true);
frame:SetFrameStrata("BACKGROUND");
frame:SetMovable(true);
--frame:SetUserPlaced(true);
frame:RegisterEvent("ADDON_LOADED");
frame:RegisterEvent("BAG_UPDATE");
frame:RegisterEvent("BAG_UPDATE_DELAYED");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
frame:RegisterEvent("PLAYER_LEAVING_WORLD");
frame:RegisterEvent("PLAYER_REGEN_DISABLED");
frame:RegisterEvent("PLAYER_REGEN_ENABLED");
frame:SetScript("OnEvent", function(self, event, ...)
	local eventAction = CanOpenerGlobal.Events[event];
	if (eventAction) then
		eventAction(...);
	end
end);

frame:SetScript("OnShow", function(self, event, ...)
	--Restore position
	self:ClearAllPoints();
	self:SetPoint(ShiGuangPerDB.CanOpenerPosition[1], UIParent, ShiGuangPerDB.CanOpenerPosition[2],
		ShiGuangPerDB.CanOpenerPosition[3], ShiGuangPerDB.CanOpenerPosition[4]);
end);

local function buttonOnLeave(btn)
	GameTooltip:Hide();
end

local function buttonOnEnter(btn)
	GameTooltip:SetOwner(btn, "ANCHOR_TOP");
	GameTooltip:SetItemByID(btn.itemID);
end

local function createButton(cacheDetails, id)
	local btn = CreateFrame("Button", "CanOpener_" .. id, frame, "SecureActionButtonTemplate");
	cacheDetails.button = btn;
	btn.itemID = id;

	btn:Hide();
	btn:SetWidth(52);
	btn:SetHeight(52);
	btn:SetClampedToScreen(true);
	--Right click to drag
	btn:EnableMouse(true);
	btn:RegisterForDrag("RightButton");
	btn:SetMovable(true);
	--btn:SetUserPlaced(true);
	btn:SetScript("OnDragStart", function(self) self:GetParent():StartMoving(); end);
	btn:SetScript("OnDragStop", function(self)
		self:GetParent():StopMovingOrSizing();
		self:GetParent():SetUserPlaced(false);
		local point, relativeTo, relativePoint, xOfs, yOfs = self:GetParent():GetPoint();
		ShiGuangPerDB.CanOpenerPosition = { point, relativePoint, xOfs, yOfs };
	end);
	--Setup macro
	btn:SetAttribute("type", "macro");
	btn:SetAttribute("macrotext", format("/use item:%d", id));

	btn.countString = btn:CreateFontString(btn:GetName() .. "Count", "OVERLAY", "NumberFontNormal");
	btn.countString:SetPoint("BOTTOMRIGHT", btn, -0, 2);
	btn.countString:SetJustifyH("RIGHT");
	btn.icon = btn:CreateTexture(nil, "BACKGROUND");
	btn.icon:SetTexture(C_Item.GetItemIconByID(id));
	btn.texture = btn.icon;
	btn.texture:SetAllPoints();
	btn:RegisterForClicks("LeftButtonUp", "LeftButtonDown");

	--Tooltip
	btn:SetScript("OnEnter", buttonOnEnter);
	btn:SetScript("OnLeave", buttonOnLeave);

	-- Hook a shift-right click to add the item to the per–character ignore list.
	btn:HookScript("OnMouseUp", function(self, button)
		if button == "RightButton" and IsShiftKeyDown() then
			local itemID = self.itemID
			local itemName = C_Item.GetItemNameByID(itemID);
			-- If not already ignored, add it; otherwise notify the user.
			if not ShiGuangPerDB.CanOpenerExcludedItems[itemID] then
				ShiGuangPerDB.CanOpenerExcludedItems[itemID] = true
				CanOpenerGlobal.CanOut(itemName .. IGNORED)  --" added to your ignore list."
			else
				CanOpenerGlobal.CanOut(itemName .. " is already in your ignore list.")
			end
			CanOpenerGlobal.ForceButtonRefresh()
			-- Prevent any further processing of the click.
			return
		end
	end)
end

local RefreshButtons = function()
	-- Don't do anything if we are in combat. Daddy Blizz says so.
	if (CanOpenerGlobal.LockDown) then
		return;
	end

	-- Hide all existing buttons
	for _, tbl in ipairs(buttons) do
		tbl.button:Hide();
	end
	wipe(buttons);

	-- Scan bags for openable items
	local visibleItems = {};
	local seen = {};
	for bagID = CanOpenerGlobal.BagIndicies.Backpack, CanOpenerGlobal.BagIndicies.ReagentBag, 1 do
		for slot = 1, C_Container.GetContainerNumSlots(bagID) do
			local itemID = C_Container.GetContainerItemID(bagID, slot);
			local cacheDetails = CanOpenerGlobal.openables[itemID];
			local onExcludeList = ShiGuangPerDB.CanOpenerExcludedItems[itemID] or false;
			if itemID and cacheDetails and not onExcludeList and not seen[itemID] then
				local count = C_Item.GetItemCount(itemID);
				if count > 0 and CanOpenerGlobal.CriteriaContext:evaluateAll(itemID, cacheDetails, count) then
					table.insert(visibleItems, itemID);
					seen[itemID] = true;
				end
			end
		end
	end

	-- Sort by item ID for stable ordering
	table.sort(visibleItems);

	-- Create/show buttons
	local buttonIndex = 0;
	for _, itemID in ipairs(visibleItems) do
		local cacheDetails = CanOpenerGlobal.openables[itemID];

		if not cacheDetails.button then
			createButton(cacheDetails, itemID);
		end

		local button = cacheDetails.button;
		button:ClearAllPoints();
		SetButton(button, buttonIndex, itemID);
		button:Show();

		table.insert(buttons, { button = button, itemID = itemID });

		if (ShiGuangPerDB.CanOpenerShowOnlyOneButton) then
			break;
		end

		buttonIndex = buttonIndex + 1;
	end
end
CanOpenerGlobal.RefreshButtons = RefreshButtons;

function SetButton(button, buttonIndex, itemID)
	button:SetPoint("LEFT", frame, "LEFT", buttonIndex * 52, 0);
	local count = C_Item.GetItemCount(itemID) or 0;
	button.countString:SetText(tostring(count));
	button.texture:SetDesaturated(false);
end
