Crossfire Server, Trunk  1.75.0
events.h
Go to the documentation of this file.
1 #ifndef EVENTS_H
2 #define EVENTS_H
3 
4 /* Event ID codes. Sorted them to present local events first, but it is
5  * just a 'cosmetic' thing.
6  * Codes should not be changed, as they are linked to objects' subtype for handling.
7  */
8 
27 #define EVENT_NONE 0
28 #define EVENT_APPLY 1
29 #define EVENT_ATTACKED 2
30 #define EVENT_ATTACKS 33
31 #define EVENT_BOUGHT 34
32 #define EVENT_CLOSE 11
33 #define EVENT_DEATH 3
34 #define EVENT_DESTROY 13
35 #define EVENT_DROP 4
36 #define EVENT_PICKUP 5
37 #define EVENT_SAY 6
38 #define EVENT_SELLING 32
39 #define EVENT_STOP 7
40 #define EVENT_TIME 8
41 #define EVENT_THROW 9
42 #define EVENT_TRIGGER 10
43 #define EVENT_TIMER 12
44 #define EVENT_USER 31
52 #define EVENT_BORN 14
53 #define EVENT_CLOCK 15
54 #define EVENT_CRASH 16
55 #define EVENT_GKILL 18
56 #define EVENT_KICK 28
57 #define EVENT_LOGIN 19
58 #define EVENT_LOGOUT 20
59 #define EVENT_MAPENTER 21
60 #define EVENT_MAPLEAVE 22
61 #define EVENT_MAPLOAD 30
62 #define EVENT_MAPREADY 35
63 #define EVENT_MAPRESET 23
64 #define EVENT_MAPUNLOAD 29
65 #define EVENT_MUZZLE 27
66 #define EVENT_PLAYER_DEATH 17
67 #define EVENT_REMOVE 24
68 #define EVENT_SHOUT 25
69 #define EVENT_TELL 26
70 #define EVENT_GBOUGHT 36
71 #define EVENT_GSOLD 37
74 #define NR_EVENTS 38
77 #define BITMASK_EVENT(evt) (1ULL << evt)
78 
79 #define BITMASK_VALID (1ULL << 63)
80 
82 typedef int (*f_plug_event)(int *type, ...);
84 typedef unsigned long event_registration;
85 
93 
100 
106 void events_execute_global_event(int eventcode, ...);
107 
113 void events_register_object_handler(const char *id, f_plug_event handler);
114 
119 void events_unregister_object_handler(const char *id);
120 
130 int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix);
131 
142 int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix);
143 
150 int events_execute_object_say(object *npc, talk_info *talk);
151 
152 #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)
Execute an event on the specified object.
Definition: events.cpp:309
events_execute_object_say
int events_execute_object_say(object *npc, talk_info *talk)
Execute an EVENT_SAY on the specified object.
Definition: events.cpp:313
events_execute_object_user
int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix)
Execute an EVENT_USER on the specified object.
Definition: events.cpp:317
events_register_global_handler
event_registration events_register_global_handler(int eventcode, f_plug_event hook)
Register a global event handler.
Definition: events.cpp:19
events_unregister_global_handler
void events_unregister_global_handler(int eventcode, event_registration id)
Remove a global event handler.
Definition: events.cpp:26
events_execute_global_event
void events_execute_global_event(int eventcode,...)
Execute a global event.
Definition: events.cpp:30
events_register_object_handler
void events_register_object_handler(const char *id, f_plug_event handler)
Register an object event handler.
Definition: events.cpp:299
events_unregister_object_handler
void events_unregister_object_handler(const char *id)
Remove an object event handler.
Definition: events.cpp:304
message
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
Definition: survival-guide.txt:34
event_registration
unsigned long event_registration
Registration identifier type.
Definition: events.h:84
f_plug_event
int(* f_plug_event)(int *type,...)
Function to call to handle global or object-related events.
Definition: events.h:82
talk_info
Structure used to build up dialog information when a player says something.
Definition: dialog.h:50
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25