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

Comparing deliantra/server/pod/objects.pod (file contents):
Revision 1.16 by elmex, Wed Dec 20 21:30:42 2006 UTC vs.
Revision 1.36 by root, Fri Mar 26 20:30:32 2010 UTC

1=head1 CROSSFIRE+ OBJECT AND INTERNALS DOCUMENTATION 1=head1 DELIANTRA OBJECT AND INTERNALS DOCUMENTATION
2 2
3Here is all information about the object types Crossfire+ 3Here is all information about the object types Deliantra
4supports at the moment. This is not a complete documentation (yet) 4supports at the moment. This is not a complete documentation (yet)
5and browsing the source is still recommended to learn about 5and browsing the source is still recommended to learn about
6the objects that aren't documented here. 6the objects that aren't documented here.
7 7
8This documentation is in a sketchy state. It's mostly 8This documentation is in a sketchy state. It's mostly
33This document does explain the behaviour of the objects and the meaning of 33This document does explain the behaviour of the objects and the meaning of
34their fields in the server engine, which are derived from archetypes. 34their fields in the server engine, which are derived from archetypes.
35 35
36This is an example of an archetype: 36This 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
108For players this field reflects the duration of the invisibility 108For players this field reflects the duration of the invisibility
109and is decreased every tick by 1. 109and is decreased every tick by 1.
110 110
111For non-player objects this field is not changed by server ticks. 111For non-player objects this field is not changed by server ticks.
112 112
113=item I<glow_radius> <number>
114
115This field indicates how far an object glows. Default is a radius of 0 (no
116glowing at all). Negative glow radii darken areas - currently, negative
117glow radii are stronger than positive ones.
118
113=item I<speed> <number> 119=item I<speed> <float>
114 120
115If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed 121If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed
116on the active object list and will be processed each tick (see also speed_left!). 122on the active object list and will be processed each tick (see also speed_left!).
117 123
118If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed 124If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed
119from the active object list and it won't experience any processing per tick. 125from the active object list and it won't experience any processing per tick.
120 126
127Negative speed settings in archetypes and files cause a speed_left
128randomisation on load or instantiatian, but for calculations, the absolute
129value is used always.
130
121=item I<speed_left> <number> 131=item I<speed_left> <float>
122 132
123If this field is greater than 0 and the object is on the 133If this field is greater than 0 and the object is on the
124active list (mostly means it's speed is also greater than 0): 134active 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
132 142
133This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED) 143This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED)
134the more seldom the object is processed. And the higher I<speed> is 144the more seldom the object is processed. And the higher I<speed> is
135the more often the object is processed. 145the more often the object is processed.
136 146
137=item I<connected> <number> 147=item I<connected> <identifier>
138 148
139When this field is set the object will be linked to a connection with the 149When this field is set the object will be linked to a connection with the
140id <number>. What happens when the connection is 'activated' depends on the 150same <identifier>. What happens when the connection is 'activated' depends on the
141type of the object. 151type of the object.
142 152
143FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control 153FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control
144when to activate the object, see description of these below for further details. 154when to activate the object, see description of these below for further details.
145 155
194See Flags section below. 204See 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
198Sets the flag FLAG_ACTIVATE_ON_RELEASE. 208Sets the flag FLAG_ACTIVATE_ON_RELEASE.
209See Flags section below.
210
211=item I<is_lightable> (0|1)
212
213Sets the flag FLAG_IS_LIGHTABLE.
199See Flags section below. 214See Flags section below.
200 215
201=item I<editable> (more than deprecated) 216=item I<editable> (more than deprecated)
202 217
203This field had a special meaning for crossedit, which used parts 218This field had a special meaning for crossedit, which used parts
238If FLAG_APPLIED is not set the object is destroyed. 253If FLAG_APPLIED is not set the object is destroyed.
239 254
240=item FLAG_CHANGING 255=item FLAG_CHANGING
241 256
242If the I<state> field of the object is 0 the object will be processed periodically 257If the I<state> field of the object is 0 the object will be processed periodically
243(if speed is set). If the I<state> field is 1 it won't be processed. 258(if I<speed> is set). If the I<state> field is 1 it won't be processed.
259
260This flag indicates that the object is changing into a different object.
261The object has to have the I<other_arch> field set. The object the changing object
262changes into is derived from the archetype in I<other_arch>.
263
264When the object does not have FLAG_ALIVE set the I<food> field will be decremented
265each time the object is processed, and if I<food> reaches 0 one new object will be generated.
266
267When the object has FLAG_ALIVE set the I<food> field is the number of objects that
268will be generated.
269
270After the new object is created the I<hp> field from the old object is copied into
271the new one.
244 272
245=item FLAG_IS_A_TEMPLATE (internal use) 273=item FLAG_IS_A_TEMPLATE (internal use)
246 274
247This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s, 275This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s,
248or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. 276or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set.
274This flag is by default on. 302This flag is by default on.
275 303
276=item FLAG_NO_STEAL 304=item FLAG_NO_STEAL
277 305
278When this flag is set this object can't be stolen. The flag will be 306When this flag is set this object can't be stolen. The flag will be
279resetted once the object is placed on a map. 307reset once the object is placed on a map.
280 308
281When this flag is set on a monster it can defent attempts of stealing 309When this flag is set on a monster it can defend attempts at stealing
282(but in this context the flag is only used internally). 310(but in this context the flag is only used internally).
283 311
284=item FLAG_NO_SKILL_IDENT 312=item FLAG_NO_SKILL_IDENT
285 313
286This flag is mostly used internal and prevents unidentified objects 314This flag is mostly used internal and prevents unidentified objects
299=item FLAG_REFL_SPELL 327=item FLAG_REFL_SPELL
300 328
301This flag indicates whether something reflects spells, like spell reflecting 329This flag indicates whether something reflects spells, like spell reflecting
302amuletts. 330amuletts.
303 331
332=item FLAG_IS_LIGHTABLE
333
334This flag indicates whether a B<LIGHTER> can light this object. See also the
335description of the B<LIGHTER> type. How easy you can light an item depends
336partially on the material of the object.
337
338=item FLAG_MONSTER
339
340Enables NPC behaviour in general (both monster AI and friendly AI). Numerous fields
341change their meaning, including:
342
343=over 4
344
345=item I<wis>
346
347Governs the "wake-up radius" - the radius within a monster detects an enemy.
348
349Also, I<wis> governs pathfinding intelligence: 8 and up means the monster
350will partake in basic smell finding. 10 and up additionally spreads smell
351knowledge, and 15 and up additionally will try to perturb the path as to
352find shortcuts.
353
354=back
355
304=back 356=back
305 357
306=head2 Description of type specific fields and behaviour 358=head2 Description of type specific fields and behaviour
307 359
308The beginning of the headers of the following subsection 360The beginning of the headers of the following subsection
311=head3 B<TRANSPORT> - type 2 - Player transports 363=head3 B<TRANSPORT> - type 2 - Player transports
312 364
313This type is implemented by the transport extension and has currently no special 365This type is implemented by the transport extension and has currently no special
314fields that affect it. 366fields that affect it.
315 367
316=head3 B<ROD> - type 3 - Rods that fire spells 368=head3 B<ROD>, B<HORN> - type 3, 35 - Rods that fire spells
317 369
318Rods contain spells and can be fired by a player. 370Rods contain spells and can be fired by a player.
319 371
320=over 4 372=over 4
321 373
327the 'use magic item' skill level of the player and 1/10 of the level of the 379the 'use magic item' skill level of the player and 1/10 of the level of the
328rod is added as bonus. 380rod is added as bonus.
329 381
330=item I<hp> <number> 382=item I<hp> <number>
331 383
332The amount of spellpoints this rod has left. 384The amount of spellpoints this rod has left. Recharges at a rate of C<1 +
385maxhp/10> per tick.
333 386
334=item I<maxhp> <number> 387=item I<maxhp> <number>
335 388
336The maximum amount of spellpoints this rod has. 389The maximum amount of spellpoints this rod has.
337 390
413This field has some special meaning in potions, currently the 466This field has some special meaning in potions, currently the
414bits for AT_DEPLETE and AT_GODPOWER control whethere this is a 467bits for AT_DEPLETE and AT_GODPOWER control whethere this is a
415restoration potion or improvement potion. 468restoration potion or improvement potion.
416See include/attackinc.h for the bits of these types. 469See include/attackinc.h for the bits of these types.
417 470
418If AT_DEPLETE is set the player will be restored and the ARCH_DEPLETION 471If AT_DEPLETE is set the player will be restored and the "depletion"
419will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED 472will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED
420set the player will be drained a random stat by inserting an ARCH_DEPLETION 473set the player will be drained a random stat by inserting an "depletion"
421into him. 474into him.
422 475
423If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat. 476If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat.
424When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats. 477When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats.
425 478
467 520
468=back 521=back
469 522
470=back 523=back
471 524
472=head3 B<FOOD> - type 6 - Eatable stuff 525=head3 B<FOOD> - type 6 - Edible stuff
473 526
474This is for objects that are representing general eatables like 527This is for objects that are representing general eatables like
475beef or bread. 528beef or bread.
476 529
477The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they 530The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they
515 568
516=over 4 569=over 4
517 570
518=item I<level> <number> 571=item I<level> <number>
519 572
520This field affects the propability of poisoning. The higher the level difference 573This field affects the probability of poisoning. The higher the level difference
521between the one who is hit and the poision the more propable it is the attacked 574between the one who is hit and the poision the more probable it is the attacked
522one will be poisoned. 575one will be poisoned.
523 576
524=item I<slaying> <race> 577=item I<slaying> <race>
525 578
526This field has the usual meaning of 'slaying', when the 579This field has the usual meaning of 'slaying', when the
652the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field 705the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field
653and the arrows I<magic> field. 706and the arrows I<magic> field.
654 707
655=item I<wc> <number> 708=item I<wc> <number>
656 709
657The weapon class of the arrow, which has effect on the propability of hitting. 710The weapon class of the arrow, which has effect on the probability of hitting.
658 711
659It is recomputed when the arrow is being fired by this formula: 712It is recomputed when the arrow is being fired by this formula:
660 713
661 wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level) 714 wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level)
662 - 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
677Bitfield which decides the attacktype of the damage, see include/attackinc.h 730Bitfield which decides the attacktype of the damage, see include/attackinc.h
678On fireing the I<attacktype> of the bow is added to the arrows I<attacktype>. 731On fireing the I<attacktype> of the bow is added to the arrows I<attacktype>.
679 732
680=item I<level> <number> (interally used) 733=item I<level> <number> (interally used)
681 734
682The level of the arrow, this affects the propability of piercing FLAG_REFL_MISSILE, 735The level of the arrow, this affects the probability of piercing FLAG_REFL_MISSILE,
683see above in the B<ARROW> description. 736see above in the B<ARROW> description.
684 737
685The I<level> is set when the arrow is fired to either the skill level or the 738The I<level> is set when the arrow is fired to either the skill level or the
686shooters level. 739shooters level.
687 740
698The minimum I<speed> of an arrow is 1.0. 751The minimum I<speed> of an arrow is 1.0.
699 752
700While flying the arrows I<speed> is decreased by 0.05 each time it's moved. 753While flying the arrows I<speed> is decreased by 0.05 each time it's moved.
701 754
702If the I<speed> is above 10.0 it goes straight through the creature it hits and 755If the I<speed> is above 10.0 it goes straight through the creature it hits and
703it's I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is 756its I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is
704stopped and either sticked into the victim (see I<weight> field description) or 757stopped and either stuck into the victim (see I<weight> field description) or
705put on it's map square (if it didn't break, see description of the I<food> field). 758put on its map square (if it didn't break, see description of the I<food> field).
706 759
707=item I<weight> <number> 760=item I<weight> <number>
708 761
709This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg) 762This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg)
710the arrow will stick in the victim it hits. Otherwise it will fall to the ground. 763the arrow will stick in the victim it hits. Otherwise it will fall to the ground.
816Generally this field on weapons is in ranges of 1-30 and decides the slowdown of the 869Generally this field on weapons is in ranges of 1-30 and decides the slowdown of the
817I<sp> regeneration. 870I<sp> regeneration.
818 871
819=item I<body_BODYSLOT> 872=item I<body_BODYSLOT>
820 873
821The part of the body you need to use this weapon, possible values should be 874The part/slot of the body you need to use this weapon, possible values for
822looked up in common/item.C at body_locations. 875C<BODYSLOT> should be looked up in common/item.C at body_locations.
823 876
877The value (in the range C<-7..7>) gives the number of those body slots
878used up by the item (if negative) or the number of body slots this object
879has (if positive, e.g. for monsters or players). The special value C<0>
880indicates that this object cannot equip items requiring these body slots.
881
824=item I<resist_RESISTNACY> <number> 882=item I<resist_RESISTANCY> <number>
825 883
826this is the factor with which the difference of the players resistancy and 100% 884this is the factor with which the difference of the players resistancy and 100%
827is multiplied, something like this: 885is multiplied, something like this:
828 886
829 additional_resistancy = (100 - current_resistanct) * (<number>/100) 887 additional_resistancy = (100 - current_resistancy) * (<number>/100)
830 888
831if <number> is negative it is added to the total vulnerabilities, 889if <number> is negative it is added to the total vulnerabilities,
832and later the total resistance is decided by: 890and later the total resistance is decided by:
833 891
834 'total resistance = total protections - total vulnerabilities' 892 'total resistance = total protections - total vulnerabilities'
835 893
836see also common/living.C:fix_player 894see also common/living.C:fix_player.
837 895
838=item I<path_(attuned|repelled|denied)> 896=item I<path_(attuned|repelled|denied)>
839 897
840this field modifies the pathes the player is attuned to, see include/spells.h PATH_* 898this field modifies the pathes the player is attuned to, see include/spells.h PATH_*
841for the pathes. 899for the pathes.
917=item I<hp> <number> 975=item I<hp> <number>
918 976
919If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can 977If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can
920be used. 978be used.
921 979
922=item I<speed> <number> 980=item I<speed> <float>
923 981
924If I<speed> is set the creator will create an object periodically, 982If I<speed> is set the creator will create an object periodically,
925see I<speed> and I<speed_left> fields in the general object field description 983see I<speed> and I<speed_left> fields in the general object field description
926for more details. 984for more details.
927 985
932=item I<other_arch> <string> 990=item I<other_arch> <string>
933 991
934If the inventory of the creator is empty new objects will be derived from the 992If the inventory of the creator is empty new objects will be derived from the
935archetype named by <string>. 993archetype named by <string>.
936 994
937=item I<connected> <number> 995=item I<connected> <identifier>
938 996
939See generic object field description. 997See generic object field description.
998
999=back
1000
1001=head3 B<SKILL> - type 43 - Skills
1002
1003This 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
1011The type of weapon or ranged item compatible with this skill (For ranged
1012and combat attacks).
1013
1014=item I<skill> <string>
1015
1016The skill identifier used by other items, usually the skill name
1017
1018=item I<level> <percentage>
1019
1020not used?
1021
1022=item I<exp> <number>
1023
1024Base amount of experience in a skill, for skills not starting at zero.
1025
1026=item I<expmul> <float>
1027
1028Experience is multiplied by this factor.
940 1029
941=back 1030=back
942 1031
943=head3 B<DRINK> - type 54 - Drinkable stuff 1032=head3 B<DRINK> - type 54 - Drinkable stuff
944 1033
991=item I<race> <string> 1080=item I<race> <string>
992 1081
993If this field is set the inventory checker will search for an object which 1082If this field is set the inventory checker will search for an object which
994has the archetype name that matches <string>. 1083has the archetype name that matches <string>.
995 1084
996=item I<connected> <connection id> 1085=item I<connected> <identifier>
997 1086
998This is the connection that will be activated. The connection is 1087This is the connection that will be activated. The connection is
999'pushed' when someone enters the space with the inventory checker, 1088'pushed' when someone enters the space with the inventory checker,
1000and it is 'released' when he leaves it. 1089and it is 'released' when he leaves it.
1001 1090
1002See also the description of the I<connected> field in the generic object field 1091See also the description of the I<connected> field in the generic object
1003section. 1092field section.
1004 1093
1005=back 1094=back
1095
1096=head3 B<MOOD_FLOOR> - type 65 - change mood of monsters
1097
1098speed == 0 for triggered mood changes, speed != 0 for non-triggered mood
1099changes.
1100
1101 (based on value that last_sp takes):
1102 0: 'furious' Makes all monsters aggressive
1103 1: 'angry' As above but pets are unaffected
1104 2: 'calm' Makes all monsters unaggressive
1105 3: 'sleep' Puts all monsters to sleep
1106 4: 'charm' Makes monster into a pet of person
1107 who triggers the square. This setting
1108 is not enabled for continous operation
1109 5: 'destroy mons' destroy any monsters on this space
1110 6: 'destroy pets' destroy friendly monsters on this space
1006 1111
1007=head3 B<FLESH> - type 72 - Organs and body parts 1112=head3 B<FLESH> - type 72 - Organs and body parts
1008 1113
1009See B<FOOD> description. 1114See B<FOOD> description.
1010 1115
1011=head3 B<MISC_OBJECT> - type 79 - Misc. objects 1116=head3 B<MISC_OBJECT> - type 79 - Misc. objects
1012 1117
1013A type for any object that has no special behaviour. 1118A type for any object that has no special behaviour.
1014
1015=head3 B<LAMP> - type 82 - A lamp
1016
1017This object makes light.
1018 1119
1019=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators 1120=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators
1020 1121
1021This type of objects multiplies objects that are above it when it is activated. 1122This type of objects multiplies objects that are above it when it is activated.
1022You can even multiply by 0, which will destroy the object. 1123You can even multiply by 0, which will destroy the object.
1029 1130
1030=item I<other_arch> <string> 1131=item I<other_arch> <string>
1031 1132
1032The archetype name of the objects that should be multiplied. 1133The archetype name of the objects that should be multiplied.
1033 1134
1034=item I<connected> <number> 1135=item I<connected> <identifier>
1035 1136
1036See generic object field description. 1137See generic object field description.
1037 1138
1038=back 1139=back
1039 1140
1057when the connection is activated. This field only has effect when the 1158when the connection is activated. This field only has effect when the
1058connection is triggered. So if you put a closed hole on a map, and the 1159connection is triggered. So if you put a closed hole on a map, and the
1059connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the 1160connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the
1060connection was triggered once. 1161connection was triggered once.
1061 1162
1062=item I<connected> <connection id> 1163=item I<connected> <identifier>
1063 1164
1064This is the connection id, which lets the hole opening or closing when 1165This is the connection id, which lets the hole opening or closing when
1065activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control 1166activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control
1066at which connection state the object is activated. 1167at which connection state the object is activated.
1067 1168

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines