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.3 by elmex, Mon Dec 18 12:11:08 2006 UTC vs.
Revision 1.23 by root, Tue May 15 16:45:23 2007 UTC

7 7
8This documentation is in a sketchy state. It's mostly 8This documentation is in a sketchy state. It's mostly
9used to collect notes about the internal behaviour of the 9used to collect notes about the internal behaviour of the
10objects. 10objects.
11 11
12=head2 About the notation and terms
13
14The term 'archetype' stands for a collection of fields.
15The term 'object' stands for an archetype instance.
16The term 'field' is used for an object fields and archetype fields.
17
18Field names will be displayed like this: I<fieldname>
19
20Type names will be displayed like this: B<TYPENAME>
21
22Flag names will be displayer like this: FLAG_NAME
23
12=head2 About archetypes and objects 24=head2 About archetypes and objects
13 25
14Field denotes an attribute of an archetype. 26Archetypes are 'templates' of objects. If an object is derived
27from an archetype the object fields will be set to the corresponding
28fields in the archetype.
29
30When a map is instanciated (loaded), the 'object' description on the
31map are considered patches of the archetype.
32
33This document does explain the behaviour of the objects and the meaning of
34their fields in the server engine, which are derived from archetypes.
35
15This is an example of an archetype: 36This is an example of an archetype:
16 37
17 Object button_trigger 38 Object button_trigger
18 name button 39 name button
19 type 30 40 type 30
30 editable 48 51 editable 48
31 visibility 50 52 visibility 50
32 weight 1 53 weight 1
33 end 54 end
34 55
35This archetype has the name 'button_trigger' and the objects that 56The first B<field> is I<name>: 'button_trigger', which basically means that
36inherit from this archetype have the name 'button'. 57instances (objects) that are created/derived from this archetype have the
58name 'button' (which means that the field I<name> of the object will be set
59to the same value as the archetypes field I<name>).
37 60
38The next field 'type' decides the main behaviour of this archetype. 61The next field I<type> decides the behaviour of objects derived from this archetype.
39For a comprehensive list of types see include/define.h. For this case 62For a comprehensive list of types see include/define.h. For this case
40you might find a line like: 63you might find a line like:
41 64
42 #define TRIGGER_BUTTON        30 65 #define TRIGGER_BUTTON        30
43 66
44The server internally works with objects that 'inherit' attributes from 67The behaviour of objects is further determined by B<Flags>, like FLAG_APPLIED.
45an archetype. They have a similar set of attributes. 68For more information on this look in the Flags subsection in the next section
46 69
47The following documentation will also document the meaning of code internal 70The following documentation will also document the meaning of internal used
48attributes of objects. These attributes are marked as '(internal)' and can't 71fields of objects. These fields are marked as (internal) and can't
49or shouldn't be set by an archetype. If the internal names differs the 72or shouldn't be set by an archetype.
50external name (for the archetypes) for the attribute is written behind it.
51 73
52=head2 Description of generic archetype and object attributes 74=head2 Description of (mostly) generic object fields
53 75
54These are the fields that most of the objects have and/or their 76These are the fields that most of the objects have and/or their
55default behaviour. 77default behaviour.
56 78
57=over 4 79=over 4
58 80
59=item name <string> 81=item I<name> <string>
60 82
61The name of the object. 83The name of the object.
62 84
63=item name_pl <string> 85=item I<name_pl> <string>
64 86
65The name of a collection of these objects (the plural of the name). 87The name of a collection of these objects (the plural of the name).
66 88
67=item face <facename> 89=item I<face> <facename>
68 90
69The graphical appearance of this object. 91The graphical appearance of this object.
70 92
93=item I<x> <number>
94
95The x position of the object when it is on a map.
96
97=item I<y> <number>
98
99The y position of the object when it is on a map.
100
101=item I<map> (internal)
102
103The map the object is on.
104
71=item invisible <number> 105=item I<invisible> <number>
72 106
73If the <number> is greater than 0 the object is invisible. 107If the <number> is greater than 0 the object is invisible.
74For players this field reflects the duration of the invisibility 108For players this field reflects the duration of the invisibility
75and is decreased every tick by 1. 109and is decreased every tick by 1.
76 110
77For non-player objects this field is not changed by server ticks. 111For non-player objects this field is not changed by server ticks.
78 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).
117
79=item speed <numeric> 118=item I<speed> <number>
80 119
81If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed 120If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed
82on the active object list and will be processed each tick (see also speed_left!). 121on the active object list and will be processed each tick (see also speed_left!).
83 122
84If the speed field drops below the MIN_ACTIVE_SPEED the object is removed 123If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed
85from the active object list and it won't experience any processing per tick. 124from the active object list and it won't experience any processing per tick.
86 125
87=item speed_left <number> 126=item I<speed_left> <number>
88 127
89If this field is greater than 0 and the object is on the 128If this field is greater than 0 and the object is on the
90active list (mostly means it's speed is also greater than 0): 129active list (mostly means it's speed is also greater than 0):
91 130
92 - speed_left is decreased by 1 131 - speed_left is decreased by 1
93 - and this object is processed and experiences a server tick. 132 - and this object is processed and experiences a server tick.
94 133
95If the object is on the active list and speed_left is lower or 134If the object is on the active list and I<speed_left> is lower or
96equal to 0 the absolute value of the speed field is added to speed_left 135equal to 0 the absolute value of the I<speed> is added to I<speed_left>
97on the end of the tick. 136on the end of the tick.
98 137
138This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED)
139the more seldom the object is processed. And the higher I<speed> is
140the more often the object is processed.
141
142=item I<connected> <number>
143
144When this field is set the object will be linked to a connection with the
145id <number>. What happens when the connection is 'activated' depends on the
146type of the object.
147
148FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control
149when to activate the object, see description of these below for further details.
150
99=item no_drop (0|1) 151=item I<no_drop> (0|1)
100 152
101Sets the flag FLAG_NO_DROP. See the Flags section below. 153Sets the flag FLAG_NO_DROP.
154See Flags section below.
102 155
103=item applied (0|1) 156=item I<applied> (0|1)
104 157
105Sets the flag FLAG_APPLIED. See the Flags section below. 158Sets the flag FLAG_APPLIED.
159See Flags section below.
106 160
107=item is_used_up (0|1) 161=item I<is_used_up> (0|1)
108 162
109Sets the flag FLAG_IS_USED_UP. See Flags section below. 163Sets the flag FLAG_IS_USED_UP.
164See Flags section below.
110 165
166=item I<changing> (0|1)
167
168Sets the flag FLAG_CHANGING.
169See Flags section below.
170
171=item I<auto_apply> (0|1)
172
173Sets the flag FLAG_AUTO_APPLY.
174See Flags section below.
175
176=item I<no_steal> (0|1)
177
178Sets the flag FLAG_NO_STEAL.
179See Flags section below.
180
181=item I<reflecting> (0|1)
182
183Sets the flag FLAG_REFLECTING.
184See Flags section below.
185
186=item I<reflect_spell> (0|1)
187
188Sets the flag FLAG_REFL_SPELL.
189See Flags section below.
190
191=item I<no_skill_ident> (0|1)
192
193Sets the flag FLAG_NO_SKILL_IDENT.
194See Flags section below.
195
196=item I<activate_on_push> (0|1) (default: 1)
197
198Sets the flag FLAG_ACTIVATE_ON_PUSH.
199See Flags section below.
200
201=item I<activate_on_release> (0|1) (default: 1)
202
203Sets the flag FLAG_ACTIVATE_ON_RELEASE.
204See Flags section below.
205
206=item I<is_lightable> (0|1)
207
208Sets the flag FLAG_IS_LIGHTABLE.
209See Flags section below.
210
111=item editable (more than deprecated) 211=item I<editable> (more than deprecated)
112 212
113This field had a special meaning for crossedit, which used parts 213This field had a special meaning for crossedit, which used parts
114of the server code for editing. Wherever you see this attribute being 214of the server code for editing. Wherever you see this field being
115set in an archetype ignore it and/or remove it. No code interprets this 215set in an archetype ignore it and/or remove it. No code interprets this
116field anymore. 216field anymore.
117 217
118=back 218=back
119 219
131 231
132This flag mostly states whether this object has been 'applied' by the player. 232This flag mostly states whether this object has been 'applied' by the player.
133For objects that are applied by the code or have this flag set in the archetype 233For objects that are applied by the code or have this flag set in the archetype
134it mostly means 'this object is active'. 234it mostly means 'this object is active'.
135 235
136For example the player adjustments of the hp/sp/grace fields and inheritance 236For example the player adjustments of the I<hp>/I<sp>/I<grace> fields and inheritance
137of flags from objects in his inventory is toggled by this flag. 237of flags from objects in his inventory is toggled by this flag.
138 238
139=item FLAG_IS_USED_UP 239=item FLAG_IS_USED_UP
140 240
141This flag controls whether an object is 'used up'. If it is set the 'food' field 241This flag controls whether an object is 'used up'. If it is set I<food>
142of the object is decreased by 1 each tick, and if it is lower or equal 0 after tha 242is decreased by 1 each tick, and will be removed when I<food> is lower or equal 0.
143it is removed.
144 243
145If also the flag FLAG_APPLIED is set, the 'duration' field controls whether 244If also the flag FLAG_APPLIED is set, the I<duration> field controls whether
146this object is removed or not, see the Force type below for the meaning 245this object is removed or not, see the B<FORCE> type below for the meaning
147of the duration field in this context. 246of the duration field in this context.
148 247
149If FLAG_APPLIED is not set the object is destroyed. 248If FLAG_APPLIED is not set the object is destroyed.
150 249
151=back 250=item FLAG_CHANGING
152 251
153=head2 Description of type specific attributes 252If the I<state> field of the object is 0 the object will be processed periodically
253(if I<speed> is set). If the I<state> field is 1 it won't be processed.
254
255This flag indicates that the object is changing into a different object.
256The object has to have the I<other_arch> field set. The object the changing object
257changes into is derived from the archetype in I<other_arch>.
258
259When the object does not have FLAG_ALIVE set the I<food> field will be decremented
260each time the object is processed, and if I<food> reaches 0 one new object will be generated.
261
262When the object has FLAG_ALIVE set the I<food> field is the number of objects that
263will be generated.
264
265After the new object is created the I<hp> field from the old object is copied into
266the new one.
267
268When the old object was a B<LAMP> it's I<food> fields value less 1 will be copied
269to the new object.
270
271=item FLAG_IS_A_TEMPLATE (internal use)
272
273This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s,
274or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set.
275
276=item FLAG_AUTO_APPLY
277
278This flag has currently only meaning for the B<TREASURE> type, see below.
279
280=item FLAG_ACTIVATE_ON_PUSH
281
282This flag has only meaning for objects that can be linked together
283by the I<connected> field and controls wether the object should
284be activated when the connection is 'pushed' or it is 'released'.
285
286What 'pushed' and 'released' means depends on the object that
287activates the connection.
288
289This flag is by default on.
290
291=item FLAG_ACTIVATE_ON_RELEASE
292
293This flag has only meaning for objects that can be linked together
294by the I<connected> field and controls wether the object should
295be activated when the connection is 'pushed' or it is 'released'.
296
297What 'pushed' and 'released' means depends on the object that
298activates the connection.
299
300This flag is by default on.
301
302=item FLAG_NO_STEAL
303
304When this flag is set this object can't be stolen. The flag will be
305resetted once the object is placed on a map.
306
307When this flag is set on a monster it can defent attempts of stealing
308(but in this context the flag is only used internally).
309
310=item FLAG_NO_SKILL_IDENT
311
312This flag is mostly used internal and prevents unidentified objects
313(objects which don't have FLAG_IDENTIFIED set) being identified
314multiple times by skills.
315
316This flag is used to mark objects which were unsuccessfully identified by a
317players skill. So that multiple tries of identifying aren't more effective than
318one.
319
320=item FLAG_REFLECTING
321
322This flag is used by spell effects (eg. SP_BOLT), B<THROWN_OBJ> and B<ARROW>
323to indicate whether this object reflects off walls.
324
325=item FLAG_REFL_SPELL
326
327This flag indicates whether something reflects spells, like spell reflecting
328amuletts.
329
330=item FLAG_IS_LIGHTABLE
331
332This flag indicates whether a B<LIGHTER> can light this object. See also the
333description of the B<LIGHTER> type. How easy you can light an item depends
334partially on the material of the object.
335
336=back
337
338=head2 Description of type specific fields and behaviour
154 339
155The beginning of the headers of the following subsection 340The beginning of the headers of the following subsection
156are the server internal names for the objects types, see include/define.h. 341are the server internal names for the objects types, see include/define.h.
157The numeric values are maybe not 100% accurate, as the code is a changing
158target, please consult include/define.h in doubt :-)
159 342
343=head3 B<MOOD_FLOOR> - type 65 - change mood of monsters
344
345speed == 0 for triggered mood changes, speed != 0 for non-triggered mood
346changes.
347
348 (based on value that last_sp takes):
349 0: 'furious' Makes all monsters aggressive
350 1: 'angry' As above but pets are unaffected
351 2: 'calm' Makes all monsters unaggressive
352 3: 'sleep' Puts all monsters to sleep
353 4: 'charm' Makes monster into a pet of person
354 who triggers the square. This setting
355 is not enabled for continous operation
356 5: 'destroy mons' destroy any monsters on this space
357 6: 'destroy pets' destroy friendly monsters on this space
358
359=head3 B<TRANSPORT> - type 2 - Player transports
360
361This type is implemented by the transport extension and has currently no special
362fields that affect it.
363
364=head3 B<ROD>, B<HORN> - type 3, 35 - Rods that fire spells
365
366Rods contain spells and can be fired by a player.
367
368=over 4
369
370=item I<level> <number>
371
372This field is used for calculating the spell level that can be fired
373with this rod, it's also the maximum level of the spell that can be fired.
374The level of the spell that is being fired depends mostly on
375the 'use magic item' skill level of the player and 1/10 of the level of the
376rod is added as bonus.
377
378=item I<hp> <number>
379
380The amount of spellpoints this rod has left. Recharges at a rate of C<1 +
381maxhp/10> per tick.
382
383=item I<maxhp> <number>
384
385The maximum amount of spellpoints this rod has.
386
387=item I<skill> <skill name>
388
389This field determines which skill you need to apply this object.
390
391=back
392
393=head3 B<TREASURE> - type 4 - Treasures
394
395This type of objects are for random treasure generation in maps.
396If this object is applied by a player it will replace itself with it's
397inventory. If it is automatically applied
398generate a treasure and replace itself with the generated treasure.
399
400Chests are also of this type, their treasures are generated by
401the auto apply code on map instantiation.
402
403=over 4
404
405=item I<hp> <number>
406
407The number of treasures to generate.
408
409=item I<exp> <level>
410
411If FLAG_AUTO_APPLY is not set the exp field has no further meaning
412and the difficulty for the treasurecode only depends on the maps difficulty,
413otherwise the exp field has the following meaning:
414
415If this field is not 0 it is passed as the difficulty
416to the treasure generation code to determine how good, how much
417worth a treasure is or what bonuses it is given by the treasure code.
418
419If this field is not set or 0 the difficulty of the map is passed to the treasure
420generation code.
421
422=item I<randomitems> <treasurelist>
423
424The treasurelist to use to generate the treasure which is put in the
425treasure objects inventory.
426
427=back
428
429=head3 B<POTION> - type 5 - Potions for drinking and other nastynesses
430
431These objects contain a spell and will emit it on apply, which most
432of the time has the meaning of 'drinking'.
433
434If no resistancy field, stat field or attacktype is set and no spell
435is put in the potion by the sp field or the randomitems the
436potion will become an artifact and the artifact code decides which kind
437of potion will be generated.
438
439If the potion has FLAG_CURSED or FLAG_DAMNED set the usage of this potion
440will yield an explosion and hurt the player.
441
442=over 4
443
444=item I<Str>, I<Dex>, I<Con>, I<Int>, I<Wis>, I<Cha>, I<Pow> <number>
445
446These stat fields determine how many stat points the player gets
447when he applies this potion.
448
449If FLAG_CURSED or FLAG_DAMNED is set the player will loose that many stat points.
450
451=item I<sp> <number>
452
453If this field is set and the randomitems field is not set
454the field is interpreted as spell number, please look the right
455number up in common/loader.C.
456
457If this field is set the randomitems field will be unset by the
458map loading code.
459
460=item I<attacktype> <attacktype>
461
462This field has some special meaning in potions, currently the
463bits for AT_DEPLETE and AT_GODPOWER control whethere this is a
464restoration potion or improvement potion.
465See include/attackinc.h for the bits of these types.
466
467If AT_DEPLETE is set the player will be restored and the ARCH_DEPLETION
468will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED
469set the player will be drained a random stat by inserting an ARCH_DEPLETION
470into him.
471
472If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat.
473When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats.
474
475=item I<resist_RESISTANCY> <number>
476
477If this stat is set and no spell is in the potion the potion
478will create a force that give the player this specific resistancy.
479The forces type will be changed to POTION_EFFECT (see POTION_EFFECT type below)
480and the potion will last 10 times longer than the default force archetype
481FORCE_NAME (at the moment of this writing spell/force.arc).
482
483=item I<randomitems> <treasurelist>
484
485The inventory/spell of the potion will be created by calling the treasure code
486with the treasurelist specified here. (I guess it's highly undefined what
487happens if there is not a spell in the potions inventory).
488
489=item I<on_use_yield> <archetype>
490
491When this object is applied an instance of <archetype> will be created.
492
493=item I<subtypes> <potion subtype>
494
495see include/spells.h for possible potion subtypes, there are currently 4:
496
497=over 4
498
499=item POT_SPELL
500
501Unused, default behaiour of a potion.
502
503=item POT_DUST
504
505This potion can be thrown to cast the spell that it has in it's inventory,
506the behaviour is not defined if there is not a B<SPELL> in the inventory and the
507server will log an error.
508
509=item POT_FIGURINE
510
511Unused, default behaiour of a potion.
512
513=item POT_BALM
514
515Unused, default behaiour of a potion.
516
517=back
518
519=back
520
521=head3 B<FOOD> - type 6 - Eatable stuff
522
523This is for objects that are representing general eatables like
524beef or bread.
525
526The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they
527give different messages.
528
529The specialty of B<FLESH> is that it inherits the resistancies of the
530monsters it was generated in and will let dragons raise their resistancies
531with that. If the monster has the B<POISON> attacktype the B<FLESH>
532will change into B<POISON>.
533
534If a player runs low on food he will grab for B<FOOD>, B<DRINK> and B<POISON>
535and if he doesn't find any of that he will start eating B<FLESH>.
536
537=over 4
538
539=item I<title> <string>
540
541If the food has B<title> set or is cursed it is considered 'special', which
542means that the fields I<Str>, I<Dex>, I<Con>, I<Int>, I<Wis>, I<Pow>,
543I<resist_RESISTANCY>, I<hp> and I<sp> are interpreted and have further effects
544on the player.
545
546The higher the I<food> field is the longer the improvement of the player lasts
547(except for I<hp> and I<sp>).
548
549=item I<food> <number>
550
551This is the amount of food points the player gets when he eats this.
552
553=item I<on_use_yield> <archetype>
554
555When this object is applied an instance of <archetype> will be created.
556
557=back
558
559=head3 B<POISON> - type 7 - Poisonous stuff
560
561This type is for objects that can poison the player when he drinks/applies it.
562When applied it will hit the attacked with AT_POISON and will create
563a B<POISONING> object in the one who was hit.
564
565=over 4
566
567=item I<level> <number>
568
569This field affects the propability of poisoning. The higher the level difference
570between the one who is hit and the poision the more propable it is the attacked
571one will be poisoned.
572
573=item I<slaying> <race>
574
575This field has the usual meaning of 'slaying', when the
576poisoned's race matches the I<slaying> field the damage done by the poison
577is multiplied by 3.
578
579=item I<hp> <number>
580
581This is the amount of damage the player will receive from applying this. The
582attacktype AT_POISON will be used to hit the player and the damage will
583determine the strenght, duration and depletion of stats of the poisoning. The
584created B<POISONING> object which is being placed in the one who was attacked will
585get the damage from this field (which is maybe adjusted by slaying or the
586resistancies).
587
588=item I<food> <number>
589
5901/4 of <number> will be drained from the players I<food>.
591
592=item I<on_use_yield> <archetype>
593
594When this object is applied an instance of <archetype> will be created.
595
596=back
597
598=head3 B<BOOK> - type 8 - Readable books
599
600This type is basically for representing text books in the game.
601
602Reading a book also identifys it (if FLAG_NO_SKILL_IDENT is not set).
603
604=over 4
605
606=item I<msg> <text>
607
608This is the contents of the book. When this field is unset
609at treasure generation a random text will be inserted.
610
611=item I<skill> <skill name>
612
613The skill required to read this book. (The most resonable
614skill would be literacy).
615
616=item I<exp> <number>
617
618The experience points the player get for reading this book.
619
620=item I<subtype> <readable subtype>
621
622This field determines the type of the readable.
623Please see common/readable.C in the readable_message_types table.
624
625=back
626
627=head3 B<CLOCK> - type 9 - Clocks
628
629This type of objects just display the time when being applied.
630
631=head3 B<LIGHTNING> - type 12 - Lightnings (DEPRECATED: see B<SPELL_EFFECT> subtype SP_BOLT)
632
633This is a spell effect of a moving bolt. It moves straigt forward
634through the map until something blocks it.
635If FLAG_REFLECTING is set it even reflects on walls.
636
637FLAG_IS_TURNABLE should be set on these objects.
638
639=over 4
640
641=item I<move_type> <movetype>
642
643This field affects the move type with which the lightning moves through
644the map and which map cells will reflect or block it.
645
646=item I<attacktype> <attacktype>
647
648The attacktype with which it hits the objects on the map.
649
650=item I<dam> <number>
651
652The damage this bolt inflicts when it hits objects on the map.
653
654=item I<Dex> <number>
655
656This is the fork percentage, it is reduced by 10 per fork.
657And the I<dam> field is halved on each fork.
658
659=item I<Con> (internal)
660
661This value is a percentage of which the forking lightning
662is deflected to the left. This value should be mostly used internally.
663
664=item I<duration> <number>
665
666The duration the bolt stays on a map cell. This field is decreased each time
667the object is processed (see the meaning of I<speed> and I<speed_left> fields in
668the generic object field description).
669
670=item I<range> <number>
671
672This is the range of the bolt, each space it advances this field is decreased.
673
674=back
675
676=head3 B<ARROW> - type 13 - Arrows
677
678This is the type for objects that represent projectiles like arrows.
679The movement of B<THROWN_OBJ>s behave similar to this type.
680
681Flying arrows are stopped either when they hit something blocking
682(I<move_block>) or something which is alive.
683If it hits something that is alive, which doesn't have FLAG_REFL_MISSILE
684set, it will inflict damage. If FLAG_REFL_MISSILE is set it will inflict
685damage with a small chance which is affected by the I<level> field of the arrow.
686
687If FLAG_REFLECTING is set on the arrow it will bounce off everything
688that is not alive and blocks it's movement.
689
690When an arrow is being shot it's I<dam>, I<wc>, I<attacktype>, I<slaying>
691fields will be saved in the I<sp>, I<hp>, I<grace> and I<spellarg> fields of
692the object, to restore them once the arrow has been stopped.
693
694=over 4
695
696=item I<dam> <number>
697
698The amount of damage that is being done to the victim that gets hit.
699This field is recomputed when the arrow is fired and will consist
700of the sum of a damage bonus (see description of the B<BOW> type),
701the arrows I<dam> field, the bows I<dam> field, the bows I<magic> field
702and the arrows I<magic> field.
703
704=item I<wc> <number>
705
706The weapon class of the arrow, which has effect on the propability of hitting.
707
708It is recomputed when the arrow is being fired by this formula:
709
710 wc = 20 - bow->magic - arrow->magic - (skill->level or shooter->level)
711 - dex_bonus - thaco_bonus - arrow->stats.wc - bow->stats.wc + wc_mod
712
713When the arrow is not being shot by an player dex_bonus and thaco_bonus and the
714level is not added.
715
716wc_mod is dependend on the fire mode of the bow. For a more detailed
717explanation of dex_bonus, thaco_bonus and wc_mod please consult the code.
718
719=item I<magic> <number>
720
721This field is added to the damage of the arrow when it is shot and
722will also improve it's I<speed> by 1/5 of it's value.
723
724=item I<attacktype> <attacktype>
725
726Bitfield which decides the attacktype of the damage, see include/attackinc.h
727On fireing the I<attacktype> of the bow is added to the arrows I<attacktype>.
728
729=item I<level> <number> (interally used)
730
731The level of the arrow, this affects the propability of piercing FLAG_REFL_MISSILE,
732see above in the B<ARROW> description.
733
734The I<level> is set when the arrow is fired to either the skill level or the
735shooters level.
736
737=item I<speed> <number> (internal)
738
739This field shouldn't be set directly in the archetype, the arrow will get it's
740I<speed> from the bow. This fields value has to be at least 0.5 or otherwise the
741arrow will be stopped immediatly.
742
743On fireing the I<speed> of the arrow is computed of 1/5 of the
744sum of the damage bonus (see BOW), bow I<magic> and arrow I<magic>. After that 1/7
745of the bows I<dam> field is added to the I<speed> of the arrow.
746
747The minimum I<speed> of an arrow is 1.0.
748
749While flying the arrows I<speed> is decreased by 0.05 each time it's moved.
750
751If the I<speed> is above 10.0 it goes straight through the creature it hits and
752it's I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is
753stopped and either sticked into the victim (see I<weight> field description) or
754put on it's map square (if it didn't break, see description of the I<food> field).
755
756=item I<weight> <number>
757
758This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg)
759the arrow will stick in the victim it hits. Otherwise it will fall to the ground.
760
761=item I<food> <number>
762
763The breaking percentage. 100 (%) means: breaks on usage for sure.
764
765=item I<inventory> (internal)
766
767If the flying/moving object has something in it's inventory and it stops, it
768will be replaced with it's inventory. Otherwise it will be handled as usual,
769which means: it will be calculated whether the arrow breaks and it will be
770reset for reuse.
771
772=item I<slaying> <string>
773
774When the bow that fires this arrow has it's I<slaying> field set it is copied
775to the arrows I<slaying> field. Otherwise the arrows I<slaying> field remains.
776
777=item I<move_type> <movetype> (internally used)
778
779This field is set when the arrow is shot to MOVE_FLY_LOW.
780
781=item I<move_on> <movetype> (internally used)
782
783This field is set when the arrow is shot to MOVE_FLY_LOW and MOVE_WALK.
784
785=item I<race> <string>
786
787The I<race> field is a unique key that assigns arrows, bows and quivers. When
788shooting an arrow the bows I<race> is used to search for arrows (which have the
789same I<race> as the bow) in the players inventory and will recursively search in
790the containers (which are applied and have the same I<race> as the bow and the arrow).
791
792=back
793
794=head3 B<BOW> - type 14 - Bows, those that fire B<ARROW>s
795
796TODO, but take into account B<ARROW> description above!
797
798=head3 B<WEAPON> - type 15 - Weapons
799
800This type is for general hack and slash weapons like swords, maces
801and daggers and and ....
802
803=over 4
804
805=item I<weapontype> <type id>
806
807decides what attackmessages are generated, see include/define.h
808
809=item I<attacktype> <bitmask>
810
811bitfield which decides the attacktype of the damage, see include/attackinc.h
812
813=item I<dam> <number>
814
815amount of damage being done with the attacktype
816
817=item I<item_power> <level>
818
819the itempower of this weapon.
820
821=item I<name>
822
823the name of the weapon.
824
825=item I<level> (internal)
826
827The improvement state of the weapon.
828If this field is greater than 0 the I<name> field starts with the
829characters name who improved this weapon.
830
831=item I<last_eat> (internal)
832
833This seems to be the amount of improvements of a weapon,
834the formular for equipping a weapon seems to be (server/apply.C:check_weapon_power):
835
836 ((who->level / 5) + 5) >= op->last_eat
837
838=item I<last_sp>
839
840the weapon speed (see magic description)
841
842=item I<food> <number>
843
844addition to food regeneration of the player
845
846=item I<hp> <number>
847
848addition to health regeneration
849
850=item I<sp> <number>
851
852addition to mana regeneration
853
854=item I<grace> <number>
855
856addititon to grace regeneration
857
858=item I<gen_sp_armour> <number>
859
860the players I<gen_sp_armour> field (which is per default 10) is being added the
861<number> amount. gen_sp_armour seems to be a factor with which gen_sp in
862do_some_living() is multiplied: gen_sp *= 10/<number> meaning: values > 10 of
863I<gen_sp_armour> limits the amout of regenerated spellpoints.
864
865Generally this field on weapons is in ranges of 1-30 and decides the slowdown of the
866I<sp> regeneration.
867
868=item I<body_BODYSLOT>
869
870The part/slot of the body you need to use this weapon, possible values for
871C<BODYSLOT> should be looked up in common/item.C at body_locations.
872
873The value (in the range C<-7..7>) gives the number of those body slots
874used up by the item (if negative) or the number of body slots this object
875has (if positive, e.g. for monsters or players). The special value C<0>
876indicates that this object cannot equip items requiring these body slots.
877
878=item I<resist_RESISTANCY> <number>
879
880this is the factor with which the difference of the players resistancy and 100%
881is multiplied, something like this:
882
883 additional_resistancy = (100 - current_resistancy) * (<number>/100)
884
885if <number> is negative it is added to the total vulnerabilities,
886and later the total resistance is decided by:
887
888 'total resistance = total protections - total vulnerabilities'
889
890see also common/living.C:fix_player.
891
892=item I<path_(attuned|repelled|denied)>
893
894this field modifies the pathes the player is attuned to, see include/spells.h PATH_*
895for the pathes.
896
897=item I<luck> <number>
898
899this luck is added to the players I<luck>
900
901=item I<move_type>
902
903if the weapon has a I<move_type> set the player inherits it's I<move_type>
904
905=item I<exp> <number>
906
907the added_speed and bonus_speed of the player is raised by <number>/3.
908if <number> < 0 then the added_speed is decreased by <number>
909
910=item I<weight>
911
912the weight of the weapon
913
914=item I<magic>
915
916the I<magic> field affects the amounts of the following fields:
917
918 - wc : the players wc is adjusted by: player->wc -= (wc + magic)
919
920 - ac : the players ac is lowered by (ac + magic) if (player->ac + magic) > 0
921
922 - dam: the players dam is adjusted by: player->dam += (dam + magic)
923
924 - weapon speed (last_sp): weapon_speed is calculated by: (last_sp * 2 - magic) / 2
925 (minium is 0)
926
927=item I<ac> <number>
928
929the amount of ac points the player's I<ac> is decreased when applying this object.
930
931=item I<wc> <number>
932
933the amount of wc points the player's I<wc> is decreased when applying this object.
934
935=back
936
937=head4 Player inherits following flags from weapons:
938
939 FLAG_LIFESAVE
940 FLAG_REFL_SPELL
941 FLAG_REFL_MISSILE
942 FLAG_STEALTH
943 FLAG_XRAYS
944 FLAG_BLIND
945 FLAG_SEE_IN_DARK
946 FLAG_UNDEAD
947
948=head3 B<GRIMREAPER> - type 28 - Grimreapers
949
950These type are mostly used for monsters, they give the
951monster the ability to dissapear after 10 hits with AT_DRAIN.
952
953=over 4
954
955=item I<value> <number>
956
957This field stores the hits the monster did yet.
958
959=back
960
961=head3 B<CREATOR> - type 42 - Object creators
962
963Once a creator is activated by a connection it creates a number of objects
964(cloned from it's inventory or a new object derived from the archetype
965named in the other_arch slot).
966
967If FLAG_LIVESAFE is set the number of uses is unlimited.
968
969=over 4
970
971=item I<hp> <number>
972
973If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can
974be used.
975
976=item I<speed> <number>
977
978If I<speed> is set the creator will create an object periodically,
979see I<speed> and I<speed_left> fields in the general object field description
980for more details.
981
982=item I<slaying> <string>
983
984If set the generated object's name and title will be set to this.
985
986=item I<other_arch> <string>
987
988If the inventory of the creator is empty new objects will be derived from the
989archetype named by <string>.
990
991=item I<connected> <number>
992
993See generic object field description.
994
995=back
996
997=head3 B<DRINK> - type 54 - Drinkable stuff
998
999See B<FOOD> description.
1000
1001=head3 B<CHECK_INV> - type 64 - Inventory checkers
1002
1003This object checks whether the player has a specific item in his
1004inventory when he moves above the inventory checker. If the player has
1005the item (or not, which can be controlled with a flag) a connection will be triggered.
1006
1007If you set I<move_block> you can deny players and monsters to reach the space where
1008the inventory checker is on, see I<move_block> description below.
1009
1010The conditions specified by I<hp>, I<slaying> and I<race> are OR concationated.
1011So matching one of those conditions is enough.
1012
1013=over 4
1014
1015=item I<move_block> <move type bitmask>
1016
1017If you set this field to block a movetype the move code will block any moves
1018onto the space with the inventory checker, IF the moving object doesn't have
1019(or has - if I<last_sp> = 0) the item that the checker is searching for.
1020
1021=item I<last_sp> (0|1)
1022
1023If I<last_sp> is 1 'having' the item that is being checked for will
1024activate the connection or make the space with the checker non-blocking.
1025If I<last_sp> is 0 'not having' the item will activate the connection
1026or make the space with the checker non-blocking.
1027
1028=item I<last_heal> (0|1)
1029
1030If I<last_heal> is 1 the matching item will be removed if the inventory checker
1031activates a connection and finds the item in the inventory.
1032
1033(A inventory checker that blocks a space won't remove anything from inventories)
1034
1035=item I<hp> <number>
1036
1037If this field is not 0 the inventory checker will search for an object
1038with the type id <number>.
1039
1040=item I<slaying> <string>
1041
1042If this field is set the inventory checker will search for an object that
1043has the same string in the I<slaying> field (for example a key string of a key).
1044
1045=item I<race> <string>
1046
1047If this field is set the inventory checker will search for an object which
1048has the archetype name that matches <string>.
1049
1050=item I<connected> <connection id>
1051
1052This is the connection that will be activated. The connection is
1053'pushed' when someone enters the space with the inventory checker,
1054and it is 'released' when he leaves it.
1055
1056See also the description of the I<connected> field in the generic object field
1057section.
1058
1059=back
1060
1061=head3 B<FLESH> - type 72 - Organs and body parts
1062
1063See B<FOOD> description.
1064
1065=head3 B<MISC_OBJECT> - type 79 - Misc. objects
1066
1067A type for any object that has no special behaviour.
1068
1069=head3 B<LAMP> - type 82 - A lamp
1070
1071This object represents a lamp, that can be carried and switched
1072on and off and has a certain amount of fuel in it.
1073
1074A lamp consists of two archetypes: the 'on' archetype and the 'off' archetype.
1075Each of them should point at the other one with it's I<other_arch> field.
1076
1077See the I<other_arch> field for the behaviour of a lamp object when it is applied.
1078
1079If this object has FLAG_IS_LIGHTABLE set the lamp can be turned on and off
1080with a B<LIGHTER>, see also the description of FLAG_IS_LIGHTABLE.
1081
1082=over 4
1083
1084=item I<glow_radius> <number>
1085
1086The radius of the light that the lamp emits, see also I<glow_radius> in the
1087generic object flags description.
1088
1089=item I<speed> <number>
1090
1091If FLAG_CHANGING is set the I<speed> field will indicate how fast the
1092lamp burns it's fuel (I<food>).
1093
1094Setting FLAG_CHANGING makes only sense on the archetype which represents
1095the 'on' state of the lamp.
1096
1097See also the description of FLAG_CHANGING.
1098
1099Lamps which have no FLAG_CHANGING set would also make sense and represent
1100lamps that never burn up.
1101
1102=item I<other_arch> <number>
1103
1104This is the field that points to the 'other' archetype which represents the
1105opposite state of the lamp. The newly from I<other_arch> derived object will
1106replace the current object and will get the value of I<food> of the replaced object.
1107
1108Rationale:
1109
1110When the lamp (on) is applied a new object is derived from the archetype
1111in I<other_arch> and the I<food> value is copied to it ('the fuel is
1112transferred'). The new lamp (off) object has to have a I<other_arch> field
1113which points to the archetype from which a lamp (on) can be derived.
1114
1115=item I<food> <number>
1116
1117This fields stands for the fuel of the lamp.
1118
1119=back
1120
1121=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators
1122
1123This type of objects multiplies objects that are above it when it is activated.
1124You can even multiply by 0, which will destroy the object.
1125
1126=over 4
1127
1128=item I<level> <number>
1129
1130The multiplicator, if set to 0 or lower it will destroy the objects above it.
1131
1132=item I<other_arch> <string>
1133
1134The archetype name of the objects that should be multiplied.
1135
1136=item I<connected> <number>
1137
1138See generic object field description.
1139
1140=back
1141
1142=head3 B<HOLE> - type 94 - Holes
1143
1144B<HOLE>s are holes in the ground where objects can fall through. When the hole
1145opens and/or is completly open all objects above it fall through (more
1146precisely: if their head is above the hole).
1147
1148When the B<HOLE> is activated it's speed is set to 0.5.
1149
1150These holes can only transfer the one who falls through to other coordinates
1151on the same map.
1152
1153=over 4
1154
1155=item I<maxsp> (0|1)
1156
1157This field negates the state of the connection: When maxsp is 1 the pit will
1158open/close when the connection is deactivated. Otherwise it will open/close
1159when the connection is activated. This field only has effect when the
1160connection is triggered. So if you put a closed hole on a map, and the
1161connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the
1162connection was triggered once.
1163
1164=item I<connected> <connection id>
1165
1166This is the connection id, which lets the hole opening or closing when
1167activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control
1168at which connection state the object is activated.
1169
1170For example: if FLAG_ACTIVATE_ON_RELEASE is set to 0 the hole won't react when
1171the connection is released.
1172
1173=item I<wc> <number> (internal)
1174
1175This is an internal field. If it is greater than 0 it means that the hole is not
1176yet fully open. More preciesly: this field is the animation-step and if it is
1177set to the 'closed' step of the animation the hole is closed and if it is on
1178the 'open' animation step (I<wc> = 0), the hole is open.
1179
1180=item I<sp> <number>
1181
1182The destination y coordinates on the same map.
1183
1184=item I<hp> <number>
1185
1186The destination x coordinates on the same map.
1187
1188=back
1189
1190=head3 B<POISONING> - type 105 - The poisoning of players and monsters
1191
1192This type is doing the actual damage to the ones who were attacked
1193via AT_POISON (or drank B<POISON>).
1194
1195The duration is handled via the FLAG_IS_USED_UP mechanism (please look
1196there for details).
1197
1198=over 4
1199
1200=item I<dam> <number>
1201
1202Each time the poisoning is proccessed (which is determined by the I<speed> and
1203I<speed_left> fields, see the general object fields description above) it hits
1204the player with <number> damage and the AT_INTERNAL attacktype (means: it will
1205simply hit the player with no strings attached).
1206
1207=item I<food> <number>
1208
1209Just a note: The posioning is removed if I<food> == 1 and not if
1210the whole I<duration> is up, because the B<POISONING> code has to remove
1211the poison-effects from the player before the FLAG_IS_USED_UP mechanism
1212deletes the B<POISONING> object.
1213
1214=back
1215
160=head3 FORCE - type 114 - Forces 1216=head3 B<FORCE> - type 114 - Forces
161 1217
162Forces are a very 'thin' type. They don't have much behaviour other than 1218Forces are a very 'thin' type. They don't have much behaviour other than
163disappearing after a time and/or affecting the player if they are in his inventory. 1219disappearing after a time and/or affecting the player if they are in his
1220inventory.
164 1221
165Forces only take effect on the player if they have set FLAG_APPLIED. 1222Forces only take effect on the player if they have FLAG_APPLIED set.
166 1223
167Whether the duration field is processed or not a tick is controlled via the 1224Whether the I<duration> field is processed or not per tick is controlled by the
168speed and speed_left field. Look above at the generic description of these 1225I<speed> and I<speed_left> fields. Look above in the generic object field description.
169fields.
170 1226
171=over 4 1227NOTE: If FLAG_IS_USED_UP is set on a B<FORCE> it's I<food> field will also
1228interpreter like described in the description of the FLAG_IS_USED_UP flag.
1229BUT: If I<food> reaches 0 before I<duration> and FLAG_APPLIED is set, the force
1230will still last for I<duration>. If the FLAG_APPLIED is not set the force is
1231removed when I<food> reaches 0. Generally this means: FLAG_IS_USED_UP doesn't
1232have good semantics on forces, try to avoid it.
172 1233
1234=over 4
1235
173=item duration 1236=item I<duration>
174 1237
175While this field is greater than 0 the force/object is not destroyed. 1238While this field is greater than 0 the force/object is not destroyed. It is
176It is decreased each tick by 1. 1239decreased each tick by 1.
177 1240
178If it reaches 0 the force/object is destroyed. 1241If it reaches 0 the force/object is destroyed.
179 1242
180This field can have this meaning for B<any> object if that object has 1243This field can have this meaning for B<any> object if that object has
181FLAG_IS_USED_UP and FLAG_APPLIED set. See the description of FLAG_IS_USED_UP 1244FLAG_IS_USED_UP and FLAG_APPLIED set. See the description of FLAG_IS_USED_UP
182what happens then. 1245what happens then.
183 1246
184=back 1247=back
185 1248
186=head3 WEAPON - type 15 - Weapons 1249=head3 B<POTION_EFFECT> - type 115 - Potion effects (resistancies)
187 1250
188This type is for general hack and slash weapons like swords, maces 1251This object is generated by the B<POTION> code when the potion is a resistance
189and daggers and and .... 1252giving potion. It has mainly the same behaviour as a B<FORCE>.
190 1253
191=over 4 1254The specialty of the potion effect is that the resistancy it gives is absolute,
1255so if you drink a resistancy potion of fire+60 you will get 60% absolute resistancy to
1256fire.
192 1257
193=item weapontype <type id> 1258Multiple potion effects only give you the maximum of their resistancy.
194
195decides what attackmessages are generated, see include/define.h
196
197=item attacktype <bitmask>
198
199bitfield which decides the attacktype of the damage, see include/attackinc.h
200
201=item dam <number>
202
203amount of damage being done with the attacktype
204
205=item item_power <level>
206
207the itempower of this weapon.
208
209=item name
210
211the name of the weapon.
212
213=item level (internal)
214
215The improvement state of the weapon.
216If this field is greater than 0 the 'name' field starts with the
217characters name who improved this weapon.
218
219=item last_eat (internal)
220
221seems to be the amount of improvements of a weapon,
222the formular for equipping a weapon seems to be (server/apply.C:check_weapon_power):
223
224 ((who->level / 5) + 5) >= op->last_eat
225
226=item last_sp
227
228the weapon speed (see magic description)
229
230=item food <number>
231
232addition to food regeneration of the player
233
234=item hp <number>
235
236addition to health regeneration
237
238=item sp <number>
239
240addition to mana regeneration
241
242=item grace <number>
243
244addititon to grace regeneration
245
246=item gen_sp_armour <number>
247
248the players gen_sp_armour field (which is per default 10) is added the <number> amount.
249gen_sp_armour seems to be a factor with which gen_sp in do_some_living()
250is multiplied: gen_sp *= 10/<number>
251meaning: values > 10 of gen_sp_armour limits the amout of regenerated
252spellpoints.
253
254generally this field on weapons is in ranges of 1-30 and decides the slowdown of the
255sp regeneration.
256
257=item body_<body slot/part>
258
259the part of the body you need to use this weapon, possible values should be
260looked up in common/item.C at body_locations.
261
262=item resist_<resistnacy> <number>
263
264this is the factor with which the difference of the players resistancy and 100%
265is multiplied, something like this:
266
267 additional_resistancy = (100 - current_resistanct) * (<number>/100)
268
269if <number> is negative it is added to the total vulnerabilities,
270and later the total resistance is decided by:
271
272 'total resistance = total protections - total vulnerabilities'
273
274see also common/living.C:fix_player
275
276=item patch_(attuned|repelled|denied)
277
278this field modifies the pathes the player is attuned to, see include/spells.h PATH_*
279for the pathes.
280
281=item luck <number>
282
283this luck is added to the players luck
284
285=item move_type
286
287if the weapon has a move_type set the player inherits it's move_type
288
289=item exp <number>
290
291the added_speed and bonus_speed of the player is raised by <number>/3.
292if <number> < 0 then the added_speed is decreased by <number>
293
294=item weight
295
296the weight of the weapon
297
298=item magic
299
300the magic field affects the amounts of the following fields:
301
302 - wc : the players wc is adjusted by: player->wc -= (wc + magic)
303
304 - ac : the players ac is lowered by (ac + magic) if (player->ac + magic) > 0
305
306 - dam: the players dam is adjusted by: player->dam += (dam + magic)
307
308 - weapon speed (last_sp): weapon_speed is calculated by: (last_sp * 2 - magic) / 2
309 (minium is 0)
310
311=item ac <number>
312
313the amount of ac points the player's ac is decreased
314
315=item wc <number>
316
317the amount of wc points the player's ac is decreased
318
319=back
320
321=head4 Player inherits following flags from weapons:
322
323 FLAG_LIFESAVE, FLAG_REFL_SPELL, FLAG_REFL_MISSILE, FLAG_STEALTH,
324 FLAG_XRAYS, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_UNDEAD

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines