diff --git a/TrialKynesAegis.lua b/TrialKynesAegis.lua index 4874eb9..4475ab2 100644 --- a/TrialKynesAegis.lua +++ b/TrialKynesAegis.lua @@ -82,14 +82,27 @@ function RaidNotifier.KA.OnCombatEvent(_, result, isError, aName, aGraphic, aAct end end -- Vrolsworn Fire Mage's meteors (3 meteors at once) - if (abilityId == buffsDebuffs.vrol_firemage_meteor) then - -- hitValue = 1 for casting or 2250 as the duration of meteor's reaching the targets - if (settings.vrol_firemage_meteor >= 1 and hitValue > 1) then - if (tType == COMBAT_UNIT_TYPE_PLAYER) then - self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_VROL_FIREMAGE_METEOR), "kynesAegis", "vrol_firemage_meteor", true, 2) - elseif (settings.vrol_firemage_meteor == 2) then - self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_VROL_FIREMAGE_METEOR_OTHER), "kynesAegis", "vrol_firemage_meteor", false, 2) - end + -- hitValue = 1 for casting or 2250 as the duration of meteor's reaching the targets + if (abilityId == buffsDebuffs.vrol_firemage_meteor and hitValue > 1) then + -- If player is tracking only meteors on himself we don't need to use any tricks + if (settings.vrol_firemage_meteor == 1 and tType == COMBAT_UNIT_TYPE_PLAYER) then + self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_VROL_FIREMAGE_METEOR), "kynesAegis", "vrol_firemage_meteor", true, 2) + elseif (settings.vrol_firemage_meteor == 2) then + -- There will be several events for each of the targeted players + -- In order to determine if our player himself is meteor's target we will analyze all of them + RaidNotifier.DelayedEventHandler.Add( + "vrol_firemage_meteor", + { tType = tType }, + function(argsBag) + if (argsBag:ContainsArgumentWithValue("tType", COMBAT_UNIT_TYPE_PLAYER)) then + self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_VROL_FIREMAGE_METEOR), "kynesAegis", "vrol_firemage_meteor", true, 2) + else + self:StartCountdown(hitValue, GetString(RAIDNOTIFIER_ALERTS_KYNESAEGIS_VROL_FIREMAGE_METEOR_OTHER), "kynesAegis", "vrol_firemage_meteor", false, 2) + + end + end, + 50 + ) end end elseif (result == ACTION_RESULT_EFFECT_GAINED_DURATION) then