World of Warcraft Forever API · C_EncounterWarnings.md, for your AI
C_EncounterWarnings
10 functions, 1 events, 1 tables, 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_EncounterWarnings.GetColorForSeverity
color = C_EncounterWarnings.GetColorForSeverity(severity)
Arguments
severity | EncounterEventSeverity |
|---|
Returns
color | colorRGBA |
|---|
C_EncounterWarnings.GetEditModeWarningInfo
warningInfo = C_EncounterWarnings.GetEditModeWarningInfo(severity)
Arguments
severity | EncounterEventSeverity |
|---|
Returns
warningInfo | EncounterWarningInfo |
|---|
C_EncounterWarnings.GetPlayCustomSoundsWhenHidden
play = C_EncounterWarnings.GetPlayCustomSoundsWhenHidden()
Returns true if custom sound alerts are allowed to play for hidden warning messages.
Returns
play | bool |
|---|
C_EncounterWarnings.GetSoundKitForSeverity
soundKitID = C_EncounterWarnings.GetSoundKitForSeverity(severity)
Arguments
severity | EncounterEventSeverity |
|---|
Returns
soundKitID | number |
|---|
C_EncounterWarnings.GetWarningsShown
shown = C_EncounterWarnings.GetWarningsShown()
Returns true if text messages for encounter events are allowed to be shown.
Returns
shown | bool |
|---|
C_EncounterWarnings.IsFeatureAvailable
isAvailable = C_EncounterWarnings.IsFeatureAvailable()
Returns
isAvailable | bool |
|---|
C_EncounterWarnings.IsFeatureEnabled
isAvailableAndEnabled = C_EncounterWarnings.IsFeatureEnabled()
Returns
isAvailableAndEnabled | bool |
|---|
C_EncounterWarnings.PlaySound
soundHandle = C_EncounterWarnings.PlaySound(severity)
May return nothing.
Arguments
severity | EncounterEventSeverity |
|---|
Returns
soundHandle | number |
|---|
C_EncounterWarnings.SetPlayCustomSoundsWhenHidden
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
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
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 |