Wikia

WoWWiki

UnitFlag

Talk0
102,229pages on
this wiki
API types

ConstantsEdit

Constant bitfield
Type
COMBATLOG_OBJECT_TYPE_MASK0x0000FC00
COMBATLOG_OBJECT_TYPE_OBJECT0x00004000
COMBATLOG_OBJECT_TYPE_GUARDIAN0x00002000
COMBATLOG_OBJECT_TYPE_PET0x00001000
COMBATLOG_OBJECT_TYPE_NPC0x00000800
COMBATLOG_OBJECT_TYPE_PLAYER0x00000400
Controller
COMBATLOG_OBJECT_CONTROL_MASK0x00000300
COMBATLOG_OBJECT_CONTROL_NPC0x00000200
COMBATLOG_OBJECT_CONTROL_PLAYER0x00000100
Reaction
COMBATLOG_OBJECT_REACTION_MASK0x000000F0
COMBATLOG_OBJECT_REACTION_HOSTILE0x00000040
COMBATLOG_OBJECT_REACTION_NEUTRAL0x00000020
COMBATLOG_OBJECT_REACTION_FRIENDLY0x00000010
Controller affiliation
COMBATLOG_OBJECT_AFFILIATION_MASK0x0000000F
COMBATLOG_OBJECT_AFFILIATION_OUTSIDER0x00000008
COMBATLOG_OBJECT_AFFILIATION_RAID0x00000004
COMBATLOG_OBJECT_AFFILIATION_PARTY0x00000002
COMBATLOG_OBJECT_AFFILIATION_MINE0x00000001
Special cases (non-exclusive)
COMBATLOG_OBJECT_SPECIAL_MASK0xFFFF0000
COMBATLOG_OBJECT_NONE0x80000000
COMBATLOG_OBJECT_RAIDTARGET80x08000000
COMBATLOG_OBJECT_RAIDTARGET70x04000000
COMBATLOG_OBJECT_RAIDTARGET60x02000000
COMBATLOG_OBJECT_RAIDTARGET50x01000000
COMBATLOG_OBJECT_RAIDTARGET40x00800000
COMBATLOG_OBJECT_RAIDTARGET30x00400000
COMBATLOG_OBJECT_RAIDTARGET20x00200000
COMBATLOG_OBJECT_RAIDTARGET10x00100000
COMBATLOG_OBJECT_MAINASSIST0x00080000
COMBATLOG_OBJECT_MAINTANK0x00040000
COMBATLOG_OBJECT_FOCUS0x00020000
COMBATLOG_OBJECT_TARGET0x00010000

ExplanationEdit

A unit can only be one type from each of the following four categories:

  1. Type
  2. Controller
  3. Reaction
  4. Controller affiliation

Here’s a quick explanation of how these flags are broken down:

TypeEdit

This is the way the unit is currently being controlled:

  • Units directly controlled by humans are players.
  • Units controlled by the server are NPCs.
  • Pets are units controlled by a player or NPC.
  • Guardians are automatons that are not controlled, but automatically defend their master.
  • Objects are everything else, such as Traps.

The result is that these bits can tell you what kind of unit that combat log object was.

ControllerEdit

This is who currently controls this object. It can only be controlled by a physical human player or by a server NPC.

ReactionEdit

This is the unit’s faction reaction, relative to you. Anything that hates you is Hostile, anything that is friendly with you is Friendly, everything else is Neutral.

Controller affiliationEdit

A unit’s controller affiliation is the unit’s controller relationship relative to YOU. Either it is controlled by you, your party, your raid or someone else.

Mine
Party
Raid
Outsiders

ExampleEdit

  • A player who is dueling you is 0x0548 (A hostile player controlled by an outsider physical human being)
  • A player who was mind controlled by another player that attacks you is 0x1148 (A hostile pet who is controlled by an outsider player)
    • Since 0x1148 can also be an enemy player's pet you need to check the unit GUID to know if it's an enemy pet or a player character.
  • A player who was charmed by a NPC is 0x1248 (A hostile pet controlled by an outsider NPC)
if bit.band(UnitFlag, COMBATLOG_OBJECT_CONTROL_PLAYER) > 0 then
  print("Controller: a player")
end

Around Wikia's network

Random Wiki