function(event, _, subevent, _, _, sourceName, _, _, destGUID, destName, _, _, spellId, spellName) -- Store Target GUID of empowered rends if (subevent == "SPELL_AURA_APPLIED" or subevent == "SPELL_AURA_REFRESH") and spellName == aura_env.rend and sourceName == UnitName("player") then local targetGuid = UnitGUID("target") local rendGlyphId = 58385 -- spell-id goes here local hasRendGlyph = false local NUM_GLYPH_SLOTS = GetNumGlyphSockets(); for i=1, NUM_GLYPH_SLOTS do if (string.find(select(3, GetGlyphSocketInfo(i)),rendGlyphId)) then hasRendGlyph = true break end end if hasRendGlyph then rendTime = 21 --print("glyph there") else rendTime = 15 --print("glyph not there") end local maxHP = UnitHealthMax("target") local curHP = UnitHealth("target") local perHP = curHP * 100 / maxHP if perHP > 75 then --rend does more when applied to >75% health target --check if target is already recorded, if it is clear it if aura_env.empoweredRendTarget[destGUID] then aura_env.empoweredRendTarget[destGUID] = nil empoweredRendTimer:Cancel() --print("replacing" .. destGUID) end aura_env.empoweredRendTarget[destGUID] = true --print(destGUID) empoweredRendTimer = C_Timer.NewTimer(rendTime,function() --print("cleaning up" .. destGUID) aura_env.empoweredRendTarget[destGUID] = nil end,1) else --print(destGUID) if aura_env.empoweredRendTarget[destGUID] then aura_env.empoweredRendTarget[destGUID] = nil empoweredRendTimer:Cancel() --print("replacing" .. destGUID) end end end end