Wow, that code was horrible to read. Give this a shot:
Code:
local spellIds = {
[42292] = "SPELL_CAST_SUCCESS",
[7744] = "SPELL_CAST_SUCCESS",
};
local f = CreateFrame("frame");
f:SetScript("OnEvent", function(self, event, ...) f[event](f, ...); end);
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
function f:COMBAT_LOG_EVENT_UNFILTERED(...)
local _, event, _, sourceGuid, _, _, _, _, _, _, _, spellId, spellName = select(1, ...);
if ( sourceGuid == UnitGUID("player") and event == spellIds[spellId] ) then
if ( GetNumPartyMembers() > 0 ) then -- not sure about returns
SendChatMessage(spellName.." used!", "PARTY");
end
end
end