Code:
<?xml version="1.0" encoding="utf-8" ?>
<PALADIN>
-- During Ultraxionlwe will use Heroic Will 1 second before Hour Of Twilight / Fading Light. Hold it ALT to stop this --
<Ability>
<Name>Heroic Will</Name>
<SpellID>0</SpellID>
<Actions>/click ExtraActionButton1</Actions>
<Lua>
local altDown = IsAltKeyDown()
if altDown == nil then
local spellHourOfTwilight = GetSpellInfo(109417)
local channelSpell, _, _, _, _, endTime = UnitCastingInfo("boss1")
if channelSpell ~= nil and channelSpell == spellHourOfTwilight then
local finishTime = endTime/1000 - GetTime()
if finishTime < 1 then
return true
end
end
end
local sFadingLight, _, _, _, _, _, fadingEndTime = UnitDebuffID("player", 110068)
if sFadingLight then
local finishTime = fadingEndTime - GetTime()
if finishTime < 1 then
return true
end
end
</Lua>
</Ability>
-- Auto target the player with the lowest HP --
<Ability>
<Name>Autotarget Low HP</Name>
<Default>false</Default>
<SpellID>0</SpellID>
<Actions></Actions>
<Lua>
if UnitExists(&quot;target&quot;)
and UnitIsDead(&quot;target&quot;) == nil
and UnitIsFriend(&quot;player&quot;, &quot;target&quot;)
and UnitCanCooperate(&quot;player&quot;,&quot;target&quot;)
then PQR_CustomTarget = &quot;target&quot;
PQR_CustomTargetHP = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
elseif UnitExists(&quot;mouseover&quot;) and UnitIsDead(&quot;mouseover&quot;) == nil
and UnitIsDead(&quot;mouseover&quot;) == nil
and UnitIsFriend(&quot;player&quot;, &quot;mouseover&quot;)
and UnitCanCooperate(&quot;player&quot;,&quot;mouseover&quot;)
and GetMouseFocus() ~= WorldFrame
then PQR_CustomTarget = &quot;mouseover&quot;
PQR_CustomTargetHP = 100 * UnitHealth(&quot;mouseover&quot;) / UnitHealthMax(&quot;mouseover&quot;)
else
PQR_CustomTarget = &quot;player&quot;
PQR_CustomTargetHP = 100 * UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;)
local group = &quot;party&quot;
local members = GetNumPartyMembers()
lowhpmembers = 0
local lowest = 100
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)
local hrmemberhp = 100 * UnitHealth(member) / UnitHealthMax(member)
if UnitInRange(member)
and UnitIsFriend(&quot;player&quot;, member)
and UnitIsDeadOrGhost(member) == nil then
if UnitGroupRolesAssigned(member) == &quot;TANK&quot; then memberhp = memberhp - 1 end
if UnitThreatSituation(member) == 3 then memberhp = memberhp - 3 end
if UnitBuffID(member, 53563) ~= nil then memberhp = memberhp + 7 end
if hrmemberhp &lt; 75 then lowhpmembers = lowhpmembers +1 end
if memberhp &lt; 80 then lowhpmembers = lowhpmembers +1 end
if hrmemberhp &lt; lowest then
PQR_CustomTarget = member
lowest = memberhp
PQR_CustomTargetHP = 100 * UnitHealth(PQR_CustomTarget) / UnitHealthMax(PQR_CustomTarget)
end
if memberhp &lt; lowest then
PQR_CustomTarget = member
lowest = memberhp
PQR_CustomTargetHP = 100 * UnitHealth(PQR_CustomTarget) / UnitHealthMax(PQR_CustomTarget)
end
end
end
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Target</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Holy Light if player is at 95% HP --
<Ability>
<Name>Holy Light</Name>
<Default>false</Default>
<SpellID>635</SpellID>
<Actions></Actions>
<Lua>
if PQR_CustomTargetHP &lt; 95 and PQR_IsMoving(1) == false and PQR_IsCastingSpell(635) == false then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Custom</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Arcane Torrent if we are at 70% mana (BE only) --
<Ability>
<Name>Arcane Torrent</Name>
<Default>false</Default>
<SpellID>28730</SpellID>
<Actions></Actions>
<Lua>
local myMana = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
local BE = UnitRace(&quot;player&quot;)
if myMana &lt; 70 and BE == &quot;Blood Elf&quot; then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Devine Shield if my health is at 16% --
<Ability>
<Name>Divine Shield</Name>
<Default>false</Default>
<SpellID>642</SpellID>
<Actions></Actions>
<Lua>
local myHealth = 100 * UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;)
if myHealth &lt; 16 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Holy Shock if player is at 94% health --
<Ability>
<Name>Holy Shock</Name>
<Default>false</Default>
<SpellID>20473</SpellID>
<Actions></Actions>
<Lua>
if PQR_CustomTargetHP &lt; 94 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Custom</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast World of Glory if player is at 80% HP and we have 3 Holy Power --
<Ability>
<Name>Word of Glory</Name>
<Default>false</Default>
<SpellID>85673</SpellID>
<Lua>
local myHolyPower = UnitPower(&quot;player&quot;, 9)
if PQR_CustomTargetHP &lt; 80 and myHolyPower == 3 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Custom</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Make sure we buff ourself with Seal of Insight --
<Ability>
<Name>Seal of Insight</Name>
<Default>false</Default>
<SpellID>20165</SpellID>
<Actions></Actions>
<Lua>
local SoI = UnitBuffID(&quot;player&quot;, 20165)
if SoI == nil then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If a player is above 96% HP while we are casting, stop casting the heal --
<Ability>
<Name>AutoStopCasting</Name>
<Default>false</Default>
<SpellID>0</SpellID>
<Actions></Actions>
<Lua>
local Spell = UnitCastingInfo(&quot;player&quot;)
if PQR_CustomTargetHP &gt; 96 then
if Spell == &quot;Holy Light&quot; or Spell == &quot;Divine Light&quot; or Spell == &quot;Flash of Light&quot; then
SpellStopCasting()
end
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Light of Dawn if more than 3 players are below 80% HP --
<Ability>
<Name>Light of Dawn</Name>
<Default>false</Default>
<SpellID>85222</SpellID>
<Lua>
local myHolyPower = UnitPower(&quot;player&quot;, 9)
local myMana = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
if PQR_CustomTargetHP &lt; 80 and PQR_IsCastingSpell(635) == false and lowhpmembers &gt;= 3 and myMana &gt;10 and myHolyPower == 2 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
</Ability>
-- If we have 3 players below 75% HP cast Holy Radiance --
<Ability>
<Name>Holy Radiance</Name>
<Default>false</Default>
<SpellID>82327</SpellID>
<Actions></Actions>
<Lua>
local myMana = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
if lowhpmembers &gt;= 3 and myMana &gt;10 and PQR_IsMoving(1) == false then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If we are mounted, stop anything from being cast --
<Ability>
<Name>Don&apos;t Dismount</Name>
<Default>false</Default>
<SpellID>0</SpellID>
<Actions></Actions>
<Lua>
if IsMounted() then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Keep up Judgement for mana regen --
<Ability>
<Name>Judgement</Name>
<Default>false</Default>
<SpellID>20271</SpellID>
<Actions></Actions>
<Lua>
if UnitDebuff(&quot;target&quot;, &quot;Polymorph&quot;) or UnitDebuff(&quot;target&quot;, &quot;Freezing Trap&quot;) or UnitDebuff(&quot;target&quot;, &quot;Scatter Shot&quot;) or UnitDebuff(&quot;target&quot;, &quot;Bad Manner&quot;) or UnitDebuff(&quot;target&quot;, &quot;Ring of Frost&quot;) or UnitDebuff(&quot;target&quot;, &quot;Fear&quot;) or UnitDebuff(&quot;target&quot;, &quot;Sap&quot;) or UnitDebuff(&quot;target&quot;, &quot;Blind&quot;) or UnitDebuff(&quot;target&quot;, &quot;Hungering Cold&quot;) then
return false
end
local SoI = UnitBuffID(&quot;player&quot;, 20165)
local SoJ = UnitBuffID(&quot;player&quot;, 20164)
local SoR = UnitBuffID(&quot;player&quot;, 20154)
local SoT = UnitBuffID(&quot;player&quot;, 31801)
local JotP1 = UnitBuffID(&quot;player&quot;, 53655)
local JotP2 = UnitBuffID(&quot;player&quot;, 53656)
local JotP3 = UnitBuffID(&quot;player&quot;, 53657)
local inRange = IsSpellInRange(&quot;Judgement&quot;, &quot;target&quot;)
local myMana = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
if UnitAffectingCombat(&quot;player&quot;) then
if (SoR ~= nil or SoT ~= nil or SoJ ~= nil or SoI ~= nil) and JotP1== nil and JotP2 == nil and JotP3 == nil then
if IsSpellInRange(&quot;Judgement&quot;, PQR_CustomTargettarget) == 1 then
CastSpellByID(20271,PQR_CustomTargettarget)
end
elseif PQR_CustomTargetHP &gt; 80 then
if UnitAffectingCombat(&quot;player&quot;) and UnitIsEnemy(&quot;player&quot;, &quot;target&quot;) and inRange == 1 then
return true
end
end
end
if myMana &lt; 15 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Target</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If we are mounted switch to Crusader Aura --
<Ability>
<Name>CrusaderAura</Name>
<Default>false</Default>
<SpellID>32223</SpellID>
<Actions></Actions>
<Lua>
local Aura = GetShapeshiftForm(&quot;player&quot;)
if Aura ~= 5 and IsMounted() then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If we are not mounted make sure we are using ConcentractionAura --
<Ability>
<Name>ConcentrationAura</Name>
<Default>false</Default>
<SpellID>19746</SpellID>
<Actions></Actions>
<Lua>
local Aura = GetShapeshiftForm(&quot;player&quot;)
if Aura ~= 3 and IsMounted() == nil then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Divine Protection on 42% HP --
<Ability>
<Name>Divine Protection</Name>
<Default>false</Default>
<SpellID>498</SpellID>
<Actions></Actions>
<Lua>
local myHealth = 100 * UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;)
if myHealth &lt; 42 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If someone drops to 40% HP use Avenging Wrath --
<Ability>
<Name>Avenging Wrath</Name>
<Default>false</Default>
<SpellID>31884</SpellID>
<Actions></Actions>
<Lua>
if PQR_CustomTargetHP &lt; 40 then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If player is at 58% HP cast Divine Light --
<Ability>
<Name>Divine Light</Name>
<Default>false</Default>
<SpellID>82326</SpellID>
<Actions></Actions>
<Lua>
if PQR_CustomTargetHP &lt; 58 and PQR_IsMoving(1) == false and PQR_IsCastingSpell(82326) == false then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Custom</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If 3 or more players are below 45% HP use Divine Favor --
<Ability>
<Name>Divine Favor</Name>
<Default>false</Default>
<SpellID>31842</SpellID>
<Actions></Actions>
<Lua>
if PQR_CustomTargetHP &lt; 45 and lowhpmembers &gt;= 3 then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- When out mana drops to 85% use Devine plea --
<Ability>
<Name>Divine Plea</Name>
<Default>false</Default>
<SpellID>54428</SpellID>
<Actions></Actions>
<Lua>
local myMana = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
if myMana &lt; 85 then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If player is at 28% HP cast Flash of Light --
<Ability>
<Name>Flash of Light</Name>
<Default>false</Default>
<SpellID>19750</SpellID>
<Actions></Actions>
<Lua>
local Infusion = UnitBuffID(&quot;player&quot;, 54149)
if PQR_CustomTargetHP &lt; 28 and PQR_IsMoving(1) == false and PQR_IsCastingSpell(19750) == false then
return true
elseif PQR_CustomTargetHP &lt; 70 and PQR_IsMoving(.1) and Infusion ~= nil then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Custom</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Make sure we Cleanse certain debuffs --
<Ability>
<Name>Cleanse</Name>
<Default>false</Default>
<SpellID>0</SpellID>
<Actions></Actions>
<Lua>
local buff = { 96328, 96325, 96326, 92876, 92877, 92878, 86788, 30108, 34914 }
local group = &quot;party&quot;
local members = GetNumPartyMembers()
if GetNumRaidMembers() &gt; 0 then
group = &quot;raid&quot;
members = GetNumRaidMembers()
end
for i = 0, members, 1 do
if i==0 then mem = &quot;player&quot; else mem = group..tostring(i) end
if UnitInRange(mem) and UnitIsDeadOrGhost(mem) == nil then
local candispel = 1
for k,v in ipairs(buff) do
if UnitDebuffID(mem,v) then candispel = nil end
end
local j = 1
local debuff,_,_,count,bufftype,dur = UnitDebuff(mem, j)
while debuff do
if ((bufftype == &quot;Magic&quot;) or (bufftype == &quot;Curse&quot;)) and dur &gt; 1 and candispel then
CastSpellByID(51886 ,mem)
return true
end
j = j + 1;
debuff,_,_,count,bufftype,duration = UnitDebuff(mem, j)
end
end
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Target</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- If a player is at 30% HP use Guardian of Ancient Kings --
<Ability>
<Name>Guardian of Ancient Kings</Name>
<Default>false</Default>
<SpellID>86150</SpellID>
<Actions></Actions>
<Lua>
if PQR_CustomTargetHP &lt; 30 then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Old debuffs to Cleanse --
<Ability>
<Name>Cleanse Old</Name>
<Default>false</Default>
<SpellID>4987</SpellID>
<Actions></Actions>
<Lua>
local greencauldron = UnitDebuffID(PQR_CustomTarget, 96328)
local bluecauldron = UnitDebuffID(PQR_CustomTarget, 96325)
local redcauldron = UnitDebuffID(PQR_CustomTarget, 96326)
local blackout10 = UnitDebuffID(PQR_CustomTarget, 92876)
local blackout25 = UnitDebuffID(PQR_CustomTarget, 92878)
local unstableaf = UnitDebuffID(PQR_CustomTarget, 30108)
local ZGPoison = UnitDebuffID(PQR_CustomTarget, 97599)
local VT = UnitDebuffID(PQR_CustomTarget, 34941)
if greencauldron or bluecauldron or redcauldron or blackout10 or blackout25 or unstableaf or VT then
return false
else
for i=1,40 do
local _,_,_,count,ismagic,duration = UnitDebuff(PQR_CustomTarget,i)
if ismagic == &quot;Magic&quot; or ismagic == &quot;Disease&quot; or ismagic == &quot;Poison&quot; then
if duration &gt; 6 and count ~= 1 then
return true
end
end
end
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Custom</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Make sure we auto target the player with the lowest HP --
<Ability>
<Name>Autotarget Low HP (No MO)</Name>
<Default>false</Default>
<SpellID>0</SpellID>
<Lua>
if UnitExists(&quot;target&quot;)
and UnitIsDead(&quot;target&quot;) == nil
and UnitIsFriend(&quot;player&quot;, &quot;target&quot;)
and UnitCanCooperate(&quot;player&quot;,&quot;target&quot;)
then PQR_CustomTarget = &quot;target&quot;
PQR_CustomTargetHP = 100 * UnitHealth(&quot;target&quot;) / UnitHealthMax(&quot;target&quot;)
else
PQR_CustomTarget = &quot;player&quot;
PQR_CustomTargetHP = 100 * UnitHealth(&quot;player&quot;) / UnitHealthMax(&quot;player&quot;)
local group = &quot;party&quot;
local members = GetNumPartyMembers()
lowhpmembers = 0
local lowest = 100
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)
local hrmemberhp = 100 * UnitHealth(member) / UnitHealthMax(member)
if UnitInRange(member)
and UnitIsFriend(&quot;player&quot;, member)
and UnitIsDeadOrGhost(member) == nil then
if UnitGroupRolesAssigned(member) == &quot;TANK&quot; then memberhp = memberhp - 1 end
if UnitThreatSituation(member) == 3 then memberhp = memberhp - 3 end
if UnitBuffID(member, 53563) ~= nil then memberhp = memberhp + 7 end
if memberhp &lt; 80 then lowhpmembers = lowhpmembers +1 end
if hrmemberhp &lt; 75 then lowhpmembers = lowhpmembers +1 end
if hrmemberhp &lt; lowest then
PQR_CustomTarget = member
lowest = memberhp
PQR_CustomTargetHP = 100 * UnitHealth(PQR_CustomTarget) / UnitHealthMax(PQR_CustomTarget)
end
if memberhp &lt; lowest then
PQR_CustomTarget = member
lowest = memberhp
PQR_CustomTargetHP = 100 * UnitHealth(PQR_CustomTarget) / UnitHealthMax(PQR_CustomTarget)
end
end
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Target</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Cast Arcane Torrent at 80% mana (If we are a BE) --
<Ability>
<Name>Arcane Torrent - Test 2</Name>
<Default>false</Default>
<SpellID>28730</SpellID>
<Lua>
local myMana = 100 * UnitPower(&quot;player&quot;) / UnitPowerMax(&quot;player&quot;)
local BE, EN = UnitRace(&quot;player&quot;)
if myMana &lt; 80 and (BE == &quot;Blood Elf&quot; or EN == &quot;Blood Elf&quot;) then
return true
end
</Lua>
<RecastDelay>0</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Beacon the assigned Tank in dungeons --
<Ability>
<Name>Beacon</Name>
<Default>false</Default>
<SpellID>53563</SpellID>
<Lua>
local BeaconTarget = nil
local BeaconTank = nil
local BeaconTankTarget = nil
local group = &quot;party&quot;
local members = GetNumPartyMembers()
if GetNumRaidMembers() &gt; 0 then
group = &quot;raid&quot;
members = GetNumRaidMembers()
end
if group == &quot;raid&quot; and UnitExists(&quot;focus&quot;) then BeaconTarget = &quot;focus&quot; end
if group == &quot;party&quot; then
for i = 1, members, 1 do
local member = group..tostring(i)
local beacon = UnitBuffID(member, 53563)
if beacon ~= nil then BeaconTarget = member end
if UnitGroupRolesAssigned(member) == &quot;TANK&quot; and UnitIsDead(member) ~= 1 then
BeaconTank = member
BeaconTankTarget = 1
end
end
end
if BeaconTarget ~= nil then
local _, _, _, _, _, _, expire = UnitBuffID(BeaconTarget, 53563)
expire = (expire - GetTime())
if expire &lt; 5 then
CastSpellByID(53563, BeaconTarget)
end
end
if BeaconTankTarget and BeaconTarget == nil then
CastSpellByID(53563, BeaconTank)
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Player</Target>
<CancelChannel>False</CancelChannel>
</Ability>
-- Casts Beacon on our Focus/Mouseover using ALT modifier --
<Ability>
<Name>Beacon (Left Alt)</Name>
<Default>false</Default>
<SpellID>53563</SpellID>
<Lua>
if IsLeftAltKeyDown() and GetCurrentKeyBoardFocus() == nil then
return true
end
</Lua>
<RecastDelay>100</RecastDelay>
<Target>Mouseover</Target>
<CancelChannel>False</CancelChannel>
</Ability>
</PALADIN>
I have lowerd what health HR gets cast, and also added LoD