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.38 by root, Mon Apr 5 16:24:59 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
577 630
578=head3 B<CLOCK> - type 9 - Clocks 631=head3 B<CLOCK> - type 9 - Clocks
579 632
580This type of objects just display the time when being applied. 633This type of objects just display the time when being applied.
581 634
635=head3 B<VEIN> - type 10 - item veins for mining
636
637Provides a place to apply to mining skill to.
638
639=item I<other_arch> <archname>
640
641The architecture to create on a successful mine.
642
643=item I<food> <number>
644
645The number of items to produce from this vein.
646
647=item I<ac> <percentage>
648
649The base chance of getting an item.
650
651=item I<race> <identifier>
652
653Race of required extraction tools.
654
655=back
656
582=head3 B<LIGHTNING> - type 12 - Lightnings (DEPRECATED: see B<SPELL_EFFECT> subtype SP_BOLT) 657=head3 B<LIGHTNING> - type 12 - Lightnings (DEPRECATED: see B<SPELL_EFFECT> subtype SP_BOLT)
583 658
584This is a spell effect of a moving bolt. It moves straigt forward 659This is a spell effect of a moving bolt. It moves straigt forward
585through the map until something blocks it. 660through the map until something blocks it.
586If FLAG_REFLECTING is set it even reflects on walls. 661If FLAG_REFLECTING is set it even reflects on walls.
652the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field 727the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field
653and the arrows I<magic> field. 728and the arrows I<magic> field.
654 729
655=item I<wc> <number> 730=item I<wc> <number>
656 731
657The weapon class of the arrow, which has effect on the propability of hitting. 732The weapon class of the arrow, which has effect on the probability of hitting.
658 733
659It is recomputed when the arrow is being fired by this formula: 734It is recomputed when the arrow is being fired by this formula:
660 735
661 wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level) 736 wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level)
662 - dex_bonus - thaco_bonus - arrow->stats.wc - bow->stats.wc + wc_mod 737 - dex_bonus - thaco_bonus - arrow->stats.wc - bow->stats.wc + wc_mod
677Bitfield which decides the attacktype of the damage, see include/attackinc.h 752Bitfield 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>. 753On fireing the I<attacktype> of the bow is added to the arrows I<attacktype>.
679 754
680=item I<level> <number> (interally used) 755=item I<level> <number> (interally used)
681 756
682The level of the arrow, this affects the propability of piercing FLAG_REFL_MISSILE, 757The level of the arrow, this affects the probability of piercing FLAG_REFL_MISSILE,
683see above in the B<ARROW> description. 758see above in the B<ARROW> description.
684 759
685The I<level> is set when the arrow is fired to either the skill level or the 760The I<level> is set when the arrow is fired to either the skill level or the
686shooters level. 761shooters level.
687 762
698The minimum I<speed> of an arrow is 1.0. 773The minimum I<speed> of an arrow is 1.0.
699 774
700While flying the arrows I<speed> is decreased by 0.05 each time it's moved. 775While flying the arrows I<speed> is decreased by 0.05 each time it's moved.
701 776
702If the I<speed> is above 10.0 it goes straight through the creature it hits and 777If 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 778its 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 779stopped 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). 780put on its map square (if it didn't break, see description of the I<food> field).
706 781
707=item I<weight> <number> 782=item I<weight> <number>
708 783
709This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg) 784This 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. 785the 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 891Generally this field on weapons is in ranges of 1-30 and decides the slowdown of the
817I<sp> regeneration. 892I<sp> regeneration.
818 893
819=item I<body_BODYSLOT> 894=item I<body_BODYSLOT>
820 895
821The part of the body you need to use this weapon, possible values should be 896The part/slot of the body you need to use this weapon, possible values for
822looked up in common/item.C at body_locations. 897C<BODYSLOT> should be looked up in common/item.C at body_locations.
823 898
899The value (in the range C<-7..7>) gives the number of those body slots
900used up by the item (if negative) or the number of body slots this object
901has (if positive, e.g. for monsters or players). The special value C<0>
902indicates that this object cannot equip items requiring these body slots.
903
824=item I<resist_RESISTNACY> <number> 904=item I<resist_RESISTANCY> <number>
825 905
826this is the factor with which the difference of the players resistancy and 100% 906this is the factor with which the difference of the players resistancy and 100%
827is multiplied, something like this: 907is multiplied, something like this:
828 908
829 additional_resistancy = (100 - current_resistanct) * (<number>/100) 909 additional_resistancy = (100 - current_resistancy) * (<number>/100)
830 910
831if <number> is negative it is added to the total vulnerabilities, 911if <number> is negative it is added to the total vulnerabilities,
832and later the total resistance is decided by: 912and later the total resistance is decided by:
833 913
834 'total resistance = total protections - total vulnerabilities' 914 'total resistance = total protections - total vulnerabilities'
835 915
836see also common/living.C:fix_player 916see also common/living.C:fix_player.
837 917
838=item I<path_(attuned|repelled|denied)> 918=item I<path_(attuned|repelled|denied)>
839 919
840this field modifies the pathes the player is attuned to, see include/spells.h PATH_* 920this field modifies the pathes the player is attuned to, see include/spells.h PATH_*
841for the pathes. 921for the pathes.
917=item I<hp> <number> 997=item I<hp> <number>
918 998
919If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can 999If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can
920be used. 1000be used.
921 1001
922=item I<speed> <number> 1002=item I<speed> <float>
923 1003
924If I<speed> is set the creator will create an object periodically, 1004If 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 1005see I<speed> and I<speed_left> fields in the general object field description
926for more details. 1006for more details.
927 1007
932=item I<other_arch> <string> 1012=item I<other_arch> <string>
933 1013
934If the inventory of the creator is empty new objects will be derived from the 1014If the inventory of the creator is empty new objects will be derived from the
935archetype named by <string>. 1015archetype named by <string>.
936 1016
937=item I<connected> <number> 1017=item I<connected> <identifier>
938 1018
939See generic object field description. 1019See generic object field description.
1020
1021=back
1022
1023=head3 B<SKILL> - type 43 - Skills
1024
1025This type is basically for representing skills in the game.
1026
1027=over 4
1028
1029=item I<subtype> <skill number>
1030
1031=item I<skill> <string>
1032
1033The skill identifier used by other items, usually the skill name
1034
1035=item I<level> <percentage>
1036
1037not used?
1038
1039=item I<exp> <number>
1040
1041Base amount of experience in a skill, for skills not starting at zero.
1042
1043=item I<expmul> <float>
1044
1045Experience is multiplied by this factor.
940 1046
941=back 1047=back
942 1048
943=head3 B<DRINK> - type 54 - Drinkable stuff 1049=head3 B<DRINK> - type 54 - Drinkable stuff
944 1050
991=item I<race> <string> 1097=item I<race> <string>
992 1098
993If this field is set the inventory checker will search for an object which 1099If this field is set the inventory checker will search for an object which
994has the archetype name that matches <string>. 1100has the archetype name that matches <string>.
995 1101
996=item I<connected> <connection id> 1102=item I<connected> <identifier>
997 1103
998This is the connection that will be activated. The connection is 1104This is the connection that will be activated. The connection is
999'pushed' when someone enters the space with the inventory checker, 1105'pushed' when someone enters the space with the inventory checker,
1000and it is 'released' when he leaves it. 1106and it is 'released' when he leaves it.
1001 1107
1002See also the description of the I<connected> field in the generic object field 1108See also the description of the I<connected> field in the generic object
1003section. 1109field section.
1004 1110
1005=back 1111=back
1112
1113=head3 B<MOOD_FLOOR> - type 65 - change mood of monsters
1114
1115speed == 0 for triggered mood changes, speed != 0 for non-triggered mood
1116changes.
1117
1118 (based on value that last_sp takes):
1119 0: 'furious' Makes all monsters aggressive
1120 1: 'angry' As above but pets are unaffected
1121 2: 'calm' Makes all monsters unaggressive
1122 3: 'sleep' Puts all monsters to sleep
1123 4: 'charm' Makes monster into a pet of person
1124 who triggers the square. This setting
1125 is not enabled for continous operation
1126 5: 'destroy mons' destroy any monsters on this space
1127 6: 'destroy pets' destroy friendly monsters on this space
1006 1128
1007=head3 B<FLESH> - type 72 - Organs and body parts 1129=head3 B<FLESH> - type 72 - Organs and body parts
1008 1130
1009See B<FOOD> description. 1131See B<FOOD> description.
1010 1132
1011=head3 B<MISC_OBJECT> - type 79 - Misc. objects 1133=head3 B<MISC_OBJECT> - type 79 - Misc. objects
1012 1134
1013A type for any object that has no special behaviour. 1135A type for any object that has no special behaviour.
1014
1015=head3 B<LAMP> - type 82 - A lamp
1016
1017This object makes light.
1018 1136
1019=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators 1137=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators
1020 1138
1021This type of objects multiplies objects that are above it when it is activated. 1139This type of objects multiplies objects that are above it when it is activated.
1022You can even multiply by 0, which will destroy the object. 1140You can even multiply by 0, which will destroy the object.
1029 1147
1030=item I<other_arch> <string> 1148=item I<other_arch> <string>
1031 1149
1032The archetype name of the objects that should be multiplied. 1150The archetype name of the objects that should be multiplied.
1033 1151
1034=item I<connected> <number> 1152=item I<connected> <identifier>
1035 1153
1036See generic object field description. 1154See generic object field description.
1037 1155
1038=back 1156=back
1039 1157
1057when the connection is activated. This field only has effect when the 1175when 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 1176connection 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 1177connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the
1060connection was triggered once. 1178connection was triggered once.
1061 1179
1062=item I<connected> <connection id> 1180=item I<connected> <identifier>
1063 1181
1064This is the connection id, which lets the hole opening or closing when 1182This 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 1183activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control
1066at which connection state the object is activated. 1184at which connection state the object is activated.
1067 1185

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines