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

Comparing deliantra/server/pod/events.pod (file contents):
Revision 1.24 by root, Mon Dec 17 08:27:44 2007 UTC vs.
Revision 1.32 by root, Wed Oct 21 00:44:39 2009 UTC

4generate the event-list itself, so is always complete. Be careful wehn 4generate the event-list itself, so is always complete. Be careful wehn
5changing it, though. 5changing it, though.
6 6
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 part is
12missing, the event will be invoked 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 15Return values are given by overriding (in Perl by calling C<cf::override>)
16can override (e.g. using C<cf::override> in Perl) event processing, 16with the return values, which will both stop further event processing and
17basically short-circuiting it. For example, if you override from within a 17tell the caller that it wants to override normal processing.
18player BIRTH event, nothing much will happen with respect to the built-in 18
19Even if no return values are supported, a plug-in can override (e.g. using
20C<cf::override> in Perl) event processing, basically short-circuiting
21it. For example, if you override from within a player BIRTH event,
22nothing much will happen with respect to the built-in processing, but if
19processing, but if you override from within a player TELL event, the tell 23you override from within a player TELL event, the tell will be ignored
20will be ignored (presumably your plug-in took care of it). 24(presumably your plug-in took care of it).
21 25
22 26
23=head2 ATTACHABLE EVENTS 27=head2 ATTACHABLE EVENTS
24 28
25No time to document this, screw me. 29No time to document this, screw me.
91Invoked whenever the object "ticks", i.e. has positive B<speed_left>. Only 95Invoked whenever the object "ticks", i.e. has positive B<speed_left>. Only
92during ticks should an objetc process any movement or other events. 96during ticks should an objetc process any movement or other events.
93 97
94=head3 kill (object hitter -- ) 98=head3 kill (object hitter -- )
95 99
96Invoked whenever an object is dead and about to get removed. Overriding 100Invoked whenever an object was killed (hp < 0 caused by an attack) and is
97processing will skip removal, but to do this successfully you have to 101about to get removed. Overriding processing will skip removal, but to do
98objetc from dieing, otherwise the event gets invoked again and again. 102this successfully you have to keep the object from dieing, otherwise the
103event gets invoked again and again.
99 104
100=head3 apply (object who -- applytype) 105=head3 apply (object who -- applytype)
101 106
102Invoked whenever the object is being applied in some way. The applytype is one of: 107Invoked whenever the object is being applied in some way. The applytype is one of:
103 108
108=item B<1> has been applied, or there was an error applying the object 113=item B<1> has been applied, or there was an error applying the object
109 114
110=item B<2> objects of that type can't be applied if not in inventory 115=item B<2> objects of that type can't be applied if not in inventory
111 116
112=back 117=back
118
119=head3 reset (object)
120
121Invoked whenever the object is initialised on a map after it was
122loaded. This can be used to emulate shop-floor behaviour for example.
113 123
114=head3 throw (object thrower) 124=head3 throw (object thrower)
115 125
116Invoked when an B<object> is thrown by B<thrower>. 126Invoked when an B<object> is thrown by B<thrower>.
117 127
180damage that has been dealt. 190damage that has been dealt.
181 191
182=head3 skill_attack (attacker victim message skill -- success) 192=head3 skill_attack (attacker victim message skill -- success)
183 193
184Invoked whenever an B<attacker> attacks B<victim> using a B<skill> (skill 194Invoked whenever an B<attacker> attacks B<victim> using a B<skill> (skill
185cna be C<undef>). B<message> is the message that describes the attack when 195can be C<undef>). B<message> is the message that describes the attack when
186damage is done. 196damage is done.
187 197
188=head3 weapon_attack (weapon hitter victim) 198=head3 weapon_attack (weapon hitter victim)
189 199
190Invoked whenever an object is used as a B<weapon> by B<hitter> to attack 200Invoked whenever an object is used as a B<weapon> by B<hitter> to attack
214 224
215Invoked whenever a container gets closed. When overriden, the container 225Invoked whenever a container gets closed. When overriden, the container
216will not get closed, but you must tell op about the reason. This event 226will not get closed, but you must tell op about the reason. This event
217is not crash-safe, i.e. containers might be closed due to a server crash 227is not crash-safe, i.e. containers might be closed due to a server crash
218without this event being invoked. 228without this event being invoked.
229
230=head3 blocked_move (self who -- do_blocked)
231
232Invoked when an C<who> tries to move to the same space as C<self>,
233C<self>'s C<move_block> causes blocked movement for C<who> and nothing
234else explicitly allows movement to this space.
235
236Should return true when C<who> is blocked, i.e., should not be allowed to
237move onto C<self>.
238
239When not overriding, normal blocked_move (blocked_link) processing will
240happen.
219 241
220 242
221=head2 GLOBAL EVENTS 243=head2 GLOBAL EVENTS
222 244
223Global events have no relation to specific objects. 245Global events have no relation to specific objects.
371=head3 leave (map player -- ) 393=head3 leave (map player -- )
372 394
373Invoked whenever a player tries to leave the B<map>. Overriding means the 395Invoked whenever a player tries to leave the B<map>. Overriding means the
374player won't be able to leave. 396player won't be able to leave.
375 397
376=head3 trigger (map connection state -- ) 398=head3 trigger (map connection state what? who? -- )
377 399
378Invoked whenever something activates a B<connection> on the B<map>. If B<state> 400Invoked whenever something activates a B<connection> on the B<map>. If B<state>
379is true the connection was 'state' and if false it is 'released'. 401is true the connection was 'state' and if false it is 'released'.
380 402
381 403

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines