summaryrefslogtreecommitdiff
path: root/src/map/itemdb.h
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-06 21:22:20 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-06 21:22:20 +0000
commit5b1d1678fd03d6c780e933f6e464e3b02a860c0d (patch)
tree65b746ac53e67d12d9958223e095697bb8f20123 /src/map/itemdb.h
parent7afdfd0b4b60c52af9f4e488bb1208a426a5bddc (diff)
downloadhercules-5b1d1678fd03d6c780e933f6e464e3b02a860c0d.tar.gz
hercules-5b1d1678fd03d6c780e933f6e464e3b02a860c0d.tar.bz2
hercules-5b1d1678fd03d6c780e933f6e464e3b02a860c0d.tar.xz
hercules-5b1d1678fd03d6c780e933f6e464e3b02a860c0d.zip
- Rewrote all the item restriction functions so that they will take into account slotted card restrictions as well.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7552 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/itemdb.h')
-rw-r--r--src/map/itemdb.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index fd3c5191f..a9b74b0ca 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -88,13 +88,21 @@ int itemdb_searchrandomid(int flags);
#define itemdb_value_notoc(n) itemdb_search(n)->flag.value_notoc
#define itemdb_canrefine(n) itemdb_search(n)->flag.no_refine
//Item trade restrictions [Skotlex]
-int itemdb_isdropable(int nameid, int gmlv);
-int itemdb_cantrade(int nameid, int gmlv, int gmlv2);
-int itemdb_cansell(int nameid, int gmlv);
-int itemdb_canstore(int nameid, int gmlv);
-int itemdb_canguildstore(int nameid, int gmlv);
-int itemdb_cancartstore(int nameid, int gmlv);
-int itemdb_canpartnertrade(int nameid, int gmlv, int gmlv2);
+int itemdb_isdropable_sub(struct item_data *, int, int);
+int itemdb_cantrade_sub(struct item_data*, int, int);
+int itemdb_canpartnertrade_sub(struct item_data*, int, int);
+int itemdb_cansell_sub(struct item_data*,int, int);
+int itemdb_cancartstore_sub(struct item_data*, int, int);
+int itemdb_canstore_sub(struct item_data*, int, int);
+int itemdb_canguildstore_sub(struct item_data*, int, int);
+int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(struct item_data*, int, int));
+#define itemdb_isdropable(item, gmlv) itemdb_isrestricted(item, gmlv, 0, itemdb_isdropable_sub)
+#define itemdb_cantrade(item, gmlv, gmlv2) itemdb_isrestricted(item, gmlv, gmlv2, itemdb_cantrade_sub)
+#define itemdb_canpartnertrade(item, gmlv, gmlv2) itemdb_isrestricted(item, gmlv, gmlv2, itemdb_canpartnertrade_sub)
+#define itemdb_cansell(item, gmlv) itemdb_isrestricted(item, gmlv, 0, itemdb_cansell_sub)
+#define itemdb_cancartstore(item, gmlv) itemdb_isrestricted(item, gmlv, 0, itemdb_cancartstore_sub)
+#define itemdb_canstore(item, gmlv) itemdb_isrestricted(item, gmlv, 0, itemdb_canstore_sub)
+#define itemdb_canguildstore(item, gmlv) itemdb_isrestricted(item , gmlv, 0, itemdb_canguildstore_sub)
int itemdb_isequip(int);
int itemdb_isequip2(struct item_data *);