Crossfire Server, Trunk
|
Go to the source code of this file.
Macros | |
#define | BITMASK_EVENT(evt) (1ULL << evt) |
#define | BITMASK_VALID (1ULL << 63) |
#define | EVENT_APPLY 1 |
#define | EVENT_ATTACKED 2 |
#define | EVENT_ATTACKS 33 |
#define | EVENT_BORN 14 |
#define | EVENT_BOUGHT 34 |
#define | EVENT_CLOCK 15 |
#define | EVENT_CLOSE 11 |
#define | EVENT_CRASH 16 |
#define | EVENT_DEATH 3 |
#define | EVENT_DESTROY 13 |
#define | EVENT_DROP 4 |
#define | EVENT_GKILL 18 |
#define | EVENT_KICK 28 |
#define | EVENT_LOGIN 19 |
#define | EVENT_LOGOUT 20 |
#define | EVENT_MAPENTER 21 |
#define | EVENT_MAPLEAVE 22 |
#define | EVENT_MAPLOAD 30 |
#define | EVENT_MAPREADY 35 |
#define | EVENT_MAPRESET 23 |
#define | EVENT_MAPUNLOAD 29 |
#define | EVENT_MUZZLE 27 |
#define | EVENT_NONE 0 |
#define | EVENT_PICKUP 5 |
#define | EVENT_PLAYER_DEATH 17 |
#define | EVENT_REMOVE 24 |
#define | EVENT_SAY 6 |
#define | EVENT_SELLING 32 |
#define | EVENT_SHOUT 25 |
#define | EVENT_STOP 7 |
#define | EVENT_TELL 26 |
#define | EVENT_THROW 9 |
#define | EVENT_TIME 8 |
#define | EVENT_TIMER 12 |
#define | EVENT_TRIGGER 10 |
#define | EVENT_USER 31 |
#define | NR_EVENTS 36 |
Typedefs | |
typedef unsigned long | event_registration |
typedef int(* | f_plug_event) (int *type,...) |
Functions | |
void | events_execute_global_event (int eventcode,...) |
int | events_execute_object_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix) |
int | events_execute_object_say (object *npc, talk_info *talk) |
int | events_execute_object_user (object *op, object *activator, object *third, const char *message, int fix) |
event_registration | events_register_global_handler (int eventcode, f_plug_event hook) |
void | events_register_object_handler (const char *id, f_plug_event handler) |
void | events_unregister_global_handler (int eventcode, event_registration id) |
void | events_unregister_object_handler (const char *id) |
#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_GKILL 18 |
#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 32 of file events.cpp.
References make_face_from_files::args, buf, EVENT_BORN, EVENT_CLOCK, EVENT_CRASH, EVENT_GKILL, 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, global_handlers, disinfect::map, give::op, and altar_valkyrie::pl.
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(), server_main(), and swap_map().
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 299 of file events.cpp.
References diamondslots::activator, do_execute_event(), diamondslots::message, and give::op.
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().
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 303 of file events.cpp.
References do_execute_event(), EVENT_SAY, npc_dialog::npc, SCRIPT_FIX_ALL, talk_info::text, and talk_info::who.
Referenced by monster_talk_to_npc().
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 307 of file events.cpp.
References diamondslots::activator, EVENT_USER, events_execute_object_event(), diamondslots::message, and give::op.
Referenced by cfapi_object_user_event().
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 21 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().
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 289 of file events.cpp.
References diamondslots::id, llevDebug, LOG(), and object_handlers.
Referenced by citylife_init(), and plugins_init_plugin().
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 28 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().
void events_unregister_object_handler | ( | const char * | id | ) |
Remove an object event handler.
id | handler identifier. |
Definition at line 294 of file events.cpp.
References llevDebug, LOG(), and object_handlers.
Referenced by citylife_close(), and plugins_remove_plugin().