Disabled 3rd Jobs and Baby 3rd jobs in @jobchange/@job command

Jedzkie

The Master of White Spaces
Messages
632
Points
0
Age
33
Location
Philippines
Discord
✪ Jedzkie#0662
IRC Nickname
Jedzkie
Github
Jedzkie
Emulator
Client Version
2016-03-16 RE
Hi! i already tried changing this:

Code:
			// High Jobs, Babies and Third			for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){				if (strncmpi(message, pc->job_name(i), 16) == 0) {					job = i;					found = true;				}			}
 
to this:
// High Jobs, Babies and Third for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){ if (strncmpi(message, pc->job_name(i), 16) == 0) { job = i; found = true; } }
Now, my problem is, i can still do job change to 3rd jobs.

 
Last edited by a moderator:
I wanted to do this also because of stubborn GM's that when the server is set to just 2nd Class or just Transcendants., they will still change into 3rd Class showing off. possible way could be binding the @job instead of doing a source Mod.

 
Last edited by a moderator:
there are 2 places, 1 for string, the other for numbers

Code:
 src/map/atcommand.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex b5e8fa7..958addb 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -951,7 +951,7 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { 			for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){ 				if (strncmpi(message, pc->job_name(i), 16) == 0) { 					job = i;-					found = true;+					found = false; 				} 			} 			@@ -973,8 +973,12 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { 		return true; 	} 	-	if (pcdb_checkid(job)) {-		if (pc->jobchange(sd, job, upper) == 0)+	if ( pcdb_checkid(job) ) {+		if ( job & JOBL_UPPER || upper == 1 ) {+			clif->message(fd, msg_txt(155)); // You are unable to change your job.+			return false;+		}+		else if (pc->jobchange(sd, job, upper) == 0) 			clif->message(fd, msg_txt(12)); // Your job has been changed. 		else { 			clif->message(fd, msg_txt(155)); // You are unable to change your job.
 
Thank you annie.

 
LMAO !!

I messed up the upper job (JOBL_UPPER) and third job (JOBL_THIRD)

1 more time

patchy

Code:
 src/map/atcommand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex b5e8fa7..1c11ad7 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -973,8 +973,12 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { 		return true; 	} 	-	if (pcdb_checkid(job)) {-		if (pc->jobchange(sd, job, upper) == 0)+	if ( pcdb_checkid(job) ) {+		if ( pc->jobid2mapid(job) & JOBL_THIRD ) {+			clif->message(fd, msg_txt(155)); // You are unable to change your job.+			return false;+		}+		else if (pc->jobchange(sd, job, upper) == 0) 			clif->message(fd, msg_txt(12)); // Your job has been changed. 		else { 			clif->message(fd, msg_txt(155)); // You are unable to change your job.
 
Last edited by a moderator:
LMAO !!

I messed up the upper job (JOBL_UPPER) and third job (JOBL_THIRD)

1 more time

patchy

src/map/atcommand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex b5e8fa7..1c11ad7 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -973,8 +973,12 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) { return true; } - if (pcdb_checkid(job)) {- if (pc->jobchange(sd, job, upper) == 0)+ if ( pcdb_checkid(job) ) {+ if ( pc->jobid2mapid(job) & JOBL_THIRD ) {+ clif->message(fd, msg_txt(155)); // You are unable to change your job.+ return false;+ }+ else if (pc->jobchange(sd, job, upper) == 0) clif->message(fd, msg_txt(12)); // Your job has been changed. else { clif->message(fd, msg_txt(155)); // You are unable to change your job.
@@AnnieRuru, can you update this code to support the latest version of hercules? Thanks!

 
hmm ... its simpler this time

someone must have optimized this code

Code:
 src/map/atcommand.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex ff88f2c..cabef1e 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -1019,6 +1019,11 @@ ACMD(jobchange) 		return true; 	} +	if ( pc->jobid2mapid(job) & JOBL_THIRD ) {+		clif->message(fd, msg_fd(fd,155)); // You are unable to change your job.+		return false;+	}+ 	if (pc->jobchange(sd, job, upper) != 0) { 		clif->message(fd, msg_fd(fd,155)); // You are unable to change your job. 		return false;
 
Last edited by a moderator:
hmm ... its simpler this time

someone must have optimized this code

src/map/atcommand.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex ff88f2c..cabef1e 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -1019,6 +1019,11 @@ ACMD(jobchange) return true; } + if ( pc->jobid2mapid(job) & JOBL_THIRD ) {+ clif->message(fd, msg_fd(fd,155)); // You are unable to change your job.+ return false;+ }+ if (pc->jobchange(sd, job, upper) != 0) { clif->message(fd, msg_fd(fd,155)); // You are unable to change your job. return false;
Thanks annie, ill try this.

 
Back
Top