Added Guild Storage Expansion Skill (#3244)

* Fixes #499 and part of #1303.
* Implements Guild Storage Expansion Skill which requires client 2013-12-23 or newer (enable by default depending on client date in src/config/packets.hpp).
* Implements guild storage permission which requires client 2014-02-05 or newer.
* Expanded script command guildopenstorage return values.
This commit is contained in:
Aleos
2018-07-03 08:49:34 -04:00
committed by GitHub
parent e4eddc3e61
commit e13ca63cc8
18 changed files with 187 additions and 83 deletions

View File

@@ -738,7 +738,7 @@ int char_memitemdata_to_sql(const struct item items[], int max, int id, enum sto
bool char_memitemdata_from_sql(struct s_storage* p, int max, int id, enum storage_type tableswitch, uint8 stor_id) {
StringBuf buf;
SqlStmt* stmt;
int i,j, offset = 0;
int i,j, offset = 0, max2;
struct item item, *storage;
const char *tablename, *selectoption, *printname;
@@ -748,24 +748,28 @@ bool char_memitemdata_from_sql(struct s_storage* p, int max, int id, enum storag
tablename = schema_config.inventory_db;
selectoption = "char_id";
storage = p->u.items_inventory;
max2 = MAX_INVENTORY;
break;
case TABLE_CART:
printname = "Cart";
tablename = schema_config.cart_db;
selectoption = "char_id";
storage = p->u.items_cart;
max2 = MAX_CART;
break;
case TABLE_STORAGE:
printname = "Storage";
tablename = inter_premiumStorage_getTableName(stor_id);
selectoption = "account_id";
storage = p->u.items_storage;
max2 = inter_premiumStorage_getMax(p->stor_id);
break;
case TABLE_GUILD_STORAGE:
printname = "Guild Storage";
tablename = schema_config.guild_storage_db;
selectoption = "guild_id";
storage = p->u.items_guild;
max2 = inter_guild_storagemax(id);
break;
default:
ShowError("Invalid table name!\n");
@@ -776,7 +780,7 @@ bool char_memitemdata_from_sql(struct s_storage* p, int max, int id, enum storag
p->id = id;
p->type = tableswitch;
p->stor_id = stor_id;
p->max_amount = inter_premiumStorage_getMax(p->stor_id);
p->max_amount = max2;
stmt = SqlStmt_Malloc(sql_handle);
if (stmt == NULL) {