Crossfire Server, Trunk
Trap

Description

A trap is a object that can either do damage or trigger another connected object when detonated. Traps are like runes except they are not magical in nature, and generally have either a physical attack or trigger a reaction.

Traps hit any monster or person who steps on them for 'dam' damage in 'attack type' attacktype and/or trigger a reaction.

Many traps are already defined in the archetypes.

Type defined by:

Attributes

Attribute Field Description
artifact object::artifact If defined, refers to an artifact to get values from.
attack type object::attacktype This attribute defines what attack type to use for direct damage when the trap detonates.
block view FLAG_BLOCKSVIEW If an item is set to block view, players (and monsters) cannot see beyond it unless they cross it or manage to stand on top.
blocks prayers blocks_prayer Similar to damned, but does not appear in detect curse.
changing FLAG_CHANGING A <changing> object converts to <food> <other_arch> objects; when it's animation is done. For non-living objects <food> is checked: if it is zero, the change happens; otherwise <food> is decreased by one. I suggest you don't mess with this value - leave the default in place.
client-sided randomized animation? FLAG_CLIENT_ANIM_RANDOM If defined, then the object's animation is client-sided. Similar objects are animated independently.
client-sided synchronized animation? FLAG_CLIENT_ANIM_SYNC If defined, then the object's animation is client-sided. Similar objects are animated synchronized.
connection connection value When the trap is detonated, all objects with the same connection value get activated.
detonation text object::msg When the trap detonates, this text is displayed to the victim. For especially powerful or complex traps, create an appropriate and thrilling description. ;)
direct damage living::dam <direct damage> specifies how much damage is done by the trap. This should be set in reasonable relation to the trap's level.
elevation elevation The elevation (height above sea level) of this square. It is used for weather calculations and should be in the range -32000..32000. The elevation of a tile must be set in the bottom-most game object; elevation values for non-bottom-most game objects are ignored by the Crossfire server.
glow radius object::glow_radius If <glow radius> is set to a value greater zero, the object appears lit up on dark maps. <glow radius> can be a value between 0 and 4, the higher, the more light does the object emit.
identified FLAG_IDENTIFIED If an item is identified, the player has full knowledge about it.
identified animation identified_animation If defined, then the object will take this animation when identified.
identified animation speed identified_anim_speed If defined, then the object will have this animation speed when identified.
identified image identified_face If defined, then the object will take this appareance when identified.
identified random animation? identified_anim_random If defined, then the object's animation is in a random sequence when identified.
identified_name identified_name If defined, then the object will take this name when identified.
identified_name_pl identified_name_pl If defined, then the object will take this plural name when identified.
image object::face The image-name defines what image is displayed for this object in-game.
invisible object::invisible Generally makes the object invisible. Depending on the object-type, some can be made visible by the show_invisible spell. If in doubt, test it. Putting an invisible object under the floor always prevents it from being shown.
is used up FLAG_IS_USED_UP If set, decrement the <food> field at <speed>. When <food> reaches zero, remove the object.
name object::name This is the name of the object, displayed to the player.
number object::nrof This value determines the number of objects in one stack (for example: 100 gold coins => "number = 100"). You should set this at least to one, for any pickable object - otherwise it won't be mergeable into a stack.
number of charges living::hp

The rune will detonate <number of charges> times before disappearing.

Should be not 0 if 'unlimited charges' is set.

price adjustment price_adjustment If set, this is the buy and sell price adjustment ratio for the item.
price adjustment for buying price_adjustment_buy If set, this is the adjustment ratio when buying the item. Ignored if <price> adjustment is set.
price adjustment for selling price_adjustment_sell If set, this is the adjustment ratio when selling the item. Ignored if <price> adjustment is set.
smooth level object::smoothlevel If <smooth level> is set to a value greater zero, the object will be drawn partially over adjacent squares having a lower <smooth level> value. The value must be between 0 and 255 (inclusive); 0 means "never overlap adjacent squares".
splitting FLAG_SPLITTING A <splitting> object converts to <food> <other_arch> objects; when it is hit physically. For non-living objects <food> is checked: if it is zero, the change happens; otherwise <food> is decreased by one. I suggest you don't mess with this value - leave the default in place.
trap level object::level Level effects how easily a trap may be found and disarmed, and how much experience the player gets for doing so. Beware: High level traps can be quite a cheap source of experience! So either make them tough, or keep the level low.
unlimited charges FLAG_LIFESAVE If set, then the rune will detonate forever if the number of charges is not 0.
visibility living::Cha This value determines what fraction of the time the trap is visible: It'll be randomly visible 1/<visibility> of the time. Also effects how easily the trap may be found.