World of Warcraft Forever API · C_UnitAuras.md, for your AI
C_UnitAuras
38 functions, 6 events, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
C_UnitAuras.AddAuraSound
auraSoundID = C_UnitAuras.AddAuraSound(trigger, sound)
Registers a sound for an aura event. The sound is stopped after five seconds of playback. The throttleSeconds value must be between 0 and 5 seconds, inclusive.
Arguments
trigger | UnitAuraSoundTrigger | |
|---|---|---|
sound | UnitAuraSoundInfo |
Returns
auraSoundID | number may be nil |
|---|
C_UnitAuras.AddBlockedAura
C_UnitAuras.AddBlockedAura(unit, auraInstanceID)
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
auraInstanceID | number |
C_UnitAuras.AddPrivateAuraAnchor
anchorID = C_UnitAuras.AddPrivateAuraAnchor(args)
Arguments
args | AddPrivateAuraAnchorArgs |
|---|
Returns
anchorID | number may be nil |
|---|
C_UnitAuras.AuraIsBigDefensive
isBigDefensive = C_UnitAuras.AuraIsBigDefensive(spellID)
Arguments
spellID | SpellIdentifier |
|---|
Returns
isBigDefensive | bool |
|---|
C_UnitAuras.AuraIsPrivate
isPrivate = C_UnitAuras.AuraIsPrivate(spellID)
Arguments
spellID | SpellIdentifier |
|---|
Returns
isPrivate | bool |
|---|
C_UnitAuras.CancelAuraByInstanceID
C_UnitAuras.CancelAuraByInstanceID(unit, auraInstanceID)
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
auraInstanceID | number |
C_UnitAuras.ClearBlockedAuras
C_UnitAuras.ClearBlockedAuras(unit)
Arguments
unit | UnitTokenRestrictedForAddOns |
|---|
C_UnitAuras.DoesAuraHaveExpirationTime
hasExpirationTime = C_UnitAuras.DoesAuraHaveExpirationTime(auraInstanceUnit, auraInstanceID)
Returns true if an aura instance will expire after a certain amount of time.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number |
Returns
hasExpirationTime | bool |
|---|
C_UnitAuras.GetAuraApplicationDisplayCount
count = C_UnitAuras.GetAuraApplicationDisplayCount(auraInstanceUnit, auraInstanceID, [minDisplayCount], [maxDisplayCount])
Formats a string for displaying the number of applications an aura has present.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number | |
minDisplayCount | number default 2 | Minimum number of applications required; if the application count is below this figure an empty string will be returned. |
maxDisplayCount | number may be nil | Maximum number of applications allowed; if the application count is above this figure then the string '*' will be returned. |
Returns
count | string |
|---|
C_UnitAuras.GetAuraBaseDuration
newDuration = C_UnitAuras.GetAuraBaseDuration(auraInstanceUnit, auraInstanceID, [spellID])
Returns the base duration of the given spell (or aura). Takes an optional spellID to use as the new duration if that cannot be derived from the aura, if that value isn't supplied the aura's spellID will be used
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number | |
spellID | SpellIdentifier may be nil |
Returns
newDuration | number may be nil |
|---|
C_UnitAuras.GetAuraCasterGUID
casterGUID = C_UnitAuras.GetAuraCasterGUID(auraInstanceUnit, auraInstanceID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number |
Returns
casterGUID | WOWGUID may be nil |
|---|
C_UnitAuras.GetAuraDataByAuraInstanceID
aura = C_UnitAuras.GetAuraDataByAuraInstanceID(unit, auraInstanceID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
auraInstanceID | number |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetAuraDataByIndex
aura = C_UnitAuras.GetAuraDataByIndex(unit, index, [filter])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
index | luaIndex | |
filter | AuraFilters may be nil |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetAuraDataBySlot
aura = C_UnitAuras.GetAuraDataBySlot(unit, slot)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
slot | number |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetAuraDataBySpellName
aura = C_UnitAuras.GetAuraDataBySpellName(unit, spellName, [filter])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
spellName | cstring | |
filter | AuraFilters may be nil |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetAuraDispelTypeColor
dispelTypeColor = C_UnitAuras.GetAuraDispelTypeColor(auraInstanceUnit, auraInstanceID, curve)
Queries the dispel type associated with an aura instance and remaps it to a color via a curve, with the dispel type ID used as the 'x' value.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number | |
curve | LuaColorCurveObject |
Returns
dispelTypeColor | colorRGBA |
|---|
C_UnitAuras.GetAuraDuration
duration = C_UnitAuras.GetAuraDuration(auraInstanceUnit, auraInstanceID)
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number |
Returns
duration | LuaDurationObject |
|---|
C_UnitAuras.GetAuraSlots
outContinuationToken, slots = C_UnitAuras.GetAuraSlots(unit, [filter], [maxSlots], [continuationToken])
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
filter | AuraFilters may be nil | |
maxSlots | number may be nil | |
continuationToken | number may be nil |
Returns
outContinuationToken | number may be nil | |
|---|---|---|
slots | number |
C_UnitAuras.GetBuffDataByIndex
aura = C_UnitAuras.GetBuffDataByIndex(unit, index, [filter])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
index | luaIndex | |
filter | AuraFilters may be nil |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetCooldownAuraBySpellID
cooldownSpellID = C_UnitAuras.GetCooldownAuraBySpellID(spellID)
Arguments
spellID | SpellIdentifier |
|---|
Returns
cooldownSpellID | number may be nil |
|---|
C_UnitAuras.GetDebuffDataByIndex
aura = C_UnitAuras.GetDebuffDataByIndex(unit, index, [filter])
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
index | luaIndex | |
filter | AuraFilters may be nil |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetGroupBuffVisualAlerts
visualAlerts = C_UnitAuras.GetGroupBuffVisualAlerts()
Returns the alerts passed to SetGroupBuffVisualAlerts plus an entry for every linked rank spell of those group buffs.
Returns
visualAlerts | GroupBuffVisualAlertInfo[] |
|---|
C_UnitAuras.GetHiddenGroupBuffs
spellIDs = C_UnitAuras.GetHiddenGroupBuffs()
Returns the spell IDs passed to SetHiddenGroupBuffs plus every linked rank spell of those group buffs.
Returns
spellIDs | number[] |
|---|
C_UnitAuras.GetPlayerAuraBySpellID
aura = C_UnitAuras.GetPlayerAuraBySpellID(spellID)
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
spellID | SpellIdentifier |
|---|
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetRefreshCarryOverDuration
newDuration = C_UnitAuras.GetRefreshCarryOverDuration(auraInstanceUnit, auraInstanceID, [spellID])
Returns the client-predicted amount of time that a new spellcast of the same spell would carry over to the new application of that aura. Takes an optional spellID to use as the new duration if that cannot be derived from the aura, if that value isn't supplied the aura's spellID will be used
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number | |
spellID | SpellIdentifier may be nil |
Returns
newDuration | number may be nil |
|---|
C_UnitAuras.GetRefreshExtendedDuration
newDuration = C_UnitAuras.GetRefreshExtendedDuration(auraInstanceUnit, auraInstanceID, [spellID])
Returns the client-predicted new duration of this aura if it were cast again right now. Takes an optional spellID to use as the new duration if that cannot be derived from the aura, if that value isn't supplied the aura's spellID will be used
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
auraInstanceUnit | UnitToken | |
|---|---|---|
auraInstanceID | number | |
spellID | SpellIdentifier may be nil |
Returns
newDuration | number may be nil |
|---|
C_UnitAuras.GetUnitAuraBySpellID
aura = C_UnitAuras.GetUnitAuraBySpellID(unit, spellID)
Returns the first instance of an aura on a unit matching a given spell ID. Returns nil if no such aura is found. Additionally can return nil if querying a unit that is not visible (eg. party members on other maps).
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
spellID | SpellIdentifier |
Returns
aura | AuraData may be nil |
|---|
C_UnitAuras.GetUnitAuraInstanceIDs
auraInstanceIDs = C_UnitAuras.GetUnitAuraInstanceIDs(unit, filter, [maxCount], [sortRule], [sortDirection])
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
filter | AuraFilters | |
maxCount | number may be nil | |
sortRule | UnitAuraSortRule default "Unsorted" | |
sortDirection | UnitAuraSortDirection default "Normal" |
Returns
auraInstanceIDs | number[] |
|---|
C_UnitAuras.GetUnitAuras
auras = C_UnitAuras.GetUnitAuras(unit, filter, [maxCount], [sortRule], [sortDirection])
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
filter | AuraFilters | |
maxCount | number may be nil | |
sortRule | UnitAuraSortRule default "Unsorted" | |
sortDirection | UnitAuraSortDirection default "Normal" |
Returns
auras | AuraData[] |
|---|
C_UnitAuras.IsAuraFilteredOutByInstanceID
isFiltered = C_UnitAuras.IsAuraFilteredOutByInstanceID(unit, auraInstanceID, filter)
Arguments
unit | UnitTokenRestrictedForAddOns | |
|---|---|---|
auraInstanceID | number | |
filter | AuraFilters |
Returns
isFiltered | bool |
|---|
C_UnitAuras.RemoveAuraSound
C_UnitAuras.RemoveAuraSound(auraSoundID)
Arguments
auraSoundID | number |
|---|
C_UnitAuras.RemovePrivateAuraAnchor
C_UnitAuras.RemovePrivateAuraAnchor(anchorID)
Arguments
anchorID | number |
|---|
C_UnitAuras.ResetAuraDataProvider
C_UnitAuras.ResetAuraDataProvider()
C_UnitAuras.SetGroupBuffVisualAlerts
C_UnitAuras.SetGroupBuffVisualAlerts(visualAlerts)
Arguments
visualAlerts | GroupBuffVisualAlertInfo[] |
|---|
C_UnitAuras.SetHiddenGroupBuffs
C_UnitAuras.SetHiddenGroupBuffs(spellIDs)
Arguments
spellIDs | number[] |
|---|
C_UnitAuras.SetPrivateWarningTextAnchor
C_UnitAuras.SetPrivateWarningTextAnchor(parent, [anchor])
Arguments
parent | SimpleFrame | |
|---|---|---|
anchor | AnchorBinding may be nil |
C_UnitAuras.SwitchAuraDataProvider
C_UnitAuras.SwitchAuraDataProvider()
C_UnitAuras.WantsAlteredForm
wantsAlteredForm = C_UnitAuras.WantsAlteredForm(unit)
Arguments
unit | UnitToken |
|---|
Returns
wantsAlteredForm | bool |
|---|
Events
AURA_DATA_PROVIDER_SWITCH
useRealDataProvider | bool |
|---|
GROUP_BUFF_VISUAL_ALERTS_CHANGED
The payload matches GetGroupBuffVisualAlerts, including linked rank spells.
visualAlerts | GroupBuffVisualAlertInfo[] |
|---|
HIDDEN_GROUP_BUFFS_CHANGED
The payload matches GetHiddenGroupBuffs, including linked rank spells.
spellIDs | number[] |
|---|
UNIT_AURA
unitTarget | UnitTokenVariant | |
|---|---|---|
updateInfo | UnitAuraUpdateInfo |
UNIT_AURA_BLOCK_LIST_CLEARED
unitTarget | UnitTokenVariant |
|---|
UNIT_AURA_BLOCKED
unitTarget | UnitTokenVariant | |
|---|---|---|
auraInstanceID | number |