diff options
-rw-r--r-- | conf/messages.conf | 3 | ||||
-rw-r--r-- | src/map/atcommand.c | 25 |
2 files changed, 25 insertions, 3 deletions
diff --git a/conf/messages.conf b/conf/messages.conf index b6904328f..aae0596af 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1560,6 +1560,9 @@ 1496: Item types on your autoloottype list: 1497: Your autoloottype list has been reset. +//Item Bind +1498: You can't add a party bound item to a character without party! +1499: You can't add a guild bound item to a character without guild! //Custom translations import: conf/import/msg_conf.txt diff --git a/src/map/atcommand.c b/src/map/atcommand.c index c87a66b72..5c31155b1 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1117,9 +1117,28 @@ ACMD(item) return false; } - if(!strcmpi(info->command,"itembound") && !(bound >= IBT_MIN && bound <= IBT_MAX) ) { - clif->message(fd, msg_txt(298)); // Invalid bound type - return false; + if(!strcmpi(info->command,"itembound") ) { + if( !(bound >= IBT_MIN && bound <= IBT_MAX) ) { + clif->message(fd, msg_txt(298)); // Invalid bound type + return false; + } + switch( (enum e_item_bound_type)bound ) { + case IBT_CHARACTER: + case IBT_ACCOUNT: + break; /* no restrictions */ + case IBT_PARTY: + if( !sd->status.party_id ) { + clif->message(fd, msg_txt(1498)); //You can't add a party bound item to a character without party! + return false; + } + break; + case IBT_GUILD: + if( !sd->status.guild_id ) { + clif->message(fd, msg_txt(1499)); //You can't add a guild bound item to a character without guild! + return false; + } + break; + } } item_id = item_data->nameid; |