summaryrefslogtreecommitdiff
path: root/src/map/buyingstore.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-09-27 14:13:07 -0300
committershennetsind <ind@henn.et>2013-09-27 14:13:07 -0300
commitc08c02223390b162de6863a56ee7c823339654c4 (patch)
treee2b217fd363bcfe51a48baa59b6cd84a45b618b3 /src/map/buyingstore.h
parent8dbf814abab8b52698e30bc2828a490b32a959d8 (diff)
downloadhercules-c08c02223390b162de6863a56ee7c823339654c4.tar.gz
hercules-c08c02223390b162de6863a56ee7c823339654c4.tar.bz2
hercules-c08c02223390b162de6863a56ee7c823339654c4.tar.xz
hercules-c08c02223390b162de6863a56ee7c823339654c4.zip
HPM: Buyingstore.c Complete
Moved missing vars and declarations of interest into the interface. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/buyingstore.h')
-rw-r--r--src/map/buyingstore.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h
index ae5fcb9e5..b0db40661 100644
--- a/src/map/buyingstore.h
+++ b/src/map/buyingstore.h
@@ -5,10 +5,38 @@
#ifndef _BUYINGSTORE_H_
#define _BUYINGSTORE_H_
+/**
+ * Declarations
+ **/
struct s_search_store_search;
+/**
+ * Defines
+ **/
#define MAX_BUYINGSTORE_SLOTS 5
+/// constants (client-side restrictions)
+#define BUYINGSTORE_MAX_PRICE 99990000
+#define BUYINGSTORE_MAX_AMOUNT 9999
+
+/**
+ * Enumerations
+ **/
+/// failure constants for clif functions
+enum e_buyingstore_failure {
+ BUYINGSTORE_CREATE = 1, // "Failed to open buying store."
+ BUYINGSTORE_CREATE_OVERWEIGHT = 2, // "Total amount of then possessed items exceeds the weight limit by %d. Please re-enter."
+ BUYINGSTORE_TRADE_BUYER_ZENY = 3, // "All items within the buy limit were purchased."
+ BUYINGSTORE_TRADE_BUYER_NO_ITEMS = 4, // "All items were purchased."
+ BUYINGSTORE_TRADE_SELLER_FAILED = 5, // "The deal has failed."
+ BUYINGSTORE_TRADE_SELLER_COUNT = 6, // "The trade failed, because the entered amount of item %s is higher, than the buyer is willing to buy."
+ BUYINGSTORE_TRADE_SELLER_ZENY = 7, // "The trade failed, because the buyer is lacking required balance."
+ BUYINGSTORE_CREATE_NO_INFO = 8, // "No sale (purchase) information available."
+};
+
+/**
+ * Structures
+ **/
struct s_buyingstore_item {
int price;
unsigned short amount;
@@ -21,7 +49,13 @@ struct s_buyingstore {
unsigned char slots;
};
+/**
+ * Interface
+ **/
struct buyingstore_interface {
+ unsigned int nextid;
+ short blankslots[MAX_SLOTS]; // used when checking whether or not an item's card slots are blank
+ /* */
bool (*setup) (struct map_session_data* sd, unsigned char slots);
void (*create) (struct map_session_data* sd, int zenylimit, unsigned char result, const char* storename, const uint8* itemlist, unsigned int count);
void (*close) (struct map_session_data* sd);
@@ -29,6 +63,7 @@ struct buyingstore_interface {
void (*trade) (struct map_session_data* sd, int account_id, unsigned int buyer_id, const uint8* itemlist, unsigned int count);
bool (*search) (struct map_session_data* sd, unsigned short nameid);
bool (*searchall) (struct map_session_data* sd, const struct s_search_store_search* s);
+ unsigned int (*getuid) (void);
};
struct buyingstore_interface *buyingstore;