Requires: Hack addon
[Donate]
Single Target Macro
Code:
/run Hack.Run("Warrior.Prot","0")
AoE Group Macro
Code:
/run Hack.Run("Warrior.Prot","1")
Code Block
Code:
local AoEMode = ...
cast=CastSpellByName
function check(sp,unit)
unit = unit or "target";
spell = string.format("%s",sp)
if GetSpellCooldown(spell)==0 and IsUsableSpell(spell) then
if SpellHasRange(spell)==1 then
if IsSpellInRange(spell,unit)~=1 then
return false
end
end
else
return false
end
return true
end
local PartyNum = GetNumPartyMembers()
if PartyNum~=0 then
if check("Commanding Shout") then cast("Commanding Shout") return end
else
if check("Battle Shout") then cast("Battle Shout") return end
end
if check("Intercept")==false and check("Charge") then cast("Charge") return end
if check("Intercept") then cast("Intercept") return end
if UnitAffectingCombat("player")~=1 then return end
if GetInventoryItemCooldown(13)==0 then UseInventoryItem(13) end
if GetInventoryItemCooldown(14)==0 then UseInventoryItem(14) end
local uch={UnitChannelInfo("target")}
local uca={UnitCastingInfo("target")}
-- Spell Reflection
if (UnitChannelInfo("target")~=nil or UnitCastingInfo("target")~=nil) and UnitName("targettarget")==UnitName("player") and check("Spell Reflection") then cast("Spell Reflection") return end
-- BWD Interuption
if UnitName("target")=="Maloriak" and (uca[1]=="Arcane Storm" or uch[1]=="Arcane Storm") and check("Pummel") then cast ("Pummel") return end
-- ZulGurub Interuption
if (UnitName("target")=="High Priest Venoxis" or UnitName("target")=="Venomancer Mauri" or UnitName("target")=="Venomancer T'Kulu") and (uca[1]=="Whispers of Hethiss" or uch[1]=="Whispers of Hethiss") and check("Pummel") then cast("Pummel") return end
-- General Interupt
if (UnitName("target")~="Maloriak" and UnitName("target")~="High Priest Venoxis" and UnitName("target")~="Venomancer Mauri" and UnitName("target")~="Venomancer T'Kulu") and (uca[9]==false or uch[8]==false) and check("Pummel") then cast("Pummel") return end
-- Nefarian Debuff
if (UnitName("target")=="Nefarian" or UnitName("target")=="Onyxia") and UnitDebuff("target", "Demoralizing Shout")~="Demoralizing Shout" and check("Demoralizing Shout") then cast("Demoralizing Shout") return end
---------------------
local playerHP=UnitHealth("player")/UnitHealthMax("player")
if playerHP<=0.30 and check("Last Stand") then cast("Last Stand") return end
if playerHP<=0.50 and check("Shield Wall") then cast("Shield Wall") return end
if playerHP<=0.40 and check("Enraged Regeneration") then cast("Enraged Regeneration") return end
if playerHP<=0.10 and check("Rallying Cry") then cast("Rallying Cry") return end
if check("Berserker Rage") then cast("Berserker Rage") return end
if check("Inner Rage") then cast("Inner Rage") return end
if check("Victory Rush") then cast("Victory Rush") return end
if AoEMode=="0" then
if check("Devastate") then cast("Devastate") return end
if check("Revenge") then cast("Revenge") return end
if check("Concussion Blow") then cast("Concussion Blow") return end
if check("Shield Block") then cast("Shield Block") return end
if check("Shield Slam") then cast("Shield Slam") return end
local Power=UnitPower("player")/UnitPowerMax("player")
if Power > 0.4 and check("Heroic Strike") then cast("Heroic Strike") return end
if UnitDebuff("target", "Rend")~="Rend" and check("rend") then cast("Rend") return end
end
if AoEMode=="1" then
_, TCCD=GetSpellCooldown("Thunder Clap")
if check("Shield Block") and TCCD>2 then cast("Shield Block") return end
if UnitDebuff("target", "Rend")~="Rend" and check("rend") then cast("Rend") return end
if check("Thunder Clap") and IsSpellInRange("Heroic Strike","target")==1 then cast("Thunder Clap") return end
if check("Cleave") and TCCD>2 then cast("Cleave") return end
if check("Revenge") and TCCD>2 then cast("Revenge") return end
if check("Shockwave") and TCCD>2 and IsSpellInRange("Heroic Strike","target")==1 then cast("Shockwave") return end
if UnitDebuff("target", "Demoralizing Shout")~="Demoralizing Shout" and check("Demoralizing Shout") then cast("Demoralizing Shout") return end
end