Disclaimer:
You *must* already have the ability to call protected LUA functions or these functions will not work. There are many other posts regarding the topic, but I'm not qualified to instruct on how to make protected methods available. I am decent at writing LUA, so I will try to help anyone in that regard.
Hello all,
I've played many classes and keep up to date on the latest rotations from Elitistjerks. I've put together many 1 button macros to do the rotations for various classes and thought they might be helpful to others.
Now, on to my 1 button Cataclysm Pally Tank macro. This macro will do the most efficient rotation according to EJ, for a pally tank. The macro is intended to make the threat generation/rotation as easy as possible. It does not taunt/use racial abilities/defensive CDs, as I have found that those are best used manually for individual circumstances.
Save the code below in a text file and name it whatever you want, e.g. PallyRotation.Lua
Put this file in any existing addon directory. e.g. C:\World of Warcraft\Interface\AddOns\Bartender4\PallyRotation.Lua.
Edit the .TOC file in that addon's directory. e.g. e.g. C:\World of Warcraft\Interface\AddOns\Bartender4\Bartender4.toc
Add the line "PallyRotation.Lua" on its own line and save.
Now, login to WoW and as long as your addon is loaded the PallyRotation.Lua will also be loaded. This gives you the ability to create a macro, that will be your 1 button you press when attacking a target.
Create the following Macro in WoW:
Code:
/run CataPallyTank();
Now that you have your macro and you have enabled protected method calls, simply target a mob and press the macro and it will cast the most efficient attack.
I'll be happy to answer as many questions as I can!
PallyRotation.Lua
Code:
function CanCast(spellname)
local spell = UnitCastingInfo("player");
local spell2 = UnitChannelInfo("player");
if(spell or spell2) then
return "FALSE";
end
local start, duration, enabled = GetSpellCooldown(spellname)
local usable = IsUsableSpell(spellname)
local inRange = IsSpellInRange(spellname,player)
if(usable and (start == 0 and duration == 0 and enabled ~= 0) and inRange ~= 0) then
return "TRUE"
else
return "FALSE"
end
end
function CataPallyTank()
if(UnitName("target")) then
local rfury = UnitAura("player","Righteous Fury");
--buff righteous fury if needed
if(not rfury and CanCast("Righteous Fury")=="TRUE") then RunMacroText("/cast Righteous Fury"); return end
local myHealth = UnitHealth("player")/UnitHealthMax("player");
local myMana = UnitMana("player")/UnitManaMax("player");
local power = UnitPower("player","9");
-- Rotation.. Shield of the Righteous > Hammer of the Righteous > Consecration > Holy Wrath > Avenger's Shield* > Judgment
if(myMana < .75 and (CanCast("Divine Plea")=="TRUE")) then RunMacroText("/cast Divine Plea");
elseif(myHealth < .25 and CanCast("Corroded Skeleton Key")=="TRUE") then RunMacroText("/cast Corroded Skeleton Key");
elseif(power~=nil and power>=3 and CanCast("Shield of the Righteous")=="TRUE") then RunMacroText("/cast [target=target] Shield of the Righteous");
elseif(CanCast("Hammer of the Righteous")=="TRUE") then RunMacroText("/cast [target=target] Hammer of the Righteous");
elseif(myMana > .5 and (CanCast("Consecration")=="TRUE")) then RunMacroText("/cast Consecration");
elseif(CanCast("Holy Wrath")=="TRUE") then RunMacroText("/cast Holy Wrath");
elseif(CanCast("Avenger's Shield")=="TRUE") then RunMacroText("/cast Avenger's Shield");
elseif(CanCast("Judgement")=="TRUE") then RunMacroText("/cast [target=target] Judgement");
elseif(CanCast("Hammer of Wrath")=="TRUE") then RunMacroText("/cast Hammer of Wrath");
end
end
end