Skip to content

Commit

Permalink
[KA] Hided Ichor Eruption timer in case boss was pushed before
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryDragon committed Nov 8, 2021
1 parent 517e57e commit 3fd808d
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions TrialKynesAegis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ local function dbg() end

local data = {}

-- Storing Lord Falgravn's Ichor Eruption timers to be able to cancel them in case effect will fade out earlier
local ichorEruption = {
callId = nil,
countdownId = nil,
}

function RaidNotifier.KA.Initialize()
p = RaidNotifier.p
dbg = RaidNotifier.dbg
Expand Down Expand Up @@ -101,10 +107,30 @@ function RaidNotifier.KA.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
if (settings.falgravn_ichor_eruption) then
local countdownTime = math.min(settings.falgravn_ichor_eruption_time_before * 1000, hitValue);

zo_callLater(function()
self:StartCountdown(countdownTime, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_ICHOR_ERUPTION), "kynesAegis", "falgravn_ichor_eruption", false)
ichorEruption.callId = zo_callLater(function()
-- Theoretically this function shouldn't be called if zo_callLater() was revoked by zo_removeCallLater()
-- So there should be no need in checking callId
-- But it's not 100% clear if that revoke works as intended at the present times
if ichorEruption.callId then
ichorEruption.callId = nil
ichorEruption.countdownId = self:StartCountdown(countdownTime, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_ICHOR_ERUPTION), "kynesAegis", "falgravn_ichor_eruption", false)
end
end, hitValue - countdownTime)
end
end
elseif (result == ACTION_RESULT_EFFECT_FADED) then
-- Lord Falgravn's Ichor Eruption timer cancelling
if (abilityId == buffsDebuffs.falgravn_ichor_eruption_timer) then
if (settings.falgravn_ichor_eruption) then
if (ichorEruption.callId ~= nil) then
zo_removeCallLater(ichorEruption.callId)
ichorEruption.callId = nil
end
if (ichorEruption.countdownId ~= nil) then
self:StopCountdown(ichorEruption.countdownId)
ichorEruption.countdownId = nil
end
end
end
end
end

0 comments on commit 3fd808d

Please sign in to comment.