summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Menaldo <guilherme.menaldo@outlook.com>2019-06-01 14:47:24 -0300
committerHaru <haru@dotalux.com>2019-07-01 01:22:32 +0200
commitb20054a678fc5a2786819e879f085e5dcf02c052 (patch)
tree660dbb77e3a9255abef686c6e0aec7f04eb49964
parent24c4d531b150863caed448fbbf4a9964dadbb63e (diff)
downloadhercules-b20054a678fc5a2786819e879f085e5dcf02c052.tar.gz
hercules-b20054a678fc5a2786819e879f085e5dcf02c052.tar.bz2
hercules-b20054a678fc5a2786819e879f085e5dcf02c052.tar.xz
hercules-b20054a678fc5a2786819e879f085e5dcf02c052.zip
Add identifyall atcommand
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--doc/atcommands.txt6
-rw-r--r--src/map/atcommand.c28
2 files changed, 26 insertions, 8 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 4acc30ae6..c909440a7 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -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.
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),