changeset 381:cc4a579b26d1

Assorted code cleanup and reorganization.
author MMOSimca <MMOSimca@gmail.com>
date Wed, 10 Dec 2014 12:47:35 -0500
parents 97824a39ddd3
children 8d63f8348496
files Constants.lua Main.lua
diffstat 2 files changed, 210 insertions(+), 223 deletions(-) [+]
line wrap: on
line diff
--- a/Constants.lua	Tue Dec 09 21:04:11 2014 -0500
+++ b/Constants.lua	Wed Dec 10 12:47:35 2014 -0500
@@ -13,26 +13,19 @@
 
 
 -----------------------------------------------------------------------
--- Game Data Constants.
+-- Boss/Loot Data Constants.
 -----------------------------------------------------------------------
 -- Map of Alliance Logging NPC Summon spells to all possible Timber objectIDs of the proper tree size
 private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP = {
-    [167902] = 234021, --{ 233604, 233922, , 234080, 234097, 234109, 234110, 234122, 234126, 234193, 234197, 237727, },
-    [167969] = 234022, --{ 233634, 234000, , 234098, 234111, 234119, 234123, 234127, 234194, 234196, 234198, },
-    [168201] = 234023, --{ 233625, 234007, , 234099, 234120, 234124, 234128, 234195, 234199, },
+    [167902] = 234021,
+    [167969] = 234022,
+    [168201] = 234023,
 }
 -- Account for Horde spell IDs
 private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[167961] = private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[167902]
 private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[168043] = private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[167969]
 private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[168200] = private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[168201]
 
--- Map of Salvage spells to item IDs of the Salvage containers (no longer loot toasts)
-private.SALVAGE_SPELL_ID_TO_ITEM_ID_MAP = {
-    [168178] = 114116, -- Bag of Salvaged Goods
-    [168179] = 114119, -- Crate of Salvage
-    [168180] = 114120, -- Big Crate of Salvage
-}
-
 -- Map of Garrison Cache object names to Garrison Cache object IDs
 private.GARRISON_CACHE_OBJECT_NAME_TO_OBJECT_ID_MAP = {
     ["Garrison Cache"] = 236916,
@@ -41,7 +34,10 @@
 }
 private.GARRISON_CACHE_LOOT_SOURCE_ID = 10
 
-private.LOOT_SPELL_ID_TO_ITEM_ID_MAP = {
+-- Mapping of items that, when right-clicked, fire a spell (which can fail, so we have to check success).
+-- They reward loot via loot toast popups upon completion of that spell.
+-- SHOW_LOOT_TOAST can be used to track loot.
+private.LOOT_TOAST_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP = {
     [142397] = 98134, -- Heroic Cache of Treasures
     [142901] = 98546, -- Bulging Heroic Cache of Treasures
     [143506] = 98095, -- Brawler's Pet Supplies
@@ -55,14 +51,193 @@
     [147598] = 104014, -- Pouch of Timeless Coins
     [149222] = 105911, -- Pouch of Enduring Wisdom
     [149223] = 105912, -- Oversized Pouch of Enduring Wisdom
-    --[168178] = 114116, -- Bag of Salvaged Goods
-    --[168179] = 114119, -- Crate of Salvage
-    --[168180] = 114120, -- Big Crate of Salvage
     [171513] = 116414, -- Pet Supplies
     [175767] = 118697, -- Big Bag of Pet Supplies
     [178508] = 120321, -- Mystery Bag
 }
 
+-- Mapping of items that, when right-clicked, fire a spell (which can fail, so we have to check success).
+-- They reward loot upon completion of that spell.
+-- CHAT_MSG_LOOT -must- be used to track loot, which is definitely not ideal.
+private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP = {
+    [168178] = 114116, -- Bag of Salvaged Goods
+    [168179] = 114119, -- Crate of Salvage
+    [168180] = 114120, -- Big Crate of Salvage
+}
+
+private.RAID_BOSS_BONUS_SPELL_ID_TO_NPC_ID_MAP = {
+    -----------------------------------------------------------------------
+    -- World Bosses
+    -----------------------------------------------------------------------
+    [132205] = 60491, -- Sha of Anger Bonus (Sha of Anger)
+    [132206] = 62346, -- Galleon Bonus (Galleon)
+    [136381] = 69099, -- Nalak Bonus (Nalak)
+    [137554] = 69161, -- Oondasta Bonus (Oondasta)
+    [148317] = 71952, -- Celestials Bonus (Chi-Ji)
+    [148316] = 72057, -- Ordos Bonus (Ordos)
+    [178848] = 81252, -- Drov the Ruiner Bonus Loot (Drov the Ruiner)
+    [178850] = 81535, -- Tarlna the Ageless Bonus Loot (Tarlna the Ageless)
+    [178852] = 83746, -- Rukhmar Bonus Loot (Rukhmar)
+
+    -----------------------------------------------------------------------
+    -- Blackrock Foundry
+    -----------------------------------------------------------------------
+    [177510] = 76877, -- Gruul Bonus Loot (Gruul)
+    [177511] = 77182, -- Oregorger Bonus Loot (Oregorger)
+    [177512] = 76809, -- Blast Furnace Loot (Foreman Feldspar)
+    [177513] = 76973, -- Hans'gar & Franzok Bonus Loot (Hans'gar)
+    [177515] = 76814, -- Flamebender Ka'graz Bonus Loot (Flamebender Ka'graz)
+    [177516] = 77692, -- Kromog Bonus Loot (Kromog)
+    [177517] = 76865, -- Beastlord Darmac Bonus Loot (Beastlord Darmac)
+    [177518] = 76906, -- Operator Thogar Bonus Loot (Operator Thogar)
+    [177519] = 77557, -- The Iron Maidens Bonus Loot (Admiral Gar'an)
+    [177520] = 77325, -- Blackhand Bonus Loot (Blackhand)
+
+    -----------------------------------------------------------------------
+    -- Highmaul
+    -----------------------------------------------------------------------
+    [177503] = 78714, -- Kargath Bladefist Bonus Loot (Kargath Bladefist)
+    [177504] = 77404, -- Butcher Bonus Loot (The Butcher)
+    [177505] = 78948, -- Tectus Bonus Loot (Tectus)
+    [177506] = 78491, -- Brackenspore Bonus Loot (Brackenspore)
+    [177507] = 78237, -- Twin Ogron Bonus Loot (Phemos)
+    [177508] = 79015, -- Ko'ragh Bonus Loot (Ko'ragh)
+    [177509] = 77428, -- Imperator Mar'gok Bonus Loot (Imperator Mar'gok)
+
+    -----------------------------------------------------------------------
+    -- Mists of Pandaria
+    -----------------------------------------------------------------------
+    [125144] = 59915, -- Stone Guard Bonus (Jasper Guardian)
+    [132189] = 60009, -- Feng the Accursed Bonus (Feng the Accursed)
+    [132190] = 60143, -- Gara'jal the Spiritbinder Bonus (Gara'jal the Spiritbinder)
+    [132191] = 60709, -- Spirit Kings Bonus (Qiang the Merciless)
+    [132192] = 60410, -- Elegon Bonus (Elegon)
+    [132193] = 60399, -- Will of the Emperor Bonus (Qin-xi)
+    [132200] = 60583, -- Protectors of the Endless Bonus (Protector Kaolan)
+    [132204] = 60583, -- Protectors of the Endless (Elite) Bonus (Protector Kaolan)
+    [132201] = 62442, -- Tsulong Bonus (Tsulong)
+    [132202] = 62983, -- Lei Shi Bonus (Lei Shi)
+    [132203] = 60999, -- Sha of Fear Bonus (Sha of Fear)
+    [132194] = 62980, -- Imperial Vizier Zor'lok Bonus (Imperial Vizier Zor'lok)
+    [132195] = 62543, -- Blade Lord Tay'ak Bonus (Blade Lord Ta'yak)
+    [132196] = 62164, -- Garalon Bonus (Garalon)
+    [132197] = 62397, -- Wind Lord Mel'jarak Bonus (Wind Lord Mel'jarak)
+    [132198] = 62511, -- Amber-Shaper Un'sok Bonus (Amber-Shaper Un'sok)
+    [132199] = 62837, -- Grand Empress Shek'zeer Bonus (Grand Empress Shek'zeer)
+    [139674] = 69465, -- Jin'rokh the Breaker Bonus (Jin'rokh the Breaker)
+    [139677] = 68476, -- Horridon Bonus (Horridon)
+    [139679] = 69078, -- Zandalari Troll Council Bonus (Sul the Sandcrawler)
+    [139680] = 67977, -- Tortos Bonus (Tortos)
+    [139682] = 68065, -- Magaera Bonus (Megaera)
+    [139684] = 69712, -- Ji'kun, the Ancient Mother Bonus (Ji-Kun)
+    [139686] = 68036, -- Durumu the Forgotten Bonus (Durumu the Forgotten)
+    [139687] = 69017, -- Primordious Bonus (Primordius)
+    [139688] = 69427, -- Dark Animus Bonus (Dark Animus)
+    [139689] = 68078, -- Iron Qon Bonus (Iron Qon)
+    [139690] = 68904, -- The Empyreal Queens Bonus (Suen)
+    [139691] = 68397, -- Lei Shen, The Thunder King Bonus (Lei Shen)
+    [139692] = 69473, -- Ra-den Bonus (Ra-den)
+    [145909] = 71543, -- Immerseus Bonus (Immerseus)
+    [145910] = 71475, -- Fallen Protectors Bonus (Rook Stonetoe)
+    [145911] = 72276, -- Norushen Bonus (Amalgam of Corruption)
+    [145912] = 71734, -- Sha of Pride Bonus (Sha of Pride)
+    [145913] = 72249, -- Galakras Bonus (Galakras)
+    [145914] = 71466, -- Iron Juggernaut Bonus (Iron Juggernaut)
+    [145915] = 71859, -- Dark Shaman Bonus (Earthbreaker Haromm)
+    [145916] = 71515, -- General Nazgrim Bonus (General Nazgrim)
+    [145917] = 71454, -- Malkorok Bonus (Malkorok)
+    [145919] = 71889, -- Spoils of Pandaria Bonus (Secured Stockpile of Pandaren Spoils)
+    [145920] = 71529, -- Thok the Bloodthirsty Bonus (Thok the Bloodthirsty)
+    [145918] = 71504, -- Siegecrafter Blackfuse Bonus (Siegecrafter Blackfuse)
+    [145921] = 71161, -- Klaxxi Paragons Bonus (Kil'ruk the Wind-Reaver)
+    [145922] = 71865, -- Garrosh Hellscream Bonus (Garrosh Hellscream)
+}
+
+
+-----------------------------------------------------------------------
+-- Fundamental Constants.
+-----------------------------------------------------------------------
+private.wow_version, private.build_num = _G.GetBuildInfo()
+private.region = GetCVar("portal"):sub(0,2):upper()
+-- PTR/Beta return "public-test", but they are properly called "XX"
+if private.region == "PU" then private.region = "XX" end
+
+private.UNIT_TYPES = {
+    PLAYER = "Player",
+    OBJECT = "GameObject",
+    UNKNOWN = "Unknown",
+    NPC = "Creature",
+    PET = "Pet",
+    VEHICLE = "Vehicle",
+    ITEM = "Item",
+}
+
+private.UNIT_TYPE_NAMES = {
+    ["Player"] = "PLAYER",
+    ["GameObject"] = "OBJECT",
+    ["Unknown"] = "UNKNOWN",
+    ["Creature"] = "NPC",
+    ["Pet"] = "PET",
+    ["Vehicle"] = "VEHICLE",
+    ["Item"] = "ITEM",
+}
+
+private.ACTION_TYPE_FLAGS = {
+    ITEM = 0x00000001,
+    NPC = 0x00000002,
+    OBJECT = 0x00000004,
+    ZONE = 0x00000008,
+}
+
+private.ACTION_TYPE_NAMES = {}
+
+for name, bit in _G.pairs(private.ACTION_TYPE_FLAGS) do
+    private.ACTION_TYPE_NAMES[bit] = name
+end
+
+private.SPELL_LABELS_BY_NAME = {
+    [_G.GetSpellInfo(13262)] = "DISENCHANT",
+    [_G.GetSpellInfo(4036)] = "ENGINEERING",
+    [_G.GetSpellInfo(30427)] = "EXTRACT_GAS",
+    [_G.GetSpellInfo(131476)] = "FISHING",
+    [_G.GetSpellInfo(2366)] = "HERB_GATHERING",
+    [_G.GetSpellInfo(51005)] = "MILLING",
+    [_G.GetSpellInfo(605)] = "MIND_CONTROL",
+    [_G.GetSpellInfo(2575)] = "MINING",
+    [_G.GetSpellInfo(3365)] = "OPENING",
+    [_G.GetSpellInfo(921)] = "PICK_POCKET",
+    [_G.GetSpellInfo(31252)] = "PROSPECTING",
+    [_G.GetSpellInfo(73979)] = "SEARCHING_FOR_ARTIFACTS",
+    [_G.GetSpellInfo(8613)] = "SKINNING",
+}
+
+private.NON_LOOT_SPELL_LABELS = {
+    MIND_CONTROL = true,
+}
+
+local AF = private.ACTION_TYPE_FLAGS
+
+private.SPELL_FLAGS_BY_LABEL = {
+    DISENCHANT = AF.ITEM,
+    ENGINEERING = AF.NPC,
+    EXTRACT_GAS = AF.ZONE,
+    FISHING = AF.ZONE,
+    HERB_GATHERING = bit.bor(AF.NPC, AF.OBJECT),
+    MILLING = AF.ITEM,
+    MIND_CONTROL = AF.NPC,
+    MINING = bit.bor(AF.NPC, AF.OBJECT),
+    OPENING = AF.OBJECT,
+    PICK_POCKET = AF.NPC,
+    PROSPECTING = AF.ITEM,
+    SEARCHING_FOR_ARTIFACTS = AF.OBJECT,
+    SKINNING = AF.NPC,
+}
+
+
+-----------------------------------------------------------------------
+-- Faction/Reputation Data Constants.
+-----------------------------------------------------------------------
+
 private.FACTION_DATA = {
     -- Used only for private.REP_BUFFS
     ARGENT_CRUSADE = { 1106, _G.GetFactionInfoByID(1106) },
@@ -277,187 +452,3 @@
         modifier = 0.1,
     },
 }
-
-private.RAID_BOSS_BONUS_SPELL_ID_TO_NPC_ID_MAP = {
-    -----------------------------------------------------------------------
-    -- World Bosses
-    -----------------------------------------------------------------------
-    [132205] = 60491, -- Sha of Anger Bonus (Sha of Anger)
-    [132206] = 62346, -- Galleon Bonus (Galleon)
-    [136381] = 69099, -- Nalak Bonus (Nalak)
-    [137554] = 69161, -- Oondasta Bonus (Oondasta)
-    [148317] = 71952, -- Celestials Bonus (Chi-Ji)
-    [148316] = 72057, -- Ordos Bonus (Ordos)
-    [178848] = 81252, -- Drov the Ruiner Bonus Loot (Drov the Ruiner)
-    [178850] = 81535, -- Tarlna the Ageless Bonus Loot (Tarlna the Ageless)
-    [178852] = 83746, -- Rukhmar Bonus Loot (Rukhmar)
-
-    -----------------------------------------------------------------------
-    -- Mogu'shan Vaults
-    -----------------------------------------------------------------------
-    [125144] = 59915, -- Stone Guard Bonus (Jasper Guardian)
-    [132189] = 60009, -- Feng the Accursed Bonus (Feng the Accursed)
-    [132190] = 60143, -- Gara'jal the Spiritbinder Bonus (Gara'jal the Spiritbinder)
-    [132191] = 60709, -- Spirit Kings Bonus (Qiang the Merciless)
-    [132192] = 60410, -- Elegon Bonus (Elegon)
-    [132193] = 60399, -- Will of the Emperor Bonus (Qin-xi)
-
-    -----------------------------------------------------------------------
-    -- Terrace of Endless Spring
-    -----------------------------------------------------------------------
-    [132200] = 60583, -- Protectors of the Endless Bonus (Protector Kaolan)
-    [132204] = 60583, -- Protectors of the Endless (Elite) Bonus (Protector Kaolan)
-    [132201] = 62442, -- Tsulong Bonus (Tsulong)
-    [132202] = 62983, -- Lei Shi Bonus (Lei Shi)
-    [132203] = 60999, -- Sha of Fear Bonus (Sha of Fear)
-
-    -----------------------------------------------------------------------
-    -- Heart of Fear
-    -----------------------------------------------------------------------
-    [132194] = 62980, -- Imperial Vizier Zor'lok Bonus (Imperial Vizier Zor'lok)
-    [132195] = 62543, -- Blade Lord Tay'ak Bonus (Blade Lord Ta'yak)
-    [132196] = 62164, -- Garalon Bonus (Garalon)
-    [132197] = 62397, -- Wind Lord Mel'jarak Bonus (Wind Lord Mel'jarak)
-    [132198] = 62511, -- Amber-Shaper Un'sok Bonus (Amber-Shaper Un'sok)
-    [132199] = 62837, -- Grand Empress Shek'zeer Bonus (Grand Empress Shek'zeer)
-
-    -----------------------------------------------------------------------
-    -- Throne of Thunder
-    -----------------------------------------------------------------------
-    [139674] = 69465, -- Jin'rokh the Breaker Bonus (Jin'rokh the Breaker)
-    [139677] = 68476, -- Horridon Bonus (Horridon)
-    [139679] = 69078, -- Zandalari Troll Council Bonus (Sul the Sandcrawler)
-    [139680] = 67977, -- Tortos Bonus (Tortos)
-    [139682] = 68065, -- Magaera Bonus (Megaera)
-    [139684] = 69712, -- Ji'kun, the Ancient Mother Bonus (Ji-Kun)
-    [139686] = 68036, -- Durumu the Forgotten Bonus (Durumu the Forgotten)
-    [139687] = 69017, -- Primordious Bonus (Primordius)
-    [139688] = 69427, -- Dark Animus Bonus (Dark Animus)
-    [139689] = 68078, -- Iron Qon Bonus (Iron Qon)
-    [139690] = 68904, -- The Empyreal Queens Bonus (Suen)
-    [139691] = 68397, -- Lei Shen, The Thunder King Bonus (Lei Shen)
-    [139692] = 69473, -- Ra-den Bonus (Ra-den)
-
-    -----------------------------------------------------------------------
-    -- Siege of Orgrimmar
-    -----------------------------------------------------------------------
-    [145909] = 71543, -- Immerseus Bonus (Immerseus)
-    [145910] = 71475, -- Fallen Protectors Bonus (Rook Stonetoe)
-    [145911] = 72276, -- Norushen Bonus (Amalgam of Corruption)
-    [145912] = 71734, -- Sha of Pride Bonus (Sha of Pride)
-    [145913] = 72249, -- Galakras Bonus (Galakras)
-    [145914] = 71466, -- Iron Juggernaut Bonus (Iron Juggernaut)
-    [145915] = 71859, -- Dark Shaman Bonus (Earthbreaker Haromm)
-    [145916] = 71515, -- General Nazgrim Bonus (General Nazgrim)
-    [145917] = 71454, -- Malkorok Bonus (Malkorok)
-    [145919] = 71889, -- Spoils of Pandaria Bonus (Secured Stockpile of Pandaren Spoils)
-    [145920] = 71529, -- Thok the Bloodthirsty Bonus (Thok the Bloodthirsty)
-    [145918] = 71504, -- Siegecrafter Blackfuse Bonus (Siegecrafter Blackfuse)
-    [145921] = 71161, -- Klaxxi Paragons Bonus (Kil'ruk the Wind-Reaver)
-    [145922] = 71865, -- Garrosh Hellscream Bonus (Garrosh Hellscream)
-
-    -----------------------------------------------------------------------
-    -- Blackrock Foundry
-    -----------------------------------------------------------------------
-    [177510] = 76877, -- Gruul Bonus Loot (Gruul)
-    [177511] = 77182, -- Oregorger Bonus Loot (Oregorger)
-    [177512] = 76809, -- Blast Furnace Loot (Foreman Feldspar)
-    [177513] = 76973, -- Hans'gar & Franzok Bonus Loot (Hans'gar)
-    [177515] = 76814, -- Flamebender Ka'graz Bonus Loot (Flamebender Ka'graz)
-    [177516] = 77692, -- Kromog Bonus Loot (Kromog)
-    [177517] = 76865, -- Beastlord Darmac Bonus Loot (Beastlord Darmac)
-    [177518] = 76906, -- Operator Thogar Bonus Loot (Operator Thogar)
-    [177519] = 77557, -- The Iron Maidens Bonus Loot (Admiral Gar'an)
-    [177520] = 77325, -- Blackhand Bonus Loot (Blackhand)
-
-    -----------------------------------------------------------------------
-    -- Highmaul
-    -----------------------------------------------------------------------
-    [177503] = 78714, -- Kargath Bladefist Bonus Loot (Kargath Bladefist)
-    [177504] = 77404, -- Butcher Bonus Loot (The Butcher)
-    [177505] = 78948, -- Tectus Bonus Loot (Tectus)
-    [177506] = 78491, -- Brackenspore Bonus Loot (Brackenspore)
-    [177507] = 78237, -- Twin Ogron Bonus Loot (Phemos)
-    [177508] = 79015, -- Ko'ragh Bonus Loot (Ko'ragh)
-    [177509] = 77428, -- Imperator Mar'gok Bonus Loot (Imperator Mar'gok)
-}
-
-
------------------------------------------------------------------------
--- Fundamental Constants.
------------------------------------------------------------------------
-private.wow_version, private.build_num = _G.GetBuildInfo()
-private.region = GetCVar("portal"):sub(0,2):upper()
--- PTR/Beta return "public-test", but they are properly called "XX"
-if private.region == "PU" then private.region = "XX" end
-
-private.UNIT_TYPES = {
-    PLAYER = "Player",
-    OBJECT = "GameObject",
-    UNKNOWN = "Unknown",
-    NPC = "Creature",
-    PET = "Pet",
-    VEHICLE = "Vehicle",
-    ITEM = "Item",
-}
-
-private.UNIT_TYPE_NAMES = {
-    ["Player"] = "PLAYER",
-    ["GameObject"] = "OBJECT",
-    ["Unknown"] = "UNKNOWN",
-    ["Creature"] = "NPC",
-    ["Pet"] = "PET",
-    ["Vehicle"] = "VEHICLE",
-    ["Item"] = "ITEM",
-}
-
-private.ACTION_TYPE_FLAGS = {
-    ITEM = 0x00000001,
-    NPC = 0x00000002,
-    OBJECT = 0x00000004,
-    ZONE = 0x00000008,
-}
-
-private.ACTION_TYPE_NAMES = {}
-
-for name, bit in _G.pairs(private.ACTION_TYPE_FLAGS) do
-    private.ACTION_TYPE_NAMES[bit] = name
-end
-
-private.SPELL_LABELS_BY_NAME = {
-    [_G.GetSpellInfo(13262)] = "DISENCHANT",
-    [_G.GetSpellInfo(4036)] = "ENGINEERING",
-    [_G.GetSpellInfo(30427)] = "EXTRACT_GAS",
-    [_G.GetSpellInfo(131476)] = "FISHING",
-    [_G.GetSpellInfo(2366)] = "HERB_GATHERING",
-    [_G.GetSpellInfo(51005)] = "MILLING",
-    [_G.GetSpellInfo(605)] = "MIND_CONTROL",
-    [_G.GetSpellInfo(2575)] = "MINING",
-    [_G.GetSpellInfo(3365)] = "OPENING",
-    [_G.GetSpellInfo(921)] = "PICK_POCKET",
-    [_G.GetSpellInfo(31252)] = "PROSPECTING",
-    [_G.GetSpellInfo(73979)] = "SEARCHING_FOR_ARTIFACTS",
-    [_G.GetSpellInfo(8613)] = "SKINNING",
-}
-
-private.NON_LOOT_SPELL_LABELS = {
-    MIND_CONTROL = true,
-}
-
-local AF = private.ACTION_TYPE_FLAGS
-
-private.SPELL_FLAGS_BY_LABEL = {
-    DISENCHANT = AF.ITEM,
-    ENGINEERING = AF.NPC,
-    EXTRACT_GAS = AF.ZONE,
-    FISHING = AF.ZONE,
-    HERB_GATHERING = bit.bor(AF.NPC, AF.OBJECT),
-    MILLING = AF.ITEM,
-    MIND_CONTROL = AF.NPC,
-    MINING = bit.bor(AF.NPC, AF.OBJECT),
-    OPENING = AF.OBJECT,
-    PICK_POCKET = AF.NPC,
-    PROSPECTING = AF.ITEM,
-    SEARCHING_FOR_ARTIFACTS = AF.OBJECT,
-    SKINNING = AF.NPC,
-}
--- a/Main.lua	Tue Dec 09 21:04:11 2014 -0500
+++ b/Main.lua	Wed Dec 10 12:47:35 2014 -0500
@@ -59,9 +59,9 @@
 local DISGUISE_SPELL_ID = 121308
 
 -- For timer-based loot gathering of abnormal containers (that don't use SHOW_LOOT_TOAST, sadly)
-local BAG_OF_SALVAGE_ITEM_ID = private.SALVAGE_SPELL_ID_TO_ITEM_ID_MAP[168178]
-local CRATE_OF_SALVAGE_ITEM_ID = private.SALVAGE_SPELL_ID_TO_ITEM_ID_MAP[168179]
-local BIG_CRATE_OF_SALVAGE_ITEM_ID = private.SALVAGE_SPELL_ID_TO_ITEM_ID_MAP[168180]
+local BAG_OF_SALVAGE_ITEM_ID = private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[168178]
+local CRATE_OF_SALVAGE_ITEM_ID = private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[168179]
+local BIG_CRATE_OF_SALVAGE_ITEM_ID = private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[168180]
 
 -- Constant for duplicate boss data; a dirty hack to get around world bosses that cannot be identified individually and cannot be linked on wowdb because they are not in a raid
 local DUPLICATE_WORLD_BOSS_IDS = {
@@ -1448,21 +1448,19 @@
         end,
         [AF.OBJECT] = function(item_id, quantity)
             Debug("CHAT_MSG_LOOT: AF.OBJECT %d (%d)", item_id, quantity)
-            --for timber_variant = 1, #private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id] do
-                -- Check for top level object data
-                local object_entry = DBEntry("objects", ("OPENING:%s"):format(private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id]))
-                local difficulty_token = InstanceDifficultyToken()
-                if object_entry[difficulty_token] then
-                    -- Increment loot count
-                    object_entry[difficulty_token]["opening_count"] = (object_entry[difficulty_token]["opening_count"] or 0) + 1
-
-                    -- Add drop data
-                    object_entry[difficulty_token]["opening"] = object_entry[difficulty_token]["opening"] or {}
-                    table.insert(object_entry[difficulty_token]["opening"], ("%d:%d"):format(item_id, quantity))
-                else
-                    Debug("CHAT_MSG_LOOT: When handling timber, the top level loot data was missing for objectID %s.", private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id])
-                end
-            --end
+            -- Check for top level object data
+            local object_entry = DBEntry("objects", ("OPENING:%s"):format(private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id]))
+            local difficulty_token = InstanceDifficultyToken()
+            if object_entry[difficulty_token] then
+                -- Increment loot count
+                object_entry[difficulty_token]["opening_count"] = (object_entry[difficulty_token]["opening_count"] or 0) + 1
+
+                -- Add drop data
+                object_entry[difficulty_token]["opening"] = object_entry[difficulty_token]["opening"] or {}
+                table.insert(object_entry[difficulty_token]["opening"], ("%d:%d"):format(item_id, quantity))
+            else
+                Debug("CHAT_MSG_LOOT: When handling timber, the top level data was missing for objectID %s.", private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[last_timber_spell_id])
+            end
         end,
         [AF.ZONE] = function(item_id, quantity)
             Debug("CHAT_MSG_LOOT: AF.ZONE %d (%d)", item_id, quantity)
@@ -2674,10 +2672,6 @@
                     elseif loot_type == "currency" then
                         local currency_texture = CurrencyLinkToTexture(hyperlink)
                         Debug("%s: Assigned stored currency loot data - %s - currency:%d:%s", event_name, hyperlink, currency_texture, quantity)
-                        -- Workaround for Patch 5.4.0 bug with Flexible raid Siege of Orgrimmar bosses and Valor Points
-                        if quantity > 1000 and currency_texture == "pvecurrency-valor" then
-                            quantity = math.floor(quantity / 100)
-                        end
                         table.insert(encounter_data[loot_label], ("currency:%d:%s"):format(quantity, currency_texture))
                     end
                 end
@@ -2708,25 +2702,23 @@
     -- Handle Logging spell casts
     if private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[spell_id] then
         last_timber_spell_id = spell_id
-        --for timber_variant = 1, #private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[spell_id] do
         UpdateDBEntryLocation("objects", ("OPENING:%s"):format(private.LOGGING_SPELL_ID_TO_OBJECT_ID_MAP[spell_id]))
-        --end
         return
     end
 
     -- Handle Loot Toast spell casts
-    if private.LOOT_SPELL_ID_TO_ITEM_ID_MAP[spell_id] then
+    if private.LOOT_TOAST_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[spell_id] then
         ClearKilledBossID()
         ClearLootToastContainerID()
         ClearLootToastData()
 
-        private.loot_toast_container_id = private.LOOT_SPELL_ID_TO_ITEM_ID_MAP[spell_id]
+        private.loot_toast_container_id = private.LOOT_TOAST_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[spell_id]
         loot_toast_container_timer_handle = WDP:ScheduleTimer(ClearLootToastContainerID, 1) -- we need to assign a handle here to cancel it later
         return
     end
 
     -- For Crates of Salvage (and potentially other items based on spell casts in the future which need manual handling)
-    if private.SALVAGE_SPELL_ID_TO_ITEM_ID_MAP[spell_id] then
+    if private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[spell_id] then
         -- Set up timer
         Debug("%s: Beginning Salvage loot timer for spellID %d", event_name, spell_id)
         chat_loot_timer_handle = WDP:ScheduleTimer(ClearTimeBasedLootData, 1)
@@ -2735,7 +2727,7 @@
         table.wipe(current_action)
         current_loot = nil
         current_action.target_type = AF.ITEM
-        current_action.identifier = private.SALVAGE_SPELL_ID_TO_ITEM_ID_MAP[spell_id]
+        current_action.identifier = private.DELAYED_CONTAINER_SPELL_ID_TO_ITEM_ID_MAP[spell_id]
         current_action.loot_label = "contains"
         InitializeCurrentLoot()
         return