WoW:API UnitAura: Difference between revisions

m
Move page script moved page API UnitAura to WoW:API UnitAura without leaving a redirect
(Fixed an typo in usage - wasn't clearly if name & rank have to be together)
m (Move page script moved page API UnitAura to WoW:API UnitAura without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 2: Line 2:


This function was introduced in Patch 3.0. It will serve as an all-in-one solution for querying unit buffs and debuffs. [[API UnitBuff|UnitBuff]] and [[API UnitDebuff|UnitDebuff]] will serve as aliases with built-in harmful/helpful filters.
This function was introduced in Patch 3.0. It will serve as an all-in-one solution for querying unit buffs and debuffs. [[API UnitBuff|UnitBuff]] and [[API UnitDebuff|UnitDebuff]] will serve as aliases with built-in harmful/helpful filters.
Usage:
 
'''''Usage''''':
  name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId  
  name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId  
   = UnitAura("unit", index or "name"[, "rank"[, "filter"]])  
   = UnitAura("unit", index or "name"[, "rank"[, "filter"]])
 
If the second parameter is a string, then the third parameter is the rank (which can be nil)
<dl>
<dt>Either use:
<dd>'''unit''', '''index''', '''filter'''
<dt>or
<dd>'''unit''', '''name''', '''rank''', '''filter'''</dl>
 
'''Examples''':<ul>
<li>UnitAura("target", 1) -- First buff on target
<li>UnitAura("target", 1, "PLAYER|HARMFUL") -- First debuff, cast by the player, on the target
<li>UnitAura("player", "Lightning Shield") -- first instance of "Lightning Shield" on the player
<li>UnitAura("player", "Lightning Shield", nil, "PLAYER|HELPFUL") -- first instance of "Lightning Shield" on the player, cast by the player
<li>UnitAura("player", "Lightning Shield", "Rank 2") -- first instance of "Lightning Shield", rank 2, on the player</ul>


== Arguments ==
== Arguments ==
Line 14: Line 29:
;name : String - The name of the spell or effect of the debuff. This is the name shown in yellow when you mouse over the icon.
;name : String - The name of the spell or effect of the debuff. This is the name shown in yellow when you mouse over the icon.
;rank : String - The rank of the spell or effect that caused the debuff. Returns "" if there is no rank.
;rank : String - The rank of the spell or effect that caused the debuff. Returns "" if there is no rank.
;icon  
;icon : String - The path to the icon file.
;count : 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 ).
;count : 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 ).
;debuffType : String - The type of the debuff: Magic, Disease, Poison, Curse, or nothing for those with out a type.
;debuffType : String - The type of the debuff: Magic, Disease, Poison, Curse, or nothing for those with out a type.
Anonymous user