→ WoW API
Retrieve info about a specified debuff on a certain unit.
name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, nameplateShowAll, timeMod, value1, value2, value3 = UnitDebuff("unit", index[, "filter"]]) = UnitDebuff("unit", "name"[, "rank"[, "filter"]])
- String (unitId) - unit whose debuffs to query.
- index or name
- Number or String - index (from 1 to 40) or name of the debuff to query.
- String (optional) - rank of the debuff to query; only available in combination with name.
- String (optional) - list of filters, separated by spaces or pipes. "HELPFUL" by default. The following filters are available:
- PLAYER - debuffs that were applied by the player.
- RAID - debuffs that can be dispelled by the player.
- CANCELABLE - buffs that can be removed (such as by right-clicking or using the /cancelaura command)
- NOT_CANCELABLE - buffs that cannot be removed
- String - The name of the spell or effect of the debuff, or nil if no debuff was found with the specified name or at the specified index. This is the name shown in yellow when you mouse over the icon.
- String - The rank of the spell or effect that caused the debuff. Returns "" if there is no rank.
- Number (fileID) - identifier of the texture used for the debuff's icon.
- Number - The number of times the debuff has been applied to the target. Returns 0 for any debuff which doesn't stack. ( Changed in 1.11 ).
- String - The type of the debuff: Magic, Disease, Poison, Curse, or nothing for those with out a type.
- Number - The full duration of the debuff in seconds; nil if the debuff was not cast by the player.
- Number - Time at which the debuff expires (GetTime() as a reference frame).
- String - unitId reference to the unit that cast the buff/debuff.
- Boolean - true if it is sealable
- Boolean - true if the buff should be shown on the player/pet/vehicle nameplate
- Number - spell ID of the aura.
- Boolean - true if the player can apply the aura (not necessarily if the player did apply the aura, just if the player can apply the aura).
- Boolean - true if the aura was cast by a boss.
- Boolean - true if the buff should be shown on nameplates
- Number - scaling factor for displaying time left
- Number - Value of variable effect 1 of the aura. (HoTs, resource-capturing trinkets, etc.)
- Number - Value of variable effect 2 of the aura. (HoTs, resource-capturing trinkets, etc.) - Malkorok's shield value (for all versions of the debuff), and Tortus' heroic's shield value.
- Number - Value of variable effect 3 of the aura. (HoTs, resource-capturing trinkets, etc.) - Norushen's Corruption debuff power value for example.
The following snippet prints the name, icon, and time left for each debuff on the player:
for i=1,40 do local name, _, icon, _, _, _, etime = UnitDebuff("player",i) if name then print(("%d=%s, %s, %.2f minutes left."):format(i,name,icon,(etime-GetTime())/60)) end end
- This is essentially an alias of UnitAura with the "HARMFUL" filter applied.
- UnitDebuff and other UnitAura-based queries may not be accurate immediately after casting a spells that applies an aura to its target.
- Patch 7.0.3 (2016-07-19): Added return values "nameplateShowAll" and "timeMod"; changed "shouldConsolidate" to "nameplateShowPersonal".
- Patch 4.2.0 (2011-06-28): Re-added the return values "canApplyAura" and "isBossDebuff" and added return values value[1-3].
- Patch 4.0.1 (2010-10-12): Removed the return values "canApplyAura" and "isBossDebuff".
- Patch 3.3.0 (2009-12-08): Added shouldConsolidate and spellId.
- Patch 3.1.0 (2009-04-14): Changed "isMine" to "unitCaster". It is now possible for addons to retrieve the unitId that cast the buff/debuff.
- Patch 3.0.2 (2008-10-14): Changed this into an alias of UnitAura; durations are now available for all debuffs.
- Patch 2.1.0 (2007-05-22): Introduced duration and timeLeft return values.
- Patch 2.0.1 (2006-12-05): Introduced name and rank return values and extended the maximum number of debuffs to 40 (from 16).
- Patch 1.9.0 (2006-01-03): Introduced the removable argument.