summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-11 17:11:56 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-11 17:11:56 +0000
commitc6a57edb3cb1b89ba16fee291fb9344260826570 (patch)
tree3dc6ec6c67bbbea335127a91bb54240d376e5565 /src/map/itemdb.c
parentdbcbf9c883a3bc85c2810dfc88b030a2aa505928 (diff)
downloadhercules-c6a57edb3cb1b89ba16fee291fb9344260826570.tar.gz
hercules-c6a57edb3cb1b89ba16fee291fb9344260826570.tar.bz2
hercules-c6a57edb3cb1b89ba16fee291fb9344260826570.tar.xz
hercules-c6a57edb3cb1b89ba16fee291fb9344260826570.zip
Added 2 new item_trade.txt flags as per kenpachi request:
- Item can't be attached to mail - Item can't be auctioned git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15564 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 3bb77ed34..7f9fedb6b 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -394,41 +394,42 @@ int itemdb_isstackable2(struct item_data *data)
/*==========================================
* Trade Restriction functions [Skotlex]
*------------------------------------------*/
-int itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused)
-{
+int itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused) {
return (item && (!(item->flag.trade_restriction&1) || gmlv >= item->gm_lv_trade_override));
}
-int itemdb_cantrade_sub(struct item_data* item, int gmlv, int gmlv2)
-{
+int itemdb_cantrade_sub(struct item_data* item, int gmlv, int gmlv2) {
return (item && (!(item->flag.trade_restriction&2) || gmlv >= item->gm_lv_trade_override || gmlv2 >= item->gm_lv_trade_override));
}
-int itemdb_canpartnertrade_sub(struct item_data* item, int gmlv, int gmlv2)
-{
+int itemdb_canpartnertrade_sub(struct item_data* item, int gmlv, int gmlv2) {
return (item && (item->flag.trade_restriction&4 || gmlv >= item->gm_lv_trade_override || gmlv2 >= item->gm_lv_trade_override));
}
-int itemdb_cansell_sub(struct item_data* item, int gmlv, int unused)
-{
+int itemdb_cansell_sub(struct item_data* item, int gmlv, int unused) {
return (item && (!(item->flag.trade_restriction&8) || gmlv >= item->gm_lv_trade_override));
}
-int itemdb_cancartstore_sub(struct item_data* item, int gmlv, int unused)
-{
+int itemdb_cancartstore_sub(struct item_data* item, int gmlv, int unused) {
return (item && (!(item->flag.trade_restriction&16) || gmlv >= item->gm_lv_trade_override));
}
-int itemdb_canstore_sub(struct item_data* item, int gmlv, int unused)
-{
+int itemdb_canstore_sub(struct item_data* item, int gmlv, int unused) {
return (item && (!(item->flag.trade_restriction&32) || gmlv >= item->gm_lv_trade_override));
}
-int itemdb_canguildstore_sub(struct item_data* item, int gmlv, int unused)
-{
+int itemdb_canguildstore_sub(struct item_data* item, int gmlv, int unused) {
return (item && (!(item->flag.trade_restriction&64) || gmlv >= item->gm_lv_trade_override));
}
+int itemdb_canmail_sub(struct item_data* item, int gmlv, int unused) {
+ return (item && (!(item->flag.trade_restriction&128) || gmlv >= item->gm_lv_trade_override));
+}
+
+int itemdb_canauction_sub(struct item_data* item, int gmlv, int unused) {
+ return (item && (!(item->flag.trade_restriction&256) || gmlv >= item->gm_lv_trade_override));
+}
+
int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(struct item_data*, int, int))
{
struct item_data* item_data = itemdb_search(item->nameid);
@@ -615,7 +616,7 @@ static bool itemdb_read_itemtrade(char* str[], int columns, int current)
flag = atoi(str[1]);
gmlv = atoi(str[2]);
- if( flag < 0 || flag >= 128 )
+ if( flag < 0 || flag > 256 )
{//Check range
ShowWarning("itemdb_read_itemtrade: Invalid trading mask %d for item id %d.\n", flag, nameid);
return false;