View Single Post
03-02-20, 12:40 PM   #1
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Help with COMBAT_LOG_EVENT_UNFILTERED (CLASSIC)

It's been a long time since I've made a WoW addon, and I'm a bit stuck. Using a modified snippet from the wowwiki I came up with the following, which doesn't give any error but also doesn't print '... just critted!'.

Code:
local frame = CreateFrame("FRAME", "FooAddonFrame");
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");

function eventHandler(self, event, ...)
    local timestamp, type, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2 = select(1, ...);

    if (event == "COMBAT_LOG_EVENT_UNFILTERED") then
      if (type == "SWING_DAMAGE") then
  
        local amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = select(15, ...);

        if (spellName == "Sinister Strike" and critical == true) then
          print("Sinister Strike just critted!");
        end
      end
    end
end

frame:SetScript("OnEvent", eventHandler);
  Reply With Quote