Code:
-- Gara'jal the Spiritbinder
if UnitDebuffID("player",116161) then
local timer = select(7,UnitDebuffID("player",116161))
if timer and timer - GetTime() < 1.5 then
SpellStopCasting()
RunMacroText("/click ExtraActionButton1")
end
end
local PQ_SN = PQ_Shrapnel
local PQ_FL = PQ_FadingLight
local PQ_HOT = PQ_HourOfTwilight
-- Fading Light Debuff
for i=1,#PQ_FL do
if select(7,UnitDebuffID("player",PQ_FL[i]))
and select(7,UnitDebuffID("player",PQ_FL[i])) - GetTime() < 0.7 then
SpellStopCasting()
RunMacroText("/click ExtraActionButton1")
end
end
-- Hour of Twilight
--if IsLeftShiftKeyDown() and not GetCurrentKeyBoardFocus() then
if UnitExists("boss1") then
if false then
if PQR_SpellAvailable(115176)
and select(2,GetSpellCooldown(115176)) < 2
then SpellStopCasting() CastSpellByName(tostring(GetSpellInfo(115176)),"player") return true end
else
local HourOfTwilight,_,_,_,_,endTime = UnitCastingInfo("boss1")
for i=1,#PQ_HOT do
if HourOfTwilight == GetSpellInfo(PQ_HOT[i]) and endTime/1000 - GetTime() < 0.7 then
SpellStopCasting()
RunMacroText("/click ExtraActionButton1")
end
end
end
end
-- Target for Shrapnel
for i=1,#PQ_SN do
if select(7,UnitDebuffID("player",PQ_SN[i]))
and select(7,UnitDebuffID("player",PQ_SN[i])) - GetTime() < 2 then
SpellStopCasting()
RunMacroText("/click ExtraActionButton1")
end
end
function BossDispel(b,d,s) --b: boss npc id, d: boss debuff id, s: dispel spell id
if UnitExists("boss1") then
if tonumber(UnitGUID("boss1"):sub(6,10), 16) == b then
if UnitDebuffID("boss1", d) then
if IsSpellInRange(GetSpellInfo(s),"boss1") == 1
and not PQR_IsOutOfSight("boss1")
and PQR_SpellAvailable(s)
and select(2,GetSpellCooldown(s)) < 2
and IsUsableSpell(s) then
CastSpellByName(tostring(GetSpellInfo(s)),"boss1")
--return true --Silent cast
end
end
end
end
end
BossDispel(65501,122149,88423) --Wind Lord Mel'jarak, Quickening debuff
BossDispel(60701,117697,88423) --Zian of the Endless Shadow, Shield of Darkness
--BossDispel(60583,117283,88423) --Protector Kaolan, Cleansing Waters -- not use because in loop 3 - boss1, boss2, boss3
--BossDispel(60586,117283,88423) --Elder Asani, Cleansing Waters -- not use because in loop 3 - boss1, boss2, boss3
--BossDispel(60585,117283,88423) --Elder Regail, Cleansing Waters -- not use because in loop 3 - boss1, boss2, boss3
-- Checking if there's a dangerous Debuff we should Cleanse asap
function EmerDispel(t) --t: dispel spell id
local buff = { 106199, 117436, 123011, 116281, 117949, 124863 } --Blood Corruption: Death, Lightning Prison, Terrorize, Cobalt Mine Blast, Closed Circuit, Visions of Demise
for i=1, #members do
for j=1, #buff do
if UnitDebuffID(members[i].Unit, buff[j]) then
if IsSpellInRange(GetSpellInfo(t),members[i].Unit) == 1
and not PQR_IsOutOfSight(members[i].Unit)
and PQR_SpellAvailable(t)
and select(2,GetSpellCooldown(t)) < 2
--and CanHeal(members[i].Unit)
and IsUsableSpell(t) then
CastSpellByName(tostring(GetSpellInfo(t)),members[i].Unit)
--return true --Silent cast
end
end
end
end
end
EmerDispel(88423)
-- Custom Yor'sahj the Unsleeping CanHeal function
function CanHealYorsahj(t)
if UnitExists("boss1") then
if tonumber(UnitGUID("boss1"):sub(6,10), 16) == 55312 then --Yor'sahj the Unsleeping
if UnitDebuffID(t, 105171) then
if select(4,UnitDebuffID(t, 105171)) <= 3 then --Deep Corruption
return true
else
return false
end
else
return true
end
else
return true
end
end
end
function CanAOEHealYorsahj()
local YorsahjDebuff = true
if UnitExists("boss1") then
if tonumber(UnitGUID("boss1"):sub(6,10), 16) == 55312 then --Yor'sahj the Unsleeping
for i=1, #members do
if UnitDebuffID(members[i].Unit, 105171) then
YorsahjDebuff = false
end
end
end
end
return YorsahjDebuff
end
and put "-- Events" below "-- Healing Engine --" ability then you should modify druid heal ability in Bubba rotation and add "CanHealYorsahj" to single heal spell or "CanAOEHealYorsahj" to aoe heal spell. Example: