# C_UnitAuras: World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/C_UnitAuras

## Functions

### C_UnitAuras.AddAuraSound

```lua
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

```lua
C_UnitAuras.AddBlockedAura(unit, auraInstanceID)
```

Arguments:
- `unit`: UnitTokenRestrictedForAddOns
- `auraInstanceID`: number

### C_UnitAuras.AddPrivateAuraAnchor

```lua
anchorID = C_UnitAuras.AddPrivateAuraAnchor(args)
```

Arguments:
- `args`: AddPrivateAuraAnchorArgs

Returns:
- `anchorID`: number, may be nil

### C_UnitAuras.AuraIsBigDefensive

```lua
isBigDefensive = C_UnitAuras.AuraIsBigDefensive(spellID)
```

Arguments:
- `spellID`: SpellIdentifier

Returns:
- `isBigDefensive`: bool

### C_UnitAuras.AuraIsPrivate

```lua
isPrivate = C_UnitAuras.AuraIsPrivate(spellID)
```

Arguments:
- `spellID`: SpellIdentifier

Returns:
- `isPrivate`: bool

### C_UnitAuras.CancelAuraByInstanceID

```lua
C_UnitAuras.CancelAuraByInstanceID(unit, auraInstanceID)
```

Arguments:
- `unit`: UnitTokenRestrictedForAddOns
- `auraInstanceID`: number

### C_UnitAuras.ClearBlockedAuras

```lua
C_UnitAuras.ClearBlockedAuras(unit)
```

Arguments:
- `unit`: UnitTokenRestrictedForAddOns

### C_UnitAuras.DoesAuraHaveExpirationTime

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
duration = C_UnitAuras.GetAuraDuration(auraInstanceUnit, auraInstanceID)
```

Arguments:
- `auraInstanceUnit`: UnitToken
- `auraInstanceID`: number

Returns:
- `duration`: LuaDurationObject

### C_UnitAuras.GetAuraSlots

```lua
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

```lua
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

```lua
cooldownSpellID = C_UnitAuras.GetCooldownAuraBySpellID(spellID)
```

Arguments:
- `spellID`: SpellIdentifier

Returns:
- `cooldownSpellID`: number, may be nil

### C_UnitAuras.GetDebuffDataByIndex

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
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

```lua
isFiltered = C_UnitAuras.IsAuraFilteredOutByInstanceID(unit, auraInstanceID, filter)
```

Arguments:
- `unit`: UnitTokenRestrictedForAddOns
- `auraInstanceID`: number
- `filter`: AuraFilters

Returns:
- `isFiltered`: bool

### C_UnitAuras.RemoveAuraSound

```lua
C_UnitAuras.RemoveAuraSound(auraSoundID)
```

Arguments:
- `auraSoundID`: number

### C_UnitAuras.RemovePrivateAuraAnchor

```lua
C_UnitAuras.RemovePrivateAuraAnchor(anchorID)
```

Arguments:
- `anchorID`: number

### C_UnitAuras.ResetAuraDataProvider

```lua
C_UnitAuras.ResetAuraDataProvider()
```

### C_UnitAuras.SetGroupBuffVisualAlerts

```lua
C_UnitAuras.SetGroupBuffVisualAlerts(visualAlerts)
```

Arguments:
- `visualAlerts`: GroupBuffVisualAlertInfo[]

### C_UnitAuras.SetHiddenGroupBuffs

```lua
C_UnitAuras.SetHiddenGroupBuffs(spellIDs)
```

Arguments:
- `spellIDs`: number[]

### C_UnitAuras.SetPrivateWarningTextAnchor

```lua
C_UnitAuras.SetPrivateWarningTextAnchor(parent, [anchor])
```

Arguments:
- `parent`: SimpleFrame
- `anchor`: AnchorBinding, may be nil

### C_UnitAuras.SwitchAuraDataProvider

```lua
C_UnitAuras.SwitchAuraDataProvider()
```

### C_UnitAuras.WantsAlteredForm

```lua
wantsAlteredForm = C_UnitAuras.WantsAlteredForm(unit)
```

Arguments:
- `unit`: UnitToken

Returns:
- `wantsAlteredForm`: bool

## Events

### AURA_DATA_PROVIDER_SWITCH

Payload, after the event's name:
- `useRealDataProvider`: bool

### GROUP_BUFF_VISUAL_ALERTS_CHANGED

The payload matches GetGroupBuffVisualAlerts, including linked rank spells.

Payload, after the event's name:
- `visualAlerts`: GroupBuffVisualAlertInfo[]

### HIDDEN_GROUP_BUFFS_CHANGED

The payload matches GetHiddenGroupBuffs, including linked rank spells.

Payload, after the event's name:
- `spellIDs`: number[]

### UNIT_AURA

Payload, after the event's name:
- `unitTarget`: UnitTokenVariant
- `updateInfo`: UnitAuraUpdateInfo

### UNIT_AURA_BLOCK_LIST_CLEARED

Payload, after the event's name:
- `unitTarget`: UnitTokenVariant

### UNIT_AURA_BLOCKED

Payload, after the event's name:
- `unitTarget`: UnitTokenVariant
- `auraInstanceID`: number

---
Make an addon with your 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."
