# HG changeset patch # User MMOSimca # Date 1478650018 18000 # Node ID 3fee2a08fdaae27f58791e48ac83baa9df386e29 # Parent 2325dbe5c10ae49f7c10eda84c77d333ca19b58a Attempted a hacky workaround for detecting Ephemeral Crystals (English clients only). diff -r 2325dbe5c10a -r 3fee2a08fdaa Constants.lua --- a/Constants.lua Tue Nov 08 19:05:42 2016 -0500 +++ b/Constants.lua Tue Nov 08 19:06:58 2016 -0500 @@ -15,6 +15,14 @@ ----------------------------------------------------------------------- -- Boss/Loot Data Constants. ----------------------------------------------------------------------- +private.EPHEMERAL_CRYSTAL_OBJECT_IDS = { + 251168, + 251183, + 251185, + 251186, + 251187, +} + -- 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, diff -r 2325dbe5c10a -r 3fee2a08fdaa Main.lua --- a/Main.lua Tue Nov 08 19:05:42 2016 -0500 +++ b/Main.lua Tue Nov 08 19:06:58 2016 -0500 @@ -49,6 +49,10 @@ local ITEM_ID_TIMBER = 114781 +local LOOT_SLOT_CURRENCY = _G.LOOT_SLOT_CURRENCY +local LOOT_SLOT_ITEM = _G.LOOT_SLOT_ITEM +local LOOT_SLOT_MONEY = _G.LOOT_SLOT_MONEY + local LOOT_SOURCE_ID_REDUNDANT = 3 local LOOT_SOURCE_ID_GARRISON_CACHE = 10 @@ -63,9 +67,7 @@ local PLAYER_NAME = _G.UnitName("player") local PLAYER_RACE = _G.select(2, _G.UnitRace("player")) -local LOOT_SLOT_CURRENCY = _G.LOOT_SLOT_CURRENCY -local LOOT_SLOT_ITEM = _G.LOOT_SLOT_ITEM -local LOOT_SLOT_MONEY = _G.LOOT_SLOT_MONEY +local SPELL_ID_UPDATE_INTERACTIONS = 161006 local WORLD_MAP_ID_BROKEN_ISLES = 1007 @@ -3010,6 +3012,14 @@ return end + -- For Ephemeral Crystals (uses a combination of mouseover text and a 'Update Interactions' spell cast to detect the object - this is incredibly hacky but there is no alternative) + local text = _G["GameTooltipTextLeft1"] and _G["GameTooltipTextLeft1"]:GetText() or nil + if spell_id == SPELL_ID_UPDATE_INTERACTIONS and text and text == "Ephemeral Crystal" then + for index = 1, #private.EPHEMERAL_CRYSTAL_OBJECT_IDS do + UpdateDBEntryLocation("objects", private.EPHEMERAL_CRYSTAL_OBJECT_IDS[index]) + end + end + if anvil_spell_ids[spell_id] then UpdateDBEntryLocation("objects", OBJECT_ID_ANVIL) elseif forge_spell_ids[spell_id] then