API UnitAura

Returns the buffs/debuffs for the unit.
 name, icon, count, dispelType, duration, expirationTime, source, isStealable, nameplateShowPersonal,
 spellId, canApplyAura, isBossDebuff, castByPlayer, nameplateShowAll, timeMod, ...
 = UnitAura (unit, index [, filter])
 = UnitBuff (unit, index [, filter])
 = UnitDebuff(unit, index [, filter])
==Arguments==
:;unit: : UnitId
:;index: - Index of an aura to query.
:;filter: - A list of filters, separated by pipe chars or spaces. Otherwise defaults to "HELPFUL".
==Filters==
* UnitBuff() is an alias for UnitAura(unit, index, "HELPFUL"), returning only buffs.
* UnitDebuff() is an alias for UnitAura(unit, index, "HARMFUL"), returning only debuffs.
Filter 	Description
"HELPFUL" 	Buffs
"HARMFUL" 	Debuffs
"PLAYER" 	Auras Debuffs applied by the player
"RAID" 	Buffs the player can apply and debuffs the player can dispell
"CANCELABLE" 	Buffs that can be cancelled with or ()
"NOT_CANCELABLE" 	Buffs that cannot be cancelled
"INCLUDE_NAME_PLATE_ONLY"	Auras that should be shown on nameplates
"MAW" 	Torghast Anima Powers
==Returns==
: Returns nil when there is no aura for that index or when the aura doesn't pass the filter.
==Details==
* UnitBuff() will ignore any HARMFUL filter, and vice versa UnitDebuff() will ignore any HELPFUL filter.
* Filters can be mutually exclusive, e.g. "HELPFUL|HARMFUL" will always return nothing.
* On retail a unit can have an unlimited amount of buffs/debuffs.
:* The debuff limit is at 16 for Classic Era and 40 for BCC.
===World Buffs===
 If the unit has the Supercharged Chronoboon Displacer buff, then the world buffs can be selected from the return values. For example for Warchief's Blessing:
select(20, UnitBuff("player", index))
Buff 	Type	Description
16. Fengus' Ferocity 	 	Duration
17. Mol'dar's Moxie 	 	Duration
18. Slip'kik's Savvy 	 	Duration
19. Rallying Cry of the Dragonslayer	 	Duration
20. Warchief's Blessing 	 	Duration
21. Spirit of Zandalar 	 	Duration
22. Songflower Serenade 	 	Duration
23. Sayge's Fortune 	 	spellID of the chosen buff
24. Sayge's Fortune 	 	Duration of the chosen buff
==Example==
* Prints the third aura on the target.
/dump UnitAura("target", 3)
[1] = "Power Word: Fortitude", -- name
[2] = 135987, -- icon
[3] = 0, -- count
[4] = "Magic", -- dispelType
[5] = 3600, -- duration
[6] = 112994.871, -- expirationTime 
[7] = "player", -- source
[8] = false, -- isStealable
[9] = false, -- nameplateShowPersonal
[10] = 21562, -- spellID
[11] = true, -- canApplyAura
[12] = false, -- isBossDebuff
[13] = true, -- castByPlayer
[14] = false, -- nameplateShowAll
[15] = 1, -- timeMod
[16] = 5, -- attribute1: Stamina increased by 5%
[17] = 0 -- attribute2: Magic damage taken reduced by 0% (Thorghast Enchanted Shroud power)
* The following are equivalent. Prints the first debuff applied by the player on the target.
 /dump UnitAura("target", 1, "PLAYER|HARMFUL")
 /dump UnitDebuff("target", 1, "PLAYER")
* () is useful for checking only a specific aura on the player character.
 /dump GetPlayerAuraBySpellID(21562)
==Aura Util==
===ForEachAura===
 AuraUtil.ForEachAura(unit, filter, [maxCount], func, [usePackedAura])
This is recommended for iterating over auras. For example to print all buffs:
AuraUtil.ForEachAura("player", "HELPFUL", nil, function(name, icon, ...)
	print(name, icon, ...)
end)
The callback function should return true once it's fine to stop processing further auras.
local function foo(name, icon, _, _, _, _, _, _, _, spellId, ...)
	if spellId == 21562 then -- Power Word: Fortitude
		-- do stuff
		return true
	end
end
AuraUtil.ForEachAura("player", "HELPFUL", nil, foo)
===FindAuraByName===
 AuraUtil.FindAuraByName(name, unit [, filter])
Finds the first aura that matches the name, but note that:
* Aura names are not unique, this will only find the first match.
* Aura names are localized, what works in one locale might not work in another.
/dump AuraUtil.FindAuraByName("Power Word: Fortitude", "player")
* Remember to specify the "HARMFUL" filter for debuffs.
/dump AuraUtil.FindAuraByName("Weakened Soul", "player", "HARMFUL")
==Patch changes==
==References==