From 94d75f867a6dae10f05a8c2399a301c66b53bce3 Mon Sep 17 00:00:00 2001 From: malufett Date: Thu, 11 Jul 2013 23:21:51 +0800 Subject: Updated some aegis(item, monster, resetstate & resetskill) command to work properly in Hercules. --- src/map/clif.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index f17766f50..18aa476ff 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11859,9 +11859,9 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) { char cmd[15]; if( RFIFOW(fd,2) ) - sprintf(cmd,"%cresetskill",atcommand->at_symbol); + sprintf(cmd,"%cskreset",atcommand->at_symbol); else - sprintf(cmd,"%cresetstat",atcommand->at_symbol); + sprintf(cmd,"%streset",atcommand->at_symbol); atcommand->parse(fd, sd, cmd, 1); } @@ -13376,23 +13376,25 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd) void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) { char *monster_item_name; + struct mob_db *mob_data; + struct item_data *item_data; char command[NAME_LENGTH+10]; monster_item_name = (char*)RFIFOP(fd,2); monster_item_name[NAME_LENGTH-1] = '\0'; - // FIXME: Should look for item first, then for monster. - // FIXME: /monster takes mob_db Sprite_Name as argument - if( mobdb_searchname(monster_item_name) ) { - snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand->at_symbol, monster_item_name); + if( (item_data=itemdb->search_name(monster_item_name)) != NULL + && strcmp(item_data->name, monster_item_name) != 0 ) { // It only accepts aegis name + if( item_data->type == IT_WEAPON || item_data->type == IT_ARMOR ) // nonstackable + snprintf(command, sizeof(command)-1, "%citem2 %d 1 0 0 0 0 0 0 0", atcommand->at_symbol, item_data->nameid); + else + snprintf(command, sizeof(command)-1, "%citem %d 20", atcommand->at_symbol, item_data->nameid); atcommand->parse(fd, sd, command, 1); return; } - // FIXME: Stackables have a quantity of 20. - // FIXME: Equips are supposed to be unidentified. - - if( itemdb->search_name(monster_item_name) ) { - snprintf(command, sizeof(command)-1, "%citem %s", atcommand->at_symbol, monster_item_name); + if( (mob_data=mob_db(mobdb_searchname(monster_item_name))) + && strcmp(mob_data->sprite, monster_item_name) != 0 ) { // It only accepts sprite name + snprintf(command, sizeof(command)-1, "%cmonster %s", atcommand->at_symbol, mob_data->name); atcommand->parse(fd, sd, command, 1); return; } -- cgit v1.2.3-70-g09d2 From 8cd740d2c77f69216f2c7d10f77773d30104ae83 Mon Sep 17 00:00:00 2001 From: Matheus Macabu Date: Thu, 11 Jul 2013 13:20:44 -0300 Subject: Fixed a little type (follow up to 94d75f8), also defaulted to 0 mute system. --- conf/battle/client.conf | 2 +- src/map/clif.c | 2 +- src/map/mail.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map/clif.c') diff --git a/conf/battle/client.conf b/conf/battle/client.conf index c832163be..eae8aad3b 100644 --- a/conf/battle/client.conf +++ b/conf/battle/client.conf @@ -117,4 +117,4 @@ client_sort_storage: no // Note: Do not enable this, if you enabled commands for players, // because the client sees multiple commands in succession as spam. // Default: 0 (means disabled) -client_accept_chatdori: 1 +client_accept_chatdori: 0 diff --git a/src/map/clif.c b/src/map/clif.c index 18aa476ff..f557271be 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11861,7 +11861,7 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) { if( RFIFOW(fd,2) ) sprintf(cmd,"%cskreset",atcommand->at_symbol); else - sprintf(cmd,"%streset",atcommand->at_symbol); + sprintf(cmd,"%cstreset",atcommand->at_symbol); atcommand->parse(fd, sd, cmd, 1); } diff --git a/src/map/mail.c b/src/map/mail.c index 021a51cde..93304bac0 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -200,4 +200,4 @@ void mail_defaults(void) mail->openmail = mail_openmail; mail->deliveryfail = mail_deliveryfail; mail->invalid_operation = mail_invalid_operation; -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2