Commit a71f6f24 authored by Ivaria's avatar Ivaria

Fix tracking of Priest 'Spirit Shell' absorb amount

parent d5c1ca97
......@@ -476,6 +476,7 @@ end
local VUHDO_IGNORE_HOT_IDS = {
[67358] = true, -- "Rejuvenating" proc has same name in russian and spanish as rejuvenation
[126921] = true, -- "Weakened Soul" by Shao-Tien Soul-Render
[109964] = true, -- "Spirit Shell" ability aura has the same name as the absorb aura itself
}
......
......@@ -479,6 +479,13 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
if (VUHDO_RAID or tEmptyRaid)[anArg1] then -- auch target, focus
VUHDO_updateBouquetsForEvent(anArg1, 36); -- VUHDO_UPDATE_SHIELD
VUHDO_updateShieldBar(anArg1);
-- 9.0.1 added Priest 'Spirit Shell' which does not fire SPELL_AURA__REFRESH events as normal
-- instead use this event handler to track the 'Spirit Shell' absorb amount
if VUHDO_getShieldPerc(anArg1, VUHDO_SPELL_ID.SPIRIT_SHELL) > 0 then
-- 114908 is the spell ID of the 'Spirit Shell' absorb aura
VUHDO_updateShield(anArg1, 114908);
end
end
elseif "UNIT_SPELLCAST_SUCCEEDED" == anEvent then
......
......@@ -14,7 +14,7 @@ local VUHDO_SHIELDS = {
[1463] = 8, -- Incanter's Ward (mage talent)
[114893] = 10, -- Stone Bulwark Totem (shaman talent)
[187805] = 15, -- VUHDO_SPELL_ID.BUFF_ETHERALUS
[109964] = 15, -- VUHDO_SPELL_ID.SPIRIT_SHELL
[114908] = 15, -- VUHDO_SPELL_ID.SPIRIT_SHELL
}
......@@ -148,7 +148,7 @@ end
--
local function VUHDO_updateShieldValue(aUnit, aShieldName, anAmount, aDuration)
local function VUHDO_updateShieldValue(aUnit, aShieldName, anAmount, aDuration, aExpirationTime)
if not VUHDO_SHIELD_SIZE[aUnit][aShieldName] then
--VUHDO_xMsg("ERROR: Failed to update shield " .. aShieldName .. " on " .. aUnit);
return;
......@@ -159,10 +159,13 @@ local function VUHDO_updateShieldValue(aUnit, aShieldName, anAmount, aDuration)
return;
end
if aDuration then
if aDuration then
VUHDO_SHIELD_EXPIRY[aUnit][aShieldName] = GetTime() + aDuration;
VUHDO_SHIELD_SIZE[aUnit][aShieldName] = anAmount;
--VUHDO_xMsg("Shield overwritten");
elseif (aExpirationTime or 0) > VUHDO_SHIELD_EXPIRY[aUnit][aShieldName] then
VUHDO_SHIELD_EXPIRY[aUnit][aShieldName] = aExpirationTime;
elseif VUHDO_SHIELD_SIZE[aUnit][aShieldName] < anAmount then
VUHDO_SHIELD_SIZE[aUnit][aShieldName] = anAmount;
end
......@@ -221,21 +224,32 @@ end
--
local tExpirationTime;
local tRemain;
local tSpellName;
function VUHDO_updateShield(aUnit, aSpellId)
tSpellName, _, _, _, _, tExpirationTime, _, _, _, _, _, _, _, _, _, tRemain = VUHDO_unitBuff(aUnit, aSpellId);
if tRemain and "number" == type(tRemain) then
if tRemain > 0 then
VUHDO_updateShieldValue(aUnit, tSpellName, tRemain, nil, tExpirationTime);
else
VUHDO_removeShield(aUnit, tSpellName);
end
end
end
--
local function VUHDO_updateShields(aUnit)
for tSpellId, _ in pairs(VUHDO_SHIELDS) do
tSpellName = select(1, GetSpellInfo(tSpellId));
tRemain = select(16, VUHDO_unitBuff(aUnit, tSpellName));
if tRemain and "number" == type(tRemain) then
if tRemain > 0 then
VUHDO_updateShieldValue(aUnit, tSpellName, tRemain, nil);
else
VUHDO_removeShield(aUnit, tSpellName);
end
end
VUHDO_updateShield(aUnit, tSpellId);
end
end
......@@ -286,7 +300,7 @@ function VUHDO_parseCombatLogShieldAbsorb(aMessage, aSrcGuid, aDstGuid, aShieldN
--VUHDO_Msg(aSpellId);
--[[if ("SPELL_AURA_APPLIED" == aMessage) then
VUHDO_xMsg(aShieldName, aSpellId);
VUHDO_xMsg(aShieldName, aSpellId);
end]]
if VUHDO_SHIELDS[aSpellId] then
......@@ -319,7 +333,7 @@ function VUHDO_parseCombatLogShieldAbsorb(aMessage, aSrcGuid, aDstGuid, aShieldN
and (tonumber(anAbsorbAmount) or 0) > 0 then
tShieldName = VUHDO_DEBUFF_SHIELDS[tUnit];
tDelta = VUHDO_getShieldLeftAmount(tUnit, tShieldName) - anAbsorbAmount;
VUHDO_updateShieldValue(tUnit, tShieldName, tDelta, nil);
VUHDO_updateShieldValue(tUnit, tShieldName, tDelta);
elseif "UNIT_DIED" == aMessage then
VUHDO_SHIELD_SIZE[tUnit] = nil;
VUHDO_SHIELD_LEFT[tUnit] = nil;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment