--- deliantra/server/pod/events.pod 2007/11/10 22:41:59 1.23 +++ deliantra/server/pod/events.pod 2009/10/21 00:44:39 1.32 @@ -6,18 +6,22 @@ =head2 NOTATION -the event description below uses a variant of the forth stack notation - +The event description below uses a variant of the forth stack notation - an opening parenthesis followed by the type of each parameter, optionally -followed by two dashes and the returning parameters. If the latter is +followed by two dashes and the returning parameters. If the latter part is missing, the event will be invoked but cannot change wether the event gets processed. -If it is specified (even if no return values are supported), a plug-in -can override (e.g. using C in Perl) event processing, -basically short-circuiting it. For example, if you override from within a -player BIRTH event, nothing much will happen with respect to the built-in -processing, but if you override from within a player TELL event, the tell -will be ignored (presumably your plug-in took care of it). +Return values are given by overriding (in Perl by calling C) +with the return values, which will both stop further event processing and +tell the caller that it wants to override normal processing. + +Even if no return values are supported, a plug-in can override (e.g. using +C in Perl) event processing, basically short-circuiting +it. For example, if you override from within a player BIRTH event, +nothing much will happen with respect to the built-in processing, but if +you override from within a player TELL event, the tell will be ignored +(presumably your plug-in took care of it). =head2 ATTACHABLE EVENTS @@ -93,9 +97,10 @@ =head3 kill (object hitter -- ) -Invoked whenever an object is dead and about to get removed. Overriding -processing will skip removal, but to do this successfully you have to -objetc from dieing, otherwise the event gets invoked again and again. +Invoked whenever an object was killed (hp < 0 caused by an attack) and is +about to get removed. Overriding processing will skip removal, but to do +this successfully you have to keep the object from dieing, otherwise the +event gets invoked again and again. =head3 apply (object who -- applytype) @@ -111,6 +116,11 @@ =back +=head3 reset (object) + +Invoked whenever the object is initialised on a map after it was +loaded. This can be used to emulate shop-floor behaviour for example. + =head3 throw (object thrower) Invoked when an B is thrown by B. @@ -182,7 +192,7 @@ =head3 skill_attack (attacker victim message skill -- success) Invoked whenever an B attacks B using a B (skill -cna be C). B is the message that describes the attack when +can be C). B is the message that describes the attack when damage is done. =head3 weapon_attack (weapon hitter victim) @@ -217,6 +227,18 @@ is not crash-safe, i.e. containers might be closed due to a server crash without this event being invoked. +=head3 blocked_move (self who -- do_blocked) + +Invoked when an C tries to move to the same space as C, +C's C causes blocked movement for C and nothing +else explicitly allows movement to this space. + +Should return true when C is blocked, i.e., should not be allowed to +move onto C. + +When not overriding, normal blocked_move (blocked_link) processing will +happen. + =head2 GLOBAL EVENTS @@ -226,10 +248,15 @@ Called when the server is cleaning up, just before it calls exit. -=head3 clock ( ) +=head3 clock () Is invoked on every server tick, usually every 0.12 seconds. +=head3 resource_update () + +Is invoked after each time the server reloads its resources, which is +usually one of the earliest things it does when starting up. + =head2 PLAYER EVENTS @@ -368,7 +395,7 @@ Invoked whenever a player tries to leave the B. Overriding means the player won't be able to leave. -=head3 trigger (map connection state -- ) +=head3 trigger (map connection state what? who? -- ) Invoked whenever something activates a B on the B. If B is true the connection was 'state' and if false it is 'released'.