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