------------------------------------------------------
--- Config
------------------------------------------------------
local raid = true;
local RaidYell = false;
local party = true;
local PartyYell = false;
------------------------------------------------------
--- the Magic
------------------------------------------------------
local OUTPUT = "%s interrupted %s from %s";
local function OnEvent(self, event, ...)
if ( event == "PLAYER_LOGIN" ) then
self:UnregisterEvent("PLAYER_LOGIN");
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
elseif ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then
local timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellID, spellName, _, extraskillID, extraSkillName = ...;
if ( eventType == "SPELL_INTERRUPT" ) and sourceName == UnitName("player") then
local text = OUTPUT:format(GetSpellLink(spellID), GetSpellLink(extraskillID), destName);
if ( PartyYell == true and RaidYell == true ) or
( PartyYell == true and RaidYell == false and not UnitInRaid("player") ) or
( PartyYell == false and RaidYell == true and not UnitInParty("player") ) then
SendChatMessage(text, "YELL");
end;
if ( UnitInRaid("player") and raid == true ) then
SendChatMessage(text, "RAID");
elseif ( UnitInParty("player") and party == true ) then
SendChatMessage(text, "PARTY");
elseif not ( UnitInParty("player") ) or not ( UnitInRaid("player") ) then
SendChatMessage(text, "SAY");
end;
end;
end;
end;
local Interrupt = CreateFrame("Frame");
Interrupt:RegisterEvent("PLAYER_LOGIN");
Interrupt:SetScript("OnEvent", OnEvent);