ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/events.pod
(Generate patch)

Comparing deliantra/server/doc/events.pod (file contents):
Revision 1.1 by root, Mon Aug 28 08:34:28 2006 UTC vs.
Revision 1.2 by root, Mon Aug 28 08:48:02 2006 UTC

7=head2 NOTATION 7=head2 NOTATION
8 8
9the event description below uses a variant of the forth stack notation - 9the event description below uses a variant of the forth stack notation -
10an opening parenthesis followed by the type of each parameter, optionally 10an opening parenthesis followed by the type of each parameter, optionally
11followed by two dashes and the returning parameters. If the latter is 11followed by two dashes and the returning parameters. If the latter is
12missing, the event will be called but cannot change wether the event gets 12missing, the event will be invoked but cannot change wether the event gets
13processed. 13processed.
14 14
15If it is specified (even if no return values are supported), a plug-in 15If it is specified (even if no return values are supported), a plug-in
16can override (e.g. using C<cf::override> in Perl) event processing, 16can override (e.g. using C<cf::override> in Perl) event processing,
17basically short-circuiting it. For example, if you override from within a 17basically short-circuiting it. For example, if you override from within a
33 33
34Player events always have a player object as first argument. 34Player events always have a player object as first argument.
35 35
36=head3 REATTACH (player) 36=head3 REATTACH (player)
37 37
38Called whenever attachments/plug-ins need to get reattached to the player 38Invoked whenever attachments/plug-ins need to get reattached to the player
39object. This usually happens when the player gets loaded from disk, or 39object. This usually happens when the player gets loaded from disk, or
40when the server is reloaded. 40when the server is reloaded.
41 41
42=head3 BIRTH (player) 42=head3 BIRTH (player)
43 43
44Called as very first thing after creating a player. 44Invoked as very first thing after creating a player.
45 45
46=head3 QUIT (player) 46=head3 QUIT (player)
47 47
48Called wheneever a player quits, before actually removing him/her. 48Invoked wheneever a player quits, before actually removing him/her.
49 49
50=head3 LOAD (player) 50=head3 LOAD (player)
51 51
52Called whenever a player has been loaded from disk, but before 52Invoked whenever a player has been loaded from disk, but before
53actual login. 53actual login.
54 54
55=head3 SAVE (player) 55=head3 SAVE (player)
56 56
57Called just before a player gets saved. 57Invoked just before a player gets saved.
58 58
59=head3 LOGIN (player) 59=head3 LOGIN (player)
60 60
61Called whenever a player logs in. 61Invoked whenever a player logs in.
62 62
63=head3 LOGOUT (player) 63=head3 LOGOUT (player)
64 64
65Called whenever a player logs out, gets disconnected etc. 65Invoked whenever a player logs out, gets disconnected etc.
66 66
67=head3 DEATH (player) 67=head3 DEATH (player)
68 68
69Called whenever a player dies, before the death actually gets processed. 69Invoked whenever a player dies, before the death actually gets processed.
70 70
71=head3 MAP_CHANGE (player oldmap newmap) 71=head3 MAP_CHANGE (player oldmap newmap)
72 72
73Called whenever a player moves from one map to another. 73Invoked whenever a player moves from one map to another.
74 74
75=head3 EXTCMD (player string) 75=head3 EXTCMD (player string)
76 76
77Called whenever a client issues the C<extcmd> protocol command. It's 77Invoked whenever a client issues the C<extcmd> protocol command. It's
78argument is passed without any changes. 78argument is passed without any changes.
79 79
80=head3 PRAY_ALTAR (player altar skill -- ) 80=head3 PRAY_ALTAR (player altar skill -- )
81 81
82Called whenever the B<player> prays over an B<altar>, using the given B<skill>. 82Invoked whenever the B<player> prays over an B<altar>, using the given B<skill>.
83 83
84=head3 TELL (player -- ) 84=head3 TELL (player -- )
85 85
86Called whenever the player uses the B<tell> command, before it gets processed. 86Invoked whenever the player uses the B<tell> command, before it gets processed.
87 87
88=head3 SAY (player --) 88=head3 SAY (player --)
89 89
90Called whenever the player uses the B<say> command, before it gets processed. 90Invoked whenever the player uses the B<say> command, before it gets processed.
91 91
92=head3 SHOUT (player --) 92=head3 SHOUT (player --)
93 93
94Called whenever the player uses the B<shout> command, before it gets processed. 94Invoked whenever the player uses the B<shout> command, before it gets processed.
95 95
96 96
97=head2 OBJECT EVENTS 97=head2 OBJECT EVENTS
98 98
99Object events always relate to a specific object, which is always the 99Object events always relate to a specific object, which is always the
109 109
110This is useful to initialise any per-object state you might need. 110This is useful to initialise any per-object state you might need.
111 111
112=head3 REATTACH (object) 112=head3 REATTACH (object)
113 113
114Called whenever attachments/plug-ins need to get reattached to the 114Invoked whenever attachments/plug-ins need to get reattached to the
115object. This usually happens when it was loaded from disk, or when the 115object. This usually happens when it was loaded from disk, or when the
116server was reloaded. This event will only be generated if the object has 116server was reloaded. This event will only be generated if the object has
117attachments. 117attachments.
118 118
119=head3 CLONE (object destination) 119=head3 CLONE (object destination)
124between instances). If this is not the behaviour you need, you have to 124between instances). If this is not the behaviour you need, you have to
125adjust the B<destination> object as you see fit. 125adjust the B<destination> object as you see fit.
126 126
127=head3 TICK (object) 127=head3 TICK (object)
128 128
129Called whenever the object "ticks", i.e. has positive B<speed_left>. Only 129Invoked whenever the object "ticks", i.e. has positive B<speed_left>. Only
130during ticks should an objetc process any movement or other events. 130during ticks should an objetc process any movement or other events.
131 131
132=head3 KILL (object hitter -- ) 132=head3 KILL (object hitter -- )
133 133
134Called whenever an object is dead and about to get removed. Overriding 134Invoked whenever an object is dead and about to get removed. Overriding
135processing will skip removal, but to do this successfully you have to 135processing will skip removal, but to do this successfully you have to
136objetc from dieing, otherwise the event gets invoked again and again. 136objetc from dieing, otherwise the event gets invoked again and again.
137 137
138=head3 APPLY (object who -- applytype) 138=head3 APPLY (object who -- applytype)
139 139
140Called whenever the object is being applied in some way. The applytype is one of: 140Invoked whenever the object is being applied in some way. The applytype is one of:
141 141
142=over 4 142=over 4
143 143
144=item B<0> player or monster can't apply objects of that type 144=item B<0> player or monster can't apply objects of that type
145 145
149 149
150=cut 150=cut
151 151
152=head3 USE_SKILL (skill who part direction strignarg -- ) 152=head3 USE_SKILL (skill who part direction strignarg -- )
153 153
154Called whenever a skill is used by somebody or something. 154Invoked whenever a skill is used by somebody or something.
155 155
156=head3 CAST_SPELL (spell casting_object owner direction stringarg -- ) 156=head3 CAST_SPELL (spell casting_object owner direction stringarg -- )
157 157
158Called whenever a given spell is cast by B<casting_oject> (used by 158Invoked whenever a given spell is cast by B<casting_oject> (used by
159B<owner>). 159B<owner>).
160 160
161=head3 DROP (object who -- ) 161=head3 DROP (object who -- )
162 162
163Called whenever an item gets dropped by somebody, e.g. as a result of a 163Invoked whenever an item gets dropped by somebody, e.g. as a result of a
164drop command. 164drop command.
165 165
166=head3 DROP_ON (floor object who -- ) 166=head3 DROP_ON (floor object who -- )
167 167
168Called whenever some B<object> is being dropped on the B<floor> object. 168Invoked whenever some B<object> is being dropped on the B<floor> object.
169 169
170=head3 LISTEN 170=head3 LISTEN
171 171
172Called whenever the object can hear something beign said in its 172Invoked whenever the object can hear something beign said in its
173vicinity. Not yet implemented. 173vicinity. Not yet implemented.
174 174
175=head3 MOVE (monster enemy -- ) 175=head3 MOVE (monster enemy -- )
176 176
177Called whenever the B<monster> tries to move, just after B<enemy> and 177Invoked whenever the B<monster> tries to move, just after B<enemy> and
178other parameters have been determined, but before movement is actually 178other parameters have been determined, but before movement is actually
179executed. 179executed.
180 180
181=head3 ATTACK (object hitter -- damage) 181=head3 ATTACK (object hitter -- damage)
182 182
183Object gets attacked by somebody - when overriden, should return the 183Object gets attacked by somebody - when overriden, should return the
184damage that has been dealt. 184damage that has been dealt.
185 185
186=head3 ATTACKS (weapon hitter victim) 186=head3 ATTACKS (weapon hitter victim)
187 187
188Called whenever an object is used as a B<weapon> by B<hitter> to attack 188Invoked whenever an object is used as a B<weapon> by B<hitter> to attack
189B<victim>. 189B<victim>.
190 190
191=head3 INSCRIBE_NOTE (book pl message skill -- ) 191=head3 INSCRIBE_NOTE (book pl message skill -- )
192 192
193Used whenever a book gets inscribed with a message. 193Used whenever a book gets inscribed with a message.
194 194
195=head3 TRIGGER (object who -- ) 195=head3 TRIGGER (object who -- )
196 196
197Called whenever a lever-like B<object> has been activated/triggered in some 197Invoked whenever a lever-like B<object> has been activated/triggered in some
198(manual) way. 198(manual) way.
199 199
200=head3 MOVE_TRIGGER (object victim originator -- ) 200=head3 MOVE_TRIGGER (object victim originator -- )
201 201
202Called whenever a trap-like B<object> has been activated, usually by 202Invoked whenever a trap-like B<object> has been activated, usually by
203moving onto it. This includes not just traps, but also buttons, holes, 203moving onto it. This includes not just traps, but also buttons, holes,
204signs and similar stuff. 204signs and similar stuff.
205 205
206=head3 CLOSE (container -- ) 206=head3 CLOSE (container -- )
207 207
208Called whenever a container gets closed (this event is not yet reliable!). 208Invoked whenever a container gets closed (this event is not yet reliable!).
209 209
210 210
211=head2 MAP EVENTS 211=head2 MAP EVENTS
212 212
213These events are generally dependent on a map and thus all have a map 213These events are generally dependent on a map and thus all have a map
214as first argument. 214as first argument.
215 215
216=head3 REATTACH (map) 216=head3 REATTACH (map)
217 217
218Called whenever attachments/plug-ins need to get reattached to the 218Invoked whenever attachments/plug-ins need to get reattached to the
219B<map>. This usually happens when the map was loaded from disk, or when the 219B<map>. This usually happens when the map was loaded from disk, or when the
220server was reloaded. 220server was reloaded.
221 221
222=head3 LOAD (map) 222=head3 LOAD (map)
223 223
224Original B<map> has been loaded (e.g. on first use, or after a map 224Original B<map> has been loaded (e.g. on first use, or after a map
225reset). This event might get renamed to instantiate in the future. 225reset). This event might get renamed to instantiate in the future.
226 226
227=head3 SWAPIN (map) 227=head3 SWAPIN (map)
228 228
229Called when a previously swapped-out temporary B<map> has been loaded again. 229Invoked when a previously swapped-out temporary B<map> has been loaded again.
230 230
231=head3 SWAPOUT (map) 231=head3 SWAPOUT (map)
232 232
233Called after a B<map> has been swapped out to disk. 233Invoked after a B<map> has been swapped out to disk.
234 234
235=head3 RESET (map) 235=head3 RESET (map)
236 236
237Called when a B<map> gets reset. 237Invoked when a B<map> gets reset.
238 238
239=head3 CLEAN (map) 239=head3 CLEAN (map)
240 240
241Called when a temporary B<map> gets deleted on-disk. 241Invoked when a temporary B<map> gets deleted on-disk.
242 242
243=head3 ENTER (map player) 243=head3 ENTER (map player)
244 244
245Called whenever a player enters the B<map>. This event is likely unreliable. 245Invoked whenever a player enters the B<map>. This event is likely unreliable.
246 246
247=head3 LEAVE (map player) 247=head3 LEAVE (map player)
248 248
249Called whenever a player leaves the B<map>. This event is likely unreliable. 249Invoked whenever a player leaves the B<map>. This event is likely unreliable.
250 250
251=head3 UPGRADE (map) 251=head3 UPGRADE (map)
252 252
253(TEMPORARY EVENT) gets called whenever a old-style map has been upgraded. 253(TEMPORARY EVENT) gets invoked whenever a old-style map has been upgraded.
254 254

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines