Need some help switching my addon over to 5.4.2, the simple function below is working for 4.3.4.
What it does is prints the Caster and the spell name of spells being cast around me, however i cant get it to work with 5.4.2, not sure if its a change in COMBAT_LOG_EVENT_UNFILTERED or not, any help is appreciated!
local function OnEvent(self, event, ...)
if ( event == "PLAYER_ENTERING_WORLD" ) then
self:UnregisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
elseif ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then
local timestamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName, _, extraskillID, extraskillname = ...;
if (eventType == "SPELL_CAST_START") and sourceName~=UnitName("player") then
print(sourceName,spellName)
end
end
end
local casts = CreateFrame("Frame")
casts:RegisterEvent("PLAYER_ENTERING_WORLD")
casts:SetScript("OnEvent", OnEvent)