# Method Global:RegisterSpellEffectEvent [-] [+]

Registers a Spell effect event handler.

    enum SpellEffectEvents
    {
        SPELL_EFFECT_EVENT_LAUNCH                            = 1,    // (event, spell, effindex)
        SPELL_EFFECT_EVENT_LAUNCH_TARGET                     = 2,    // (event, spell, effindex)
        SPELL_EFFECT_EVENT_EFFECT_HIT                        = 3,    // (event, spell, effindex)
        SPELL_EFFECT_EVENT_EFFECT_HIT_TARGET                 = 4,    // (event, spell, effindex)
        SPELL_EFFECT_EVENT_EFFECT_SUCCESSFUL_DISPEL          = 5,    // (event, spell, effindex)
        SPELL_EFFECT_EVENT_EFFECT_OBJECT_AREA_TARGET_SELECT  = 6,    // (event, spell, effIndex, targets)
        SPELL_EFFECT_EVENT_EFFECT_OBJECT_TARGET_SELECT       = 7,    // (event, spell, effIndex, target) - Target is the Creature/GameObject/Item.
        SPELL_EFFECT_EVENT_EFFECT_DESTINATION_TARGET_SELECT  = 8,    // (event, spell, effIndex, spelldest)
        SPELL_EFFECT_EVENT_COUNT
    };

    enum SpellEffIndex : uint8
    {
        EFFECT_0 = 0,
        EFFECT_1 = 1,
        EFFECT_2 = 2
    };

## Synopsis

`cancel = RegisterSpellEffectEvent( entry, event, effindex, function )`

`cancel = RegisterSpellEffectEvent( entry, event, effindex, function, shots )`

## Arguments

`number entry`

  Spell entry Id (Use negative entry Id for all spell ranks).

  Valid numbers: integers from -2,147,483,647 to 2,147,483,647.

`number effindex`

  Spell effect Id, refer to SpellEffIndex.

  Valid numbers: integers from 0 to 4,294,967,295.

`number event`

  Spell event Id, refer to SpellEffectEvents above.

  Valid numbers: integers from 0 to 4,294,967,295.

`function function`

  Function to register.

`number shots (0)`

  The number of times the function will be called, 0 means "always call this function".

  Valid numbers: integers from 0 to 4,294,967,295.

## Returns

`function cancel`

  A function that cancels the binding when called.

# Keyboard shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

# Search tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct` (or `str`), `enum`, `trait`, `typedef` (or `tdef`).

Generated on
© 2010 - 2024 Eluna Lua Engine