# C_EncounterWarnings: 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_EncounterWarnings

## Functions

### C_EncounterWarnings.GetColorForSeverity

```lua
color = C_EncounterWarnings.GetColorForSeverity(severity)
```

Arguments:
- `severity`: EncounterEventSeverity

Returns:
- `color`: colorRGBA

### C_EncounterWarnings.GetEditModeWarningInfo

```lua
warningInfo = C_EncounterWarnings.GetEditModeWarningInfo(severity)
```

Arguments:
- `severity`: EncounterEventSeverity

Returns:
- `warningInfo`: EncounterWarningInfo

### C_EncounterWarnings.GetPlayCustomSoundsWhenHidden

```lua
play = C_EncounterWarnings.GetPlayCustomSoundsWhenHidden()
```

Returns true if custom sound alerts are allowed to play for hidden warning messages.

Returns:
- `play`: bool

### C_EncounterWarnings.GetSoundKitForSeverity

```lua
soundKitID = C_EncounterWarnings.GetSoundKitForSeverity(severity)
```

Arguments:
- `severity`: EncounterEventSeverity

Returns:
- `soundKitID`: number

### C_EncounterWarnings.GetWarningsShown

```lua
shown = C_EncounterWarnings.GetWarningsShown()
```

Returns true if text messages for encounter events are allowed to be shown.

Returns:
- `shown`: bool

### C_EncounterWarnings.IsFeatureAvailable

```lua
isAvailable = C_EncounterWarnings.IsFeatureAvailable()
```

Returns:
- `isAvailable`: bool

### C_EncounterWarnings.IsFeatureEnabled

```lua
isAvailableAndEnabled = C_EncounterWarnings.IsFeatureEnabled()
```

Returns:
- `isAvailableAndEnabled`: bool

### C_EncounterWarnings.PlaySound

```lua
soundHandle = C_EncounterWarnings.PlaySound(severity)
```

May return nothing.

Arguments:
- `severity`: EncounterEventSeverity

Returns:
- `soundHandle`: number

### C_EncounterWarnings.SetPlayCustomSoundsWhenHidden

```lua
C_EncounterWarnings.SetPlayCustomSoundsWhenHidden(play)
```

Controls whether custom sound alerts for encounter events are allowed to play for warning messages that are hidden.

Arguments:
- `play`: bool. If true, allow playing custom sound alerts. Note that sound alerts will not be played if the encounter warnings feature has been disabled.

### C_EncounterWarnings.SetWarningsShown

```lua
C_EncounterWarnings.SetWarningsShown(shown)
```

Controls whether text messages for encounter events are allowed to be shown.

Arguments:
- `shown`: bool. If false, hides all warning messages in the default UI.

## Events

### ENCOUNTER_WARNING

Payload, after the event's name:
- `encounterWarningInfo`: EncounterWarningInfo

## Tables

### EncounterWarningInfo (structure)

- `text`: cstring
- `casterGUID`: WOWGUID
- `casterName`: cstring
- `targetGUID`: WOWGUID
- `targetName`: cstring
- `iconFileID`: number
- `tooltipSpellID`: number
- `isDeadly`: bool
- `color`: colorRGBA
- `duration`: Seconds
- `severity`: EncounterEventSeverity
- `shouldPlaySound`: bool
- `shouldShowChatMessage`: bool
- `shouldShowWarning`: bool

---
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."
