-- COMBAT_LOG_EVENT_UNFILTERED
function (eventName, ...)
local timestamp, type, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = ...;
if (type == "SPELL_CAST_START") then
local spellId, spellName, spellSchool = select(12, ...);
for castOnMeSpell, castOnMe in pairs(ZNT["CastOnMe"]) do
if (castOnMeSpell == spellName) then -- spell matched
if (castOnMe[1] == "" or castOnMe[1] == sourceName) then -- source matched
local isTargetOnMe = false;
for i=1, 40 do
local nmps = "nameplate" .. i;
local nmpGUID = UnitGUID(nmps);
if (nmpGUID == sourceGUID) then
if (UnitIsUnit("nameplate" .. i .. "target", "player")) then
isTargetOnMe = true;
end
break;
end
end
if (isTargetOnMe) then -- target on me
-- alert message
if (castOnMe[2] ~= "") then
SendChatMessage(castOnMe[2]);
end
-- alert sound
if (castOnMe[3] ~= "") then
PlaySoundFile(ZNSM[castOnMe[3]]);
end
end
end
break -- break when spell matched anyway...
end
end -- for castOnMeSpell, castOnMe in pairs(ZNT["CastOnMe"]) do
for castAnySpell, castAny in pairs(ZNT["CastAny"]) do
if (castAnySpell == spellName) then -- spell matched
if (castAny[1] == "" or castAny[1] == sourceName) then -- source matched
-- alert message
if (castAny[2] ~= "") then
SendChatMessage(castAny[2]);
end
-- alert sound
if (castAny[3] ~= "") then
PlaySoundFile(ZNSM[castAny[3]]);
end
end
break -- break when spell matched anyway...
end
end -- for castAnySpell, castAny in pairs(ZNT["CastAny"]) do
end -- if (type == "SPELL_CAST_START") then
end