Crossfire Server, Branches 1.12  R18729
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 'attacktype' attacktype and/or trigger a reaction.

Many traps are already defined in the archetypes.

Type defined by:

Attributes

Attribute Field Description
attacktype obj::attacktype This attribute defines what attacktype 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.
connection connection value When the trap is detonated, all objects with the same connection value get activated.
detonation text obj::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 liv::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 obj::elevation The elevation (height above sea level) of this tile. 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 obj::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.
image obj::face The image-name defines what image is displayed for this object in-game.
invisible obj::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.
name obj::name This is the name of the object, displayed to the player.
number obj::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 liv::hp The trap will detonate <number of charges> times before disappearing.
smooth level obj::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".
trap level obj::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.
visibility liv::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.