Code:
<?xml version="1.0" encoding="utf-8" ?><DRUID><Ability><Name>Cat - Tigers Fury</Name><Default>false</Default><SpellID>5217</SpellID><Actions>/use Ancient Petrified Seed</Actions><Lua>local _,_,_,TF = UnitBuffID(&quot;player&quot;, 5217)
local TFstart, TFduration = GetSpellCooldown(5217)
local TFcooldown = (TFstart + TFduration - GetTime())
local tfEnergy = UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;) * 100
if GetShapeshiftForm()==3 and TF ~= nil then
return false
else
if TFcooldown &gt; 0 then
return false
else
if tfEnergy &lt; 40 then
return true
end
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Ferocious Bite</Name><Default>false</Default><SpellID>22568</SpellID><Actions></Actions><Lua>local fbrip, _, _, _, _, _, fbtimer = UnitDebuffID(&quot;target&quot;, 1079, &quot;PLAYER&quot;)
local fbCP = GetComboPoints(&quot;player&quot;, &quot;target&quot;)
local fbhealth = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
local fbenergy = UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;) * 100
if GetShapeshiftForm()==3 and fbhealth &lt;= 25 then
if fbrip ~= nil then
if fbCP == 5 then
return true
end
end
else
if GetShapeshiftForm()==3 and fbrip ~= nil then
if fbtimer - GetTime() &gt; 5 and fbenergy &gt;= 60 and fbCP == 5 then
return true
end
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Savage Roar</Name><Default>false</Default><SpellID>52610</SpellID><Actions></Actions><Lua>local _,_,_,SavageRoar = UnitBuffID(&quot;player&quot;, 62071)
local srCP = GetComboPoints(&quot;player&quot;, &quot;target&quot;)
local rip, _, _, _, _, _, riptimer = UnitDebuffID(&quot;target&quot;, 1079, &quot;PLAYER&quot;)
if GetShapeshiftForm()==3 and SavageRoar ~= nil then
return false
else
if rip ~= nil then
if srCP &gt;= 1 then
if riptimer - GetTime() &gt;= 8 then
return true
end
end
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Faerie Fire</Name><Default>false</Default><SpellID>16857</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()==3 then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Faerie Fire</Name><Default>false</Default><SpellID>16857</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()==1 then
return true
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Rip</Name><Default>false</Default><SpellID>1079</SpellID><Actions>/use Ancient Petrified Seed</Actions><Lua>local rip, _, _, _, _, _, riptimer = UnitDebuffID(&quot;target&quot;, 1079, &quot;PLAYER&quot;)
local ripCP = GetComboPoints(&quot;player&quot;, &quot;target&quot;)
local riphealth = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
if GetShapeshiftForm()==3 and rip ~= nil then
if riphealth &gt; 25 then
if ripCP == 5 then
if riptimer - GetTime() &lt; 2 then
return true
end
end
end
else
if ripCP == 5 then
return true
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Mangle</Name><Default>false</Default><SpellID>33878</SpellID><Actions>/startattack</Actions><Lua>if GetShapeshiftForm()==1 then
return true
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Berserk</Name><Default>false</Default><SpellID>50334</SpellID><Actions>/use Berserking</Actions><Lua>if GetShapeshiftForm()~=0 and IsLeftShiftKeyDown() then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Swipe</Name><Default>false</Default><SpellID>62078</SpellID><Actions></Actions><Lua>local _,_,_,BS = UnitBuffID(&quot;player&quot;, 50334)
local energy = UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;) * 100
if GetShapeshiftForm()==3 and BS ~= nil and CheckInteractDistance(&quot;target&quot;, 3) ~= nil then
if energy &gt;= 22 and CheckInteractDistance(&quot;target&quot;, 3) ~= nil then
return true
end
else
if energy &gt;= 45 and CheckInteractDistance(&quot;target&quot;, 3) ~= nil then
return true
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Shred</Name><Default>false</Default><SpellID>5221</SpellID><Actions>/startattack</Actions><Lua>-- Check for the debuffs.
local hasCatMangle = UnitDebuffID(&quot;target&quot;, 33876)
local hasBearMangle = UnitDebuffID(&quot;target&quot;, 33878)
local hasTrauma = UnitDebuffID(&quot;target&quot;, 46857)
local hasHemorrhage = UnitDebuffID(&quot;target&quot;, 16511)
local CP = GetComboPoints(&quot;player&quot;, &quot;target&quot;)
-- Just check for all buffs, we have no casting time on Shred so no need for a timer check
if GetShapeshiftForm()==3 and hasCatMangle ~= nil or hasBearMangle ~= nil or hasTrauma ~= nil or hasHemorrhage ~= nil then
if PQR_NotBehindTarget() then
return false
else
if CP == 5 then
return false
else
return true
end
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Swipe</Name><Default>false</Default><SpellID>779</SpellID><Actions>/startattack</Actions><Lua>if GetShapeshiftForm()==1 and CheckInteractDistance(&quot;target&quot;, 3) == nil or UnitCanAttack(&quot;player&quot;, &quot;target&quot;) == nil then
return false
end
if GetShapeshiftForm()==1 then
return true
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Maul</Name><Default>false</Default><SpellID>6807</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()==1 then
return true
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Enrage</Name><Default>false</Default><SpellID>5229</SpellID><Actions>/use Ancient Petrified Seed</Actions><Lua>local _,_,_,ER = UnitBuffID(&quot;player&quot;, 5229)
local ERstart, ERduration = GetSpellCooldown(5229)
local ERcooldown = (ERstart + ERduration - GetTime())
local erEnergy = UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;) * 100
if GetShapeshiftForm()==1 and ER ~= nil then
return false
else
if GetShapeshiftForm()==1 and ERcooldown &gt; 0 then
return false
else
if GetShapeshiftForm()==1 and erEnergy &lt; 75 then
return true
end
end
end</Lua><RecastDelay>0</RecastDelay><Target>Player</Target></Ability><Ability><Name>Bear - Lacerate</Name><Default>false</Default><SpellID>33745</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()==1 then
return true
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Pulverize</Name><Default>false</Default><SpellID>80313</SpellID><Actions>/use Enrage|/use Ancient Petrified Seed|/use Berserk|/use Berserking</Actions><Lua>local _, _, _, LacerateCount = UnitDebuff(&quot;target&quot;, &quot;Lacerate&quot;)
if GetShapeshiftForm()==1 and LacerateCount ~= nil then
if LacerateCount == 3 then
return true
end
else
return false;
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Thrash</Name><Default>false</Default><SpellID>77758</SpellID><Actions>/startattack|/use Enrage</Actions><Lua>if GetShapeshiftForm()==1 then
return true
end</Lua><RecastDelay>1</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Demoraling Roar</Name><Default>false</Default><SpellID>99</SpellID><Actions></Actions><Lua>local vindication = UnitDebuffID(&quot;target&quot;, 26017)
local demoshout = UnitDebuffID(&quot;target&quot;, 1160)
local curseofweakness = UnitDebuffID(&quot;target&quot;, 702)
local demoroar = UnitDebuffID(&quot;target&quot;, 99)
if GetShapeshiftForm()==1 and CheckInteractDistance(&quot;target&quot;, 3) == nil or UnitCanAttack(&quot;player&quot;, &quot;target&quot;) == nil then
return false
end
if GetShapeshiftForm()==1 and vindication == nil and demoshout == nil and curseofweakness == nil and demoroar == nil then
local targetName = UnitName(&quot;target&quot;)
if targetName ~= nil then
return true
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Mangle</Name><Default>false</Default><SpellID>33876</SpellID><Actions>/startattack</Actions><Lua>-- Rogues and Warriors can handle it themselves.
local hasCatMangle, _, _, _, _, _, CatMangleTimer = UnitDebuffID(&quot;target&quot;, 33876)
local hasBearMangle, _, _, _, _, _, BearMangleTimer = UnitDebuffID(&quot;target&quot;, 33878, &quot;PLAYER&quot;)
local hasTrauma = UnitDebuffID(&quot;target&quot;, 46857)
local hasHemorrhage = UnitDebuffID(&quot;target&quot;, 16511)
local CP = GetComboPoints(&quot;player&quot;, &quot;target&quot;)
if GetShapeshiftForm()==3 and PQR_NotBehindTarget() then
if CP == 5 then
return false
else
return true
end
end
-- First, let&apos;s let other people handle their own debuffs
if hasTrauma ~= nil then
return false
elseif hasHemorrhage ~= nil then
return false
elseif hasBearMangle ~= nil then
return false
-- Let us handle it!
elseif hasCatMangle ~= nil or hasBearMangle ~= nil and GetShapeshiftForm()==3 then
-- Check the timer
if CatMangleTimer - GetTime() &lt; 1 then
return true
end
else
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear - Feral Charge</Name><Default>false</Default><SpellID>16979</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()==1 and IsLeftControlKeyDown() then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Feral Charge</Name><Default>false</Default><SpellID>49376</SpellID><Actions></Actions><Lua>if IsLeftControlKeyDown() then
if GetShapeshiftForm()==3 then
return true
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat - Rake</Name><Default>false</Default><SpellID>1822</SpellID><Actions>/startattack</Actions><Lua>local rake, _, _, _, _, _, raketimer = UnitDebuffID(&quot;target&quot;, 1822, &quot;PLAYER&quot;)
if GetShapeshiftForm()==3 and rake ~= nil then
if raketimer - GetTime() &lt; 3 then
return true
end
else
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Mark of the Wild</Name><Default>false</Default><SpellID>1126</SpellID><Actions></Actions><Lua>if UnitCanCooperate(&quot;player&quot;,&quot;target&quot;) and UnitIsDead(&quot;target&quot;) == nil and UnitBuffID(&quot;target&quot;, 79061) == nil and UnitAffectingCombat(&quot;target&quot;) == nil then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Cat Form</Name><Default>false</Default><SpellID>768</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()~=3 and IsRightControlKeyDown() then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Bear Form</Name><Default>false</Default><SpellID>5487</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()~=1 and IsRightShiftKeyDown() then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>--- offensive spells ---</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>local buff = { 642, 45438, 31224, 23920, 33786, 19263, 97417, 97977 }
local mob = { &quot;Training Dummy&quot;, &quot;Raider&apos;s Training Dummy&quot;, &quot;Twisted Spirit&quot;, &quot;Amani shi Hatcher&quot;, &quot;Hakkar&apos;s Chains&quot; }
local noaggromobs = nil
local immunity = nil
for i,v in ipairs(buff) do
if UnitBuffID(&quot;target&quot;,v) then immunity = 1 end
end
for i,v in ipairs(mob) do
if UnitName(&quot;target&quot;) == v then noaggromobs = 1 end
end
if UnitIsDead(&quot;target&quot;)
or SpellIsTargeting()
or immunity
or UnitCanAttack(&quot;player&quot;,&quot;target&quot;) == nil
or (UnitAffectingCombat(&quot;target&quot;) == nil and noaggromobs == nil)
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster Form</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>if GetShapeshiftForm()~=0 and IsRightAltKeyDown() then
CancelShapeshiftForm()
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Barkskin</Name><Default>false</Default><SpellID>22812</SpellID><Actions></Actions><Lua>local unithealth = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
if GetShapeshiftForm()==0 and enraged == nil and unithealth &lt;= 50 then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Innervate</Name><Default>false</Default><SpellID>29166</SpellID><Actions></Actions><Lua>local manapercent = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
if GetShapeshiftForm()==0 and manapercent &lt; 50 then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Auto Target</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>local mytarget = &quot;player&quot;
local lowest = 100 * UnitHealth(mytarget) / UnitHealthMax(mytarget)
local self = 100 * UnitHealth(mytarget) / UnitHealthMax(mytarget)
local group = &quot;party&quot;
local members = GetNumPartyMembers()
lowhpmembers = 0
if GetNumRaidMembers() &gt; 0 then
group = &quot;raid&quot;
members = GetNumRaidMembers()
end
for i = 1, members, 1 do
local member = group..tostring(i)
local memberhp = 100 * UnitHealth(member) / UnitHealthMax(member)
if UnitGroupRolesAssigned(member) == &quot;TANK&quot; then memberhp = memberhp - 5 end
if UnitThreatSituation(member) == 3 then memberhp = memberhp - 5 end
if memberhp &lt; 95 and UnitInRange(member) then lowhpmembers = lowhpmembers +1 end
if memberhp &gt; 1 and memberhp &lt; lowest and UnitInRange(member) then
mytarget = member
lowest = memberhp
end
end
if GetShapeshiftForm()==0 and IsLeftShiftKeyDown() then
TargetUnit(mytarget)
elseif GetShapeshiftForm()==0 and self &lt; 75 then
TargetUnit(&quot;player&quot;)
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Healing Touch</Name><Default>false</Default><SpellID>5185</SpellID><Actions></Actions><Lua>local friend = UnitIsFriend(&quot;player&quot;,&quot;target&quot;)
local mytarget = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
local manapercent = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
if GetShapeshiftForm()==0 and friend ~= nil and mytarget &lt; 40 and manapercent &gt; 10 then
return true
end
if GetShapeshiftForm()==0 and friend ~= nil and PQR_IsMoving(1) == false and mytarget &lt; 40 and manapercent &gt; 10 then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Rejuvenation</Name><Default>false</Default><SpellID>774</SpellID><Actions></Actions><Lua>local friend = UnitIsFriend(&quot;player&quot;,&quot;target&quot;)
local mytarget = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
local rejuvenation = UnitBuffID(&quot;target&quot;, 774)
if GetShapeshiftForm()==0 and friend ~= nil and mytarget &lt; 90 and rejuvenation == nil and IsMounted() == nil then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Regrowth</Name><Default>false</Default><SpellID>8936</SpellID><Actions></Actions><Lua>local friend = UnitIsFriend(&quot;player&quot;,&quot;target&quot;)
local mytarget = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
local manapercent = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
local regrowth = UnitBuffID(&quot;target&quot;, 8936)
if GetShapeshiftForm()==0 and friend ~= nil and mytarget &lt; 50 and manapercent &gt; 15 and IsMounted() == nil and regrowth == nil then
return true
end
if GetShapeshiftForm()==0 and friend ~= nil and PQR_IsMoving(1) == false and mytarget &lt; 35 and manapercent &gt; 30 and IsMounted() == nil and regrowth == nil then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Nourish</Name><Default>false</Default><SpellID>50464</SpellID><Actions></Actions><Lua>local friend = UnitIsFriend(&quot;player&quot;,&quot;target&quot;)
local mytarget = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
local regrowth = UnitBuffID(&quot;target&quot;, 8936)
if GetShapeshiftForm()==0 and friend ~= nil and mytarget &lt; 50 and regrowth ~= nil then
return true
end
if GetShapeshiftForm()==0 and friend ~= nil and PQR_IsMoving(1) == false and mytarget &lt; 70 and regrowth ~= nil then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability><Ability><Name>Caster - Life Bloom</Name><Default>false</Default><SpellID>33763</SpellID><Actions></Actions><Lua>local friend = UnitIsFriend(&quot;player&quot;,&quot;target&quot;)
local mytarget = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
local _,_,_,LB,_,_,LBt = UnitBuffID(&quot;target&quot;, 33763)
if GetShapeshiftForm()==0 and friend ~= nil and mytarget &lt; 90 and LB == nil then
return true
elseif GetShapeshiftForm()==0 and friend ~= nil and mytarget &lt; 90 and LB &lt; 3 then
return true
elseif GetShapeshiftForm()==0 and friend ~= nil and LB ~= nil and LBt - GetTime() &lt; 1 and mytarget &lt; 96 then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target></Ability></DRUID>
DRUID_Rotations.xml