From 77a5220dc8d5f04d0e7cee09520321f8915f6008 Mon Sep 17 00:00:00 2001 From: BillLive Date: Wed, 30 Dec 2015 22:53:12 +1030 Subject: [PATCH] Fixed miniAura debuff not clearing when leaving combat and windshear now checks for interuptable spell before displaying Signed-off-by: BillLive --- Elementarist.lua | 6 +++++- modules/elemental.lua | 44 +++++++++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Elementarist.lua b/Elementarist.lua index 9a43ff1..0b731f6 100755 --- a/Elementarist.lua +++ b/Elementarist.lua @@ -1052,7 +1052,11 @@ function Elementarist:OnUpdate(elapsed) if (not ElementaristDB.debuffdisabled) then Elementarist.AuraTrackerUpdate = Elementarist.AuraTrackerUpdate + elapsed if (Elementarist.AuraTrackerUpdate >= 1) then - Elementarist:UpdateAuraTracker() + if (UnitAffectingCombat("player")) then + Elementarist:UpdateAuraTracker() + else + Elementarist:PurgeDebuffTable() + end end end if (not ElementaristDB.shielddisabled) then diff --git a/modules/elemental.lua b/modules/elemental.lua index 0db442c..8da49e9 100755 --- a/modules/elemental.lua +++ b/modules/elemental.lua @@ -476,6 +476,31 @@ Elementarist.elemental = { -- interruptions, purge, and AoE on target local d + if Elementarist:SpellAvailable(Elementarist.SpellList["Wind Shear"]) then + d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"]) + if ( (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") == 1) and (d) and (d<0.5) ) then + local _, status, threatpct, _, _ = UnitDetailedThreatSituation("player", "target") + + + --- windshear to drop threat + if ( (status) and (threatpct>80) and (Elementarist.person["friendCount"]>1) and (Elementarist.inParty>0)) then + return Elementarist.SpellList["Wind Shear"] + end + + --- windshear to interupt channel spell + spell, _, _, _, _, _, _, notInterruptible = UnitChannelInfo("target") + if (spell) and (not notInterruptible) then + return Elementarist.SpellList["Wind Shear"] + end + + --- windshear to interupt cast spell + spell, _, _, _, _, _, _, _, notInterruptible = UnitCastingInfo("target") + if (spell) and (not notInterruptible) then + return Elementarist.SpellList["Wind Shear"] + end + end + end + ---- Earthquake with Enhanced chain lightning buff d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"]) if (d) and (d<0.5) then @@ -524,25 +549,6 @@ Elementarist.elemental = { return Elementarist.SpellList["Chain Lightning"] end end - - if Elementarist:SpellAvailable(Elementarist.SpellList["Wind Shear"]) then - if IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") == 1 then - local _, status, threatpct, _, _ = UnitDetailedThreatSituation("player", "target") - if ((UnitCastingInfo("target")) or (UnitChannelInfo("target"))) or ((status) and (threatpct>80) and (Elementarist.person["friendCount"]>1) and (Elementarist.inParty>0)) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"]) - if (d) and (d<0.5) and (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") ) then - return Elementarist.SpellList["Wind Shear"] - end - end - - if (UnitChannelInfo("target")) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"]) - if (d<0.5) and (interruptable) and (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") ) then - return Elementarist.SpellList["Wind Shear"] - end - end - end - end -- check if purgeable buff is on target (not sure if this is ok) if Elementarist:SpellAvailable(Elementarist.SpellList["Purge"]) then -- 1.7.9.5