Skip to content

Instantly share code, notes, and snippets.

@michaelmano
Created January 30, 2026 05:36
Show Gist options
  • Select an option

  • Save michaelmano/917cdb350cd5945a56430bef5e1afbdd to your computer and use it in GitHub Desktop.

Select an option

Save michaelmano/917cdb350cd5945a56430bef5e1afbdd to your computer and use it in GitHub Desktop.
--------------------------------------------------
-- SUNDER STACK DETECTION
--------------------------------------------------
function get_sunder_stacks()
for i = 1, 40 do
local texture, stacks = UnitDebuff("target", i)
if not texture then break end
-- Expose Armor (treated as full sunder)
if string.find(texture, "Ability_Warrior_Riposte") then
return 5
end
-- Sunder Armor
if string.find(texture, "Ability_Warrior_Sunder") then
return stacks or 0
end
end
return 0
end
--------------------------------------------------
-- 1. INITIAL SUNDER
--------------------------------------------------
function initial_sunder()
if get_sunder_stacks() == 0 then
CastSpellByName("Sunder Armor")
return true
end
return false
end
--------------------------------------------------
-- 2. SUNDER ARMOR
--------------------------------------------------
function sunder_armor()
if get_sunder_stacks() < 5 then
CastSpellByName("Sunder Armor")
return true
end
return false
end
--------------------------------------------------
-- 3. BATTLE SHOUT UPKEEP
--------------------------------------------------
function battle_shout_up()
for i = 1, 40 do
local buff = UnitBuff("player", i)
if not buff then break end
if string.find(buff, "Ability_Warrior_BattleShout") then
return true
end
end
return false
end
function battle_shout()
if not battle_shout_up() then
CastSpellByName("Battle Shout")
return true
end
return false
end
--------------------------------------------------
-- 4. EXECUTE LOGIC
--------------------------------------------------
function execute()
local maxhp = UnitHealthMax("target")
if maxhp == 0 then return false end
local hp = UnitHealth("target")
if (hp / maxhp) * 100 < 20 then
CastSpellByName("Execute")
return true
end
return false
end
--------------------------------------------------
-- 5. SHIELD BASH LOGIC
--------------------------------------------------
function shield_slam()
CastSpellByName("Shield Slam")
end
--------------------------------------------------
-- 6. REVENGE LOGIC
--------------------------------------------------
function revenge()
CastSpellByName("Revenge")
end
--------------------------------------------------
-- 7. HEROIC STRIKE RAGE DUMP
--------------------------------------------------
function heroic_strike()
if UnitMana("player") >= 35 then
CastSpellByName("Heroic Strike")
return true
end
return false
end
--------------------------------------------------
-- MAIN ROTATION
--------------------------------------------------
function rotation()
if not UnitExists("target") then return end
if initial_sunder() then return end
if battle_shout() then return end
if execute() then return end
shield_slam()
revenge()
if sunder_armor() then return end
if heroic_strike() then return end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment