Crossfire Server, Trunk  1.75.0
treasure.h
Go to the documentation of this file.
1 
6 #ifndef TREASURE_H
7 #define TREASURE_H
8 
10 #define CHANCE_FOR_ARTIFACT 20
11 
13 #define MAXMAGIC 4
14 
16 #define DIFFLEVELS 201
17 
19 #define MAX_SPELLITEM_LEVEL 110
20 
30 enum {
31  GT_ENVIRONMENT = 0x0001,
32  GT_INVISIBLE = 0x0002,
33  GT_STARTEQUIP = 0x0004,
34  GT_ONLY_GOOD = 0x0008,
35  GT_UPDATE_INV = 0x0010,
36  GT_MINIMAL = 0x0020
37 };
38 
51 struct _change_arch {
52  const char *name;
53  const char *title;
54  const char *slaying;
55 };
56 
63 struct treasure {
64  struct archetype *item;
68  uint8_t list_magic_value;
73  uint8_t chance;
74  uint8_t magic;
79  uint16_t nrof;
80 };
81 
85 struct treasurelist {
87  int16_t total_chance;
93 };
94 
95 #endif /* TREASURE_H */
treasure::chance
uint8_t chance
Percent chance for this item.
Definition: treasure.h:73
treasurelist::items
treasure * items
Items in this list, linked.
Definition: treasure.h:92
treasurelist::total_chance
int16_t total_chance
If non-zero, only 1 item on this list should be generated.
Definition: treasure.h:87
treasure::list_magic_value
uint8_t list_magic_value
Set difficulty when generating the list pointed by name.
Definition: treasure.h:68
GT_ONLY_GOOD
@ GT_ONLY_GOOD
Don't generate bad/cursed items.
Definition: treasure.h:34
GT_STARTEQUIP
@ GT_STARTEQUIP
Generated items have the FLAG_STARTEQUIP.
Definition: treasure.h:33
treasure::name
sstring name
If non null, name of list to use instead.
Definition: treasure.h:66
treasure::change_arch
struct _change_arch change_arch
Override default arch values if set in treasure list.
Definition: treasure.h:72
GT_INVISIBLE
@ GT_INVISIBLE
Unused?
Definition: treasure.h:32
treasurelist
treasurelist represents one logical group of items to be generated together.
Definition: treasure.h:85
treasurelist::name
sstring name
Usually monster-name/combination.
Definition: treasure.h:86
treasure::nrof
uint16_t nrof
Random 1 to nrof items are generated.
Definition: treasure.h:79
treasure::item
struct archetype * item
Which item this link can be.
Definition: treasure.h:64
_change_arch::slaying
const char * slaying
If != NULL, copy this over the original arch slaying.
Definition: treasure.h:54
archetype
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:483
GT_ENVIRONMENT
@ GT_ENVIRONMENT
?
Definition: treasure.h:31
treasure::next
treasure * next
Next treasure-item in a linked list.
Definition: treasure.h:69
_change_arch
when a treasure got cloned from archlist, we want perhaps change some default values.
Definition: treasure.h:51
treasure::next_yes
treasure * next_yes
If this item was generated, use this link instead of ->next.
Definition: treasure.h:70
treasure::magic
uint8_t magic
Max magic bonus to item If the entry is a list transition, 'magic' contains the difficulty required t...
Definition: treasure.h:74
sstring
const typedef char * sstring
Definition: sstring.h:2
_change_arch::name
const char * name
If != NULL, copy this over the original arch name.
Definition: treasure.h:52
treasure::next_no
treasure * next_no
If this item was not generated, then continue here.
Definition: treasure.h:71
_change_arch::title
const char * title
If != NULL, copy this over the original arch title.
Definition: treasure.h:53
treasure
treasure is one element in a linked list, which together consist of a complete treasure-list.
Definition: treasure.h:63
GT_UPDATE_INV
@ GT_UPDATE_INV
When object has been generated, send its information to player.
Definition: treasure.h:35
treasure::artifact
sstring artifact
If not null, the name of the artifact to apply to item.
Definition: treasure.h:65
GT_MINIMAL
@ GT_MINIMAL
Do minimal adjustments, don't make artifacts, and so on.
Definition: treasure.h:36
treasure::list_magic_adjustment
int8_t list_magic_adjustment
Adjust difficulty when generating the list pointed by name, ignored if list_magic_value is non zero.
Definition: treasure.h:67