summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-05-01 02:46:40 +0200
committerGitHub <noreply@github.com>2017-05-01 02:46:40 +0200
commitbbfa7d9b536fc499961cb1d0d3569008f158f0d7 (patch)
treed40d8e7db8a14dd20a906435b2e6d3fdf72aaebc
parenta20d06809f0c2ab15442744fba16ee90e3fb0bec (diff)
parent27e2e06ad3acfa7a43e781d3a7963897b82f16df (diff)
downloadhercules-bbfa7d9b536fc499961cb1d0d3569008f158f0d7.tar.gz
hercules-bbfa7d9b536fc499961cb1d0d3569008f158f0d7.tar.bz2
hercules-bbfa7d9b536fc499961cb1d0d3569008f158f0d7.tar.xz
hercules-bbfa7d9b536fc499961cb1d0d3569008f158f0d7.zip
Merge pull request #1698 from Jedzkie/10-BodyStyle
Added job checks for @bodystyle command
-rw-r--r--conf/messages.conf2
-rw-r--r--src/map/atcommand.c20
2 files changed, 18 insertions, 4 deletions
diff --git a/conf/messages.conf b/conf/messages.conf
index a1b070391..e14ec239a 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -60,7 +60,7 @@
32: PvP: On.
33: GvG: Off.
34: GvG: On.
-//35 FREE
+35: This job has no alternate body styles.
36: Appearance changed.
37: An invalid number was specified.
38: Invalid location number, or name.
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index bf816faa7..13eab74ec 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1714,7 +1714,21 @@ ACMD(bodystyle)
memset(atcmd_output, '\0', sizeof(atcmd_output));
- if (!*message || sscanf(message, "%d", &body_style) < 1) {
+ if ((sd->job & MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS
+ && (sd->job & MAPID_THIRDMASK) != MAPID_GENETIC
+ && (sd->job & MAPID_THIRDMASK) != MAPID_MECHANIC
+ && (sd->job & MAPID_THIRDMASK) != MAPID_ROYAL_GUARD
+ && (sd->job & MAPID_THIRDMASK) != MAPID_ARCH_BISHOP
+ && (sd->job & MAPID_THIRDMASK) != MAPID_RANGER
+ && (sd->job & MAPID_THIRDMASK) != MAPID_WARLOCK
+ && (sd->job & MAPID_THIRDMASK) != MAPID_SHADOW_CHASER
+ && (sd->job & MAPID_THIRDMASK) != MAPID_MINSTRELWANDERER
+ ) {
+ clif->message(fd, msg_fd(fd, 35)); // This job has no alternate body styles.
+ return false;
+ }
+
+ if (*message == '\0' || sscanf(message, "%d", &body_style) < 1) {
sprintf(atcmd_output, "Please, enter a body style (usage: @bodystyle <body ID: %d-%d>).", MIN_BODY_STYLE, MAX_BODY_STYLE);
clif->message(fd, atcmd_output);
return false;
@@ -1722,9 +1736,9 @@ ACMD(bodystyle)
if (body_style >= MIN_BODY_STYLE && body_style <= MAX_BODY_STYLE) {
pc->changelook(sd, LOOK_BODY2, body_style);
- clif->message(fd, msg_txt(36)); // Appearence changed.
+ clif->message(fd, msg_fd(fd, 36)); // Appearence changed.
} else {
- clif->message(fd, msg_txt(37)); // An invalid number was specified.
+ clif->message(fd, msg_fd(fd, 37)); // An invalid number was specified.
return false;
}