local _,ns = ...
ns.ADDUIEVENT("PLAYER_LOGIN", function()
if AddUIDB.stop ==  false  then return end

-------------------------------------
-- 打斷提示 
-------------------------------------
local frame = CreateFrame("Frame", nil, UIParent)
frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
frame:SetScript("OnEvent", function(self, event, ...)
    local _, subevent, _, _, sourceName, sourceFlag, _, _, destName, _, _, _, _, _, extraSpellID = CombatLogGetCurrentEventInfo()
    if (subevent ~= 'SPELL_INTERRUPT') then return end
    if (bit.band(sourceFlag, COMBATLOG_OBJECT_AFFILIATION_MINE) == 0) then return end
    if (not sourceName) then return end
	if (destName == UnitName("Player")) then return end
    local msg = format("%s>%s<的%s",  "已打断", destName or "", C_Spell.GetSpellLink(extraSpellID))
	SendChatMessage(msg, "EMOTE")
end)
--驱散
local frame = CreateFrame("Frame", nil, UIParent)
frame:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')
frame:SetScript("OnEvent", function(self, event, ...)
    local _, subevent, _, _, sourceName, sourceFlag, _, _, destName, _, _, _, _, _, extraSpellID = CombatLogGetCurrentEventInfo()
	if (subevent ~= 'SPELL_DISPEL') then return end
	if sourceName==UnitName("player") or sourceName==UnitName("pet") then
		PlaySoundFile("Interface\\AddOns\\AddUI\\Func\\call\\驱散成功音效.mp3","Master")
	end
end)

end)