Returns the general threat status of a unit. See UnitDetailedThreatSituation
for details about threat values.
Threat information for a pair of units is only returned if the player has threat against the NPC unit in question. (For example, no threat data is provided if the player's pet is attacking an NPC but the player himself has taken no action, even though the pet has threat against the NPC.)
See also Threat functions.
Signature:
status
=
UnitThreatSituation(unit
[,
mobUnit])
or
UnitThreatSituation("name"
[,
mobUnit])
Arguments:
unit
- The unit whose threat situation is being requested (unitid
)name
- The name of a unit to query. Only valid for the player, pet, and party/raid members. (string
)mobUnit
- An NPC unit the first unit may have threat against; if nil, returned values reflect whichever NPC unit the first unit has the highest threat against. (unitid
)
Returns:
status
- A threat status category (number
)0
- Unit has less than 100% raw threat (default UI shows no indicator)1
- Unit has 100% or higher raw threat but isn'tmobUnit
's primary target (default UI shows yellow indicator)2
- Unit ismobUnit
's primary target, and another unit has 100% or higher raw threat (default UI shows orange indicator)3
- Unit ismobUnit
's primary target, and no other unit has 100% or higher raw threat (default UI shows red indicator)