-
Notifications
You must be signed in to change notification settings - Fork 5
Event handling types
Several types of event handling are available, allowing you to specify certain actions in the guide script as a reaction to a registered dungeon event (hook). For each individual type of handlers, it is possible to specify additional parameters to customize the processing behavior. Below is a table of all types of handlers and their parameters.
Read more about event handling here.
A special object containing the entity of data about the NPC or player placed on the map. The entity is used for bind to coordinates of the boss, NPC, animation, etc. The definition and transfer of this entity to the spawn function occurs automatically when the event handler is called.
If the handler was called from within the context of a function called with a handler of type func, entity transfer occurs automatically by writing and reading the ent variable (which is not required in the arguments).
There is a possibility of specifying a time pause, allowing to delay the execution of an event. Setting the delay is possible for any type of event, for this the optional parameter delay
is set, the value of which is a number in milliseconds.
Example:
{ type: "text", sub_type: "message", message: "Text", message_RU: "Сообщение", delay: 3000 }
Important! Checking all filtering methods occurs only after the event delay specified by the optional parameter delay
has been processed. If this parameter is not specified or is equal to zero – filtering methods are checked instantly.
To bind a specific event to the required playable character class, the optional parameter class_position
is used, in the value of which the following words are allowed: tank, dps, heal, priest, mystic, lancer.
If this parameter is specified, the event will be executed only for the specified game class of the player.
Also is allowed to specify several values for one event using the array [...]
.
Example:
{ type: "text", sub_type: "message", message: "Clense", message_RU: "Клинс", class_position: "heal" },
{ type: "text", sub_type: "message", message: "Dodge", message_RU: "Эвейд", class_position: ["tank", "dps"] }
It is also possible to filter the execution of events by the value of the called function. To do this, use the optional parameter check_func
, the value of which indicates the name of the function (an anonymous function can be specified).
When the event is called, the specified function will be called, and if it returns true, the event will be executed, otherwise the event will not be executed.
The following arguments will be passed to the called function:
- ent – current entity object.
-
event – current event data object (contains parameter:
_key
– current event key).
Example:
{ type: "text", sub_type: "message", message: "OUT", check_func: () => debuff === 1 },
{ type: "text", sub_type: "message", message: "IN", check_func: () => debuff === 2 }
Important! The mandatory parameter message
is used to specify the text of messages.
It is possible to use special tags that allow to set the color for all or part of the text: [c=#color_code]...[/c]
.
Simultaneous setting of several message texts in different languages is allowed. For this, the specify keys in the message_LANG
format (where LANG
is the ISO language code) can be used, for example: message_RU
.
Type type
|
Subtype sub_type
|
Description |
---|---|---|
text | message | Display a text message on the screen (green background). |
text | alert | Display text message on screen (red background). |
text | warning | Display a text message on the screen (blue background). |
text | notification | Send a text message of the raid leader. |
text | speech | Play message text via Text-to-Speech (TTS). |
In addition to displaying messages on the screen, the specified text is also duplicated by TTS notification (regardless of the specified handler subtype). To forcefully disable Text-to-Speech notification for message, you must use the optional parameter speech
with the value false.
Examples:
{ type: "text", sub_type: "message", message: "Standard text", message_RU: "Стандартное сообщение" },
{ type: "text", sub_type: "alert", message: "Alert text", message_RU: "Важное сообщение", delay: 2000 },
{ type: "text", sub_type: "warning", message: "Warning text", message_RU: "Предуп. сообщение", delay: 4000 },
{ type: "text", sub_type: "notification", message: "Notification text", message_RU: "Уведомление", delay: 6000 },
Important! All types of events that use this methods of spawning items require specifying the mandatory parameter sub_delay
, which specified the display time of the created item. The parameter value is a number in milliseconds.
It is possible to use the optional parameter force_gameId
to specify a unique identifier used for despawn of an item by the despawn handler.
Type type
|
Subtype sub_type
|
Parameter | Description |
---|---|---|---|
spawn | collection | No | Spawn item. Allowed to specify an optional parameter tag used in the despawn_all handler. |
spawn | item | No | Create an item dropped to the ground. Allowed to specify an optional parameter tag used in the despawn_all handler. |
spawn | build_object | No | Create an object (sign). Allowed to specify an optional parameter tag used in the despawn_all handler. |
spawn | bonfire | id |
Create a bonfire. In parameter id can be specified with the following values: normal, fire, santa, blue, purple, sacrifice. Allowed to specify an optional parameter tag used in the despawn_all handler. |
despawn | No | id |
Delete the spawned item specified in parameter id (the gameId of the item is specified or the identifier specified when creating the item in the force_gameId parameter). |
despawn_all | No | No | Remove all spawned items and items. It is allowed to specify an optional parameter tag containing the keyword specified when the items were created. If this parameter was specified, only those items that were created with the specified word will be deleted. |
It is allowed to specify additional parameters responsible for the positioning of the spawned items: distance
(distance in units, 1 meter = 25 units), angle
(offset angle), pos
(coordinates on the map as an object { x: n, y: n, z: n }
). It is not allowed to specify the distance
/angle
with pos
parameters together.
Examples:
{ type: "spawn", sub_type: "item", id: 206960, offset: 45, distance: 100, sub_delay: 2000 },
{ type: "spawn", sub_type: "item", id: 206960, pos: { x: 53192, y: 100761, z: 14233 }, sub_delay: 2000 },
Type type
|
Parameters | Description |
---|---|---|
spawn, spawn_func |
func , args
|
Create an item or figure, the type of which is specified in the parameter func . More about types read here. To specify an array of [...] properties of the created figure, use the mandatory parameter args . Allowed to specify an optional parameter tag used in the despawn_all handler to remove items. |
Examples:
{ type: "spawn", func: "item", args: [88704, 0, 100, 0, 2000] },
{ type: "spawn", func: "marker", args: [false, 0, 100, 2000, 2000, true, ["Test", "Marker"]] },
{ type: "spawn", func: "point", args: [537, 0, 100, 4000, 2000] },
{ type: "spawn", func: "vector", args: [553, 0, 0, 0, 300, 6000, 2000] },
{ type: "spawn", func: "circle", args: [true, 553, 0, 0, 12, 250, 8000, 2000] },
{ type: "spawn", func: "semicircle", args: [-90, 90, 553, 0, 0, 18, 150, 10000, 2000] },
Important! The marker event type requires the mandatory parameter sub_delay
to specify the display time of the placed marker. The parameter value is a number in milliseconds.
Type type
|
Parameter | Description |
---|---|---|
marker, marker_add |
id (optional if ent used) |
Place a marker on a player or NPC whose identifier is specified in the parameter id . If no identifier is specified, the value of gameId from the ent variable is used for binding. |
marker_remove | id |
Remove the placed marker by identifier, which is specified in the parameter id . |
marker_remove_all | No | Remove all placed markers (only markers placed by the script will be removed). |
Examples:
{ type: "marker", color: "red", sub_delay: 2000 },
{ type: "marker", color: "yellow", delay: 2000, sub_delay: 2000 },
{ type: "marker", color: "blue", delay: 4000, sub_delay: 50000 },
{ type: "marker_remove_all", delay: 6000 },
Type type
|
Parameter | Description |
---|---|---|
func | func |
Call the specified function in parameter func with the following arguments: ent – entity object (event binding point), event – current event data object (contains parameter: _key – current event key),handlers – instance of handlers class. Is possible sending an additional arguments to the called function (to the start of the argument list) using the array [...] specified in the optional args parameter.When a function is called by this handler, the current binding point is written to the ent variable, which allows using the items spawn methods inside the called function without manually binding them to the current binding point. |
event, start_events | args |
Execute the event or chain of events specified (listed as objects) in the array [...] in the parameter args . |
alias | id |
Execute an existing event from the guide script, the key of which is specified in parameter id . It is not allowed to specify a self event key value. |
stop_timers | No | Stop all event delay timers, preventing their execution. The timers specified for some types of handlers in the sub_delay parameter are also stopped, so after stopping the timers, all spawned items or markers will not be removed. |
Examples:
{ type: "func", func: test_event, args: ["Foo", "Bar"] },
{ type: "event", args: [{ type: "text", sub_type: "message", message: "Text", message_RU: "Сообщение" }] },
{ type: "alias", id: "s-735-1000-111-0" },
{ type: "stop_timers" },