Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

UnitFlag

Last wiki revision 2023-04-26

Unit flags contain information for a unit in the combat log. They are returned from COMBAT_LOG_EVENT and params.

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

  • 1) Type: The way the unit is currently being controlled.
  • 2) Controller: Who currently controls this unit - an NPC or a player.
  • 3) Reaction: The unit's reaction, relative to you - hostile, friendly or neutral.
  • 4) Affiliation: If the unit belongs to you (your character, pet, mind controlled) or is in your party or raid, or neither.

Source: FrameXML/Constants.lua

A few of these example situations were with the unit targeted (COMBATLOG_OBJECT_TARGET). Some situations are not distinguishable from each other without additional checks.

  • A player who is dueling you is (A hostile outsider player controlled by a player)
  • A player who was mind controlled by another player that attacks you is (A hostile outsider pet controlled by a player)
  • Since 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 an NPC is (A hostile outsider pet controlled by an NPC)
  • Checks if the unit is friendly.
  • Prints unit flag information for the dest unit on combat log events.
  • A hostile NPC in the world.
  • [[File:UnitFlag1.png]]
  • A friendly player in the world.
  • [[File:UnitFlag2.png]]
  • Your combat pet.
  • [[File:UnitFlag3.png]]
  • Your mind controlled NPC.
  • [[File:UnitFlag4.png]]
  • You are mind controlled by a player. Affiliation appears to change to outsider.
  • [[File:UnitFlag7.png]]
  • A party member.
  • [[File:UnitFlag5.png]]
  • A party member mind controlled by a friendly player (who is not in your party) in a duel.
  • [[File:UnitFlag6.png]]

It's convenient to use for checking multiple bitfields.

They were previously part of the special cases section as follows:

Source

https://warcraft.wiki.gg/wiki/UnitFlag · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.