Skip to content

API UO IsActiveSpellAbility en

Codex edited this page Sep 23, 2026 · 1 revision

UO.IsActiveSpellAbility

ClassicUO / Basic IDE

Home · API · Commands

Reads whether the server has reported the selected spell/ability as active. Useful before reactivating an ability supported by this status. It does not enable anything, cast or select a target.

Exact syntax

UO.IsActiveSpellAbility(SpellName:Any) -> Any

Parameters

  • SpellName — One required argument: the English catalog name or integer spell ID. "Confidence" and 402 identify the same Bushido spell. Names ignore case; underscores become spaces. Numeric strings also resolve. This is not a character serial, item graphic or skill number.

Returns

Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration or last-cast result. Unknown names, IDs outside 1…65535 and missing state also return 0.

Behavior

  • Server packet 0xBF/0x25 adds or removes the ID. Reading works without graphics or a spell shortcut. Closing the window retains state; disconnection clears it. Zero does not establish that the character cannot cast. The shard must send this status; this is not a universal buff query. Instant Heal/Recall examples cannot prove casting success. This command does not report remaining duration, mana, availability or success.

Internal functions: from call to result

InjectionApiUO resolves the name using the Full catalog or reads the numeric ID. Bridge.IsActiveSpell reads ActiveSpellIconsManager on the world thread and returns 1/0. The getter sends no request and performs no wait.

1. IsActiveSpell

Reads whether the server has reported the selected spell/ability as active. Useful before reactivating an ability supported by this status. It does not enable anything, cast or select a target.

Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration or last-cast result. Unknown names, IDs outside 1…65535 and missing state also return 0.

Project source: src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs; function IsActiveSpell.

2. ActiveSpellIconsManager

Server packet 0xBF/0x25 adds or removes the ID. Reading works without graphics or a spell shortcut. Closing the window retains state; disconnection clears it. Zero does not establish that the character cannot cast. The shard must send this status; this is not a universal buff query. Instant Heal/Recall examples cannot prove casting success. This command does not report remaining duration, mana, availability or success.

Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration or last-cast result. Unknown names, IDs outside 1…65535 and missing state also return 0.

Project source: src/ClassicUO.Client/Game/Managers/ActiveIconsManager.cs; function ActiveSpellIconsManager.

Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration or last-cast result. Unknown names, IDs outside 1…65535 and missing state also return 0.

Examples

Check a spell ID

# Check a spell ID
#
# Reads whether the server has reported the selected spell/ability as active. Useful before
# reactivating an ability supported by this status. It does not enable anything, cast or select
# a target.
#
# Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In
# conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration
# or last-cast result. Unknown names, IDs outside 165535 and missing state also return 0.

SUB Main()
    # 402 is Confidence. active contains 1 or 0; TRUE equals 1 in this condition. The message
    # describes received state, not an attempted cast result.

    VAR active = UO.IsActiveSpellAbility(402)
    IF active = TRUE THEN
        UO.Print("Confidence is active")
    ELSE
        UO.Print("No active Confidence state received")
    END IF
END SUB

Parameter and execution notes:

  • 402 is Confidence. active contains 1 or 0; TRUE equals 1 in this condition. The message describes received state, not an attempted cast result.

Avoid repeating an active ability

# Avoid repeating an active ability
#
# Reads whether the server has reported the selected spell/ability as active. Useful before
# reactivating an ability supported by this status. It does not enable anything, cast or select
# a target.
#
# Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In
# conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration
# or last-cast result. Unknown names, IDs outside 165535 and missing state also return 0.

SUB Main()
    # Cast("Confidence") takes only the name. It sends one request when active state is absent,
    # without guaranteeing server success. Do not repeat this in a tight loop: the server reply may
    # lag.

    IF UO.IsActiveSpellAbility("Confidence") = 0 THEN
        UO.Cast("Confidence")
    END IF
END SUB

Parameter and execution notes:

  • Cast("Confidence") takes only the name. It sends one request when active state is absent, without guaranteeing server success. Do not repeat this in a tight loop: the server reply may lag.

Wait for state with a limit

# Wait for state with a limit
#
# Reads whether the server has reported the selected spell/ability as active. Useful before
# reactivating an ability supported by this status. It does not enable anything, cast or select
# a target.
#
# Integer: 1 means this ID is in the received active-state set; 0 means it is absent. In
# conditions you may compare with 1/0 or TRUE/FALSE. This is a state flag, not a count, duration
# or last-cast result. Unknown names, IDs outside 165535 and missing state also return 0.

SUB Main()
    # spell is name/ID; expected is TRUE for active or FALSE for inactive; timeoutMs is
    # milliseconds. Main waits up to 500 ms in 25 ms polling steps and casts nothing. The helper
    # returns TRUE on a match, otherwise FALSE. Pauses or load can extend elapsed wall time; the
    # state does not identify why it changed.

    IF WaitAbilityState("Confidence", TRUE, 500) THEN
        UO.Print("Active state received")
    ELSE
        UO.Print("No active state before timeout")
    END IF
END SUB

FUNCTION WaitAbilityState(spell, expected, timeoutMs)
    VAR elapsed = 0
    WHILE elapsed < timeoutMs
        IF (UO.IsActiveSpellAbility(spell) = 1) = expected THEN
            RETURN TRUE
        END IF
        UO.Wait(25)
        elapsed = elapsed + 25
    WEND
    RETURN (UO.IsActiveSpellAbility(spell) = 1) = expected
END FUNCTION

Parameter and execution notes:

  • spell is name/ID; expected is TRUE for active or FALSE for inactive; timeoutMs is milliseconds. Main waits up to 500 ms in 25 ms polling steps and casts nothing. The helper returns TRUE on a match, otherwise FALSE. Pauses or load can extend elapsed wall time; the state does not identify why it changed.

Spells / Заклинания

Spells / Заклинания

Русский · English · Українська · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

Clone this wiki locally