function CritSound_OnLoad()
this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
end
function CritSound_OnEvent(self, event, ...)
local timestamp, event, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
if CombatLog_Object_IsA(sourceFlags, COMBATLOG_FILTER_MINE) then
-- 技能、法术。
if (event == "SPELL_DAMAGE") then
critical = select(18, ...)
if critical then
PlaySoundFile("Interface\\AddOns\\CritSound\\appla use2.mp3","Interface\\AddOns\\CritSound\\applause1 .mp3","Interface\\AddOns\\CritSound\\applause3.mp3 ","Interface\\AddOns\\CritSound\\applause4.mp3 ");
end
-- 伤害护盾,如闪电盾。
elseif (event == "DAMAGE_SHIELD") then
critical = select(18, ...)
if critical then
PlaySoundFile("Interface\\AddOns\\CritSound\\appla use4.mp3","Interface\\AddOns\\CritSound\\applause2 .mp3","Interface\\AddOns\\CritSound\\applause3.mp3 ","Interface\\AddOns\\CritSound\\applause1.mp3 ");
end
-- 和近战攻击相关。
elseif (event == "SWING_DAMAGE") then
critical = select(15, ...)
if critical then
PlaySoundFile("Interface\\AddOns\\CritSound\\appla use3.mp3","Interface\\AddOns\\CritSound\\applause2 .mp3","Interface\\AddOns\\CritSound\\applause1.mp3 ","Interface\\AddOns\\CritSound\\applause4.mp3 ");
end
-- 和远程攻击相关,如猎人的弓弩射击或术士(法师、牧师)的魔杖攻击。
elseif (event == "RANGE_DAMAGE") then
critical = select(18, ...)
if critical then
PlaySoundFile("Interface\\AddOns\\CritSound\\appla use1.mp3","Interface\\AddOns\\CritSound\\applause2 .mp3","Interface\\AddOns\\CritSound\\applause3.mp3 ","Interface\\AddOns\\CritSound\\applause4.mp3 ");
end
-- 治疗法术。
elseif (event == "SPELL_HEAL") then
critical = select(14, ...)
if critical then
PlaySoundFile("Interface\\AddOns\\CritSound");
end
end
end