Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API UnitAura
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{wowapi}} __NOTOC__ 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''''': name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = 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 == ;unit : String - The [[API TYPE UnitId|unit]] you want debuff information for. ;index : Number - The index of the debuff to retrieve info for. Starts at 1, maximum 40. ;filter : This parameter can be any of "HELPFUL", "HARMFUL", "PLAYER", "RAID", "CANCELABLE", "NOT_CANCELABLE". You can also specify several filters separated by a | or space character to chain multiple filters together (e.g. "HELPFUL|RAID" or "HELPFUL RAID" == helpful buffs that you can cast on your raid). By default UnitAura has "HELPFUL" as an implicit filter - you cannot get back BOTH helpful and harmful at the same time. Neither "HELPFUL" or "HARMFUL" have meaning for UnitBuff/UnitDebuff, and will be ignored. == Returns == ;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. ;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 ). ;debuffType : String - The type of the debuff: Magic, Disease, Poison, Curse, or nothing for those with out a type. ; duration : Number - The full duration of the debuff in seconds; ; expirationTime : Number - The time in seconds (like what returns [[API GetTime|GetTime()]]) when the aura will expire. ; unitCaster : String - [[unitId]] reference to the unit that casted the buff/debuff. ; isStealable : Boolean - 1 or nil depending on if the aura can be spellstolen. ; shouldConsolidate : Boolean - 1 or nil depending on if the default Blizzard UI should put the aura into the "consolidated" box of buffs. ; spellId : Number - the spellId of the aura. ==Macro Options:== 1. Prints the name of any stealable buffs on the current target, or a notice if nothing is stealable: <pre>/run local y=0;for i=1,40 do local n,_,_,_,_,_,_,_,isStealable=UnitAura("target",i);if isStealable==1 then print(n.." on target, steal it!")y=1;end end if y~=1 then print("No stealable buffs.")end</pre> == History == * Patch 3.0 combined UnitDebuff and UnitBuff into this command. * Patch 3.1 changed "isMine" to "unitCaster". It is now possible for addons to retrieve the unitId that cast the buff/debuff. * Patch 3.3 added shouldConsolidate and spellId == See Also == : [[API UnitBuff|UnitBuff]] : [[API UnitDebuff|UnitDebuff]] : [[Queriable Buff effects|List of known buff and debuff effects that can be queried]] : [http://forums.worldofwarcraft.com/thread.html?topicId=8202271194&sid=1 Upcoming 3.0 Changes - Concise List]
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Tocright
(
edit
)
Template:Wowapi
(
edit
)