Skip to content

Instantly share code, notes, and snippets.

@zyxd
Created June 7, 2018 12:38
Show Gist options
  • Save zyxd/ede2438b1f5a00f1fd014ed8ab70a02a to your computer and use it in GitHub Desktop.
Save zyxd/ede2438b1f5a00f1fd014ed8ab70a02a to your computer and use it in GitHub Desktop.
function zyxdAttack()
-- If target exists, enemy
if GetUnitName("target") and not UnitIsFriend("player", "target") and not IsCurrentAction(60) then
UseAction(60);
end
end
function zyxdWarriorCharge()
-- If target exists and enemy
if GetUnitName("target") and not UnitIsFriend("player", "target") then
zyxdAttack();
if UnitAffectingCombat("player") then
icon, name, active = GetShapeshiftFormInfo(3);
-- If Berserker Stance is active
if active then
CastSpellByName("Intercept");
else
CastSpellByName("Berserker Stance");
end
else
icon, name, active = GetShapeshiftFormInfo(1);
-- If Battle Stance is active
if active then
CastSpellByName("Charge");
else
CastSpellByName("Battle Stance");
end
end
end
end
function zyxdWarriorHeroic()
-- Do not check rage because it's attack ability and we should be Berserker Stance every time
-- if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 15 then
if GetUnitName("target") and not UnitIsFriend("player", "target") then
zyxdAttack();
icon, name, active = GetShapeshiftFormInfo(3);
-- If Berserker Stance is active
if active then
CastSpellByName("Heroic Strike");
else
CastSpellByName("Berserker Stance");
end
end
end
function zyxdWarriorOverpower()
if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 5 then
zyxdAttack();
icon, name, active = GetShapeshiftFormInfo(1);
-- If Battle Stance is active
if active then
CastSpellByName("Overpower");
else
CastSpellByName("Battle Stance");
end
end
end
function zyxdWarriorExecute()
if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 15 then
zyxdAttack();
icon, name, active = GetShapeshiftFormInfo(3);
-- If Berserker Stance is active
if active then
CastSpellByName("Execute");
else
CastSpellByName("Berserker Stance");
end
end
end
function zyxdWarriorHamstring()
if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 10 then
zyxdAttack();
icon, name, activeBattle = GetShapeshiftFormInfo(1);
icon, name, activeBerserker = GetShapeshiftFormInfo(3);
-- If Battle Stance or Berserker Stance is active
if activeBattle or activeBerserker then
CastSpellByName("Hamstring");
else
CastSpellByName("Berserker Stance");
end
end
end
function zyxdWarriorRend()
if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 10 then
zyxdAttack();
icon, name, activeBattle = GetShapeshiftFormInfo(1);
icon, name, activeDefensive = GetShapeshiftFormInfo(2);
-- If Battle Stance or Defensive Stance is active
if activeBattle or activeDefensive then
CastSpellByName("Rend");
else
CastSpellByName("Battle Stance");
end
end
end
function zyxdWarriorDisarm()
if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 20 then
zyxdAttack();
icon, name, active = GetShapeshiftFormInfo(2);
-- If Defensive Stance is active
if active then
CastSpellByName("Disarm");
else
CastSpellByName("Defensive Stance");
end
end
end
function zyxdWarriorRetaliation()
icon, name, active = GetShapeshiftFormInfo(1);
-- If Battle Stance is active
if active then
CastSpellByName("Retaliation");
else
CastSpellByName("Battle Stance");
end
end
function zyxdWarriorShieldWall()
icon, name, active = GetShapeshiftFormInfo(2);
-- If Defensive Stance is active
if active then
CastSpellByName("Shield Wall");
else
CastSpellByName("Defensive Stance");
end
end
function zyxdWarriorThunderClap()
if UnitMana("player") >= 20 then
icon, name, active = GetShapeshiftFormInfo(1);
-- If Battle Stance is active
if active then
CastSpellByName("Thunder Clap");
else
CastSpellByName("Battle Stance");
end
end
end
function zyxdWarriorShout()
if UnitMana("player") >= 10 then
if FindBuff("Battle Shout", "player") then
CastSpellByName("Demoralizing Shout");
else
CastSpellByName("Battle Shout");
end
end
end
function zyxdWarriorShieldBash()
if UnitMana("player") >= 10 then
icon, name, active = GetShapeshiftFormInfo(1);
-- If Defensive Stance is active
if active then
CastSpellByName("Shield Bash");
else
CastSpellByName("Battle Stance");
end
end
end
function zyxdWarriorBerserkerRage()
icon, name, active = GetShapeshiftFormInfo(3);
-- If Berserker Stance is active
if active then
CastSpellByName("Berserker Rage");
else
CastSpellByName("Berserker Stance");
end
end
function zyxdWarriorMockingBlow()
if GetUnitName("target") and not UnitIsFriend("player", "target") and UnitMana("player") >= 10 then
zyxdAttack();
icon, name, active = GetShapeshiftFormInfo(1);
-- If Battle Stance is active
if active then
CastSpellByName("Mocking Blow");
else
CastSpellByName("Battle Stance");
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment