From b20054a678fc5a2786819e879f085e5dcf02c052 Mon Sep 17 00:00:00 2001 From: Guilherme Menaldo Date: Sat, 1 Jun 2019 14:47:24 -0300 Subject: Add identifyall atcommand Signed-off-by: Haru --- src/map/atcommand.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 3c454011f..a2db15f6c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6769,23 +6769,34 @@ ACMD(refreshall) } /*========================================== - * @identify + * @identify / @identifyall * => GM's magnifier. *------------------------------------------*/ ACMD(identify) { int num = 0; + bool identifyall = (strcmpi(info->command, "identifyall") == 0); - for (int i = 0; i < sd->status.inventorySize; i++) { - if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify!=1){ - num++; + if (!identifyall) { + for (int i = 0; i < sd->status.inventorySize; i++) { + if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify != 1) { + num++; + } } - } - if (num > 0) { - clif->item_identify_list(sd); } else { - clif->message(fd,msg_fd(fd,1238)); // There are no items to appraise. + for (int i = 0; i < sd->status.inventorySize; i++) { + if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify != 1) { + skill->identify(sd, i); + num++; + } + } } + + if (num == 0) + clif->message(fd,msg_fd(fd,1238)); // There are no items to appraise. + else if (!identifyall) + clif->item_identify_list(sd); + return true; } @@ -10061,6 +10072,7 @@ static void atcommand_basecommands(void) ACMD_DEF(refresh), ACMD_DEF(refreshall), ACMD_DEF(identify), + ACMD_DEF2("identifyall", identify), ACMD_DEF(misceffect), ACMD_DEF(mobsearch), ACMD_DEF(cleanmap), -- cgit v1.2.3-70-g09d2