Code:
------INITIALIZE------
cast = CastSpellByName
------SPEC------
pt = GetPrimaryTalentTree();
------LOCAL VARIABLES------
if lastuacast==nil then
lastuacast=0
end
if lastpetcast==nil then
lastpetcast=0
end
if lastimmocast==nil then
lastimmocast=0
end
if lasthauntcast==nil then
lasthauntcast=0
end
if soulswap==nil then
soulswap=false
end
if UnitExists("focus") then
if UnitCanAttack("player","focus") then
hasFocus=true
soulswap=true
end
elseif not UnitExists("focus") then
hasFocus=false
soulswap=false
end
if (UnitName("target")=="Vile Swill" or UnitName("target")=="Training Dummy") then
dots=1
else
dots=nil
end
if (UnitName("target")=="Magmatron" or UnitName("target")=="Arcanotron" or UnitName("target")=="Electron" or UnitName("target")=="Toxitron") then
revswap=1
else
revswap=nil
end
------PET------
if not UnitExists("pet") then
if not UnitCastingInfo("player") and not UnitBuff("player","Soulburn") and select(2,IsUsableSpell("Soulburn"))==nil and GetSpellCooldown("Soulburn")==0 then
cast("Soulburn")
elseif not UnitCastingInfo("player") and not UnitChannelInfo("player") and UnitBuff("player","Soulburn") and GetSpellCooldown("Corruption")==0 then
cast("Summon Felhunter")
end
end
------BUFFS------
if not UnitBuff("player","Fel Armor") then
cast("Fel Armor")
elseif UnitExists("pet") and not UnitBuff("player","Soul Link") then
cast("Soul Link")
end
------CURRENT TARGET REMAINS------
if not UnitDebuff("target","Corruption","","player") then
crpremain=0
elseif UnitDebuff("target","Corruption","","player") then
crpremain=select(7,UnitDebuff("target","Corruption","","player"))-GetTime()
end
if not UnitDebuff("target","Unstable Affliction","","player") then
uaremain=0
elseif UnitDebuff("target","Unstable Affliction","","player") then
uaremain=select(7,UnitDebuff("target","Unstable Affliction","","player"))-GetTime()
end
if not UnitDebuff("target","Haunt","","player") then
hauremain=0
elseif UnitDebuff("target","Haunt","","player") then
hauremain=select(7,UnitDebuff("target","Haunt","","player"))-GetTime()
end
if not UnitDebuff("target","Bane of Agony","","player") then
boaremain=0
elseif UnitDebuff("target","Bane of Agony","","player") then
boaremain=select(7,UnitDebuff("target","Bane of Agony","","player"))-GetTime()
end
if not UnitDebuff("target","Bane of Doom","","player") then
bodremain=0
elseif UnitDebuff("target","Bane of Doom","","player") then
bodremain=select(7,UnitDebuff("target","Bane of Doom","","player"))-GetTime()
end
------FOCUS TARGET REMAINS------
if not UnitDebuff("focus","Corruption","","player") then
crpfremain=0
elseif UnitDebuff("focus","Corruption","","player") then
crpfremain=select(7,UnitDebuff("focus","Corruption","","player"))-GetTime()
end
if not UnitDebuff("focus","Unstable Affliction","","player") then
uafremain=0
elseif UnitDebuff("focus","Unstable Affliction","","player") then
uafremain=select(7,UnitDebuff("focus","Unstable Affliction","","player"))-GetTime()
end
if not UnitDebuff("focus","Haunt","","player") then
haufremain=0
elseif UnitDebuff("focus","Haunt","","player") then
haufremain=select(7,UnitDebuff("focus","Haunt","","player"))-GetTime()
end
if not UnitDebuff("focus","Bane of Agony","","player") then
boafremain=0
elseif UnitDebuff("focus","Bane of Agony","","player") then
boafremain=select(7,UnitDebuff("focus","Bane of Agony","","player"))-GetTime()
end
if not UnitDebuff("focus","Bane of Doom","","player") then
bodfremain=0
elseif UnitDebuff("focus","Bane of Doom","","player") then
bodfremain=select(7,UnitDebuff("focus","Bane of Doom","","player"))-GetTime()
end
------CURSE OF ELEMENTS------
if not (UnitDebuff("target","Jinx: Curse of the Elements") or UnitDebuff("target","Curse of the Elements") or UnitDebuff("target","Earth and Moon") or UnitDebuff("target","Ebon Plague")) and select(2,IsUsableSpell("Curse of the Elements"))==nil and GetSpellCooldown("Curse of the Elements")==0 then
cast("Curse of the Elements")
end
------LIFETAP------
if not UnitCastingInfo("player") and not UnitChannelInfo("player") and UnitPower("player")<((UnitHealthMax("player")*.15)*1.4) and (UnitHealth("player")/UnitHealthMax("player")*100)>20 and GetSpellCooldown("Life Tap")==0 then
cast("Life Tap")
end
------POTION------
if not UnitCastingInfo("player") and not UnitChannelInfo("player") and (UnitBuff("player","Bloodlust") or UnitBuff("player","Time Warp") or UnitBuff("player","Ancient Hysteria")) and GetItemCooldown(58091)==0 then
RunMacroText("/use Volcanic Potion")
end
------BANES------
if not aoew and not dots then
if (UnitLevel("target")==-1 or (UnitLevel("target")==UnitLevel("player")+2 and select(2,GetInstanceInfo())=="party")) then
if UnitHealth("target")>100000 and not soulswap==true and not UnitDebuff("target","Bane of Doom","","player") and select(2,IsUsableSpell("Bane of Doom"))==nil and GetSpellCooldown("Bane of Doom")==0 then
cast("Bane of Doom")
elseif boaremain==0 and not UnitCastingInfo("player") and GetSpellCooldown("Bane of Agony")==0 and select(2,IsUsableSpell("Bane of Agony"))==nil and not UnitDebuff("target","Bane of Doom","","player") then
cast("Bane of Agony")
end
elseif not (UnitLevel("target")==-1 or (UnitLevel("target")==UnitLevel("player")+2 and select(2,GetInstanceInfo())=="party")) then
if boaremain==0 and not UnitCastingInfo("player") and GetSpellCooldown("Bane of Agony")==0 and select(2,IsUsableSpell("Bane of Agony"))==nil and not UnitDebuff("target","Bane of Doom","","player") then
cast("Bane of Agony")
end
end
end
------SOUL SWAP------
if revswap and not aoew and not dots then
if not UnitCastingInfo("player") and UnitBuff("player","Soul Swap") and hasFocus and not (UnitGUID("target") == UnitGUID("focus")) and PlayerToTarget<40 and GetSpellCooldown("Soul Swap Exhale")==0 then
cast("Soul Swap Exhale","target")
elseif not UnitCastingInfo("player") and hasFocus and not (UnitGUID("target") == (UnitGUID("focus"))) and (boafremain>2 and crpfremain>2 and uafremain>2) and GetSpellCooldown("Soul Swap")==0 then
cast("Soul Swap","focus")
end
elseif not revswap and not aoew and not dots then
if not UnitCastingInfo("player") and UnitBuff("player","Soul Swap") and hasFocus and not (UnitGUID("target") == UnitGUID("focus")) and PlayerToFocus<40 and GetSpellCooldown("Soul Swap Exhale")==0 then
cast("Soul Swap Exhale","focus")
elseif not UnitCastingInfo("player") and hasFocus and not (UnitGUID("target") == (UnitGUID("focus"))) and (boaremain>2 and crpremain>2 and uaremain>2) and GetSpellCooldown("Soul Swap")==0 then
cast("Soul Swap","target")
end
end
------(DOTS) MALORIAK ADDS------
if dots then
if not UnitCastingInfo("player") and not UnitChannelInfo("player") and UnitBuff("player","Shadow Trance") and GetSpellCooldown("Shadow Bolt")==0 and select(2,IsUsableSpell("Shadow Bolt"))==nil then
cast("Shadow Bolt","focus")
elseif (bodfremain==0 or crpfremain<2 or uafremain<2 or haufremain==0) then
if not UnitCastingInfo("player") and bodfremain==0 and select(2,IsUsableSpell("Bane of Doom"))==nil and GetSpellCooldown("Bane of Doom")==0 then
cast("Bane of Doom","focus")
elseif not UnitCastingInfo("player") and crpfremain<2 and GetSpellCooldown("Corruption")==0 and select(2,IsUsableSpell("Corruption"))==nil then
cast("Corruption","focus")
elseif uafremain<2 and (lastuacast+0.5)<=GetTime() then
if not UnitCastingInfo("player") and GetSpellCooldown("Unstable Affliction")==0 and select(2,IsUsableSpell("Unstable Affliction"))==nil then
cast("Unstable Affliction","focus")
end
lastuacast=GetTime()
elseif haufremain==0 and (lasthauntcast+0.5)<=GetTime() then
if not UnitCastingInfo("player") and GetSpellCooldown("Haunt")==0 and select(2,IsUsableSpell("Haunt"))==nil then
cast("Haunt","focus")
end
lasthauntcast=GetTime()
end
elseif not UnitCastingInfo("player") and GetSpellCooldown("Shadowflame")==0 and PlayerToTarget<10 then
cast("Shadowflame")
elseif not UnitCastingInfo("player") and select(2,IsUsableSpell("Soulburn"))==nil and GetSpellCooldown("Soulburn")==0 then
cast("Soulburn")
elseif not UnitCastingInfo("player") and UnitBuff("player","Soulburn") and select(2,IsUsableSpell("Seed of Corruption"))==nil and GetSpellCooldown("Seed of Corruption")==0 then
cast("Seed of Corruption")
elseif not UnitCastingInfo("player") and boaremain==0 and not UnitCastingInfo("player") and GetSpellCooldown("Bane of Agony")==0 and select(2,IsUsableSpell("Bane of Agony"))==nil and not UnitDebuff("target","Bane of Doom","","player") then
cast("Bane of Agony")
elseif not UnitCastingInfo("player") and crpremain==0 and GetSpellCooldown("Corruption")==0 and select(2,IsUsableSpell("Corruption"))==nil then
cast("Corruption")
elseif not UnitCastingInfo("player") and uaremain==0 then
if GetUnitSpeed("player")==0 and GetSpellCooldown("Unstable Affliction")==0 and select(2,IsUsableSpell("Unstable Affliction"))==nil then
cast("Unstable Affliction")
end
elseif not UnitCastingInfo("player") and (boaremain>0 and crpremain>0 and uaremain>0) then
RunMacroText("/TargetEnemy")
end
end
------AOE------
if aoew and not dots then
if not UnitCastingInfo("player") and GetSpellCooldown("Shadowflame")==0 and PlayerToTarget<10 then
cast("Shadowflame")
elseif not UnitCastingInfo("player") and select(2,IsUsableSpell("Soulburn"))==nil and GetSpellCooldown("Soulburn")==0 then
cast("Soulburn")
elseif not UnitCastingInfo("player") and select(2,IsUsableSpell("Seed of Corruption"))==nil and GetSpellCooldown("Seed of Corruption")==0 then
cast("Seed of Corruption")
end
end
------MAIN ROTATION------
if not dots and not aoew then
if not IsPetAttackActive() then
PetAttack("target")
end
if GetSpellCooldown("Demon Soul")==0 and (crpremain>2 and uaremain>2 and hauremain>2) and GetSpellCooldown("Corruption")==0 and UnitAffectingCombat("player") then
cast("Demon Soul")
end
if GetUnitSpeed("player")>0 then
if not UnitCastingInfo("player") and crpremain<2 and GetSpellCooldown("Corruption")==0 and select(2,IsUsableSpell("Corruption"))==nil then
cast("Corruption")
elseif not UnitCastingInfo("player") and UnitBuff("player","Shadow Trance") and GetSpellCooldown("Shadow Bolt")==0 and select(2,IsUsableSpell("Shadow Bolt"))==nil then
cast("Shadow Bolt")
elseif not UnitCastingInfo("player") and IsSpellInRange("Fel Flame","target")==1 and select(2,IsUsableSpell("Fel Flame"))==nil then
cast("Fel Flame")
end
elseif GetUnitSpeed("player")==0 then
if not UnitCastingInfo("player") and crpremain<2 and GetSpellCooldown("Corruption")==0 and select(2,IsUsableSpell("Corruption"))==nil then
cast("Corruption")
elseif uaremain<3 and (lastuacast+0.5)<=GetTime() then
if not UnitCastingInfo("player") and GetSpellCooldown("Unstable Affliction")==0 and select(2,IsUsableSpell("Unstable Affliction"))==nil then
cast("Unstable Affliction")
end
lastuacast=GetTime()
elseif hauremain<3 and (lasthauntcast+0.5)<=GetTime() then
if not UnitCastingInfo("player") and GetSpellCooldown("Haunt")==0 and select(2,IsUsableSpell("Haunt"))==nil then
cast("Haunt")
end
lasthauntcast=GetTime()
elseif not UnitCastingInfo("player") and not UnitChannelInfo("player") and UnitHealth("target")/UnitHealthMax("target")<0.25 and select(2,IsUsableSpell("Drain Soul"))==nil then
cast("Drain Soul")
elseif not UnitCastingInfo("player") and not UnitChannelInfo("player") and GetSpellCooldown("Shadowflame")==0 and PlayerToTarget<10 then
cast("Shadowflame")
elseif not UnitCastingInfo("player") and not UnitChannelInfo("player") and (crpremain>2 and uaremain>2 and hauremain>2) and UnitBuff("player","Shadow Trance") and GetSpellCooldown("Shadow Bolt")==0 and select(2,IsUsableSpell("Shadow Bolt"))==nil then
cast("Shadow Bolt")
elseif not UnitCastingInfo("player") and not UnitChannelInfo("player") and (crpremain>2 and uaremain>2 and hauremain>2) and GetSpellCooldown("Shadow Bolt")==0 and select(2,IsUsableSpell("Shadow Bolt"))==nil then
cast("Shadow Bolt")
end
end
end