//===== 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,37,103,6	script	Job Master#g	2_M_MOLGENSTEIN,{
	while(1) {
		mes "^FF0000Job Master^000000";
		mes "Please select your job.";
		next;
		menu implode(.job_name$, ":"), -;
		.@index = @menu - 1;
		switch(select("Confirm - [ "+ callfunc("colour","008800", .job_name$[.@index]) +" ]:Change selection:"+ callfunc("colour","FF0000", "End session") )) {
		case 1:
			close2();
			callfunc("changejob",.job_id[.@index] );
			callfunc("getplatinum");
			end;
				
		case 2:
			break;
		
		case 3:
			close;
		}
	}
	end;

	
	/*-----------------------------------------------------
	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;
}

//09294377152
//3609747

function	script	colour	{
	return "^"+ getarg(0) + getarg(1) +"^000000";
}

function	script	changejob	{
	jobchange (getarg(0));
	resetskill;
	resetstatus;
	BaseLevel = 99;
	JobLevel = 50;
	skill NV_BASIC, 9, 0;	// Level 9 Basic Skill
	SkillPoint = 98;	// 49 First, 49 2nd
	StatPoint = 1273;
	jobchange_level = 50;
	set ADVJOB,0;
	callfunc "F_ClearJobVar";
	percentheal(10000, 10000);	
	return;
}

function	script	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;
}
	
