… | |
… | |
48 | made. The copy automatically has all attachments the original object |
48 | made. The copy automatically has all attachments the original object |
49 | had. The perl variables get copied in a shallow way (references are shared |
49 | had. The perl variables get copied in a shallow way (references are shared |
50 | between instances). If this is not the behaviour you need, you have to |
50 | between instances). If this is not the behaviour you need, you have to |
51 | adjust the B<destination> object as you see fit. |
51 | adjust the B<destination> object as you see fit. |
52 | |
52 | |
|
|
53 | =head3 add_bonus (item creator difficulty max_magic flags) |
|
|
54 | |
|
|
55 | A basic item has been created (e.g. for shops, monsters drops etc.) |
|
|
56 | that needs bonus values applied. The B<creator> object is a template |
|
|
57 | object that can be used to inherit stuff (and can be NULL). Flags is a |
|
|
58 | combination of GT_ENVIRONMENT (???) or GT_STARTEQUIP (set FLAG_STARTEQUIP |
|
|
59 | on item or set its value to 0) or GT_MINIMAL (???) |
|
|
60 | |
|
|
61 | When overriden, built-in bonus generation is skipped, otherwise |
|
|
62 | treasure generation continues as it would without this hook. |
|
|
63 | |
|
|
64 | In general, if flags != 0 or creator != 0 you should just return and leave |
|
|
65 | item generation to the standard code. |
|
|
66 | |
53 | =head3 destroy (object) |
67 | =head3 destroy (object) |
54 | |
68 | |
55 | Invoked when the crossfire object gets destroyed, and only when the object |
69 | Invoked when the crossfire object gets destroyed, and only when the object |
56 | has a handler for this event. This event can occur many times, as its |
70 | has a handler for this event. This event can occur many times, as its |
57 | called when the in-memory object is destroyed, not when the object itself |
71 | called when the in-memory object is destroyed, not when the object itself |
… | |
… | |
307 | Invoked when a temporary B<map> gets deleted on-disk. |
321 | Invoked when a temporary B<map> gets deleted on-disk. |
308 | |
322 | |
309 | =head3 enter (map player x y -- ) |
323 | =head3 enter (map player x y -- ) |
310 | |
324 | |
311 | Invoked whenever a player tries to enter the B<map>, while he/she is still |
325 | Invoked whenever a player tries to enter the B<map>, while he/she is still |
312 | on the old map. Overriding means the player won't be able to enter. |
326 | on the old map. Overriding means the player won't be able to enter, and, |
|
|
327 | if newmap/x/y are given, will be redirected to that map instead. |
313 | |
328 | |
314 | =head3 leave (map player -- ) |
329 | =head3 leave (map player -- ) |
315 | |
330 | |
316 | Invoked whenever a player tries to leave the B<map>. Overriding means the |
331 | Invoked whenever a player tries to leave the B<map>. Overriding means the |
317 | player won't be able to leave. |
332 | player won't be able to leave. |
318 | |
333 | |
319 | =head3 trigger (map connection state) |
334 | =head3 trigger (map connection state) |
320 | |
335 | |
321 | Invoked whenever something activates a B<connection> on the B<map>. If B<state> |
336 | Invoked whenever something activates a B<connection> on the B<map>. If B<state> |
322 | is true the connection was 'state' and if false it is 'released'. |
337 | is true the connection was 'state' and if false it is 'released'. |
|
|
338 | |