1 | =head1 CROSSFIRE+ OBJECT AND INTERNALS DOCUMENTATION |
1 | =head1 DELIANTRA OBJECT AND INTERNALS DOCUMENTATION |
2 | |
2 | |
3 | Here is all information about the object types Crossfire+ |
3 | Here is all information about the object types Deliantra |
4 | supports at the moment. This is not a complete documentation (yet) |
4 | supports at the moment. This is not a complete documentation (yet) |
5 | and browsing the source is still recommended to learn about |
5 | and browsing the source is still recommended to learn about |
6 | the objects that aren't documented here. |
6 | the objects that aren't documented here. |
7 | |
7 | |
8 | This documentation is in a sketchy state. It's mostly |
8 | This documentation is in a sketchy state. It's mostly |
… | |
… | |
33 | This document does explain the behaviour of the objects and the meaning of |
33 | This document does explain the behaviour of the objects and the meaning of |
34 | their fields in the server engine, which are derived from archetypes. |
34 | their fields in the server engine, which are derived from archetypes. |
35 | |
35 | |
36 | This is an example of an archetype: |
36 | This is an example of an archetype: |
37 | |
37 | |
38 | Object button_trigger |
38 | object button_trigger |
39 | name button |
39 | name button |
40 | type 30 |
40 | type 30 |
41 | face button_sma.111 |
41 | face button_sma.x11 |
42 | anim |
42 | anim |
43 | button_sma.111 |
43 | button_sma.x11 |
44 | button_sma.112 |
44 | button_sma.x12 |
45 | mina |
45 | mina |
46 | is_animated 0 |
46 | is_animated 0 |
47 | exp 30 |
47 | exp 30 |
48 | no_pick 1 |
48 | no_pick 1 |
49 | walk_on 1 |
49 | walk_on 1 |
… | |
… | |
108 | For players this field reflects the duration of the invisibility |
108 | For players this field reflects the duration of the invisibility |
109 | and is decreased every tick by 1. |
109 | and is decreased every tick by 1. |
110 | |
110 | |
111 | For non-player objects this field is not changed by server ticks. |
111 | For non-player objects this field is not changed by server ticks. |
112 | |
112 | |
|
|
113 | =item I<glow_radius> <number> |
|
|
114 | |
|
|
115 | This field indicates how far an object glows. Default is a radius of 0 (no |
|
|
116 | glowing at all). Negative glow radii darken areas - currently, negative |
|
|
117 | glow radii are stronger than positive ones. |
|
|
118 | |
113 | =item I<speed> <number> |
119 | =item I<speed> <float> |
114 | |
120 | |
115 | If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed |
121 | If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed |
116 | on the active object list and will be processed each tick (see also speed_left!). |
122 | on the active object list and will be processed each tick (see also speed_left!). |
117 | |
123 | |
118 | If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed |
124 | If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed |
119 | from the active object list and it won't experience any processing per tick. |
125 | from the active object list and it won't experience any processing per tick. |
120 | |
126 | |
|
|
127 | Negative speed settings in archetypes and files cause a speed_left |
|
|
128 | randomisation on load or instantiatian, but for calculations, the absolute |
|
|
129 | value is used always. |
|
|
130 | |
121 | =item I<speed_left> <number> |
131 | =item I<speed_left> <float> |
122 | |
132 | |
123 | If this field is greater than 0 and the object is on the |
133 | If this field is greater than 0 and the object is on the |
124 | active list (mostly means it's speed is also greater than 0): |
134 | active list (mostly means it's speed is also greater than 0): |
125 | |
135 | |
126 | - speed_left is decreased by 1 |
136 | - speed_left is decreased by 1 |
… | |
… | |
194 | See Flags section below. |
204 | See Flags section below. |
195 | |
205 | |
196 | =item I<activate_on_release> (0|1) (default: 1) |
206 | =item I<activate_on_release> (0|1) (default: 1) |
197 | |
207 | |
198 | Sets the flag FLAG_ACTIVATE_ON_RELEASE. |
208 | Sets the flag FLAG_ACTIVATE_ON_RELEASE. |
|
|
209 | See Flags section below. |
|
|
210 | |
|
|
211 | =item I<is_lightable> (0|1) |
|
|
212 | |
|
|
213 | Sets the flag FLAG_IS_LIGHTABLE. |
199 | See Flags section below. |
214 | See Flags section below. |
200 | |
215 | |
201 | =item I<editable> (more than deprecated) |
216 | =item I<editable> (more than deprecated) |
202 | |
217 | |
203 | This field had a special meaning for crossedit, which used parts |
218 | This field had a special meaning for crossedit, which used parts |
… | |
… | |
253 | will be generated. |
268 | will be generated. |
254 | |
269 | |
255 | After the new object is created the I<hp> field from the old object is copied into |
270 | After the new object is created the I<hp> field from the old object is copied into |
256 | the new one. |
271 | the new one. |
257 | |
272 | |
258 | When the old object was a B<LAMP> it's I<food> fields value less 1 will be copied |
|
|
259 | to the new object. |
|
|
260 | |
|
|
261 | =item FLAG_IS_A_TEMPLATE (internal use) |
273 | =item FLAG_IS_A_TEMPLATE (internal use) |
262 | |
274 | |
263 | This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s, |
275 | This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s, |
264 | or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. |
276 | or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. |
265 | |
277 | |
… | |
… | |
290 | This flag is by default on. |
302 | This flag is by default on. |
291 | |
303 | |
292 | =item FLAG_NO_STEAL |
304 | =item FLAG_NO_STEAL |
293 | |
305 | |
294 | When this flag is set this object can't be stolen. The flag will be |
306 | When this flag is set this object can't be stolen. The flag will be |
295 | resetted once the object is placed on a map. |
307 | reset once the object is placed on a map. |
296 | |
308 | |
297 | When this flag is set on a monster it can defent attempts of stealing |
309 | When this flag is set on a monster it can defend attempts at stealing |
298 | (but in this context the flag is only used internally). |
310 | (but in this context the flag is only used internally). |
299 | |
311 | |
300 | =item FLAG_NO_SKILL_IDENT |
312 | =item FLAG_NO_SKILL_IDENT |
301 | |
313 | |
302 | This flag is mostly used internal and prevents unidentified objects |
314 | This flag is mostly used internal and prevents unidentified objects |
… | |
… | |
315 | =item FLAG_REFL_SPELL |
327 | =item FLAG_REFL_SPELL |
316 | |
328 | |
317 | This flag indicates whether something reflects spells, like spell reflecting |
329 | This flag indicates whether something reflects spells, like spell reflecting |
318 | amuletts. |
330 | amuletts. |
319 | |
331 | |
|
|
332 | =item FLAG_IS_LIGHTABLE |
|
|
333 | |
|
|
334 | This flag indicates whether a B<LIGHTER> can light this object. See also the |
|
|
335 | description of the B<LIGHTER> type. How easy you can light an item depends |
|
|
336 | partially on the material of the object. |
|
|
337 | |
|
|
338 | =item FLAG_MONSTER |
|
|
339 | |
|
|
340 | Enables NPC behaviour in general (both monster AI and friendly AI). Numerous fields |
|
|
341 | change their meaning, including: |
|
|
342 | |
|
|
343 | =over 4 |
|
|
344 | |
|
|
345 | =item I<wis> |
|
|
346 | |
|
|
347 | Governs the "wake-up radius" - the radius within a monster detects an enemy. |
|
|
348 | |
|
|
349 | Also, I<wis> governs pathfinding intelligence: 8 and up means the monster |
|
|
350 | will partake in basic smell finding. 10 and up additionally spreads smell |
|
|
351 | knowledge, and 15 and up additionally will try to perturb the path as to |
|
|
352 | find shortcuts. |
|
|
353 | |
|
|
354 | =back |
|
|
355 | |
320 | =back |
356 | =back |
321 | |
357 | |
322 | =head2 Description of type specific fields and behaviour |
358 | =head2 Description of type specific fields and behaviour |
323 | |
359 | |
324 | The beginning of the headers of the following subsection |
360 | The beginning of the headers of the following subsection |
… | |
… | |
327 | =head3 B<TRANSPORT> - type 2 - Player transports |
363 | =head3 B<TRANSPORT> - type 2 - Player transports |
328 | |
364 | |
329 | This type is implemented by the transport extension and has currently no special |
365 | This type is implemented by the transport extension and has currently no special |
330 | fields that affect it. |
366 | fields that affect it. |
331 | |
367 | |
332 | =head3 B<ROD> - type 3 - Rods that fire spells |
368 | =head3 B<ROD>, B<HORN> - type 3, 35 - Rods that fire spells |
333 | |
369 | |
334 | Rods contain spells and can be fired by a player. |
370 | Rods contain spells and can be fired by a player. |
335 | |
371 | |
336 | =over 4 |
372 | =over 4 |
337 | |
373 | |
… | |
… | |
343 | the 'use magic item' skill level of the player and 1/10 of the level of the |
379 | the 'use magic item' skill level of the player and 1/10 of the level of the |
344 | rod is added as bonus. |
380 | rod is added as bonus. |
345 | |
381 | |
346 | =item I<hp> <number> |
382 | =item I<hp> <number> |
347 | |
383 | |
348 | The amount of spellpoints this rod has left. |
384 | The amount of spellpoints this rod has left. Recharges at a rate of C<1 + |
|
|
385 | maxhp/10> per tick. |
349 | |
386 | |
350 | =item I<maxhp> <number> |
387 | =item I<maxhp> <number> |
351 | |
388 | |
352 | The maximum amount of spellpoints this rod has. |
389 | The maximum amount of spellpoints this rod has. |
353 | |
390 | |
… | |
… | |
429 | This field has some special meaning in potions, currently the |
466 | This field has some special meaning in potions, currently the |
430 | bits for AT_DEPLETE and AT_GODPOWER control whethere this is a |
467 | bits for AT_DEPLETE and AT_GODPOWER control whethere this is a |
431 | restoration potion or improvement potion. |
468 | restoration potion or improvement potion. |
432 | See include/attackinc.h for the bits of these types. |
469 | See include/attackinc.h for the bits of these types. |
433 | |
470 | |
434 | If AT_DEPLETE is set the player will be restored and the ARCH_DEPLETION |
471 | If AT_DEPLETE is set the player will be restored and the "depletion" |
435 | will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED |
472 | will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED |
436 | set the player will be drained a random stat by inserting an ARCH_DEPLETION |
473 | set the player will be drained a random stat by inserting an "depletion" |
437 | into him. |
474 | into him. |
438 | |
475 | |
439 | If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat. |
476 | If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat. |
440 | When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats. |
477 | When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats. |
441 | |
478 | |
… | |
… | |
483 | |
520 | |
484 | =back |
521 | =back |
485 | |
522 | |
486 | =back |
523 | =back |
487 | |
524 | |
488 | =head3 B<FOOD> - type 6 - Eatable stuff |
525 | =head3 B<FOOD> - type 6 - Edible stuff |
489 | |
526 | |
490 | This is for objects that are representing general eatables like |
527 | This is for objects that are representing general eatables like |
491 | beef or bread. |
528 | beef or bread. |
492 | |
529 | |
493 | The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they |
530 | The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they |
… | |
… | |
531 | |
568 | |
532 | =over 4 |
569 | =over 4 |
533 | |
570 | |
534 | =item I<level> <number> |
571 | =item I<level> <number> |
535 | |
572 | |
536 | This field affects the propability of poisoning. The higher the level difference |
573 | This field affects the probability of poisoning. The higher the level difference |
537 | between the one who is hit and the poision the more propable it is the attacked |
574 | between the one who is hit and the poision the more probable it is the attacked |
538 | one will be poisoned. |
575 | one will be poisoned. |
539 | |
576 | |
540 | =item I<slaying> <race> |
577 | =item I<slaying> <race> |
541 | |
578 | |
542 | This field has the usual meaning of 'slaying', when the |
579 | This field has the usual meaning of 'slaying', when the |
… | |
… | |
668 | the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field |
705 | the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field |
669 | and the arrows I<magic> field. |
706 | and the arrows I<magic> field. |
670 | |
707 | |
671 | =item I<wc> <number> |
708 | =item I<wc> <number> |
672 | |
709 | |
673 | The weapon class of the arrow, which has effect on the propability of hitting. |
710 | The weapon class of the arrow, which has effect on the probability of hitting. |
674 | |
711 | |
675 | It is recomputed when the arrow is being fired by this formula: |
712 | It is recomputed when the arrow is being fired by this formula: |
676 | |
713 | |
677 | wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level) |
714 | wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level) |
678 | - dex_bonus - thaco_bonus - arrow->stats.wc - bow->stats.wc + wc_mod |
715 | - dex_bonus - thaco_bonus - arrow->stats.wc - bow->stats.wc + wc_mod |
… | |
… | |
693 | Bitfield which decides the attacktype of the damage, see include/attackinc.h |
730 | Bitfield which decides the attacktype of the damage, see include/attackinc.h |
694 | On fireing the I<attacktype> of the bow is added to the arrows I<attacktype>. |
731 | On fireing the I<attacktype> of the bow is added to the arrows I<attacktype>. |
695 | |
732 | |
696 | =item I<level> <number> (interally used) |
733 | =item I<level> <number> (interally used) |
697 | |
734 | |
698 | The level of the arrow, this affects the propability of piercing FLAG_REFL_MISSILE, |
735 | The level of the arrow, this affects the probability of piercing FLAG_REFL_MISSILE, |
699 | see above in the B<ARROW> description. |
736 | see above in the B<ARROW> description. |
700 | |
737 | |
701 | The I<level> is set when the arrow is fired to either the skill level or the |
738 | The I<level> is set when the arrow is fired to either the skill level or the |
702 | shooters level. |
739 | shooters level. |
703 | |
740 | |
… | |
… | |
714 | The minimum I<speed> of an arrow is 1.0. |
751 | The minimum I<speed> of an arrow is 1.0. |
715 | |
752 | |
716 | While flying the arrows I<speed> is decreased by 0.05 each time it's moved. |
753 | While flying the arrows I<speed> is decreased by 0.05 each time it's moved. |
717 | |
754 | |
718 | If the I<speed> is above 10.0 it goes straight through the creature it hits and |
755 | If the I<speed> is above 10.0 it goes straight through the creature it hits and |
719 | it's I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is |
756 | its I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is |
720 | stopped and either sticked into the victim (see I<weight> field description) or |
757 | stopped and either stuck into the victim (see I<weight> field description) or |
721 | put on it's map square (if it didn't break, see description of the I<food> field). |
758 | put on its map square (if it didn't break, see description of the I<food> field). |
722 | |
759 | |
723 | =item I<weight> <number> |
760 | =item I<weight> <number> |
724 | |
761 | |
725 | This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg) |
762 | This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg) |
726 | the arrow will stick in the victim it hits. Otherwise it will fall to the ground. |
763 | the arrow will stick in the victim it hits. Otherwise it will fall to the ground. |
… | |
… | |
832 | Generally this field on weapons is in ranges of 1-30 and decides the slowdown of the |
869 | Generally this field on weapons is in ranges of 1-30 and decides the slowdown of the |
833 | I<sp> regeneration. |
870 | I<sp> regeneration. |
834 | |
871 | |
835 | =item I<body_BODYSLOT> |
872 | =item I<body_BODYSLOT> |
836 | |
873 | |
837 | The part of the body you need to use this weapon, possible values should be |
874 | The part/slot of the body you need to use this weapon, possible values for |
838 | looked up in common/item.C at body_locations. |
875 | C<BODYSLOT> should be looked up in common/item.C at body_locations. |
839 | |
876 | |
|
|
877 | The value (in the range C<-7..7>) gives the number of those body slots |
|
|
878 | used up by the item (if negative) or the number of body slots this object |
|
|
879 | has (if positive, e.g. for monsters or players). The special value C<0> |
|
|
880 | indicates that this object cannot equip items requiring these body slots. |
|
|
881 | |
840 | =item I<resist_RESISTNACY> <number> |
882 | =item I<resist_RESISTANCY> <number> |
841 | |
883 | |
842 | this is the factor with which the difference of the players resistancy and 100% |
884 | this is the factor with which the difference of the players resistancy and 100% |
843 | is multiplied, something like this: |
885 | is multiplied, something like this: |
844 | |
886 | |
845 | additional_resistancy = (100 - current_resistanct) * (<number>/100) |
887 | additional_resistancy = (100 - current_resistancy) * (<number>/100) |
846 | |
888 | |
847 | if <number> is negative it is added to the total vulnerabilities, |
889 | if <number> is negative it is added to the total vulnerabilities, |
848 | and later the total resistance is decided by: |
890 | and later the total resistance is decided by: |
849 | |
891 | |
850 | 'total resistance = total protections - total vulnerabilities' |
892 | 'total resistance = total protections - total vulnerabilities' |
851 | |
893 | |
852 | see also common/living.C:fix_player |
894 | see also common/living.C:fix_player. |
853 | |
895 | |
854 | =item I<path_(attuned|repelled|denied)> |
896 | =item I<path_(attuned|repelled|denied)> |
855 | |
897 | |
856 | this field modifies the pathes the player is attuned to, see include/spells.h PATH_* |
898 | this field modifies the pathes the player is attuned to, see include/spells.h PATH_* |
857 | for the pathes. |
899 | for the pathes. |
… | |
… | |
933 | =item I<hp> <number> |
975 | =item I<hp> <number> |
934 | |
976 | |
935 | If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can |
977 | If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can |
936 | be used. |
978 | be used. |
937 | |
979 | |
938 | =item I<speed> <number> |
980 | =item I<speed> <float> |
939 | |
981 | |
940 | If I<speed> is set the creator will create an object periodically, |
982 | If I<speed> is set the creator will create an object periodically, |
941 | see I<speed> and I<speed_left> fields in the general object field description |
983 | see I<speed> and I<speed_left> fields in the general object field description |
942 | for more details. |
984 | for more details. |
943 | |
985 | |
… | |
… | |
1018 | See also the description of the I<connected> field in the generic object field |
1060 | See also the description of the I<connected> field in the generic object field |
1019 | section. |
1061 | section. |
1020 | |
1062 | |
1021 | =back |
1063 | =back |
1022 | |
1064 | |
|
|
1065 | =head3 B<MOOD_FLOOR> - type 65 - change mood of monsters |
|
|
1066 | |
|
|
1067 | speed == 0 for triggered mood changes, speed != 0 for non-triggered mood |
|
|
1068 | changes. |
|
|
1069 | |
|
|
1070 | (based on value that last_sp takes): |
|
|
1071 | 0: 'furious' Makes all monsters aggressive |
|
|
1072 | 1: 'angry' As above but pets are unaffected |
|
|
1073 | 2: 'calm' Makes all monsters unaggressive |
|
|
1074 | 3: 'sleep' Puts all monsters to sleep |
|
|
1075 | 4: 'charm' Makes monster into a pet of person |
|
|
1076 | who triggers the square. This setting |
|
|
1077 | is not enabled for continous operation |
|
|
1078 | 5: 'destroy mons' destroy any monsters on this space |
|
|
1079 | 6: 'destroy pets' destroy friendly monsters on this space |
|
|
1080 | |
1023 | =head3 B<FLESH> - type 72 - Organs and body parts |
1081 | =head3 B<FLESH> - type 72 - Organs and body parts |
1024 | |
1082 | |
1025 | See B<FOOD> description. |
1083 | See B<FOOD> description. |
1026 | |
1084 | |
1027 | =head3 B<MISC_OBJECT> - type 79 - Misc. objects |
1085 | =head3 B<MISC_OBJECT> - type 79 - Misc. objects |
1028 | |
1086 | |
1029 | A type for any object that has no special behaviour. |
1087 | A type for any object that has no special behaviour. |
1030 | |
|
|
1031 | =head3 B<LAMP> - type 82 - A lamp |
|
|
1032 | |
|
|
1033 | This object represents a lamp, that can be carried and switched |
|
|
1034 | on and off and has a certain amount of fuel in it. |
|
|
1035 | |
|
|
1036 | A lamp consists of two archetypes: the 'on' archetype and the 'off' archetype. |
|
|
1037 | Each of them should point at the other one with it's I<other_arch> field. |
|
|
1038 | |
|
|
1039 | See the I<other_arch> field for the behaviour of a lamp object when it is applied. |
|
|
1040 | |
|
|
1041 | =over 4 |
|
|
1042 | |
|
|
1043 | =item I<speed> <number> |
|
|
1044 | |
|
|
1045 | If FLAG_CHANGING is set the I<speed> field will indicate how fast the |
|
|
1046 | lamp burns it's fuel (I<food>). |
|
|
1047 | |
|
|
1048 | Setting FLAG_CHANGING makes only sense on the archetype which represents |
|
|
1049 | the 'on' state of the lamp. |
|
|
1050 | |
|
|
1051 | See also the description of FLAG_CHANGING. |
|
|
1052 | |
|
|
1053 | Lamps which have no FLAG_CHANGING set would also make sense and represent |
|
|
1054 | lamps that never burn up. |
|
|
1055 | |
|
|
1056 | =item I<other_arch> <number> |
|
|
1057 | |
|
|
1058 | This is the field that points to the 'other' archetype which represents the |
|
|
1059 | opposite state of the lamp. The newly from I<other_arch> derived object will |
|
|
1060 | replace the current object and will get the value of I<food> of the replaced object. |
|
|
1061 | |
|
|
1062 | Rationale: |
|
|
1063 | |
|
|
1064 | When the lamp (on) is applied a new object is derived from the archetype |
|
|
1065 | in I<other_arch> and the I<food> value is copied to it ('the fuel is |
|
|
1066 | transferred'). The new lamp (off) object has to have a I<other_arch> field |
|
|
1067 | which points to the archetype from which a lamp (on) can be derived. |
|
|
1068 | |
|
|
1069 | =item I<food> <number> |
|
|
1070 | |
|
|
1071 | This fields stands for the fuel of the lamp. |
|
|
1072 | |
|
|
1073 | =back |
|
|
1074 | |
1088 | |
1075 | =head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators |
1089 | =head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators |
1076 | |
1090 | |
1077 | This type of objects multiplies objects that are above it when it is activated. |
1091 | This type of objects multiplies objects that are above it when it is activated. |
1078 | You can even multiply by 0, which will destroy the object. |
1092 | You can even multiply by 0, which will destroy the object. |