Skip to content

Instantly share code, notes, and snippets.

@butchpeters
Last active December 10, 2020 04:29
Show Gist options
  • Save butchpeters/3d1ebd10338ea0d9d0f9989e193bb50e to your computer and use it in GitHub Desktop.
Save butchpeters/3d1ebd10338ea0d9d0f9989e193bb50e to your computer and use it in GitHub Desktop.
MaxDPS rotation for classic warriors
function()
local FT = {
Bloodthirst = 23894,
Whirlwind = 1680,
-- Bloodrage = 2687,
-- BerserkerRage = 18499,
SunderArmor = 11597,
HeroicStrike = 25286,
Cleave = 20569,
Execute = 20662,
-- DeathWish = 12328,
Hamstring = 7373,
ExposeArmor = 11200,
Revenge = 25288,
ShieldBash = 1672,
};
if
UnitIsDead('target') == 1
or not UnitAffectingCombat('player')
then
return nil;
end
local stance = GetShapeshiftForm();
local isDefensive = stance == 2;
local isBerserker = stance == 3;
local rage = UnitPower('player');
local ttd = MaxDps.FrameData.timeToDie;
local hsTxt = GetSpellTexture(FT.HeroicStrike);
local clvTxt = GetSpellTexture(FT.Cleave);
local hsQueued = false;
local clvQueued = false;
local i = 0;
for i = 1, 120
do
local t = GetActionTexture(i);
if t == hsTxt
then
hsQueued = IsCurrentAction(i);
end
if t == clvTxt
then
clvQueued = IsCurrentAction(i);
end
end
local isTanking = UnitThreatSituation('player') >= 2;
-- Execute
local pctHealth = MaxDps:TargetPercentHealth('target');
-- ChatFrame4:AddMessage("Execute: [pctHealth=" .. pctHealth .. ", berserker=" .. (isBerserker and "yes" or "no") .. "]");
if
pctHealth <= 0.2
and isBerserker
then
-- ChatFrame4:AddMessage("execute");
return FT.Execute;
end
-- Heroic Strike / Cleave
if
rage > 30
and not hsQueued
and not clvQueued
then
-- local targetsInRange = MaxDps:TargetsInRange(FT.HeroicStrike);
-- if targetsInRange > 1
-- then
-- return FT.Cleave;
-- else
return FT.HeroicStrike;
-- end
end
-- Revenge
local revengeCooldown = MaxDps:CooldownConsolidated(FT.Revenge);
local revengeUsable = IsUsableSpell(FT.Revenge);
if
revengeUsable
and revengeCooldown.remains < 1.5
and isDefensive
then
return FT.Revenge;
end
-- Bloodthirst
local btCooldown = MaxDps:CooldownConsolidated(FT.Bloodthirst);
if
rage > 30
and btCooldown.remains < 1.5
then
return FT.Bloodthirst;
end
-- Shield Bash
local shieldBashCooldown = MaxDps:CooldownConsolidated(FT.ShieldBash);
local shieldBashUsable = IsUsableSpell(FT.ShieldBash);
if
shieldBashUsable
and shieldBashCooldown.ready
and (rage > 40 or btCooldown.remains > 4)
and isDefensive
then
return FT.ShieldBash;
end
-- SunderArmor
if
isDefensive
and rage > 40
then
return FT.SunderArmor;
end
-- Whirlwind
local wwCooldown = MaxDps:CooldownConsolidated(FT.Whirlwind);
if
(rage > 40
or (rage > 25 and btCooldown.remains > 1.5))
and wwCooldown.remains < 1.5
and isBerserker
then
return FT.Whirlwind;
end
-- Death Wish
-- local dwCooldown = MaxDps:CooldownConsolidated(FT.DeathWish);
-- if
-- dwCooldown.ready
-- and ttd < 25
-- and isBerserker
-- then
-- return FT.DeathWish;
-- end
-- Bloodrage
-- local brCooldown = MaxDps:CooldownConsolidated(FT.Bloodrage);
-- ChatFrame4:AddMessage("Bloodrage: [rage=" .. rage .. ", cooldown=" .. brCooldown.remains .. "]");
-- if
-- rage < 75
-- and brCooldown.ready
-- then
-- return FT.Bloodrage;
-- end
-- Berserker rage
-- local brskCooldown = MaxDps:CooldownConsolidated(FT.BerserkerRage);
-- ChatFrame4:AddMessage("Berserker Rage: [rage=" .. rage .. ", cooldown=" .. brskCooldown.remains .. ", isTanking=" .. (isTanking and "yes" or "no") .. ", isBerserker=" .. (isBerserker and "yes" or "no") .. "]");
-- if
-- (isBerserker and isTanking and brskCooldown.ready and rage < 75)
-- or (isDefensive and brskCooldown.ready and rage < 25)
-- then
-- return FT.BerserkerRage;
-- end
-- Hamstring
if
rage > 50
and isBerserker
then
return FT.Hamstring
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment