//===== Hercules Script ======================================
//= Job Master
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.4
//===== Description: =========================================
//= A fully functional job changer.
//===== Additional Comments: =================================
//= 1.1 Fixed reset on Baby job change. [Euphy]
//= 1.2 Added Expanded Super Novice support and initial Kagerou/Oboro support. [Euphy]
//= 1.3 Kagerou/Oboro added. [Euphy]
//= 1.4 Improved legibility (renamed variables, replaced
//      numbers with constants; Changed syntax to match
//      Hercules standards; Fixed status point exploit upon
//      Baby Novice job change. [Haru]
//============================================================

tournament,88,105,6	script	Job Master	2_F_MAGICMASTER,{
	if(countitem($key) == 0){
		mes "[ Job Master ]";
		mes "I can only assist delegates for GvG Match.";
		close;
	}
	if( getcharid(CHAR_ID_GUILD) ){
		mes "[ Job Master ]";
		mes "Oppps! You must leave guild before you can change job again.";
		close;
	}

	function colour; function getplatinum;
	menu implode(.job_name$, ":"), -;
	.@index = @menu - 1;
	switch(select("Confirm - ["+ colour("008800", .job_name$[.@index]) +"]:Change selection:"+ colour("FF0000", "End session"))) {
	case 1:
		jobchange (.trans ? .job_id_t[.@index] : .job_id[.@index]);
		resetskill;
		/*-----------------------------------------------------
		Job Change Settings
		-----------------------------------------------------*/
		BaseLevel = 99;	// Max base level
		JobLevel = 50;		// Max job level
		skill NV_BASIC, 9, 0;	// Level 9 Basic Skill
		SkillPoint = 98;	// 49 First, 49 2nd
		jobchange_level = 50;
		set ADVJOB,0;
		callfunc "F_ClearJobVar";
		percentheal(10000, 10000);
		getplatinum ();
		/*---------------------------------------------------*/
		close;
				
	case 2:
		break;
		
	case 3:
		close;
	}

	/*-----------------------------------------------------
	Function: colour()
	-------------------------------------------------------
	Description: Colours the defined string.
	-------------------------------------------------------
	Usage:
	colour("<colour hex>", "<string>");
	-----------------------------------------------------*/
	function colour {
		return "^"+ getarg(0) + getarg(1) +"^000000";
	}

function getplatinum {
	skill NV_FIRSTAID, 1, 0;
	if (BaseClass == Job_Novice) {
		if (Class != Job_SuperNovice)
			skill NV_TRICKDEAD, 1, 0;
	} else if (BaseClass == Job_Swordman) {
		skill SM_MOVINGRECOVERY, 1, 0;
		skill SM_FATALBLOW, 1, 0;
		skill SM_AUTOBERSERK, 1, 0;
	} else if (BaseClass == Job_Mage) {
		skill MG_ENERGYCOAT, 1, 0;
	} else if (BaseClass == Job_Archer) {
		skill AC_MAKINGARROW, 1, 0;
		skill AC_CHARGEARROW, 1, 0;
	} else if (BaseClass == Job_Acolyte) {
		skill AL_HOLYLIGHT, 1, 0;
	} else if (BaseClass == Job_Merchant) {
		skill MC_CARTREVOLUTION, 1, 0;
		skill MC_CHANGECART, 1, 0;
		skill MC_LOUD, 1, 0;
	} else if (BaseClass == Job_Thief) {
		skill TF_SPRINKLESAND, 1, 0;
		skill TF_BACKSLIDING, 1, 0;
		skill TF_PICKSTONE, 1, 0;
		skill TF_THROWSTONE, 1, 0;
	}
	
	return;
}
	
	
	/*-----------------------------------------------------
	Configuration
	-----------------------------------------------------*/
	OnInit:
		.trans = 0;	// Transcend? 0 = no, 1 = yes (default: 1)
		
		// Job names
		setarray .job_name$[0],	"Knight", "Priest", "Wizard", "Blacksmith", "Hunter", "Assassin",
								"Crusader", "Monk", "Sage", "Rogue", "Alchemist", "Bard/Dancer";
		
		// Job IDs
		setarray .job_id[0],	Job_Knight, Job_Priest, Job_Wizard, Job_Blacksmith, Job_Hunter, Job_Assassin,
								Job_Crusader, Job_Monk, Job_Sage, Job_Rogue, Job_Alchemist, Job_Bard;
		
		end;
	

}
