Requires: Hack addon
[Donate]
Single Target Macro
Code:
/run Hack.Run("Warrior.Arms","0")
AoE Group Macro
Code:
/run Hack.Run("Warrior.Arms","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 check("Charge") then cast("Charge") return end
if UnitAffectingCombat("player")~=1 then return end
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 GetInventoryItemCooldown(13)==0 then UseInventoryItem(13) end
if GetInventoryItemCooldown(14)==0 then UseInventoryItem(14) end
if (UnitHealth("player")/UnitHealthMax("player")<=0.2) and check("Rallying Cry") then cast("Rallying Cry") return end
local uca={UnitChannelInfo("target")}
local uch={UnitCastingInfo("target")}
if UnitName("target")=="Maloriak" and (uca[1]=="Arcane Storm" or uch[1]=="Arcane Storm") and check("Pummel") then cast ("Pummel") return end
if UnitName("target")~="Maloriak" and (uca[8]==false or uch[9]==false) and check("Pummel") then cast("Pummel") return end
if check("Retaliation") and UnitIsPlayer("target")==true and UnitName("targettarget")==UnitName("player") then cast("Retaliation") return end
if check("Hamstring") and UnitIsPlayer("target")==true and UnitDebuff("target", "Hamstring")~="Hamstring" then cast("Hamstring") return end
if check("Victory Rush") then cast("Victory Rush") return end
if check("Overpower") then cast("Overpower") return end
if check("Execute") then cast("Execute") return end
if check("Enraged Regeneration") and (UnitHealth("player")/UnitHealthMax("player")<=0.5) then cast("Enraged Regeneration") return end
if check("Inner Rage") then cast("Inner Rage") return end
if check("Deadly Calm") then cast("Deadly Calm") return end
if check("Berserker Rage") then cast("Berserker Rage") return end
if check("Sweeping Strikes") then cast("Sweeping Strikes") return end
if AoEMode=="0" then
local _,MSCD,_ =GetSpellCooldown("Mortal Strike")
if check("Mortal Strike") then cast("Mortal Strike") return end
if MSCD>=2 and check("Throwdown") then cast("Throwdown") return end
if MSCD>=2 and check("Colossus Smash") then cast("Colossus Smash") return end
if MSCD>=2 and check("Shattering Throw") then cast("Shattering Throw") return end
if MSCD>=2 and check("Heroic Throw") then cast("Heroic Throw") return end
if check("Rend") and UnitDebuff("target", "Rend")~="Rend" then cast("Rend") return end
i=1 d=90
if check("Sunder Armor") then
while(i<=40) do a={UnitDebuff("target",i)}
if a[1]=="Sunder Armor" and a[8]=="player" then
d=a[7]-GetTime()
if a[4]==3 then
break
end
end
i=i+1
end
end
if i>40 or d<10 then
cast("Sunder Armor")
end
local PartyNum=GetNumPartyMembers()
local _,MSCD,_ =GetSpellCooldown("Mortal Strike")
if PartyNum~=0 then
if (UnitPower("player")/UnitPowerMax("player")>0.3) and check("Heroic Strike") and MSCD>=2 then cast("Heroic Strike") return end
else
if MSCD>=2 and check("Heroic Strike") then cast("Heroic Strike") return end
end
local _,HSCD,_ =GetSpellCooldown("Heroic Strike")
if HSCD>=2 and check("Slam") then cast("Slam") return end
else
if check("Bladestorm") and IsSpellInRange("Heroic Strike")==1 then cast("Bladestorm") return end
local _,BSCD,_ =GetSpellCooldown("Bladestorm")
if BSCD>=2 and check("Cleave") and IsSpellInRange("Heroic Strike")==1 then cast("Cleave") return end
if BSCD>=2 and check("Thunder Clap") then cast("Thunder Clap") return end
end