WoW API: UnitThreatSituation
Jump to navigation
Jump to search
← WoW API < UnitThreatSituation
Returns brief information about a unit's standing in another unit's threat table. New in Patch 3.0.
status = UnitThreatSituation("unit", "mob")
Parameters
Arguments
- unit
- String - The UnitId whose threat to query (e.g. "player", "party2", "pet", etc.)
- mob
- String - The UnitId of the unit whose threat table to query (e.g. "target", "pettarget" etc.)
Returns
- status
- Integer - returns the threat status for the unit on the mob, or nil if unit is not on mob's threat table. (3 = securely tanking, 2 = insecurely tanking, 1 = not tanking but higher threat than tank, 0 = not tanking and lower threat than tank)
Example
local status, statustxts = UnitThreatSituation("player", "target"), {"low on threat", "overnuking", "losing threat", "tanking securely"}; ChatFrame1:AddMessage('You are ' .. statustxts[status+1] .. '.');
Result
- Prints a description of the player's threat situation to the chat frame. e.g.
You are overnuking.
Details
- The function will return nil if the unit is not on the mob's threat list or if either unit isn't available.