summaryrefslogtreecommitdiff
path: root/src/map/itemdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/itemdb.h')
-rw-r--r--src/map/itemdb.h58
1 files changed, 39 insertions, 19 deletions
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index eebcd5d4d..2ad596ce1 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -2,12 +2,15 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _MAP_ITEMDB_H_
-#define _MAP_ITEMDB_H_
+#ifndef MAP_ITEMDB_H
+#define MAP_ITEMDB_H
+#include "map.h"
+#include "../common/cbasetypes.h"
+#include "../common/conf.h"
#include "../common/db.h"
#include "../common/mmo.h" // ITEM_NAME_LENGTH
-#include "map.h"
+#include "../common/sql.h"
/**
* Declarations
@@ -316,10 +319,6 @@ enum geneticist_item_list {
ITEMID_BLACK_THING_TO_THROW, // 13290
};
-enum item_nouse_list {
- NOUSE_SITTING = 0x01,
-};
-
//
enum e_chain_cache {
ECC_ORE,
@@ -338,6 +337,34 @@ enum item_class_upper {
ITEMUPPER_ALL = 0x3f, // Sum of all the above
};
+/**
+ * Item Trade restrictions
+ */
+enum ItemTradeRestrictions {
+ ITR_NONE = 0x000, ///< No restrictions
+ ITR_NODROP = 0x001, ///< Item can't be dropped
+ ITR_NOTRADE = 0x002, ///< Item can't be traded (nor vended)
+ ITR_PARTNEROVERRIDE = 0x004, ///< Wedded partner can override ITR_NOTRADE restriction
+ ITR_NOSELLTONPC = 0x008, ///< Item can't be sold to NPCs
+ ITR_NOCART = 0x010, ///< Item can't be placed in the cart
+ ITR_NOSTORAGE = 0x020, ///< Item can't be placed in the storage
+ ITR_NOGSTORAGE = 0x040, ///< Item can't be placed in the guild storage
+ ITR_NOMAIL = 0x080, ///< Item can't be attached to mail messages
+ ITR_NOAUCTION = 0x100, ///< Item can't be auctioned
+
+ ITR_ALL = 0x1ff ///< Sum of all the above values
+};
+
+/**
+ * Iten No-use restrictions
+ */
+enum ItemNouseRestrictions {
+ INR_NONE = 0x0, ///< No restrictions
+ INR_SITTING = 0x1, ///< Item can't be used while sitting
+
+ INR_ALL = 0x1 ///< Sum of all the above values
+};
+
struct item_data {
uint16 nameid;
char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
@@ -377,7 +404,7 @@ struct item_data {
unsigned available : 1;
unsigned no_refine : 1; // [celest]
unsigned delay_consume : 1; // Signifies items that are not consumed immediately upon double-click [Skotlex]
- unsigned trade_restriction : 9; //Item restrictions mask [Skotlex]
+ unsigned trade_restriction : 9; ///< Item trade restrictions mask (@see enum ItemTradeRestrictions)
unsigned autoequip: 1;
unsigned buyingstore : 1;
unsigned bindonequip : 1;
@@ -389,8 +416,8 @@ struct item_data {
unsigned int storage:1;
unsigned int guildstorage:1;
} stack;
- struct {// used by item_nouse.txt
- unsigned int flag;
+ struct {
+ unsigned int flag; ///< Item nouse restriction mask (@see enum ItemNouseRestrictions)
unsigned short override;
} item_usage;
short gm_lv_trade_override; //GM-level to override trade_restriction
@@ -562,12 +589,6 @@ struct itemdb_interface {
int (*isrestricted) (struct item *item, int gmlv, int gmlv2, int(*func)(struct item_data *, int, int));
int (*isidentified) (int nameid);
int (*isidentified2) (struct item_data *data);
- bool (*read_itemavail) (char *str[], int columns, int current);
- bool (*read_itemtrade) (char *str[], int columns, int current);
- bool (*read_itemdelay) (char *str[], int columns, int current);
- bool (*read_stack) (char *fields[], int columns, int current);
- bool (*read_buyingstore) (char *fields[], int columns, int current);
- bool (*read_nouse) (char *fields[], int columns, int current);
int (*combo_split_atoi) (char *str, int *val);
void (*read_combos) ();
int (*gendercheck) (struct item_data *id);
@@ -576,8 +597,7 @@ struct itemdb_interface {
int (*readdb_libconfig_sub) (config_setting_t *it, int n, const char *source);
int (*readdb_libconfig) (const char *filename);
int (*readdb_sql) (const char *tablename);
- uint64 (*unique_id) (int8 flag, int64 value);
- int (*uid_load) ();
+ uint64 (*unique_id) (struct map_session_data *sd);
void (*read) (bool minimal);
void (*destroy_item_data) (struct item_data *self, int free_self);
int (*final_sub) (DBKey key, DBData *data, va_list ap);
@@ -589,4 +609,4 @@ struct itemdb_interface *itemdb;
void itemdb_defaults(void);
-#endif /* _MAP_ITEMDB_H_ */
+#endif /* MAP_ITEMDB_H */