WoW:API UnitDebuff: Difference between revisions

Reformat. Update FAQ link.
(Added debuffDispelType return type (from 1.11))
(Reformat. Update FAQ link.)
Line 1: Line 1:
<center>'''UnitDebuff''' ''-Documentation by Sarf-''</center>
{{wowapi}} __NOTOC__


Retrieve info about a certain debuff on a certain unit.
Retrieve info about a certain debuff on a certain unit.


  debuffTexture, debuffApplications, debuffDispelType = UnitDebuff(unitName, debuffIndex, showDispellable);
  debuffTexture, debuffApplications, debuffDispelType = UnitDebuff(unitID, debuffIndex, showDispellable);


----
== Parameters ==
;''Arguments''
=== Arguments ===


:(String unitName)
:;unitName : The [[API TYPE UnitId|unit id]] you want debuff information for


:;unitName : The name of the unit you wish to retrieve info on
:;debuffIndex : Number - The index of the debuff to retrieve info for. Starts at 1.


: Viable names known:
:: The maximum numbers used by the Blizzard code are 16 for party/pet/target debuffs.
:* player
:* party1-4
:* raid1-40
:* pet
:* partypet1-4
:* target


:(Number debuffIndex)
:;showDispellable : Boolean - <small><i>(optional)</i></small> - Can be 0, 1, or nil. If present and 1, then only debuffs will be returned which are dispellable by the player. Index is still starting with 1 and counting up. (new in 1.9, works in 1.9.3)


:;debuffIndex : The index num of the debuff to retrieve info on. Starts at 1 and goes up to (and possibly beyond) a certain number.
=== Returns ===


: The maximum numbers used by the Blizzard code are 16 for party/pet/target debuffs.
:;debuffTexture : String - The identifier of (path and filename to) the indicated debuff, or nil if no debuff


:(Boolean showDispellable)
:;debuffApplications : Number (docs said String?!) - The number of times the debuff has been applied to the target.


:;showDispellable : Flag <small><i>(optional)</i></small> - Can be 0, 1, or nil. If present and 1, then only debuffs will be returned which are dispellable by the player. Index is still starting with 1 and counting up. (new in 1.9, works in 1.9.3)
:;debuffType : String - The debuff dispel type. Can be "Magic", "Curse", "Poison", "Disease" or nil if not dispellable. (Added in 1.11)


----
== Example ==
;''Returns''
 
:(String debuffTexture)
 
:;debuffTexture : The identifier of (path and filename to) the indicated debuff, or nil if no debuff
 
:(String debuffApplications)
 
:;debuffApplications : The number of times the debuff has been applied to the target.
 
:(String debuffDispelType)
 
:;debuffType : The debuff dispel type. Can be "Magic", "Curse", "Poison", "Disease" or nil if not dispellable. (Added in 1.11)
 
----
;''Example''
  debuff = UnitDebuff("pet", i);
  debuff = UnitDebuff("pet", i);
;''Result''


Retrieves the debuff texture of the pets debuff with the index of "i".
Retrieves the debuff texture of the pets debuff with the index of "i".


----
== See Also ==
;''Description''
 
: Retrieve info (texture name) about a certain debuff of the specified unit.
 
;''See Also''


: [[API UnitBuff|UnitBuff]]
: [[API UnitBuff|UnitBuff]]
: [[UI Questions#Lua_Questions|Why doesn't UnitDebuff accurately report the spell I just cast?]]
: [[Interface Customization FAQ#Why doesn.27t UnitDebuff accurately report the spell I just cast|Why doesn't UnitDebuff accurately report the spell I just cast?]]
: [[Check Hunter Mark|Sample Code Check Hunter's Mark Aspect]]
: [[Check Hunter Mark|Sample Code Check Hunter's Mark Aspect]]
: [[Queriable Buff effects|List of known buff and debuff effects that can be queried]]
: [[Queriable Buff effects|List of known buff and debuff effects that can be queried]]
----
{{WoW API}}
Anonymous user