summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-07 17:05:56 -0200
committershennetsind <ind@henn.et>2013-11-07 17:05:56 -0200
commit8083daec0d94f78510411c9b225abcfa7e829e95 (patch)
treec872c4b13d0853c2acf426cdf85dd25d010e3974
parentb9b32ac7609e33c21b488d722103cc0eea16b12c (diff)
downloadhercules-8083daec0d94f78510411c9b225abcfa7e829e95.tar.gz
hercules-8083daec0d94f78510411c9b225abcfa7e829e95.tar.bz2
hercules-8083daec0d94f78510411c9b225abcfa7e829e95.tar.xz
hercules-8083daec0d94f78510411c9b225abcfa7e829e95.zip
Further item bind adjustments
Thanks to Haruna! Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r--sql-files/upgrades/2013-10-31--07-49.sql2
-rw-r--r--src/map/atcommand.c4
-rw-r--r--src/map/buyingstore.c2
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/intif.c6
-rw-r--r--src/map/mail.c2
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/storage.c4
-rw-r--r--src/map/trade.c2
-rw-r--r--src/map/vending.c2
11 files changed, 22 insertions, 18 deletions
diff --git a/sql-files/upgrades/2013-10-31--07-49.sql b/sql-files/upgrades/2013-10-31--07-49.sql
index e18c7e20d..f0c51b0d9 100644
--- a/sql-files/upgrades/2013-10-31--07-49.sql
+++ b/sql-files/upgrades/2013-10-31--07-49.sql
@@ -2,5 +2,5 @@
ALTER TABLE `inventory` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `favorite`;
ALTER TABLE `cart_inventory` ADD COLUMN `bound` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
ALTER TABLE `storage` ADD COLUMN `bound` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
-ALTER TABLE `guild_storage` ADD COLUMN `bound` TINYINT(3) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
+ALTER TABLE `guild_storage` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); \ No newline at end of file
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index e19428d36..316e5a39b 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1123,7 +1123,7 @@ ACMD(item)
return false;
}
- if( bound < IBT_MIN || bound > IBT_MAX ) {
+ if(!strcmpi(command+1,"itembound") && !(bound >= IBT_MIN && bound <= IBT_MAX) ) {
clif->message(fd, msg_txt(298)); // Invalid bound type
return false;
}
@@ -1189,7 +1189,7 @@ ACMD(item2)
if (number <= 0)
number = 1;
- if( bound < IBT_MIN || bound > IBT_MAX ) {
+ if( !strcmpi(command+1,"itembound2") && !(bound >= IBT_MIN && bound <= IBT_MAX) ) {
clif->message(fd, msg_txt(298)); // Invalid bound type
return false;
}
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 44ece49c6..a9f1412ed 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -290,7 +290,7 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
return;
}
- if( sd->status.inventory[index].expire_time || (sd->status.inventory[index].bound && !pc->can_give_bounded_items(sd)) || !itemdb_cantrade(&sd->status.inventory[index], pc->get_group_level(sd), pc->get_group_level(pl_sd)) || memcmp(sd->status.inventory[index].card, buyingstore->blankslots, sizeof(buyingstore->blankslots)) )
+ if( sd->status.inventory[index].expire_time || (sd->status.inventory[index].bound && !pc->can_give_bound_items(sd)) || !itemdb_cantrade(&sd->status.inventory[index], pc->get_group_level(sd), pc->get_group_level(pl_sd)) || memcmp(sd->status.inventory[index].card, buyingstore->blankslots, sizeof(buyingstore->blankslots)) )
{// non-tradable item
clif->buyingstore_trade_failed_seller(sd, BUYINGSTORE_TRADE_SELLER_FAILED, nameid);
return;
diff --git a/src/map/clif.c b/src/map/clif.c
index fecf0be0e..70b81ffab 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1805,7 +1805,7 @@ void clif_selllist(struct map_session_data *sd)
if( sd->status.inventory[i].expire_time )
continue; // Cannot Sell Rental Items
- if( sd->status.inventory[i].bound && !pc->can_give_bounded_items(sd))
+ if( sd->status.inventory[i].bound && !pc->can_give_bound_items(sd))
continue; // Don't allow sale of bound items
val=sd->inventory_data[i]->value_sell;
@@ -15070,7 +15070,7 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
if( !pc->can_give_items(sd) || sd->status.inventory[idx].expire_time ||
!sd->status.inventory[idx].identify ||
!itemdb_canauction(&sd->status.inventory[idx],pc->get_group_level(sd)) || // Quest Item or something else
- (sd->status.inventory[idx].bound && !pc->can_give_bounded_items(sd)) ) {
+ (sd->status.inventory[idx].bound && !pc->can_give_bound_items(sd)) ) {
clif->auction_setitem(sd->fd, idx, true);
return;
}
@@ -15178,7 +15178,7 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
}
// Auction checks...
- if( sd->status.inventory[sd->auction.index].bound && !pc->can_give_bounded_items(sd) ) {
+ if( sd->status.inventory[sd->auction.index].bound && !pc->can_give_bound_items(sd) ) {
clif->message(sd->fd, msg_txt(293));
clif->auction_message(fd, 2); // The auction has been canceled
return;
diff --git a/src/map/intif.c b/src/map/intif.c
index 5cf385fe4..e6ff91af7 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -2120,9 +2120,13 @@ int intif_parse(int fd)
case 0x3854: intif->pAuctionMessage(fd); break;
case 0x3855: intif->pAuctionBid(fd); break;
//Bound items
+ case 0x3856:
#ifdef GP_BOUND_ITEMS
- case 0x3856: intif->pItembound_ack(fd); break;
+ intif->pItembound_ack(fd);
+#else
+ ShowWarning("intif_parse: Received 0x3856 with GP_BOUND_ITEMS disabled !!!\n")
#endif
+ break;
// Mercenary System
case 0x3870: intif->pMercenaryReceived(fd); break;
case 0x3871: intif->pMercenaryDeleted(fd); break;
diff --git a/src/map/mail.c b/src/map/mail.c
index 76c94879b..007f7592d 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -83,7 +83,7 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
return 1;
if( !pc->can_give_items(sd) || sd->status.inventory[idx].expire_time ||
!itemdb_canmail(&sd->status.inventory[idx],pc->get_group_level(sd)) ||
- (sd->status.inventory[idx].bound && !pc->can_give_bounded_items(sd)) )
+ (sd->status.inventory[idx].bound && !pc->can_give_bound_items(sd)) )
return 1;
sd->mail.index = idx;
diff --git a/src/map/pc.c b/src/map/pc.c
index 752151888..07fba6e57 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -571,7 +571,7 @@ bool pc_can_give_items(struct map_session_data *sd)
/**
* Determines if player can give / drop / trade / vend bounded items
*/
-bool pc_can_give_bounded_items(struct map_session_data *sd)
+bool pc_can_give_bound_items(struct map_session_data *sd)
{
return pc->has_permission(sd, PC_PERM_TRADE_BOUND);
}
@@ -4535,7 +4535,7 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun
return 1;
}
- if( !itemdb_cancartstore(item_data, pc->get_group_level(sd)) || (item_data->bound > IBT_ACCOUNT && !pc->can_give_bounded_items(sd)))
+ if( !itemdb_cancartstore(item_data, pc->get_group_level(sd)) || (item_data->bound > IBT_ACCOUNT && !pc->can_give_bound_items(sd)))
{ // Check item trade restrictions [Skotlex]
clif->message (sd->fd, msg_txt(264));
return 1;/* TODO: there is no official response to this? */
@@ -8058,7 +8058,7 @@ int pc_setmadogear(TBL_PC* sd, int flag)
*------------------------------------------*/
int pc_candrop(struct map_session_data *sd, struct item *item)
{
- if( item && (item->expire_time || (item->bound && !pc->can_give_bounded_items(sd))) )
+ if( item && (item->expire_time || (item->bound && !pc->can_give_bound_items(sd))) )
return 0;
if( !pc->can_give_items(sd) ) //check if this GM level can drop items
return 0;
@@ -10395,7 +10395,7 @@ void pc_defaults(void) {
pc->class2idx = pc_class2idx;
pc->get_group_level = pc_get_group_level;
pc->can_give_items = pc_can_give_items;
- pc->can_give_bounded_items = pc_can_give_bounded_items;
+ pc->can_give_bound_items = pc_can_give_bound_items;
pc->can_use_command = pc_can_use_command;
pc->has_permission = pc_has_permission;
diff --git a/src/map/pc.h b/src/map/pc.h
index 93463d19b..32ca214c0 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -750,7 +750,7 @@ struct pc_interface {
int (*get_group_level) (struct map_session_data *sd);
//int (*getrefinebonus) (int lv,int type); FIXME: This function does not exist, nor it is ever called
bool (*can_give_items) (struct map_session_data *sd);
- bool (*can_give_bounded_items) (struct map_session_data *sd);
+ bool (*can_give_bound_items) (struct map_session_data *sd);
bool (*can_use_command) (struct map_session_data *sd, const char *command);
bool (*has_permission) (struct map_session_data *sd, unsigned int permission);
diff --git a/src/map/storage.c b/src/map/storage.c
index 0a2e6d118..db85b3c98 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -141,7 +141,7 @@ int storage_additem(struct map_session_data* sd, struct item* item_data, int amo
return 1;
}
- if( item_data->bound > IBT_ACCOUNT && !pc->can_give_bounded_items(sd) ) {
+ if( item_data->bound > IBT_ACCOUNT && !pc->can_give_bound_items(sd) ) {
clif->message(sd->fd, msg_txt(294));
return 1;
}
@@ -441,7 +441,7 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
return 1;
}
- if( item_data->bound && item_data->bound != IBT_GUILD && !pc->can_give_bounded_items(sd) ) {
+ if( item_data->bound && item_data->bound != IBT_GUILD && !pc->can_give_bound_items(sd) ) {
clif->message(sd->fd, msg_txt(294));
return 1;
}
diff --git a/src/map/trade.c b/src/map/trade.c
index 327d19880..ffd1336f5 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -368,7 +368,7 @@ void trade_tradeadditem(struct map_session_data *sd, short index, short amount)
if( item->bound &&
!( item->bound == IBT_GUILD && sd->status.guild_id == target_sd->status.guild_id ) &&
!( item->bound == IBT_PARTY && sd->status.party_id == target_sd->status.party_id )
- && !pc->can_give_bounded_items(sd) ) {
+ && !pc->can_give_bound_items(sd) ) {
clif->message(sd->fd, msg_txt(293));
clif->tradeitemok(sd, index+2, TIO_INDROCKS);
return;
diff --git a/src/map/vending.c b/src/map/vending.c
index d5e5d1804..f16a208e4 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -257,7 +257,7 @@ void vending_openvending(struct map_session_data* sd, const char* message, const
|| !sd->status.cart[index].identify // unidentified item
|| sd->status.cart[index].attribute == 1 // broken item
|| sd->status.cart[index].expire_time // It should not be in the cart but just in case
- || (sd->status.cart[index].bound && !pc->can_give_bounded_items(sd)) // can't trade bound items w/o permission
+ || (sd->status.cart[index].bound && !pc->can_give_bound_items(sd)) // can't trade bound items w/o permission
|| !itemdb_cantrade(&sd->status.cart[index], pc->get_group_level(sd), pc->get_group_level(sd)) ) // untradeable item
continue;