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 |
… | |
… | |
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> |
113 | =item I<glow_radius> <number> |
114 | |
114 | |
115 | This field indicates how far an object glows. Default is a radius of 0 (no |
115 | This field indicates how far an object glows. Default is a radius of 0 (no |
116 | glowing at all). |
116 | glowing at all). Negative glow radii darken areas - currently, negative |
|
|
117 | glow radii are stronger than positive ones. |
117 | |
118 | |
118 | =item I<speed> <number> |
119 | =item I<speed> <float> |
119 | |
120 | |
120 | 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 |
121 | 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!). |
122 | |
123 | |
123 | 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 |
124 | 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. |
125 | |
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 | |
126 | =item I<speed_left> <number> |
131 | =item I<speed_left> <float> |
127 | |
132 | |
128 | 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 |
129 | 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): |
130 | |
135 | |
131 | - speed_left is decreased by 1 |
136 | - speed_left is decreased by 1 |
… | |
… | |
137 | |
142 | |
138 | This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED) |
143 | This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED) |
139 | the more seldom the object is processed. And the higher I<speed> is |
144 | the more seldom the object is processed. And the higher I<speed> is |
140 | the more often the object is processed. |
145 | the more often the object is processed. |
141 | |
146 | |
142 | =item I<connected> <number> |
147 | =item I<connected> <identifier> |
143 | |
148 | |
144 | When this field is set the object will be linked to a connection with the |
149 | When this field is set the object will be linked to a connection with the |
145 | id <number>. What happens when the connection is 'activated' depends on the |
150 | same <identifier>. What happens when the connection is 'activated' depends on the |
146 | type of the object. |
151 | type of the object. |
147 | |
152 | |
148 | FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control |
153 | FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control |
149 | when to activate the object, see description of these below for further details. |
154 | when to activate the object, see description of these below for further details. |
150 | |
155 | |
… | |
… | |
263 | will be generated. |
268 | will be generated. |
264 | |
269 | |
265 | 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 |
266 | the new one. |
271 | the new one. |
267 | |
272 | |
268 | When the old object was a B<LAMP> it's I<food> fields value less 1 will be copied |
|
|
269 | to the new object. |
|
|
270 | |
|
|
271 | =item FLAG_IS_A_TEMPLATE (internal use) |
273 | =item FLAG_IS_A_TEMPLATE (internal use) |
272 | |
274 | |
273 | 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, |
274 | 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. |
275 | |
277 | |
… | |
… | |
300 | This flag is by default on. |
302 | This flag is by default on. |
301 | |
303 | |
302 | =item FLAG_NO_STEAL |
304 | =item FLAG_NO_STEAL |
303 | |
305 | |
304 | 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 |
305 | resetted once the object is placed on a map. |
307 | reset once the object is placed on a map. |
306 | |
308 | |
307 | 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 |
308 | (but in this context the flag is only used internally). |
310 | (but in this context the flag is only used internally). |
309 | |
311 | |
310 | =item FLAG_NO_SKILL_IDENT |
312 | =item FLAG_NO_SKILL_IDENT |
311 | |
313 | |
312 | This flag is mostly used internal and prevents unidentified objects |
314 | This flag is mostly used internal and prevents unidentified objects |
… | |
… | |
330 | =item FLAG_IS_LIGHTABLE |
332 | =item FLAG_IS_LIGHTABLE |
331 | |
333 | |
332 | This flag indicates whether a B<LIGHTER> can light this object. See also the |
334 | This flag indicates whether a B<LIGHTER> can light this object. See also the |
333 | description of the B<LIGHTER> type. How easy you can light an item depends |
335 | description of the B<LIGHTER> type. How easy you can light an item depends |
334 | partially on the material of the object. |
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 |
335 | |
355 | |
336 | =back |
356 | =back |
337 | |
357 | |
338 | =head2 Description of type specific fields and behaviour |
358 | =head2 Description of type specific fields and behaviour |
339 | |
359 | |
… | |
… | |
446 | This field has some special meaning in potions, currently the |
466 | This field has some special meaning in potions, currently the |
447 | 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 |
448 | restoration potion or improvement potion. |
468 | restoration potion or improvement potion. |
449 | See include/attackinc.h for the bits of these types. |
469 | See include/attackinc.h for the bits of these types. |
450 | |
470 | |
451 | 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" |
452 | 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 |
453 | 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" |
454 | into him. |
474 | into him. |
455 | |
475 | |
456 | 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. |
457 | 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. |
458 | |
478 | |
… | |
… | |
500 | |
520 | |
501 | =back |
521 | =back |
502 | |
522 | |
503 | =back |
523 | =back |
504 | |
524 | |
505 | =head3 B<FOOD> - type 6 - Eatable stuff |
525 | =head3 B<FOOD> - type 6 - Edible stuff |
506 | |
526 | |
507 | This is for objects that are representing general eatables like |
527 | This is for objects that are representing general eatables like |
508 | beef or bread. |
528 | beef or bread. |
509 | |
529 | |
510 | 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 |
… | |
… | |
731 | The minimum I<speed> of an arrow is 1.0. |
751 | The minimum I<speed> of an arrow is 1.0. |
732 | |
752 | |
733 | 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. |
734 | |
754 | |
735 | 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 |
736 | 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 |
737 | 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 |
738 | 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). |
739 | |
759 | |
740 | =item I<weight> <number> |
760 | =item I<weight> <number> |
741 | |
761 | |
742 | 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) |
743 | 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. |
… | |
… | |
955 | =item I<hp> <number> |
975 | =item I<hp> <number> |
956 | |
976 | |
957 | 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 |
958 | be used. |
978 | be used. |
959 | |
979 | |
960 | =item I<speed> <number> |
980 | =item I<speed> <float> |
961 | |
981 | |
962 | 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, |
963 | 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 |
964 | for more details. |
984 | for more details. |
965 | |
985 | |
… | |
… | |
970 | =item I<other_arch> <string> |
990 | =item I<other_arch> <string> |
971 | |
991 | |
972 | If the inventory of the creator is empty new objects will be derived from the |
992 | If the inventory of the creator is empty new objects will be derived from the |
973 | archetype named by <string>. |
993 | archetype named by <string>. |
974 | |
994 | |
975 | =item I<connected> <number> |
995 | =item I<connected> <identifier> |
976 | |
996 | |
977 | See generic object field description. |
997 | See generic object field description. |
|
|
998 | |
|
|
999 | =back |
|
|
1000 | |
|
|
1001 | =head3 B<SKILL> - type 43 - Skills |
|
|
1002 | |
|
|
1003 | This type is basically for representing skills in the game. |
|
|
1004 | |
|
|
1005 | =over 4 |
|
|
1006 | |
|
|
1007 | =item I<subtype> <skill number> |
|
|
1008 | |
|
|
1009 | =item I<weapontype> <type of tool> |
|
|
1010 | |
|
|
1011 | The type of weapon or ranged item compatible with this skill (For ranged |
|
|
1012 | and combat attacks). |
|
|
1013 | |
|
|
1014 | =item I<skill> <string> |
|
|
1015 | |
|
|
1016 | The skill identifier used by other items, usually the skill name |
|
|
1017 | |
|
|
1018 | =item I<level> <percentage> |
|
|
1019 | |
|
|
1020 | not used? |
|
|
1021 | |
|
|
1022 | =item I<exp> <number> |
|
|
1023 | |
|
|
1024 | Base amount of experience in a skill, for skills not starting at zero. |
|
|
1025 | |
|
|
1026 | =item I<expmul> <float> |
|
|
1027 | |
|
|
1028 | Experience is multiplied by this factor. |
978 | |
1029 | |
979 | =back |
1030 | =back |
980 | |
1031 | |
981 | =head3 B<DRINK> - type 54 - Drinkable stuff |
1032 | =head3 B<DRINK> - type 54 - Drinkable stuff |
982 | |
1033 | |
… | |
… | |
1029 | =item I<race> <string> |
1080 | =item I<race> <string> |
1030 | |
1081 | |
1031 | If this field is set the inventory checker will search for an object which |
1082 | If this field is set the inventory checker will search for an object which |
1032 | has the archetype name that matches <string>. |
1083 | has the archetype name that matches <string>. |
1033 | |
1084 | |
1034 | =item I<connected> <connection id> |
1085 | =item I<connected> <identifier> |
1035 | |
1086 | |
1036 | This is the connection that will be activated. The connection is |
1087 | This is the connection that will be activated. The connection is |
1037 | 'pushed' when someone enters the space with the inventory checker, |
1088 | 'pushed' when someone enters the space with the inventory checker, |
1038 | and it is 'released' when he leaves it. |
1089 | and it is 'released' when he leaves it. |
1039 | |
1090 | |
1040 | See also the description of the I<connected> field in the generic object field |
1091 | See also the description of the I<connected> field in the generic object |
1041 | section. |
1092 | field section. |
1042 | |
1093 | |
1043 | =back |
1094 | =back |
1044 | |
1095 | |
1045 | =head3 B<MOOD_FLOOR> - type 65 - change mood of monsters |
1096 | =head3 B<MOOD_FLOOR> - type 65 - change mood of monsters |
1046 | |
1097 | |
… | |
… | |
1064 | |
1115 | |
1065 | =head3 B<MISC_OBJECT> - type 79 - Misc. objects |
1116 | =head3 B<MISC_OBJECT> - type 79 - Misc. objects |
1066 | |
1117 | |
1067 | A type for any object that has no special behaviour. |
1118 | A type for any object that has no special behaviour. |
1068 | |
1119 | |
1069 | =head3 B<LAMP> - type 82 - A lamp |
|
|
1070 | |
|
|
1071 | This object represents a lamp, that can be carried and switched |
|
|
1072 | on and off and has a certain amount of fuel in it. |
|
|
1073 | |
|
|
1074 | A lamp consists of two archetypes: the 'on' archetype and the 'off' archetype. |
|
|
1075 | Each of them should point at the other one with it's I<other_arch> field. |
|
|
1076 | |
|
|
1077 | See the I<other_arch> field for the behaviour of a lamp object when it is applied. |
|
|
1078 | |
|
|
1079 | If this object has FLAG_IS_LIGHTABLE set the lamp can be turned on and off |
|
|
1080 | with a B<LIGHTER>, see also the description of FLAG_IS_LIGHTABLE. |
|
|
1081 | |
|
|
1082 | =over 4 |
|
|
1083 | |
|
|
1084 | =item I<glow_radius> <number> |
|
|
1085 | |
|
|
1086 | The radius of the light that the lamp emits, see also I<glow_radius> in the |
|
|
1087 | generic object flags description. |
|
|
1088 | |
|
|
1089 | =item I<speed> <number> |
|
|
1090 | |
|
|
1091 | If FLAG_CHANGING is set the I<speed> field will indicate how fast the |
|
|
1092 | lamp burns it's fuel (I<food>). |
|
|
1093 | |
|
|
1094 | Setting FLAG_CHANGING makes only sense on the archetype which represents |
|
|
1095 | the 'on' state of the lamp. |
|
|
1096 | |
|
|
1097 | See also the description of FLAG_CHANGING. |
|
|
1098 | |
|
|
1099 | Lamps which have no FLAG_CHANGING set would also make sense and represent |
|
|
1100 | lamps that never burn up. |
|
|
1101 | |
|
|
1102 | =item I<other_arch> <number> |
|
|
1103 | |
|
|
1104 | This is the field that points to the 'other' archetype which represents the |
|
|
1105 | opposite state of the lamp. The newly from I<other_arch> derived object will |
|
|
1106 | replace the current object and will get the value of I<food> of the replaced object. |
|
|
1107 | |
|
|
1108 | Rationale: |
|
|
1109 | |
|
|
1110 | When the lamp (on) is applied a new object is derived from the archetype |
|
|
1111 | in I<other_arch> and the I<food> value is copied to it ('the fuel is |
|
|
1112 | transferred'). The new lamp (off) object has to have a I<other_arch> field |
|
|
1113 | which points to the archetype from which a lamp (on) can be derived. |
|
|
1114 | |
|
|
1115 | =item I<food> <number> |
|
|
1116 | |
|
|
1117 | This fields stands for the fuel of the lamp. |
|
|
1118 | |
|
|
1119 | =back |
|
|
1120 | |
|
|
1121 | =head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators |
1120 | =head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators |
1122 | |
1121 | |
1123 | This type of objects multiplies objects that are above it when it is activated. |
1122 | This type of objects multiplies objects that are above it when it is activated. |
1124 | You can even multiply by 0, which will destroy the object. |
1123 | You can even multiply by 0, which will destroy the object. |
1125 | |
1124 | |
… | |
… | |
1131 | |
1130 | |
1132 | =item I<other_arch> <string> |
1131 | =item I<other_arch> <string> |
1133 | |
1132 | |
1134 | The archetype name of the objects that should be multiplied. |
1133 | The archetype name of the objects that should be multiplied. |
1135 | |
1134 | |
1136 | =item I<connected> <number> |
1135 | =item I<connected> <identifier> |
1137 | |
1136 | |
1138 | See generic object field description. |
1137 | See generic object field description. |
1139 | |
1138 | |
1140 | =back |
1139 | =back |
1141 | |
1140 | |
… | |
… | |
1159 | when the connection is activated. This field only has effect when the |
1158 | when the connection is activated. This field only has effect when the |
1160 | connection is triggered. So if you put a closed hole on a map, and the |
1159 | connection is triggered. So if you put a closed hole on a map, and the |
1161 | connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the |
1160 | connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the |
1162 | connection was triggered once. |
1161 | connection was triggered once. |
1163 | |
1162 | |
1164 | =item I<connected> <connection id> |
1163 | =item I<connected> <identifier> |
1165 | |
1164 | |
1166 | This is the connection id, which lets the hole opening or closing when |
1165 | This is the connection id, which lets the hole opening or closing when |
1167 | activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control |
1166 | activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control |
1168 | at which connection state the object is activated. |
1167 | at which connection state the object is activated. |
1169 | |
1168 | |