Crossfire Server  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;
72  struct _change_arch change_arch;
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 extern bool chance(int a, int b);
96 
97 #endif /* TREASURE_H */
When object has been generated, send its information to player.
Definition: treasure.h:35
Unused?
Definition: treasure.h:32
const char * name
If != NULL, copy this over the original arch name.
Definition: treasure.h:52
sstring name
If non null, name of list to use instead.
Definition: treasure.h:66
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
Do minimal adjustments, don't make artifacts, and so on.
Definition: treasure.h:36
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:483
uint8_t chance
Percent chance for this item.
Definition: treasure.h:73
const char * title
If != NULL, copy this over the original arch title.
Definition: treasure.h:53
when a treasure got cloned from archlist, we want perhaps change some default values.
Definition: treasure.h:51
int16_t total_chance
If non-zero, only 1 item on this list should be generated.
Definition: treasure.h:87
treasure * next_no
If this item was not generated, then continue here.
Definition: treasure.h:71
bool chance(int a, int b)
Return true with a probability of a/b.
Definition: treasure.cpp:890
treasurelist represents one logical group of items to be generated together.
Definition: treasure.h:85
treasure * next_yes
If this item was generated, use this link instead of ->next.
Definition: treasure.h:70
sstring artifact
If not null, the name of the artifact to apply to item.
Definition: treasure.h:65
treasure * next
Next treasure-item in a linked list.
Definition: treasure.h:69
sstring name
Usually monster-name/combination.
Definition: treasure.h:86
treasure * items
Items in this list, linked.
Definition: treasure.h:92
uint8_t list_magic_value
Set difficulty when generating the list pointed by name.
Definition: treasure.h:68
uint16_t nrof
Random 1 to nrof items are generated.
Definition: treasure.h:79
treasure is one element in a linked list, which together consist of a complete treasure-list.
Definition: treasure.h:63
Don't generate bad/cursed items.
Definition: treasure.h:34
const char * slaying
If != NULL, copy this over the original arch slaying.
Definition: treasure.h:54
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
struct archetype * item
Which item this link can be.
Definition: treasure.h:64
const char * sstring
Definition: sstring.h:2
Generated items have the FLAG_STARTEQUIP.
Definition: treasure.h:33