Jump to content
  • 0
Bringer

Adding Custom Job

Question

mmo.hpp

//These mark the ID of the jobs, as expected by the client. [Skotlex]
enum e_job {

	JOB_STAR_EMPEROR,
	JOB_SOUL_REAPER,
	JOB_BABY_STAR_EMPEROR,
	JOB_BABY_SOUL_REAPER,
	JOB_STAR_EMPEROR2,
	JOB_BABY_STAR_EMPEROR2,

	JOB_PADAWAN = 4230,
	JOB_JEDI = 4231,
	JOB_SITH = 4232,
	JOB_MAX,
};

map.hpp

//First Jobs
//Note the oddity of the novice:
//Super Novices are considered the 2-1 version of the novice! Novices are considered a first class type, too...
enum e_mapid : uint64{

//Baby 3-2 Jobs
	MAPID_BABY_ROYAL_GUARD = JOBL_THIRD|MAPID_BABY_CRUSADER,
	MAPID_BABY_SORCERER,
	MAPID_BABY_MINSTRELWANDERER,
	MAPID_BABY_SURA,
	MAPID_BABY_GENETIC,
	MAPID_BABY_SHADOW_CHASER,
	MAPID_BABY_SOUL_REAPER,

//Star Wars Job
	MAPID_PADAWAN,
	MAPID_JEDI = JOBL_2_1 | MAPID_PADAWAN,
	MAPID_SITH = JOBL_2_2 | MAPID_PADAWAN,
// Additional constants
	MAPID_ALL = UINT64_MAX
};

pc.cpp
 

/*==========================================
 * Convert's from the client's lame Job ID system
 * to the map server's 'makes sense' system. [Skotlex]
 *------------------------------------------*/
int pc_jobid2mapid(unsigned short b_class)

	//Baby 3-2 Jobs
		case JOB_BABY_ROYAL_GUARD:      return MAPID_BABY_ROYAL_GUARD;
		case JOB_BABY_SORCERER:         return MAPID_BABY_SORCERER;
		case JOB_BABY_MINSTREL:
		case JOB_BABY_WANDERER:         return MAPID_BABY_MINSTRELWANDERER;
		case JOB_BABY_SURA:             return MAPID_BABY_SURA;
		case JOB_BABY_GENETIC:          return MAPID_BABY_GENETIC;
		case JOB_BABY_SHADOW_CHASER:    return MAPID_BABY_SHADOW_CHASER;
		case JOB_BABY_SOUL_REAPER:      return MAPID_BABY_SOUL_REAPER;
	//Doram Jobs
		case JOB_SUMMONER:              return MAPID_SUMMONER;
	//Custom Jobs
		case JOB_PADAWAN:               return MAPID_PADAWAN;
		case JOB_JEDI:                  return MAPID_JEDI;
		case JOB_SITH:                  return MAPID_SITH;
		default:
			return -1;
	}
}

//Reverts the map-style class id to the client-style one.
int pc_mapid2jobid(unsigned short class_, int sex)
{

	//Baby 3-2 Jobs
		case MAPID_BABY_ROYAL_GUARD:      return JOB_BABY_ROYAL_GUARD;
		case MAPID_BABY_SORCERER:         return JOB_BABY_SORCERER;
		case MAPID_BABY_MINSTRELWANDERER: return sex?JOB_BABY_MINSTREL:JOB_BABY_WANDERER;
		case MAPID_BABY_SURA:             return JOB_BABY_SURA;
		case MAPID_BABY_GENETIC:          return JOB_BABY_GENETIC;
		case MAPID_BABY_SHADOW_CHASER:    return JOB_BABY_SHADOW_CHASER;
		case MAPID_BABY_SOUL_REAPER:      return JOB_BABY_SOUL_REAPER;
	//Doram Jobs
		case MAPID_SUMMONER:              return JOB_SUMMONER;
	//Custom Jobs
		case MAPID_PADAWAN:               return JOB_PADAWAN;
		case MAPID_JEDI:                  return JOB_JEDI;
		case MAPID_SITH:                  return JOB_SITH;
		default:
			return -1;
	}

/*====================================================
 * This function return the name of the job (by [Yor])
 *----------------------------------------------------*/
const char* job_name(int class_)
{

	case JOB_STAR_EMPEROR:
	case JOB_SOUL_REAPER:
	case JOB_BABY_STAR_EMPEROR:
	case JOB_BABY_SOUL_REAPER:
		return msg_txt(NULL,782 - JOB_STAR_EMPEROR + class_);

	case JOB_STAR_EMPEROR2:
		return msg_txt(NULL,782);

	case JOB_BABY_STAR_EMPEROR2:
		return msg_txt(NULL,784);

	case JOB_PADAWAN: // Custom Jobs
	case JOB_JEDI:
	case JOB_SITH:
		return msg_txt(NULL,790 - JOB_PADAWAN + class_);

	default:
		return msg_txt(NULL,655);
	}
}

script_constants.hpp
 

	export_constant(JOB_STAR_EMPEROR);
	export_constant(JOB_SOUL_REAPER);
	export_constant(JOB_BABY_STAR_EMPEROR);
	export_constant(JOB_BABY_SOUL_REAPER);
	export_constant(JOB_STAR_EMPEROR2);
	export_constant(JOB_BABY_STAR_EMPEROR2);
	export_constant(JOB_PADAWAN);
	export_constant(JOB_JEDI);
	export_constant(JOB_SITH);

	export_constant2("EAJ_SUPER_NOVICE",MAPID_SUPER_NOVICE);
	export_constant2("EAJ_SUPERNOVICE",MAPID_SUPER_NOVICE);
	export_constant2("EAJ_SUPER_BABY",MAPID_SUPER_BABY);
	export_constant2("EAJ_SUPER_NOVICE_E",MAPID_SUPER_NOVICE_E);
	export_constant2("EAJ_SUPER_BABY_E",MAPID_SUPER_BABY_E);

	export_constant2("EAJ_SUMMONER",MAPID_SUMMONER);

	export_constant2("EAJ_PADAWAN", MAPID_PADAWAN);
	export_constant2("EAJ_JEDI", MAPID_JEDI);
	export_constant2("EAJ_SITH", MAPID_SITH);

inter.cpp

/* from pc.cpp due to @accinfo. any ideas to replace this crap are more than welcome. */
const char* job_name(int class_) {


		case JOB_PADAWAN:
		case JOB_JEDI:
		case JOB_SITH:
			return msg_txt(790 - JOB_PADAWAN + class_);

		default:
			return msg_txt(199);
	}
}

anyone can tell what is missing ?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.   Paste as plain text instead

  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.



×
×
  • Create New...

Important Information

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