Jump to content
  • 0
Sign in to follow this  
Jedzkie

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

Question

Hi! i already tried changing 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;				}			}

 
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.

Edited by Frost

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

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.

Edited by THPO

Share this post


Link to post
Share on other sites
  • 0

there are 2 places, 1 for string, the other for numbers

 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.

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

 

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!

Share this post


Link to post
Share on other sites
  • 0

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;

Share this post


Link to post
Share on other sites
  • 0

 

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.