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.17 by elmex, Wed Dec 20 22:54:59 2006 UTC vs.
Revision 1.34 by root, Sun Nov 29 09:41:28 2009 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
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
253will be generated. 268will be generated.
254 269
255After the new object is created the I<hp> field from the old object is copied into 270After the new object is created the I<hp> field from the old object is copied into
256the new one. 271the new one.
257 272
258When the old object was a B<LAMP> it's I<food> fields value less 1 will be copied
259to the new object.
260
261=item FLAG_IS_A_TEMPLATE (internal use) 273=item FLAG_IS_A_TEMPLATE (internal use)
262 274
263This 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,
264or 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.
265 277
290This flag is by default on. 302This flag is by default on.
291 303
292=item FLAG_NO_STEAL 304=item FLAG_NO_STEAL
293 305
294When 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
295resetted once the object is placed on a map. 307reset once the object is placed on a map.
296 308
297When 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
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
302This flag is mostly used internal and prevents unidentified objects 314This flag is mostly used internal and prevents unidentified objects
315=item FLAG_REFL_SPELL 327=item FLAG_REFL_SPELL
316 328
317This flag indicates whether something reflects spells, like spell reflecting 329This flag indicates whether something reflects spells, like spell reflecting
318amuletts. 330amuletts.
319 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
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
324The beginning of the headers of the following subsection 360The 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
329This 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
330fields that affect it. 366fields 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
334Rods contain spells and can be fired by a player. 370Rods contain spells and can be fired by a player.
335 371
336=over 4 372=over 4
337 373
343the '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
344rod is added as bonus. 380rod is added as bonus.
345 381
346=item I<hp> <number> 382=item I<hp> <number>
347 383
348The 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.
349 386
350=item I<maxhp> <number> 387=item I<maxhp> <number>
351 388
352The maximum amount of spellpoints this rod has. 389The maximum amount of spellpoints this rod has.
353 390
429This field has some special meaning in potions, currently the 466This field has some special meaning in potions, currently the
430bits for AT_DEPLETE and AT_GODPOWER control whethere this is a 467bits for AT_DEPLETE and AT_GODPOWER control whethere this is a
431restoration potion or improvement potion. 468restoration potion or improvement potion.
432See include/attackinc.h for the bits of these types. 469See include/attackinc.h for the bits of these types.
433 470
434If 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"
435will 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
436set 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"
437into him. 474into him.
438 475
439If 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.
440When 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.
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
490This is for objects that are representing general eatables like 527This is for objects that are representing general eatables like
491beef or bread. 528beef or bread.
492 529
493The 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
531 568
532=over 4 569=over 4
533 570
534=item I<level> <number> 571=item I<level> <number>
535 572
536This field affects the propability of poisoning. The higher the level difference 573This field affects the probability of poisoning. The higher the level difference
537between 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
538one will be poisoned. 575one will be poisoned.
539 576
540=item I<slaying> <race> 577=item I<slaying> <race>
541 578
542This field has the usual meaning of 'slaying', when the 579This field has the usual meaning of 'slaying', when the
668the 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
669and the arrows I<magic> field. 706and the arrows I<magic> field.
670 707
671=item I<wc> <number> 708=item I<wc> <number>
672 709
673The 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.
674 711
675It is recomputed when the arrow is being fired by this formula: 712It 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
693Bitfield which decides the attacktype of the damage, see include/attackinc.h 730Bitfield which decides the attacktype of the damage, see include/attackinc.h
694On 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>.
695 732
696=item I<level> <number> (interally used) 733=item I<level> <number> (interally used)
697 734
698The 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,
699see above in the B<ARROW> description. 736see above in the B<ARROW> description.
700 737
701The 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
702shooters level. 739shooters level.
703 740
714The minimum I<speed> of an arrow is 1.0. 751The minimum I<speed> of an arrow is 1.0.
715 752
716While 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.
717 754
718If 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
719it'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
720stopped 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
721put 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).
722 759
723=item I<weight> <number> 760=item I<weight> <number>
724 761
725This 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)
726the 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.
832Generally 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
833I<sp> regeneration. 870I<sp> regeneration.
834 871
835=item I<body_BODYSLOT> 872=item I<body_BODYSLOT>
836 873
837The 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
838looked up in common/item.C at body_locations. 875C<BODYSLOT> should be looked up in common/item.C at body_locations.
839 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
840=item I<resist_RESISTNACY> <number> 882=item I<resist_RESISTANCY> <number>
841 883
842this 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%
843is multiplied, something like this: 885is multiplied, something like this:
844 886
845 additional_resistancy = (100 - current_resistanct) * (<number>/100) 887 additional_resistancy = (100 - current_resistancy) * (<number>/100)
846 888
847if <number> is negative it is added to the total vulnerabilities, 889if <number> is negative it is added to the total vulnerabilities,
848and later the total resistance is decided by: 890and 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
852see also common/living.C:fix_player 894see also common/living.C:fix_player.
853 895
854=item I<path_(attuned|repelled|denied)> 896=item I<path_(attuned|repelled|denied)>
855 897
856this 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_*
857for the pathes. 899for the pathes.
933=item I<hp> <number> 975=item I<hp> <number>
934 976
935If 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
936be used. 978be used.
937 979
938=item I<speed> <number> 980=item I<speed> <float>
939 981
940If I<speed> is set the creator will create an object periodically, 982If I<speed> is set the creator will create an object periodically,
941see 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
942for more details. 984for more details.
943 985
1018See also the description of the I<connected> field in the generic object field 1060See also the description of the I<connected> field in the generic object field
1019section. 1061section.
1020 1062
1021=back 1063=back
1022 1064
1065=head3 B<MOOD_FLOOR> - type 65 - change mood of monsters
1066
1067speed == 0 for triggered mood changes, speed != 0 for non-triggered mood
1068changes.
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
1025See B<FOOD> description. 1083See 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
1029A type for any object that has no special behaviour. 1087A type for any object that has no special behaviour.
1030
1031=head3 B<LAMP> - type 82 - A lamp
1032
1033This object represents a lamp, that can be carried and switched
1034on and off and has a certain amount of fuel in it.
1035
1036A lamp consists of two archetypes: the 'on' archetype and the 'off' archetype.
1037Each of them should point at the other one with it's I<other_arch> field.
1038
1039See 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
1045If FLAG_CHANGING is set the I<speed> field will indicate how fast the
1046lamp burns it's fuel (I<food>).
1047
1048Setting FLAG_CHANGING makes only sense on the archetype which represents
1049the 'on' state of the lamp.
1050
1051See also the description of FLAG_CHANGING.
1052
1053Lamps which have no FLAG_CHANGING set would also make sense and represent
1054lamps that never burn up.
1055
1056=item I<other_arch> <number>
1057
1058This is the field that points to the 'other' archetype which represents the
1059opposite state of the lamp. The newly from I<other_arch> derived object will
1060replace the current object and will get the value of I<food> of the replaced object.
1061
1062Rationale:
1063
1064When the lamp (on) is applied a new object is derived from the archetype
1065in I<other_arch> and the I<food> value is copied to it ('the fuel is
1066transferred'). The new lamp (off) object has to have a I<other_arch> field
1067which points to the archetype from which a lamp (on) can be derived.
1068
1069=item I<food> <number>
1070
1071This 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
1077This type of objects multiplies objects that are above it when it is activated. 1091This type of objects multiplies objects that are above it when it is activated.
1078You can even multiply by 0, which will destroy the object. 1092You can even multiply by 0, which will destroy the object.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines