WoW:UnitFlag: Difference between revisions

104 bytes added ,  10 March 2010
→‎Example: added an code example
m (Corrected spelling/grammar)
(→‎Example: added an code example)
Line 127: Line 127:
**Since '''0x1148''' can also be an enemy player's pet you need to check the [[API UnitGUID| unit GUID]] to know if it's an enemy pet or a player character.
**Since '''0x1148''' can also be an enemy player's pet you need to check the [[API UnitGUID| 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)
*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
Anonymous user