API COMBAT LOG EVENT


 * COMBAT_LOG_EVENT_UNFILTERED redirects to this page, but most add-on developers will want to use it in preference to COMBAT_LOG_EVENT, because the events provided by the latter will only reflect the user's actual combat log.


 * Note: COMBAT_LOG_EVENT and COMBAT_LOG_EVENT_UNFILTERED have identical parameters. All information provided here applies to both events.

Base Parameters
The timestamp parameter has almost the same format as the return value of the time function. You can use it as the second parameter to date. The only difference is that time returns an integer (the unit is seconds), while the timestamp parameter has three decimal places (milliseconds). That means (timestamp-floor(timestamp))*1000 is the number of milliseconds of the timestamp.

More information on GUIDs (including format, how to tell a player from an NPC, pets, mob IDs, and more) can be found on the API UnitGUID page.

More information on raid flags can be found on the Raid Flag page.

Events
How to get full event strings: Read prefix to suffix in order and use the parameter table as specified. Unused entries are nil. A Blank cell means that there are no additional arguments for this pre- or suffix.

Prefixes
The Parameters listed with prefixes are numbered in the order they come after the base 9 parameters.

Suffixes
The Parameters listed with suffixes are numbered in the order they come after the prefix parameters. Note that for the SWING prefix, _DAMAGE starts at the 12th parameter. For ENVIRONMENTAL, it starts at the 13th.

Special Events
† These events are pretty much useless. They are triggered when a weapon's enchant changes, but before the API information is updated to reflect the change. It is possible for main-hand and off-hand wielded weapons to have the same itemID. So we might not even know for sure which wea pon the enchant changed on. When an enchant is reapplied the original is removed first, triggering an ENCHANT_REMOVED event before a ENCHANT_APPLIED event is triggered.

A much better way of tracking temporary weapon enchants is to use the UNIT_INVENTORY_CHANGED event (a true event, not part of a COMBAT_LOG_EVENT_UNFILTERED) which is triggered every time an enchant changes. What's more, the information on the temporary enchants available through the API has been updated at the point this event is triggered. Sometimes the event is triggered twice however.

Spell School

 * Source: Coloring, Masks & Strings

Power Type
Note that 4.1 removed pet happiness (Power Type 4).

Miss type

 * "ABSORB"
 * "BLOCK"
 * "DEFLECT"
 * "DODGE"
 * "EVADE"
 * "IMMUNE"
 * "MISS"
 * "PARRY"
 * "REFLECT"
 * "RESIST"

Aura Type

 * "BUFF"
 * "DEBUFF"

Environmental Type

 * "DROWNING"
 * "FALLING"
 * "FATIGUE"
 * "FIRE"
 * "LAVA"
 * "SLIME"
 * More possible but currently unconfirmed

Failed Type

 * "A more powerful spell is already active"
 * "Another action is in progress"
 * "Can only use outside"
 * "Can only use while swimming"
 * "Can't do that while asleep"
 * "Can't do that while charmed"
 * "Can't do that while confused"
 * "Can't do that while fleeing"
 * "Can't do that while horrified"
 * "Can't do that while incapacitated"
 * "Can't do that while moving"
 * "Can't do that while silenced"
 * "Can't do that while stunned"
 * "Interrupted"
 * "Invalid target"
 * "Item is not ready yet"
 * "Must be in Bear Form, Dire Bear Form"
 * "Must have a Ranged Weapon equipped"
 * "No path available"
 * "No target"
 * "Not enough energy"
 * "Not enough mana"
 * "Not enough rage"
 * "Not yet recovered"
 * "Nothing to dispel"
 * "Out of range"
 * "Target is friendly"
 * "Target is hostile"
 * "Target needs to be in front of you."
 * "Target not in line of sight"
 * "Target too close"
 * "You are dead"
 * "You are in combat"
 * "You are in shapeshift form"
 * "You are unable to move"
 * "You can't do that yet"
 * "You must be behind your target."
 * "Your target is dead"
 * More possible but currently unconfirmed

Introduction
I wanted to post some info about what I have learned about using this event. I think the description of how the work arguments is confusing. Hopefully this provides some clarity.

There are always at least 11 arguments. (arg1 through arg11) Depending on the Prefix there will be 0, 1, or 3 more arguments. These will be numbered starting with 12 and going up to 14 if necessary. Depending on the Suffix there will be 0-8 more arguments. These will be numbered starting from the last Prefix argument (IE 12, 13, or 15).

Sample Arguments Example
Example: The following 2 examples show the parameters used for a SPELL_MISS event and a SWING_DAMAGE events

Simple Function Example
Example the following function would display a message whenever a Mind Blast crits.

Foo.lua local frame = CreateFrame("FRAME"); frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED"); frame:SetScript("OnEvent", function(self, event, ...)  local timestamp, type, hideCaster,     sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = ...   --     * Note, for this example, you could just use 'local type = select(2, ...)'.  The others are included       so that it's clear what's available.     * You can also lump all of the arguments into one block (or one really long line):     local timestamp, type, hideCaster,                                                                      -- arg1  to arg3       sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags,   -- arg4  to arg11       spellId, spellName, spellSchool,                                                                      -- arg12 to arg14       amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ...             -- arg15 to arg23 if (event == "COMBAT_LOG_EVENT_UNFILTERED") then if (type == "SPELL_DAMAGE") then local spellId, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = select(10, ...) if (spellName == "Mind Blast" and critical == 1) then -- "== 1" for clarity only. Not needed. print("Mind Blast Just Critted!") end end end end);

Event Descriptions
Summary Of what I have learned about when events fire and when they don't: (Preliminary)