Code:
<?xml version="1.0" encoding="utf-8" ?><SHAMAN><Ability><Name>totems</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>local DB = UnitBuffID(&quot;player&quot;,61316)
local AB = UnitBuffID(&quot;player&quot;,1459)
local _, WaterTotem = GetTotemInfo(3)
local _, FireTotem = GetTotemInfo(1)
local _, AirTotem = GetTotemInfo(4)
local _, EarthTotem = GetTotemInfo(2)
local MQ = UnitBuffID(&quot;player&quot;, 49868)
local MA = UnitBuffID(&quot;player&quot;, 24907)
local HP = UnitBuffID(&quot;player&quot;, 53290)
local IIT = UnitBuffID(&quot;player&quot;, 55610)
local DA = UnitBuffID(&quot;player&quot;, 465)
local ST = UnitBuffID(&quot;player&quot;, 8071)
local BoM = UnitBuffID(&quot;player&quot;, 19740)
local FI = UnitBuffID(&quot;player&quot;, 54424)
if FireTotem == &quot;&quot; and AirTotem == &quot;&quot; and EarthTotem == &quot;&quot; and WaterTotem == &quot;&quot; and incombat == 1 then
SilentCast(66842)
return true
end
if DB == nil and AB == nil then
SetMultiCastSpell (133,8227)
if FireTotem == &quot;&quot; and incombat == 1 then
SilentCast(8227)
return true
end
else
SetMultiCastSpell (133,3599)
if FireTotem == &quot;&quot; and incombat == 1 then
SilentCast(3599)
return true
end
end
if MQ == nil and MA == nil then
SetMultiCastSpell (136,3738)
if AirTotem == &quot;&quot; and incombat == 1 then
SilentCast(3738)
return true
end
else
if HP == nil and IIT == nil then
SetMultiCastSpell (136,8512)
if AirTotem == &quot;&quot; and incombat == 1 then
SilentCast(8512)
return true
end
end
end
if DA == nil then
SetMultiCastSpell (134,8071)
if EarthTotem == &quot;&quot; and incombat == 1 then
SilentCast(8071)
return true
end
else
SetMultiCastSpell (134,8075)
if EarthTotem == &quot;&quot; and incombat == 1 then
SilentCast(8075)
return true
end
end
if BoM == nil and FI == nil then
SetMultiCastSpell (135,5675)
if WaterTotem == &quot;&quot; and incombat == 1 then
SilentCast(5675)
return true
end
else
SetMultiCastSpell (135,5394)
if WaterTotem == &quot;&quot; and incombat == 1 then
SilentCast(5394)
return true
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Earthliving Weapon</Name><Default>false</Default><SpellID>51730</SpellID><Actions></Actions><Lua>local hasEarthliving = GetWeaponEnchantInfo()
if hasEarthliving ~= nil then
return false
else
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Player</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>-- init</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>if not xeroninit then
function SpecialAggro(t)
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;,
&quot;Exposed Head of Magmaw&quot;, &quot;Battleground Demolisher&quot;, &quot;Ozumat&quot;, &quot;Right Foot&quot;, &quot;Left Foot&quot;,
&quot;Icy Tomb&quot;, &quot;Risen Ghoul&quot;, &quot;Mana Void&quot;, &quot;Burning Tendons&quot;, &quot;Wing Tentacle&quot;, &quot;Arm Tentacle&quot;,
&quot;Twilight Assault Drake&quot;, &quot;Goriona&quot;, &quot;Ice Tomb&quot; }
for _,v in ipairs(mob) do if UnitName(t) == v then return true end end
end
function ImmuneTarget(t)
local buff = { 642, 45438, 31224, 23920, 33786, 19263, 97417, 97977, 102915, 100686, 105784, 74938 }
for _,v in ipairs(buff) do if UnitBuffID(t,v) then return true end end
end
function HoldCooldown(cd)
if GetMinimapZoneText() == &quot;Deathwing&quot; and UnitName(&quot;target&quot;) ~= &quot;Burning Tendons&quot; and cd &gt;= 1
then return true end
if UnitName(&quot;target&quot;) == &quot;Warlord Zon&apos;ozz&quot; and not UnitDebuffID(&quot;target&quot;,104031) and cd &gt;= 3
then return true end
if UnitName(&quot;boss1&quot;) == &quot;Alysrazor&quot; and not UnitDebuffID(&quot;boss1&quot;,99432) and cd &gt;= 3
then return true end
end
print(&quot;Sheuron initialized, ver: \124cFFFFE6402012.01.05&quot;)
xeroninit = true
end
if IsLeftAltKeyDown()
or IsMounted()
or SpellIsTargeting()
or UnitBuffID(&quot;player&quot;,80169)
or UnitBuffID(&quot;player&quot;,87959)
or UnitChannelInfo(&quot;player&quot;)
then return true end
if not xeroninit then
function SpecialAggro(t)
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;,
&quot;Exposed Head of Magmaw&quot;, &quot;Battleground Demolisher&quot;, &quot;Ozumat&quot;, &quot;Right Foot&quot;, &quot;Left Foot&quot;,
&quot;Icy Tomb&quot;, &quot;Risen Ghoul&quot;, &quot;Mana Void&quot;, &quot;Burning Tendons&quot;, &quot;Wing Tentacle&quot;, &quot;Arm Tentacle&quot;,
&quot;Twilight Assault Drake&quot;, &quot;Goriona&quot;, &quot;Ice Tomb&quot; }
for _,v in ipairs(mob) do if UnitName(t) == v then return true end end
end
function ImmuneTarget(t)
local buff = { 642, 45438, 31224, 23920, 33786, 19263, 97417, 97977, 102915, 100686, 105784, 74938 }
for _,v in ipairs(buff) do if UnitBuffID(t,v) then return true end end
end
function HoldCooldown(cd)
if GetMinimapZoneText() == &quot;Deathwing&quot; and UnitName(&quot;target&quot;) ~= &quot;Burning Tendons&quot; and cd &gt;= 1
then return true end
if UnitName(&quot;target&quot;) == &quot;Warlord Zon&apos;ozz&quot; and not UnitDebuffID(&quot;target&quot;,104031) and cd &gt;= 3
then return true end
if UnitName(&quot;boss1&quot;) == &quot;Alysrazor&quot; and not UnitDebuffID(&quot;boss1&quot;,99432) and cd &gt;= 3
then return true end
end
print(&quot;Sheuron initialized, ver: \124cFFFFE6402012.01.05&quot;)
xeroninit = true
end
if IsLeftAltKeyDown()
or IsMounted()
or SpellIsTargeting()
or UnitBuffID(&quot;player&quot;,80169)
or UnitBuffID(&quot;player&quot;,87959)
or UnitChannelInfo(&quot;player&quot;)
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Mana Tide</Name><Default>false</Default><SpellID>16190</SpellID><Actions></Actions><Lua>local _,lcd = GetSpellCooldown(16190)
if lcd == 0 and manapercent &lt; 65 and incombat == 1 then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Riptide</Name><Default>false</Default><SpellID>61295</SpellID><Actions></Actions><Lua>if not UnitBuffID(PQR_CustomTarget, 139,&quot;PLAYER&quot;)
and ( PQR_CustomTargetHP &lt; 90 or UnitThreatSituation(PQR_CustomTarget) == 3 )
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Nature Swiftness</Name><Default>false</Default><SpellID>16188</SpellID><Actions></Actions><Lua>local _,lcd = GetSpellCooldown(16188)
if lcd == 0 and member[lowest].health &lt; nshealth then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>True</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Run N Cast</Name><Default>false</Default><SpellID>79206</SpellID><Actions></Actions><Lua>if PQR_IsMoving(2) == true and member[lowest].health &lt;40 and moving == 1 then
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Healing Rain</Name><Default>false</Default><SpellID>73920</SpellID><Actions></Actions><Lua>local _,lcd = GetSpellCooldown(73920)
Spell, _, _, _, _, endTime = UnitCastingInfo(&quot;player&quot;)
if lcd == 0 and IsControlKeyDown() and GetCurrentKeyBoardFocus() == nil and Spell ~=&quot;Healing Rain&quot; then
SilentCast(73920)
if SpellIsTargeting() then CameraOrSelectOrMoveStart() CameraOrSelectOrMoveStop() end
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Earth Shield</Name><Default>false</Default><SpellID>974</SpellID><Actions></Actions><Lua>local EStarget = nil
if group == &quot;raid&quot; and UnitExists(&quot;focus&quot;) then EStarget = &quot;focus&quot; end
if group == &quot;party&quot; then
for i = 1, members, 1 do
local member = group..tostring(i)
if UnitGroupRolesAssigned(member) == &quot;TANK&quot; and UnitIsDead(member) ~= 1 then EStarget = member end
end
end
if mytarget &lt; 75 and EStarget == nil and UnitThreatSituation(targettoheal) == 3
then EStarget = targettoheal
end
if EStarget ~= nil then
local ES = UnitBuffID(EStarget, 974)
if ES == nil and UnitInRange(EStarget) and UnitIsDead(EStarget) ~= 1 then
return true
end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>---- Healing Spells ----</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>if not UnitAffectingCombat(PQR_CustomTarget)
and not IsLeftShiftKeyDown()
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Greater Healing Wave</Name><Default>false</Default><SpellID>77472</SpellID><Actions></Actions><Lua>if PQR_CustomTargetHP &lt; 70
and 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;) &gt; 50
or PQR_IsCastingSpell(8004) ) )
and PQR_IsCastingSpell(2060) == false
and PQR_IsMoving(1) == false
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Healing Wave</Name><Default>false</Default><SpellID>331</SpellID><Actions></Actions><Lua>if ( PQR_CustomTargetHP &lt; 90
or UnitThreatSituation(PQR_CustomTarget) == 5
or ( PQR_CustomTargetHP &lt; 90 and not UnitBuffID(PQR_CustomTarget, 139) ) )
and PQR_IsMoving(1) == false
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>--- Special Event ----</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>-- Avoid sudden death on Ultraxion
local fadingtime = select(7,UnitDebuffID(&quot;player&quot;,110070))
if fadingtime and fadingtime - GetTime() &lt; 1.3 then RunMacroText(&quot;/click ExtraActionButton1&quot;) end
-- Avoid Hour of Twilight on Ultraxion, Delete next 3 lines if you are working as tank
local channelSpell, _, _, _, _, endTime = UnitCastingInfo(&quot;boss1&quot;)
if channelSpell == GetSpellInfo(109417) and endTime/1000 - GetTime() &lt; 1.3
then RunMacroText(&quot;/click ExtraActionButton1&quot;) end
-- Try to aim on Darkmoon Faerie Cannon
local canontime = select(7,UnitBuffID(&quot;player&quot;,102116))
if canontime and canontime - GetTime() &lt; 1.15 then CancelUnitBuff(&quot;player&quot;,&quot;Magic Wings&quot;) end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Chain Heal</Name><Default>false</Default><SpellID>1064</SpellID><Actions></Actions><Lua>if PQR_CustomTargetHP &lt; 80
and lowhpmembers &gt; 2
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Water Shield</Name><Default>false</Default><SpellID>52127</SpellID><Actions></Actions><Lua>local WS = UnitBuffID(&quot;player&quot;, 52127)
if (member[lowest].health &gt; ghwhealth ) and WS == nil then
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Player</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>trinkets -- int</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>if member[lowest].health &lt;50 and incombat ==1 then
if GetInventoryItemCooldown(&quot;player&quot;,13) == 0 then UseInventoryItem(13) end
if GetInventoryItemCooldown(&quot;player&quot;,14) == 0 then UseInventoryItem(14) end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>trinkets -- spirit</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>if manapercent &lt; 85 and incombat ==1 then
if GetInventoryItemCooldown(&quot;player&quot;,13) == 0 then UseInventoryItem(13) end
if GetInventoryItemCooldown(&quot;player&quot;,14) == 0 then UseInventoryItem(14) end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Hex</Name><Default>false</Default><SpellID>51514</SpellID><Actions></Actions><Lua>local inRange = 0
local _,lcd = GetSpellCooldown(51514)
if lcd == 0 and UnitExists(&quot;focus&quot;) and UnitIsVisible(&quot;focus&quot;) and UnitIsEnemy(&quot;player&quot;,&quot;focus&quot;) then
inRange = IsSpellInRange(&quot;Hex&quot;,&quot;focus&quot;)
end
if inRange==1 then
SilentCast(51514,&quot;focus&quot;)
return true
end</Lua><RecastDelay>0</RecastDelay><Target>Focus</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>---- Auto Target ---</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>if not healinit then
function CalculateHP(t)
local incomingheal = 0
if UnitGetIncomingHeals(t) then incomingheal = UnitGetIncomingHeals(t) end
return 80 * ( UnitHealth(t) + incomingheal ) / UnitHealthMax(t)
end
function SafeTarget(t)
if IsSpellInRange(tostring(GetSpellInfo(2050)),t) == 1
and UnitIsCharmed(t) == nil
and UnitIsDeadOrGhost(t) == nil
and UnitCanCooperate(&quot;player&quot;,t)
and PQR_IsOutOfSight(t) == false
then return true end
end
function DontDispel(t)
local buff = { 96328, 96325, 96326, 86788, 30108 }
for _,v in ipairs(buff) do if UnitDebuffID(t,v) then return true end end
end
function DangerousMagic(t)
local buff = { 5782, 118, 122, 339, 1499, 6358, 605, 20066, 8122, 853, 5484, 71757, 104601, 107629, 99567 }
for _,v in ipairs(buff) do if UnitDebuffID(t,v) then return true end end
end
healinit = true
end
if SafeTarget(&quot;target&quot;) then
PQR_CustomTarget = &quot;target&quot;
PQR_CustomTargetHP = CalculateHP(&quot;target&quot;)
elseif SafeTarget(&quot;mouseover&quot;) and GetMouseFocus() ~= WorldFrame then
PQR_CustomTarget = &quot;mouseover&quot;
PQR_CustomTargetHP = CalculateHP(&quot;mouseover&quot;)
else
lowhpmembers = 0
priodispel = nil
PQR_CustomTarget = &quot;player&quot;
PQR_CustomTargetHP = CalculateHP(&quot;player&quot;)
local group = &quot;party&quot;
local members = GetNumPartyMembers()
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 = CalculateHP(member)
if SafeTarget(member) then
if UnitThreatSituation(member) == 3 then memberhp = memberhp - 3 end
if memberhp &lt; 80 then lowhpmembers = lowhpmembers +1 end
if memberhp &lt; PQR_CustomTargetHP then
PQR_CustomTarget = member
PQR_CustomTargetHP = memberhp
end
if DangerousMagic(member) and not DontDispel(member) then priodispel = member end
end
end
if SafeTarget(&quot;pet&quot;) and DangerousMagic(&quot;pet&quot;) and not DontDispel(&quot;pet&quot;) then priodispel = &quot;pet&quot; end
if priodispel then PQR_CustomTarget = priodispel end
end</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Healing surge</Name><Default>false</Default><SpellID>8004</SpellID><Actions></Actions><Lua>if ( PQR_CustomTargetHP &lt; 40
or UnitThreatSituation(PQR_CustomTarget) == 5
or ( PQR_CustomTargetHP &lt; 40 and not UnitBuffID(PQR_CustomTarget, 139) ) )
and PQR_IsMoving(1) == false
then return true end</Lua><RecastDelay>0</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability></SHAMAN>