Crossfire Server, Trunk
|
Treasure lists specify what items an object can have when it is first created during a map initialisation.
Treasure lists contain items with a certain probability of apparition. When the list is instancied, so that for instance a monster can receive its items, the items are randomly chosen based on this probability, and inserted at the desired location.
Lists can reference other lists to group commony-used definitions.
The list format enables a yes-no structure, so that the presence of an item implies the presence of another (so arrows are given with a bow) or the absence of an item enables another item to be present (so a bow or a crossbow can be given, but not both).
Each item in the list has a chance factor, that determines its probability to be generated.
Treasure lists exist in two variations:
Treasures are defined in .trs files in the archetypes tree. For historical reasons, many are groupes in treasures.trs
at the root or archetypes.
When a treasure must be generated, a magic level is used to determine what items are eligible for generation. An item on a treasure list can only be generated if its magic field is less then the magic level specified.
Some flags can alter the generating behaviour. In particular, GT_ONLY_GOOD will forbid the generation of cursed or damned items.
A maximum of 100 tries will be done to generate an item, after which the generation is considered to have failed.
The format is a line by line description of the treasure, and its options. The text before the first space is the field, remaining of the line is the value.
A treasure list definition starts by a treasure, treasureone, yes, no or more parameter. If treasure or treasureone is used, the part on the right of the first space is the treasure list name. The definition must end by a end line.
The line can start by spaces that will be ignored. A line starting by # is a comment and will be totally ignored.
The following fields are available:
arch
of; in this case magic
is ignored. If the item
is incompatible with artifact
, then no item is generatedlist
will be generated with this difficulty instead of the current onelist
list
, minimum magic required for this list to be generated; for an item
, the maximum magic it can have (capping the magic from the difficulty), this may restrict artifacts which may be generated; does not apply if artifact
is setEither arch or list must be set.
treasure rod arch rod_light chance 2 no arch rod_heavy chance 1 end end
This treasure means:
treasure poor_old arch bow chance 5 yes arch arrow nrof 6 end more arch b_ssword_2 magic 1 chance 5 no arch b_ssword_1 chance 10 no arch b_dagger chance 15 no arch stoneaxe chance 20 no arch club chance 25 end end end end more arch b_small_shield chance 4 more arch silvercoin nrof 8 chance 10 end
Given the magic of 1 or more, this list has: