![]() |
Crossfire Server, Trunk
1.75.0
|
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | BITMASK_EVENT(evt) (1ULL << evt) |
| Convert an event to its bit. More... | |
| #define | BITMASK_VALID (1ULL << 63) |
| Bit indicating if the event bitmask is valid or not. More... | |
| #define | EVENT_APPLY 1 |
| Object applied-unapplied. More... | |
| #define | EVENT_ATTACKED 2 |
| Object attacked, with weapon or spell. More... | |
| #define | EVENT_ATTACKS 33 |
| Weapon or arrow hitting something. More... | |
| #define | EVENT_BORN 14 |
| A new character has been created. More... | |
| #define | EVENT_BOUGHT 34 |
| Object is being bought by player. More... | |
| #define | EVENT_CLOCK 15 |
| Global time event. More... | |
| #define | EVENT_CLOSE 11 |
| Container closed. More... | |
| #define | EVENT_CRASH 16 |
| Triggered when the server crashes. More... | |
| #define | EVENT_DEATH 3 |
| Player or monster dead. More... | |
| #define | EVENT_DESTROY 13 |
| Object destroyed (includes map reset/swapout) More... | |
| #define | EVENT_DROP 4 |
| Object dropped on the floor. More... | |
| #define | EVENT_GBOUGHT 36 |
| Player bought object in shop, but global. More... | |
| #define | EVENT_GKILL 18 |
| Triggered when anything got killed by anyone. More... | |
| #define | EVENT_GSOLD 37 |
| Player sold object in shop, but global. More... | |
| #define | EVENT_KICK 28 |
| A player was Kicked by a DM More... | |
| #define | EVENT_LOGIN 19 |
| Player login. More... | |
| #define | EVENT_LOGOUT 20 |
| Player logout. More... | |
| #define | EVENT_MAPENTER 21 |
| A player entered a map. More... | |
| #define | EVENT_MAPLEAVE 22 |
| A player left a map. More... | |
| #define | EVENT_MAPLOAD 30 |
| A map is loaded (pristine state) More... | |
| #define | EVENT_MAPREADY 35 |
| A map is ready, either first load or after reload. More... | |
| #define | EVENT_MAPRESET 23 |
| A map is resetting. More... | |
| #define | EVENT_MAPUNLOAD 29 |
| A map is freed (includes swapping out) More... | |
| #define | EVENT_MUZZLE 27 |
| A player was Muzzled (no_shout set). More... | |
| #define | EVENT_NONE 0 |
| No event. More... | |
| #define | EVENT_PICKUP 5 |
| Object picked up. More... | |
| #define | EVENT_PLAYER_DEATH 17 |
| Global Death event More... | |
| #define | EVENT_REMOVE 24 |
| A Player character has been removed. More... | |
| #define | EVENT_SAY 6 |
| Someone speaks. More... | |
| #define | EVENT_SELLING 32 |
| Object is being sold by another one. More... | |
| #define | EVENT_SHOUT 25 |
| A player 'shout' something. More... | |
| #define | EVENT_STOP 7 |
| Thrown object stopped. More... | |
| #define | EVENT_TELL 26 |
| A player 'tell' something. More... | |
| #define | EVENT_THROW 9 |
| Object is thrown. More... | |
| #define | EVENT_TIME 8 |
| Triggered each time the object can react/move. More... | |
| #define | EVENT_TIMER 12 |
| Timer connected triggered it. More... | |
| #define | EVENT_TRIGGER 10 |
| Button pushed, lever pulled, etc. More... | |
| #define | EVENT_USER 31 |
| User-defined event. More... | |
| #define | NR_EVENTS 38 |
| Number of events, maximum code + 1. More... | |
Typedefs | |
| typedef unsigned long | event_registration |
| Registration identifier type. More... | |
| typedef int(* | f_plug_event) (int *type,...) |
| Function to call to handle global or object-related events. More... | |
Functions | |
| void | events_execute_global_event (int eventcode,...) |
| Execute a global event. More... | |
| int | events_execute_object_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix) |
| Execute an event on the specified object. More... | |
| int | events_execute_object_say (object *npc, talk_info *talk) |
| Execute an EVENT_SAY on the specified object. More... | |
| int | events_execute_object_user (object *op, object *activator, object *third, const char *message, int fix) |
| Execute an EVENT_USER on the specified object. More... | |
| event_registration | events_register_global_handler (int eventcode, f_plug_event hook) |
| Register a global event handler. More... | |
| void | events_register_object_handler (const char *id, f_plug_event handler) |
| Register an object event handler. More... | |
| void | events_unregister_global_handler (int eventcode, event_registration id) |
| Remove a global event handler. More... | |
| void | events_unregister_object_handler (const char *id) |
| Remove an object event handler. More... | |
| #define BITMASK_EVENT | ( | evt | ) | (1ULL << evt) |
| #define BITMASK_VALID (1ULL << 63) |
| #define EVENT_ATTACKED 2 |
| #define EVENT_CRASH 16 |
| #define EVENT_DESTROY 13 |
| #define EVENT_GBOUGHT 36 |
| #define EVENT_GKILL 18 |
| #define EVENT_GSOLD 37 |
| #define EVENT_MAPREADY 35 |
| #define EVENT_MAPUNLOAD 29 |
| #define EVENT_MUZZLE 27 |
| #define EVENT_NONE 0 |
| #define EVENT_REMOVE 24 |
| #define EVENT_SELLING 32 |
| #define EVENT_TIME 8 |
| typedef unsigned long event_registration |
| typedef int(* f_plug_event) (int *type,...) |
| void events_execute_global_event | ( | int | eventcode, |
| ... | |||
| ) |
Execute a global event.
| eventcode | event code. |
| ... | additional parameters, depending on the event. |
Definition at line 30 of file events.cpp.
References buf, EVENT_BORN, EVENT_CLOCK, EVENT_CRASH, EVENT_GBOUGHT, EVENT_GKILL, EVENT_GSOLD, EVENT_KICK, EVENT_LOGIN, EVENT_LOGOUT, EVENT_MAPENTER, EVENT_MAPLEAVE, EVENT_MAPLOAD, EVENT_MAPREADY, EVENT_MAPRESET, EVENT_MAPUNLOAD, EVENT_MUZZLE, EVENT_PLAYER_DEATH, EVENT_REMOVE, EVENT_SHOUT, EVENT_TELL, global_events_total, and global_handlers.
Referenced by apply_race_and_class(), apply_savebed(), check_login(), command_kick2(), command_tell_all(), command_toggle_shout(), do_tell(), flush_old_maps(), free_map(), key_change_class(), key_confirm_quit(), kill_object(), kill_player(), mapfile_load(), player_map_change_common(), ready_map_name(), sell_item(), server_main(), shop_pay_unpaid_callback(), and swap_map().
Here is the caller graph for this function:| int events_execute_object_event | ( | object * | op, |
| int | eventcode, | ||
| object * | activator, | ||
| object * | third, | ||
| const char * | message, | ||
| int | fix | ||
| ) |
Execute an event on the specified object.
| op | object to execute the event on. |
| eventcode | event code to execute. |
| activator | object which caused the event to be triggered. |
| third | additional object. |
| message | what the object said to trigger. |
| fix | whether to fix op or not. |
Definition at line 308 of file events.cpp.
References do_execute_event(), and message.
Referenced by apply_container(), attack_ob_simple(), cftimer_process_event(), common_pre_ob_move_on(), do_throw(), drop_object(), events_execute_object_user(), hit_player(), hit_with_arrow(), kill_object(), kill_player(), move_teleporter(), ob_apply(), object_free(), pick_lock(), pick_up_object(), player_changer_type_process(), pray_at_altar(), process_object(), sell_item(), shop_pay_unpaid_callback(), stop_projectile(), trigger_connected(), write_note(), and write_scroll().
Here is the call graph for this function:
Here is the caller graph for this function:Execute an EVENT_SAY on the specified object.
| npc | object to execute the event on. |
| talk | dialog information, which may be altered to add replies or questions. |
Definition at line 312 of file events.cpp.
References do_execute_event(), EVENT_SAY, SCRIPT_FIX_ALL, talk_info::text, and talk_info::who.
Referenced by monster_talk_to_npc().
Here is the call graph for this function:
Here is the caller graph for this function:| int events_execute_object_user | ( | object * | op, |
| object * | activator, | ||
| object * | third, | ||
| const char * | message, | ||
| int | fix | ||
| ) |
Execute an EVENT_USER on the specified object.
| op | object to execute the event on. |
| activator | object which caused the event to be triggered. |
| third | additional object. |
| message | what the object said to trigger. |
| fix | whether to fix op or not. |
Definition at line 316 of file events.cpp.
References EVENT_USER, events_execute_object_event(), and message.
Referenced by cfapi_object_user_event().
Here is the call graph for this function:
Here is the caller graph for this function:| event_registration events_register_global_handler | ( | int | eventcode, |
| f_plug_event | hook | ||
| ) |
Register a global event handler.
| eventcode | event code to register the handler for. |
| hook | function to call for the event. |
Definition at line 19 of file events.cpp.
References eg, global_handlers, and next_event_registration.
Referenced by cfapi_system_register_global_event(), cfcitybell_init(), citylife_init(), and random_house_generator_init().
Here is the caller graph for this function:| void events_register_object_handler | ( | const char * | id, |
| f_plug_event | handler | ||
| ) |
Register an object event handler.
| id | handler identifier, must be unique and match the "title" field of the event connector. |
| handler | function to call for the event. |
Definition at line 298 of file events.cpp.
References llevDebug, LOG(), and object_handlers.
Referenced by citylife_init(), and plugins_init_plugin().
Here is the call graph for this function:
Here is the caller graph for this function:| void events_unregister_global_handler | ( | int | eventcode, |
| event_registration | id | ||
| ) |
Remove a global event handler.
| eventcode | event code to unregister the handler of. |
| id | registration identifier as returned by events_register_global_handler(). |
Definition at line 26 of file events.cpp.
References global_handlers.
Referenced by cfapi_system_unregister_global_event(), cfcitybell_close(), citylife_close(), plugins_remove_plugin(), and random_house_generator_close().
Here is the caller graph for this function:| void events_unregister_object_handler | ( | const char * | id | ) |
Remove an object event handler.
| id | handler identifier. |
Definition at line 303 of file events.cpp.
References llevDebug, LOG(), and object_handlers.
Referenced by citylife_close(), and plugins_remove_plugin().
Here is the call graph for this function:
Here is the caller graph for this function: