… | |
… | |
49 | or shouldn't be set by an archetype. If the internal names differs the |
49 | or shouldn't be set by an archetype. If the internal names differs the |
50 | external name (for the archetypes) for the attribute is written behind it. |
50 | external name (for the archetypes) for the attribute is written behind it. |
51 | |
51 | |
52 | =head2 Description of generic archetype and object attributes |
52 | =head2 Description of generic archetype and object attributes |
53 | |
53 | |
|
|
54 | These are the fields that most of the objects have and/or their |
|
|
55 | default behaviour. |
|
|
56 | |
54 | =over 4 |
57 | =over 4 |
|
|
58 | |
|
|
59 | =item name <string> |
|
|
60 | |
|
|
61 | The name of the object. |
|
|
62 | |
|
|
63 | =item name_pl <string> |
|
|
64 | |
|
|
65 | The name of a collection of these objects (the plural of the name). |
|
|
66 | |
|
|
67 | =item face <facename> |
|
|
68 | |
|
|
69 | The graphical appearance of this object. |
|
|
70 | |
|
|
71 | =item invisible <number> |
|
|
72 | |
|
|
73 | If the <number> is greater than 0 the object is invisible. |
|
|
74 | For players this field reflects the duration of the invisibility |
|
|
75 | and is decreased every tick by 1. |
|
|
76 | |
|
|
77 | For non-player objects this field is not changed by server ticks. |
|
|
78 | |
|
|
79 | =item speed <number> |
|
|
80 | |
|
|
81 | If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed |
|
|
82 | on the active object list and will be processed each tick (see also speed_left!). |
|
|
83 | |
|
|
84 | If the speed field drops below the MIN_ACTIVE_SPEED the object is removed |
|
|
85 | from the active object list and it won't experience any processing per tick. |
|
|
86 | |
|
|
87 | =item speed_left <number> |
|
|
88 | |
|
|
89 | If this field is greater than 0 and the object is on the |
|
|
90 | active list (mostly means it's speed is also greater than 0): |
|
|
91 | |
|
|
92 | - speed_left is decreased by 1 |
|
|
93 | - and this object is processed and experiences a server tick. |
|
|
94 | |
|
|
95 | If the object is on the active list and speed_left is lower or |
|
|
96 | equal to 0 the absolute value of the speed field is added to speed_left |
|
|
97 | on the end of the tick. |
|
|
98 | |
|
|
99 | =item no_drop (0|1) |
|
|
100 | |
|
|
101 | Sets the flag FLAG_NO_DROP. |
|
|
102 | See Flags section below. |
|
|
103 | |
|
|
104 | =item applied (0|1) |
|
|
105 | |
|
|
106 | Sets the flag FLAG_APPLIED. |
|
|
107 | See Flags section below. |
|
|
108 | |
|
|
109 | =item is_used_up (0|1) |
|
|
110 | |
|
|
111 | Sets the flag FLAG_IS_USED_UP. |
|
|
112 | See Flags section below. |
|
|
113 | |
|
|
114 | =item auto_apply (0|1) |
|
|
115 | |
|
|
116 | Sets the flag FLAG_AUTO_APPLY. |
|
|
117 | See Flags section below. |
|
|
118 | |
|
|
119 | =item editable (more than deprecated) |
|
|
120 | |
|
|
121 | This field had a special meaning for crossedit, which used parts |
|
|
122 | of the server code for editing. Wherever you see this attribute being |
|
|
123 | set in an archetype ignore it and/or remove it. No code interprets this |
|
|
124 | field anymore. |
|
|
125 | |
|
|
126 | =back |
|
|
127 | |
|
|
128 | =head3 Flags |
|
|
129 | |
|
|
130 | Here are the effects of the flags described. |
|
|
131 | |
|
|
132 | =over 4 |
|
|
133 | |
|
|
134 | =item FLAG_NO_DROP |
|
|
135 | |
|
|
136 | An object can't be picked up and dropped. |
|
|
137 | |
|
|
138 | =item FLAG_APPLIED |
|
|
139 | |
|
|
140 | This flag mostly states whether this object has been 'applied' by the player. |
|
|
141 | For objects that are applied by the code or have this flag set in the archetype |
|
|
142 | it mostly means 'this object is active'. |
|
|
143 | |
|
|
144 | For example the player adjustments of the hp/sp/grace fields and inheritance |
|
|
145 | of flags from objects in his inventory is toggled by this flag. |
|
|
146 | |
|
|
147 | =item FLAG_IS_USED_UP |
|
|
148 | |
|
|
149 | This flag controls whether an object is 'used up'. If it is set the 'food' field |
|
|
150 | of the object is decreased by 1 each tick, and if it is lower or equal 0 after tha |
|
|
151 | it is removed. |
|
|
152 | |
|
|
153 | If also the flag FLAG_APPLIED is set, the 'duration' field controls whether |
|
|
154 | this object is removed or not, see the Force type below for the meaning |
|
|
155 | of the duration field in this context. |
|
|
156 | |
|
|
157 | If FLAG_APPLIED is not set the object is destroyed. |
|
|
158 | |
|
|
159 | =item FLAG_IS_A_TEMPLATE (internal use) |
|
|
160 | |
|
|
161 | This flag is set on the inventory of generators like CREATORs and CONVERTERs, |
|
|
162 | or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. |
|
|
163 | |
|
|
164 | =item FLAG_AUTO_APPLY |
|
|
165 | |
|
|
166 | This flag has currently only meaning for the TREASURE type, see below. |
55 | |
167 | |
56 | =back |
168 | =back |
57 | |
169 | |
58 | =head2 Description of type specific attributes |
170 | =head2 Description of type specific attributes |
59 | |
171 | |
60 | The beginning of the headers of the following subsection |
172 | The beginning of the headers of the following subsection |
61 | are the server internal names for the objects types, see include/define.h. |
173 | are the server internal names for the objects types, see include/define.h. |
62 | The numeric values are maybe not 100% accurate, as the code is a changing |
174 | |
63 | target, please consult include/define.h in doubt :-) |
175 | =head3 TRANSPORT - type 2 - Player transports |
|
|
176 | |
|
|
177 | This type is implemented by the transport extension and has currently no special |
|
|
178 | attributes that affect it. |
|
|
179 | |
|
|
180 | =head3 ROD - type 3 - Rods that fire spells |
|
|
181 | |
|
|
182 | Rods contain spells and can be fired by a player. |
|
|
183 | |
|
|
184 | =over 4 |
|
|
185 | |
|
|
186 | =item level <number> |
|
|
187 | |
|
|
188 | This attribute is used for calculating the spell level that can be fired |
|
|
189 | with this rod, it's also the maximum level of the spell that can be fired. |
|
|
190 | The level of the spell that is being fired depends mostly on |
|
|
191 | the 'use magic item' skill level of the player and 1/10 of the level of the |
|
|
192 | rod is added as bonus. |
|
|
193 | |
|
|
194 | =item hp <number> |
|
|
195 | |
|
|
196 | The amount of spellpoints this rod has left. |
|
|
197 | |
|
|
198 | =item maxhp <number> |
|
|
199 | |
|
|
200 | The maximum amount of spellpoints this rod has. |
|
|
201 | |
|
|
202 | =item skill <skill name> |
|
|
203 | |
|
|
204 | This field determines which skill you need to apply this object. |
|
|
205 | |
|
|
206 | =back |
|
|
207 | |
|
|
208 | =head3 TREASURE - type 4 - Treasures |
|
|
209 | |
|
|
210 | This type of objects are for random treasure generation in maps. |
|
|
211 | If this object is applied by a player it will replace itself with it's |
|
|
212 | inventory. If it is automatically applied |
|
|
213 | generate a treasure and replace itself with the generated treasure. |
|
|
214 | |
|
|
215 | Chests are also of this type, their treasures are generated by |
|
|
216 | the auto apply code on map instantiation. |
|
|
217 | |
|
|
218 | =over 4 |
|
|
219 | |
|
|
220 | =item hp <number> |
|
|
221 | |
|
|
222 | The number of treasures to generate. |
|
|
223 | |
|
|
224 | =item exp <level> |
|
|
225 | |
|
|
226 | If FLAG_AUTO_APPLY is not set the exp field has no further meaning |
|
|
227 | and the difficulty for the treasurecode only depends on the maps difficulty, |
|
|
228 | otherwise the exp field has the following meaning: |
|
|
229 | |
|
|
230 | If this field is not 0 it is passed as the difficulty |
|
|
231 | to the treasure generation code to determine how good, how much |
|
|
232 | worth a treasure is or what bonuses it is given by the treasure code. |
|
|
233 | |
|
|
234 | If this field is not set or 0 the difficulty of the map is passed to the treasure |
|
|
235 | generation code. |
|
|
236 | |
|
|
237 | =item randomitems <treasurelist> |
|
|
238 | |
|
|
239 | The treasurelist to use to generate the treasure which is put in the |
|
|
240 | treasure objects inventory. |
|
|
241 | |
|
|
242 | =back |
|
|
243 | |
|
|
244 | =head3 POTION - type 5 - Potions for drinking and other nastynesses |
|
|
245 | |
|
|
246 | These objects contain a spell and will emit it on apply, which most |
|
|
247 | of the time has the meaning of 'drinking'. |
|
|
248 | |
|
|
249 | If no resistancy field, stat field or attacktype is set and no spell |
|
|
250 | is put in the potion by the sp field or the randomitems the |
|
|
251 | potion will become an artifact and the artifact code decides which kind |
|
|
252 | of potion will be generated. |
|
|
253 | |
|
|
254 | If the potion has FLAG_CURSED or FLAG_DAMNED set the usage of this potion |
|
|
255 | will yield an explosion and hurt the player. |
|
|
256 | |
|
|
257 | =over 4 |
|
|
258 | |
|
|
259 | =item Str, Dex, Con, Int, Wis, Cha, Pow <number> |
|
|
260 | |
|
|
261 | These stat fields determine how many stat points the player gets |
|
|
262 | when he applies this potion. |
|
|
263 | |
|
|
264 | If FLAG_CURSED or FLAG_DAMNED is set the player will loose that many stat points. |
|
|
265 | |
|
|
266 | =item sp <number> |
|
|
267 | |
|
|
268 | If this field is set and the randomitems field is not set |
|
|
269 | the field is interpreted as spell number, please look the right |
|
|
270 | number up in common/loader.C. |
|
|
271 | |
|
|
272 | If this field is set the randomitems field will be unset by the |
|
|
273 | map loading code. |
|
|
274 | |
|
|
275 | =item attacktype <attacktype> |
|
|
276 | |
|
|
277 | This field has some special meaning in potions, currently the |
|
|
278 | bits for AT_DEPLETE and AT_GODPOWER control whethere this is a |
|
|
279 | restoration potion or improvement potion. |
|
|
280 | See include/attackinc.h for the bits of these types. |
|
|
281 | |
|
|
282 | If AT_DEPLETE is set the player will be restored and the ARCH_DEPLETION |
|
|
283 | will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED |
|
|
284 | set the player will be drained a random stat by inserting an ARCH_DEPLETION |
|
|
285 | into him. |
|
|
286 | |
|
|
287 | If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat. |
|
|
288 | When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats. |
|
|
289 | |
|
|
290 | =item resist_<resistancy> <number> |
|
|
291 | |
|
|
292 | If this stat is set and no spell is in the potion the potion |
|
|
293 | will create a force that give the player this specific resistancy. |
|
|
294 | The forces type will be changed to POTION_EFFECT (see POTION_EFFECT type below) |
|
|
295 | and the potion will last 10 times longer than the default force archetype |
|
|
296 | FORCE_NAME (at the moment of this writing spell/force.arc). |
|
|
297 | |
|
|
298 | =item randomitems <treasurelist> |
|
|
299 | |
|
|
300 | The inventory/spell of the potion will be created by calling the treasure code |
|
|
301 | with the treasurelist specified here. (I guess it's highly undefined what |
|
|
302 | happens if there is not a spell in the potions inventory). |
|
|
303 | |
|
|
304 | =item on_use_yield <archetype> |
|
|
305 | |
|
|
306 | When this object is applied this object will be created. |
|
|
307 | This field is also used by FOOD and POISON. |
|
|
308 | |
|
|
309 | =item subtypes <potion subtype> |
|
|
310 | |
|
|
311 | see include/spells.h for possible potion subtypes, there are currently 4: |
|
|
312 | |
|
|
313 | =over 4 |
|
|
314 | |
|
|
315 | =item POT_SPELL |
|
|
316 | |
|
|
317 | Unused, default behaiour of a potion. |
|
|
318 | |
|
|
319 | =item POT_DUST |
|
|
320 | |
|
|
321 | This potion can be thrown to cast the spell that it has in it's inventory, |
|
|
322 | the behaviour is not defined if there is not a spell in the inventory and the |
|
|
323 | server will log an error. |
|
|
324 | |
|
|
325 | =item POT_FIGURINE |
|
|
326 | |
|
|
327 | Unused, default behaiour of a potion. |
|
|
328 | |
|
|
329 | =item POT_BALM |
|
|
330 | |
|
|
331 | Unused, default behaiour of a potion. |
|
|
332 | |
|
|
333 | =back |
|
|
334 | |
|
|
335 | =back |
64 | |
336 | |
65 | =head3 WEAPON - type 15 - Weapons |
337 | =head3 WEAPON - type 15 - Weapons |
66 | |
338 | |
67 | This type is for general hack and slash weapons like swords, maces |
339 | This type is for general hack and slash weapons like swords, maces |
68 | and daggers and and .... |
340 | and daggers and and .... |
… | |
… | |
75 | |
347 | |
76 | =item attacktype <bitmask> |
348 | =item attacktype <bitmask> |
77 | |
349 | |
78 | bitfield which decides the attacktype of the damage, see include/attackinc.h |
350 | bitfield which decides the attacktype of the damage, see include/attackinc.h |
79 | |
351 | |
80 | =item dam <integer> |
352 | =item dam <number> |
81 | |
353 | |
82 | amount of damage being done with the attacktype |
354 | amount of damage being done with the attacktype |
83 | |
355 | |
84 | =item item_power <level> |
356 | =item item_power <level> |
85 | |
357 | |
… | |
… | |
104 | |
376 | |
105 | =item last_sp |
377 | =item last_sp |
106 | |
378 | |
107 | the weapon speed (see magic description) |
379 | the weapon speed (see magic description) |
108 | |
380 | |
109 | =item food <integer> |
381 | =item food <number> |
110 | |
382 | |
111 | addition to food regeneration of the player |
383 | addition to food regeneration of the player |
112 | |
384 | |
113 | =item hp <integer> |
385 | =item hp <number> |
114 | |
386 | |
115 | addition to health regeneration |
387 | addition to health regeneration |
116 | |
388 | |
117 | =item sp <integer> |
389 | =item sp <number> |
118 | |
390 | |
119 | addition to mana regeneration |
391 | addition to mana regeneration |
120 | |
392 | |
121 | =item grace <integer> |
393 | =item grace <number> |
122 | |
394 | |
123 | addititon to grace regeneration |
395 | addititon to grace regeneration |
124 | |
396 | |
125 | =item gen_sp_armour <integer> |
397 | =item gen_sp_armour <number> |
126 | |
398 | |
127 | the players gen_sp_armour field (which is per default 10) is added the <integer> amount. |
399 | the players gen_sp_armour field (which is per default 10) is added the <number> amount. |
128 | gen_sp_armour seems to be a factor with which gen_sp in do_some_living() |
400 | gen_sp_armour seems to be a factor with which gen_sp in do_some_living() |
129 | is multiplied: gen_sp *= 10/<integer> |
401 | is multiplied: gen_sp *= 10/<number> |
130 | meaning: values > 10 of gen_sp_armour limits the amout of regenerated |
402 | meaning: values > 10 of gen_sp_armour limits the amout of regenerated |
131 | spellpoints. |
403 | spellpoints. |
132 | |
404 | |
133 | generally this field on weapons is in ranges of 1-30 and decides the slowdown of the |
405 | generally this field on weapons is in ranges of 1-30 and decides the slowdown of the |
134 | sp regeneration. |
406 | sp regeneration. |
… | |
… | |
136 | =item body_<body slot/part> |
408 | =item body_<body slot/part> |
137 | |
409 | |
138 | the part of the body you need to use this weapon, possible values should be |
410 | the part of the body you need to use this weapon, possible values should be |
139 | looked up in common/item.C at body_locations. |
411 | looked up in common/item.C at body_locations. |
140 | |
412 | |
141 | =item resist_<resistnacy> <integer> |
413 | =item resist_<resistnacy> <number> |
142 | |
414 | |
143 | this is the factor with which the difference of the players resistancy and 100% |
415 | this is the factor with which the difference of the players resistancy and 100% |
144 | is multiplied, something like this: |
416 | is multiplied, something like this: |
145 | |
417 | |
146 | additional_resistancy = (100 - current_resistanct) * (<integer>/100) |
418 | additional_resistancy = (100 - current_resistanct) * (<number>/100) |
147 | |
419 | |
148 | if <integer> is negative it is added to the total vulnerabilities, |
420 | if <number> is negative it is added to the total vulnerabilities, |
149 | and later the total resistance is decided by: |
421 | and later the total resistance is decided by: |
150 | |
422 | |
151 | 'total resistance = total protections - total vulnerabilities' |
423 | 'total resistance = total protections - total vulnerabilities' |
152 | |
424 | |
153 | see also common/living.C:fix_player |
425 | see also common/living.C:fix_player |
… | |
… | |
155 | =item patch_(attuned|repelled|denied) |
427 | =item patch_(attuned|repelled|denied) |
156 | |
428 | |
157 | this field modifies the pathes the player is attuned to, see include/spells.h PATH_* |
429 | this field modifies the pathes the player is attuned to, see include/spells.h PATH_* |
158 | for the pathes. |
430 | for the pathes. |
159 | |
431 | |
160 | =item luck <integer> |
432 | =item luck <number> |
161 | |
433 | |
162 | this luck is added to the players luck |
434 | this luck is added to the players luck |
163 | |
435 | |
164 | =item move_type |
436 | =item move_type |
165 | |
437 | |
166 | if the weapon has a move_type set the player inherits it's move_type |
438 | if the weapon has a move_type set the player inherits it's move_type |
167 | |
439 | |
168 | =item exp <integer> |
440 | =item exp <number> |
169 | |
441 | |
170 | the added_speed and bonus_speed of the player is raised by <integer>/3. |
442 | the added_speed and bonus_speed of the player is raised by <number>/3. |
171 | if <integer> < 0 then the added_speed is decreased by <integer> |
443 | if <number> < 0 then the added_speed is decreased by <number> |
172 | |
444 | |
173 | =item weight |
445 | =item weight |
174 | |
446 | |
175 | the weight of the weapon |
447 | the weight of the weapon |
176 | |
448 | |
… | |
… | |
185 | - dam: the players dam is adjusted by: player->dam += (dam + magic) |
457 | - dam: the players dam is adjusted by: player->dam += (dam + magic) |
186 | |
458 | |
187 | - weapon speed (last_sp): weapon_speed is calculated by: (last_sp * 2 - magic) / 2 |
459 | - weapon speed (last_sp): weapon_speed is calculated by: (last_sp * 2 - magic) / 2 |
188 | (minium is 0) |
460 | (minium is 0) |
189 | |
461 | |
190 | =item ac <integer> |
462 | =item ac <number> |
191 | |
463 | |
192 | the amount of ac points the player's ac is decreased |
464 | the amount of ac points the player's ac is decreased |
193 | |
465 | |
194 | =item wc <integer> |
466 | =item wc <number> |
195 | |
467 | |
196 | the amount of wc points the player's ac is decreased |
468 | the amount of wc points the player's wc is decreased |
197 | |
469 | |
198 | =back |
470 | =back |
199 | |
471 | |
200 | =head4 Player inherits following flags from weapons: |
472 | =head4 Player inherits following flags from weapons: |
201 | |
473 | |
202 | FLAG_LIFESAVE, FLAG_REFL_SPELL, FLAG_REFL_MISSILE, FLAG_STEALTH, |
474 | FLAG_LIFESAVE |
203 | FLAG_XRAYS, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_UNDEAD |
475 | FLAG_REFL_SPELL |
|
|
476 | FLAG_REFL_MISSILE |
|
|
477 | FLAG_STEALTH |
|
|
478 | FLAG_XRAYS |
|
|
479 | FLAG_BLIND |
|
|
480 | FLAG_SEE_IN_DARK |
|
|
481 | FLAG_UNDEAD |
|
|
482 | |
|
|
483 | =head3 FORCE - type 114 - Forces |
|
|
484 | |
|
|
485 | Forces are a very 'thin' type. They don't have much behaviour other than |
|
|
486 | disappearing after a time and/or affecting the player if they are in his inventory. |
|
|
487 | |
|
|
488 | Forces only take effect on the player if they have set FLAG_APPLIED. |
|
|
489 | |
|
|
490 | Whether the duration field is processed or not a tick is controlled via the |
|
|
491 | speed and speed_left field. Look above at the generic description of these |
|
|
492 | fields. |
|
|
493 | |
|
|
494 | =over 4 |
|
|
495 | |
|
|
496 | =item duration |
|
|
497 | |
|
|
498 | While this field is greater than 0 the force/object is not destroyed. |
|
|
499 | It is decreased each tick by 1. |
|
|
500 | |
|
|
501 | If it reaches 0 the force/object is destroyed. |
|
|
502 | |
|
|
503 | This field can have this meaning for B<any> object if that object has |
|
|
504 | FLAG_IS_USED_UP and FLAG_APPLIED set. See the description of FLAG_IS_USED_UP |
|
|
505 | what happens then. |
|
|
506 | |
|
|
507 | =back |
|
|
508 | |
|
|
509 | =head3 POTION_EFFECT - type 115 - Potion effects (resistancies) |
|
|
510 | |
|
|
511 | This object is generated by the POTION code when the potion is a |
|
|
512 | resistance giving potion. It has mainly the same behaviour as a FORCE. |
|
|
513 | |
|
|
514 | The specialty of the potion effect is that the resistancy it gives is absolute, |
|
|
515 | so if you drin a resistancy potion of fire+60 you will get 60% resistancy to fire. |
|
|
516 | |
|
|
517 | Multiple potion effects only give you the maximum of their resistancy. |