Skip to content
Permalink
Browse files

Add identifyall atcommand

Signed-off-by: Haru <haru@dotalux.com>
  • Loading branch information...
guilherme-gm authored and MishimaHaruna committed Jun 1, 2019
1 parent 24c4d53 commit b20054a678fc5a2786819e879f085e5dcf02c052
Showing with 26 additions and 8 deletions.
  1. +6 −0 doc/atcommands.txt
  2. +20 −8 src/map/atcommand.c
@@ -584,6 +584,12 @@ Opens the Identification window if any unappraised items are in your inventory.

---------------------------------------

@identifyall

Identifies all unappraised items in your inventory.

---------------------------------------

@trade <player name>

Opens the trade window with the specified player.
@@ -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),

0 comments on commit b20054a

Please sign in to comment.
You can’t perform that action at this time.