# Method Global:RegisterMapEvent [-] [+]

Registers a Map event handler for all instance of a Map.

    enum InstanceEvents
    {
        INSTANCE_EVENT_ON_INITIALIZE                    = 1,    // (event, instance_data, map)
        INSTANCE_EVENT_ON_LOAD                          = 2,    // (event, instance_data, map)
        INSTANCE_EVENT_ON_UPDATE                        = 3,    // (event, instance_data, map, diff)
        INSTANCE_EVENT_ON_PLAYER_ENTER                  = 4,    // (event, instance_data, map, player)
        INSTANCE_EVENT_ON_CREATURE_CREATE               = 5,    // (event, instance_data, map, creature)
        INSTANCE_EVENT_ON_GAMEOBJECT_CREATE             = 6,    // (event, instance_data, map, go)
        INSTANCE_EVENT_ON_CHECK_ENCOUNTER_IN_PROGRESS   = 7,    // (event, instance_data, map)
        INSTANCE_EVENT_COUNT
    };

## Synopsis

`RegisterMapEvent( map_id, event, function )`

`RegisterMapEvent( map_id, event, function, shots )`

## Arguments

`number map_id`

  ID of a Map.

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

`number event`

  Map event ID, refer to MapEvents 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

Nothing.

# 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