OSDN Git Service

First version
[st-ro/stro.git] / src / map / storage.h
1 // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
2 // For more information, see LICENCE in the main folder
3
4 #ifndef _STORAGE_H_
5 #define _STORAGE_H_
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 //#include "../common/mmo.h"
12 struct s_storage;
13 struct item;
14 //#include "map.h"
15 struct map_session_data;
16
17 extern struct s_storage_table *storage_db;
18 extern int storage_count;
19
20 enum e_storage_add {
21         STORAGE_ADD_OK,
22         STORAGE_ADD_NOROOM,
23         STORAGE_ADD_NOACCESS,
24         STORAGE_ADD_INVALID,
25 };
26
27 const char *storage_getName(uint8 id);
28 bool storage_exists(uint8 id);
29
30 int storage_delitem(struct map_session_data* sd, struct s_storage *stor, int index, int amount);
31 int storage_storageopen(struct map_session_data *sd);
32 void storage_storageadd(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
33 void storage_storageget(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
34 void storage_storageaddfromcart(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
35 void storage_storagegettocart(struct map_session_data *sd, struct s_storage *stor, int index, int amount);
36 void storage_storagesave(struct map_session_data *sd);
37 void storage_storageclose(struct map_session_data *sd);
38 void storage_sortitem(struct item* items, unsigned int size);
39 void do_init_storage(void);
40 void do_final_storage(void);
41 void do_reconnect_storage(void);
42 void storage_storage_quit(struct map_session_data *sd, int flag);
43
44 struct s_storage* guild2storage(int guild_id);
45 struct s_storage* guild2storage2(int guild_id);
46 void storage_guild_delete(int guild_id);
47 char storage_guild_storageopen(struct map_session_data *sd);
48 bool storage_guild_additem(struct map_session_data *sd,struct s_storage *stor,struct item *item_data,int amount);
49 bool storage_guild_additem2(struct s_storage* stor, struct item* item, int amount);
50 bool storage_guild_delitem(struct map_session_data *sd,struct s_storage *stor,int n,int amount);
51 void storage_guild_storageadd(struct map_session_data *sd,int index,int amount);
52 void storage_guild_storageget(struct map_session_data *sd,int index,int amount);
53 void storage_guild_storageaddfromcart(struct map_session_data *sd,int index,int amount);
54 void storage_guild_storagegettocart(struct map_session_data *sd,int index,int amount);
55 void storage_guild_storageclose(struct map_session_data *sd);
56 void storage_guild_storage_quit(struct map_session_data *sd,int flag);
57 bool storage_guild_storagesave(uint32 account_id, int guild_id, int flag);
58 void storage_guild_storagesaved(int guild_id); //Ack from char server that guild store was saved.
59
60 // Premium Storage [Cydh]
61 void storage_premiumStorage_open(struct map_session_data *sd);
62 bool storage_premiumStorage_load(struct map_session_data *sd, uint8 num, uint8 mode);
63 void storage_premiumStorage_save(struct map_session_data *sd);
64 void storage_premiumStorage_saved(struct map_session_data *sd);
65 void storage_premiumStorage_close(struct map_session_data *sd);
66 void storage_premiumStorage_quit(struct map_session_data *sd);
67
68 int compare_item(struct item *a, struct item *b);
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif /* _STORAGE_H_ */