There is a way to do this. I have no idea if it'll work properly, but here's some code:
(I'll test it when I can)
Code:
-- Custom Trigger: Event: COMBAT_LOG_EVENT
-- Trigger
function(evt,timestamp,event,hideCaster,sourceGUID,sourceName,sourceFlags,sourceFlags2,destGUID,destName,destFlags,destFlags2,spellId,spellName,spellSchool,extraSpellID,extraSpellName,extraSchool)
-- Check if the boss cast a spell or apllied an aura to you
if event == "SPELL_CAST_SUCCESS" or event == "SPELL_AURA_APPLIED" then
local me = UnitName("player") -- May need to remove -Server, but I don't think so
local boss = UnitName("boss1") -- There can be a lot of bosses, but let's use 1 for this
-- Is the one who cast the spell the boss? And am I the one who got targeted?
if sourceName == boss and destName == me then
-- Just saving the spell name
aura_env.IgotTargetBythisSpell = spellName
return true
end
end
end
-- Name
function()
return aura_env.IgotTargetBythisSpell
end
-- Icon
function()
_, _, icon = GetSpellInfo(aura_env.IgotTargetBythisSpell)
return icon
end