Code:
------INITIALIZE------
cast=CastSpellByName
------THREAT------
local t={UnitDetailedThreatSituation("player","target")}
if GetNumPartyMembers()>0 and (t[1]==1 or (t[5] ~=nil and t[5]>25000 and t[3]>90)) and GetSpellCooldown("Cower")==0 and select(2,IsUsableSpell("Cower")) then
cast("Cower")
end
------INTERRUPTS------
if UnitCastingInfo("target") and select(9,UnitCastingInfo("target"))==false and IsSpellInRange("Skull Bash(Cat Form)","target")==1 and GetSpellCooldown("Skull Bash(Cat Form)")==0 and IsUsableSpell("Skull Bash(Cat Form)") and select(2,IsUsableSpell("Skull Bash(Cat Form)"))==nil and (select(6,UnitCastingInfo("target"))/1000)-GetTime()<.60 and UnitIsPlayer("target") then
cast("Skull Bash(Cat Form)")
end
if select(8,UnitChannelInfo("target"))==false and IsSpellInRange("Skull Bash(Cat Form)","target")==1 and GetSpellCooldown("Skull Bash(Cat Form)")==0 and IsUsableSpell("Skull Bash(Cat Form)") and select(2,IsUsableSpell("Skull Bash(Cat Form)"))==nil and UnitIsPlayer("target") then
cast("Skull Bash(Cat Form)")
end
------CAT CHECKS, DOTS, ETC------
if (UnitDebuff("target","Mangle") and select(7,UnitDebuff("target","Mangle"))-GetTime()>5) or UnitDebuff("target","Hemorrhage") or UnitDebuff("target","Trauma") then
bl=0 else bl=1
end
if IsSpellInRange("Rake","target")==0 and GetSpellCooldown(49376)==0 and GetSpellCooldown("Shred")==0 and IsSpellInRange("Feral Charge","target")==1 and not (UnitName("target")=="Valiona" or UnitName("target")=="Theralion" or UnitName("target")=="Magmatron" or UnitName("target")=="Magmaw" or UnitName("target")=="Nefarian") then
CastSpellByID(49376)
end
if GetShapeshiftForm()==3 and GetSpellCooldown("Tiger's Fury")==0 and GetSpellCooldown("Shred")==0 and UnitPower("player")<=26 and IsSpellInRange("Rip")==1 then
cast("Tiger's Fury")
end
if not UnitDebuff("target","Rip","Cat Form","player") then
ripremain=0
elseif UnitDebuff("target","Rip","Cat Form","player") then
ripremain=select(7,UnitDebuff("target","Rip","Cat Form","player"))-GetTime()
end
if not UnitDebuff("target","Rake","Cat Form","player") then
rkremain=0
elseif UnitDebuff("target","Rake","Cat Form","player") then
rkremain=select(7,UnitDebuff("target","Rake","Cat Form","player"))-GetTime()
end
if not UnitBuff("player","Savage Roar") then
srremain=0
elseif UnitBuff("player","Savage Roar") then
srremain=select(7,UnitBuff("player","Savage Roar"))-GetTime()
end
if GetSpellCooldown("Tiger's Fury")==0 then
tfremain=0
elseif GetSpellCooldown("Tiger's Fury")~=0 then
tfremain=GetSpellCooldown("Tiger's Fury")+select(2,GetSpellCooldown("Tiger's Fury"))-GetTime()
end
if GetShapeshiftForm()==3 and UnitLevel("target")==-1 and GetSpellCooldown("Berserk")==0 and GetSpellCooldown("Shred")==0 and IsSpellInRange("Rip")==1 and tfremain>15 then
cast("Berserk")
end
------MAIN------
if GetShapeshiftForm()==3 and IsStealthed() and IsSpellInRange("Pounce","target")==1 and select(2,IsUsableSpell("Pounce"))==nil then
cast("Pounce")
elseif GetShapeshiftForm()~=3 then
return
end
if aoed then
if select(2,IsUsableSpell("Swipe(Cat Form)"))==nil and GetSpellCooldown("Swipe")==0 and IsSpellInRange("Mangle(Cat Form)","target")==1 and not IsStealthed() then
cast("Swipe(Cat Form)")
end
elseif not aoed then
if (not UnitDebuff("target","Faerie Fire") or (UnitDebuff("target","Faerie Fire") and select(4,UnitDebuff("target","Faerie Fire"))<2)) and IsSpellInRange("Faerie Fire (Feral)","target")==1 and GetSpellCooldown("Faerie Fire (Feral)")==0 and not IsStealthed() then
cast("Faerie Fire (Feral)")
elseif UnitBuff("player","Stampede") and GetSpellCooldown("Shred")==0 and IsSpellInRange("Mangle(Cat Form)","target")==1 and not IsStealthed() then
RunMacroText("/click BT4Button27")
elseif IsShiftKeyDown() and select(2,IsUsableSpell("Swipe(Cat Form)"))==nil and GetSpellCooldown("Shred")==0 and IsSpellInRange("Mangle(Cat Form)","target")==1 and not IsStealthed() then
cast("Swipe(Cat Form)")
elseif bl==1 and GetSpellCooldown("Mangle(Cat Form)")==0 and select(2,IsUsableSpell("Mangle(Cat Form)"))==nil and GetSpellCooldown("Shred")==0 and IsSpellInRange("Mangle(Cat Form)","target")==1 and not IsStealthed() then
cast("Mangle(Cat Form)")
elseif UnitBuff("player","Stampede") and select(7,UnitBuff("player","Stampede"))-GetTime()<2 and IsSpellInRange("Mangle(Cat Form)","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
RunMacroText("/click BT4Button27")
elseif UnitHealth("target")/UnitHealthMax("target")<.25 and ripremain>0 and ripremain<=5 and GetComboPoints("player","target")>0 and select(2,IsUsableSpell("Ferocious Bite"))==nil and IsSpellInRange("Mangle(Cat Form)","target")==1 and GetSpellCooldown("Shred")==0 then
cast("Ferocious Bite")
elseif GetComboPoints("player","target")==5 and select(2,IsUsableSpell("Rip"))==nil and (not UnitDebuff("target","Rip","Cat Form","player") or ripremain<=8) and ripremain<tfremain and IsSpellInRange("Rip","target")==1 and GetSpellCooldown("Shred")==0 then
cast("Rip")
elseif UnitBuff("player","Tiger's Fury") and select(2,IsUsableSpell("Rake"))==nil and (not UnitDebuff("target","Rake","Cat Form","player") or (UnitDebuff("target","Rake","Cat Form","player") and rkremain<9)) and IsSpellInRange("Rake","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
cast("Rake")
elseif select(2,IsUsableSpell("Rake"))==nil and (not UnitDebuff("target","Rake","Cat Form","player") or (UnitDebuff("target","Rake","Cat Form","player") and rkremain<3)) and (UnitPower("player")>70 or tfremain+0.8>rkremain) and IsSpellInRange("Rake","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
cast("Rake")
elseif UnitBuff("player","Clearcasting") and IsSpellInRange("Shred","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
if AmIBehind==true then
cast("Shred")
else
cast("Mangle(Cat Form)")
end
elseif (not UnitBuff("player","Savage Roar") or (UnitBuff("player","Savage Roar") and srremain<=2)) and UnitPower("player")>25 and GetComboPoints("player","target")>0 and GetComboPoints("player","target")<3 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
cast("Savage Roar")
elseif GetComboPoints("player","target")==5 and ripremain>6 and select(2,IsUsableSpell("Ferocious Bite"))==nil and IsSpellInRange("Ferocious Bite","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
cast("Ferocious Bite")
elseif UnitBuff("player","Stampede") and not UnitBuff("player","Clearcasting") and UnitBuff("player","Tiger's Fury") and IsSpellInRange("Rake","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
RunMacroText("/click BT4Button27")
elseif select(2,IsUsableSpell("Shred"))==nil and IsSpellInRange("Shred","target")==1 and GetSpellCooldown("Shred")==0 and not IsStealthed() then
if AmIBehind==true then
cast("Shred")
else
cast("Mangle(Cat Form)")
end
end
end