Crossfire Server, Trunk
events.h
Go to the documentation of this file.
1 #ifndef EVENTS_H
2 #define EVENTS_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 /* Event ID codes. Sorted them to present local events first, but it is
9  * just a 'cosmetic' thing.
10  * Codes should not be changed, as they are linked to objects' subtype for handling.
11  */
12 
17 /* Local events. Those are always linked to a specific object. */
18 #define EVENT_NONE 0
19 #define EVENT_APPLY 1
20 #define EVENT_ATTACKED 2
21 #define EVENT_ATTACKS 33
22 #define EVENT_BOUGHT 34
23 #define EVENT_CLOSE 11
24 #define EVENT_DEATH 3
25 #define EVENT_DESTROY 13
26 #define EVENT_DROP 4
27 #define EVENT_PICKUP 5
28 #define EVENT_SAY 6
29 #define EVENT_SELLING 32
30 #define EVENT_STOP 7
31 #define EVENT_TIME 8
32 #define EVENT_THROW 9
33 #define EVENT_TRIGGER 10
34 #define EVENT_TIMER 12
35 #define EVENT_USER 31
37 /* Global events. Those are never linked to a specific object.*/
38 #define EVENT_BORN 14
39 #define EVENT_CLOCK 15
40 #define EVENT_CRASH 16
41 #define EVENT_GKILL 18
42 #define EVENT_KICK 28
43 #define EVENT_LOGIN 19
44 #define EVENT_LOGOUT 20
45 #define EVENT_MAPENTER 21
46 #define EVENT_MAPLEAVE 22
47 #define EVENT_MAPLOAD 30
48 #define EVENT_MAPREADY 35
49 #define EVENT_MAPRESET 23
50 #define EVENT_MAPUNLOAD 29
51 #define EVENT_MUZZLE 27
52 #define EVENT_PLAYER_DEATH 17
53 #define EVENT_REMOVE 24
54 #define EVENT_SHOUT 25
55 #define EVENT_TELL 26
57 
58 #define NR_EVENTS 36
61 typedef int (*f_plug_event)(int *type, ...);
62 
63 typedef unsigned long event_registration;
64 
72 
79 
85 void events_execute_global_event(int eventcode, ...);
86 
92 void events_register_object_handler(const char *id, f_plug_event handler);
93 
98 void events_unregister_object_handler(const char *id);
99 
109 int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix);
110 
121 int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix);
122 
129 int events_execute_object_say(object *npc, talk_info *talk);
130 
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif /* EVENTS_H */
events_execute_object_event
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Definition: events.cpp:274
events_execute_object_say
int events_execute_object_say(object *npc, talk_info *talk)
Definition: events.cpp:278
events_execute_object_user
int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix)
Definition: events.cpp:282
events_register_global_handler
event_registration events_register_global_handler(int eventcode, f_plug_event hook)
Definition: events.cpp:18
events_unregister_global_handler
void events_unregister_global_handler(int eventcode, event_registration id)
Definition: events.cpp:25
diamondslots.activator
activator
Definition: diamondslots.py:10
events_execute_global_event
void events_execute_global_event(int eventcode,...)
Definition: events.cpp:29
events_register_object_handler
void events_register_object_handler(const char *id, f_plug_event handler)
Definition: events.cpp:264
events_unregister_object_handler
void events_unregister_object_handler(const char *id)
Definition: events.cpp:269
diamondslots.message
string message
Definition: diamondslots.py:57
event_registration
unsigned long event_registration
Definition: events.h:63
f_plug_event
int(* f_plug_event)(int *type,...)
Definition: events.h:61
give.op
op
Definition: give.py:33
talk_info
Definition: dialog.h:51
npc_dialog.npc
npc
Definition: npc_dialog.py:95