WoW:API UnitDebuff: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Clarified optional parameter. Confirmed that number is the 2nd return parameter, and it's zero for unstackable buffs.)
No edit summary
Line 3: Line 3:
Retrieve info about a certain debuff on a certain unit.
Retrieve info about a certain debuff on a certain unit.


  debuffTexture, debuffApplications, debuffDispelType = UnitDebuff( unitID, debuffIndex [, showDispellable] );
  debuffName, debuffRank, debuffTexture, debuffApplications = UnitDebuff( unitID, debuffIndex [, showDispellable] );


== Parameters ==
== Parameters ==
Line 17: Line 17:


=== Returns ===
=== Returns ===
:;debuffName : String - The name of the spell or effect of the debuff. This is the name shown in yellow when you mouse over the icon. (Added in 2.0)
:;debuffRank : String - The rank of the spell or effect that caused the debuff. Returns "" if there is no rank. (Added in 2.0)


:;debuffTexture : String - The identifier of (path and filename to) the indicated debuff, or nil if no debuff
:;debuffTexture : String - The identifier of (path and filename to) the indicated debuff, or nil if no debuff


:;debuffApplications : 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 ).
:;debuffApplications : 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 ).
:;debuffDispelType : String - The debuff dispel type. Can be "Magic", "Curse", "Poison", "Disease" or nil if not dispellable. These strings are constant across localizations. (Added in 1.11)


== Example ==  
== Example ==  
  debuff = UnitDebuff("pet", i);
  debuff, debuffR, debuffT = UnitDebuff("pet", i);


Retrieves the debuff texture of the player's pet's debuff with the index i.
Retrieves the texture of the player's pet's debuff along with the name and rank of the spell that caused the debuff with the index i.


== See Also ==
== See Also ==

Revision as of 06:37, 8 December 2006

WoW API < UnitDebuff

Retrieve info about a certain debuff on a certain unit.

debuffName, debuffRank, debuffTexture, debuffApplications = UnitDebuff( unitID, debuffIndex [, showDispellable] );

Parameters

Arguments

unitName
The unit id you want debuff information for
debuffIndex
Number - The index of the debuff to retrieve info for. Starts at 1.
The maximum numbers used by the Blizzard code are 16 for party/pet/target debuffs.
showDispellable
Boolean - (optional) - 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)

Returns

debuffName
String - The name of the spell or effect of the debuff. This is the name shown in yellow when you mouse over the icon. (Added in 2.0)
debuffRank
String - The rank of the spell or effect that caused the debuff. Returns "" if there is no rank. (Added in 2.0)
debuffTexture
String - The identifier of (path and filename to) the indicated debuff, or nil if no debuff
debuffApplications
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 ).

Example

debuff, debuffR, debuffT = UnitDebuff("pet", i);

Retrieves the texture of the player's pet's debuff along with the name and rank of the spell that caused the debuff with the index i.

See Also

UnitBuff
FAQ: Why doesn't UnitDebuff accurately report the spell I just cast?
Sample Code Check Hunter's Mark Aspect
List of known buff and debuff effects that can be queried