LuaSlinger»Counterattack Alert

Counterattack Alert

Counterattack alert

Blow a whistle when Revenge, Overpower, or Execute become available. Set this to execute on event UNIT_COMBAT. Requires GetCurrentShapeshiftStanceForm and BlowWhistle in your Library.

local junk, englishClass = UnitClass("player")
if (englishClass == "WARRIOR") then

  local myForm = stkGetShapeshiftForm()

  if (arg1 == "player" and myForm == "Defensive Stance" and
      (arg2 == "PARRY" or arg2 == "BLOCK" or arg2 == "DODGE")) then
    -- Revenge
    stkBlowWhistle();

  elseif (arg1 == "target" and myForm == "Battle Stance" and arg2 == "DODGE") then
    -- Overpower
    stkBlowWhistle();

  elseif (arg1 == "target" and
            (myForm == "Battle Stance" or myForm == "Berserker Stance")) then
    local tHealthPct = (UnitHealthMax("target") - UnitHealth("target"))/UnitHealthMax("target")
    if (tHealthPct < .20) then
      -- Execute
      stkBlowWhistle()
    end
  end

end