Code:
<?xml version="1.0" encoding="utf-8" ?><DRUID><Ability><Name>-- Loader --</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>-- Make sure we&apos;re only loading once
if not loaded then
-- Global Variable
Perform = { }
-- Create our event handler function
function EventHandler(self, event, ...)
-- Check for a combat log event
if event == &quot;COMBAT_LOG_EVENT_UNFILTERED&quot; then
-- Check for a debuff addition on a member of the raid, party or player
if select(2, ...) == &quot;SPELL_AURA_APPLIED&quot; and
select(15, ...) == &quot;DEBUFF&quot; and
bit.band(select(10, ...), COMBATLOG_OBJECT_AFFILIATION_OUTSIDER) ~= 8
then
Perform[&quot;action&quot;] = &quot;Decurse&quot;
Perform[&quot;spell&quot;] = select(13, ...)
Perform[&quot;spellid&quot;] = select(12, ...)
PQR_CustomTarget = select(9, ...)
end
end
end
-- Create our frame and bind combat log events
frame = CreateFrame(&quot;FRAME&quot;, &quot;OurFrame&quot;)
frame:RegisterEvent(&quot;COMBAT_LOG_EVENT_UNFILTERED&quot;)
frame:SetScript(&quot;OnEvent&quot;, EventHandler)
-- Stop multiple loads
loaded = true
end</Lua><RecastDelay>0</RecastDelay><Target>Player</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>Decurse</Name><Default>false</Default><SpellID>2782</SpellID><Actions></Actions><Lua>-- Define what we&apos;d like to decurse
Decurse = { &quot;Living Bomb&quot; }
-- Define the spell, just for range etc. checks
DecurseSpell = 2782
-- Check we&apos;ve got something to decurse
if Perform[&quot;action&quot;] == &quot;Decurse&quot; then
-- Get debuff details
local Name,_,_,_,Type,Duration,Expires = UnitDebuff(PQR_CustomTarget, Perform[&quot;spell&quot;])
-- Check the debuff is something we can deal with
if Name ~= nil and
tableFind(Decurse, Perform[&quot;spell&quot;]) ~= false and
Expires - GetTime() &gt;= 2 and
spellCheck(DecurseSpell, PQR_CustomTarget) ~= false
then
-- Debug messages
local spell = &quot;|cff71d5ff|Hspell:&quot;..Perform[&quot;spellid&quot;]..&quot;|h[&quot;..Perform[&quot;spell&quot;]..&quot;]|h|r&quot;
print(&quot;Removing&quot;, spell, &quot;from&quot;, classColor(UnitName(PQR_CustomTarget), true)..&quot;.&quot;)
-- Reset perform
Perform = { }
-- Cast It!
return true
end
end</Lua><RecastDelay>1000</RecastDelay><Target>Custom</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability><Ability><Name>-- Functions --</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua>-- Make sure we&apos;re only declaring once
if not functions then
-- FUNCTION: spellCheck
-- ACCEPTS: SpellID or Name and Unit
-- PERFORMS: Various range, afinity and other checks to ensure a spell should be cast
-- RETURNS: 1 or 0 depending on the check results
function spellCheck(spell, target)
local Cast = true;
local SpellName = GetSpellInfo(spell)
if UnitExists(target) == nil or
UnitIsDeadOrGhost(target) or
UnitCanCooperate(&quot;player&quot;, target) == nil or
IsSpellInRange(SpellName, target) == 0 or
UnitChannelInfo(&quot;player&quot;) ~= nil or
PQR_IsOutOfSight(target)
then Cast = false end
return Cast
end
-- FUNCTION: classColor
-- ACCEPTS: String Name, Boolean use [ ] around name?
-- PERFORMS: Builds a class coloured hyperlink to be used in chat
-- RETURNS: A hyperlink string
function classColor(name, brackets)
local str = name
if UnitExists(name) then
local playerClass, englishClass = UnitClass(name)
local color = RAID_CLASS_COLORS[englishClass]
str = Hex(color)..&quot;|Hplayer:&quot;..name..&quot;|h&quot;
if brackets == true then str = str..&quot;[&quot;..name..&quot;]|h|r&quot; else str = str..name..&quot;|h|r&quot; end
end
return str
end
-- FUNCTION: Hex
-- ACCEPTS: table r of r,g,b colors, or seperate r,g,b values
-- PERFORMS: takes the input colours and turns them into a hex value for coloring chat
-- RETURNS: Hex string
function Hex(r, g, b)
if(type(r) == &quot;table&quot;) then if(r.r) then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end end
if(not r or not g or not b) then r, g, b = 1, 1, 1 end
return format(&quot;|cff%02x%02x%02x&quot;, tonumber(r*255), tonumber(g*255), tonumber(b*255))
end
-- FUNCTION: table.find
-- ACCEPTS: table name, value to find
-- PERFORMS: Searches the given table for the value
-- RETURNS: position if found, false on not
function tableFind(table, value)
if type(table) == &quot;table&quot; and value then
for k, val in pairs(table) do
if val:lower() == value:lower() then return true end
end
end
return false
end
-- Stop multiple loads
functions = true
end</Lua><RecastDelay>0</RecastDelay><Target>Player</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability></DRUID>