//===== Hercules Script ======================================
//= Universal Rental NPC
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.2
//===== Description: =========================================
//= One-click automatic mount rentals.
//= Replaced 'close' with 'end' [Streusel]
//= Fixed 'close' issues. [Joseph]
//============================================================
//@unloadnpc Universal Rental
//@loadnpc npc/amatsu/match/rental.txt

tournament,83,97,2	script	Universal Rental	4_F_JOB_BLACKSMITH,{
	if(countitem($key) == 0){
		mes "[ Armory ]";
		mes "I can only assist delegates for GvG Match.";
		close;
	}
	/* TODO: This can be optimized with just setmount(), as it can
		 auto-detect the proper mount for the class/skills. */
	if (hascashmount()) {
		message strcharinfo(PC_NAME),"You must first remove your mount.";
		end;
	} else if (!checkcart() && getskilllv(MC_PUSHCART)) {
		setcart;
	} else if (!checkfalcon() && getskilllv(HT_FALCON) && !checkwug()) {
		setfalcon;
	} else if (checkmount() != MOUNT_PECO && getskilllv(KN_RIDING)) {
		setmount; // Peco or Dragon
	} else {
		message strcharinfo(PC_NAME),"You do not meet requirements to rent.";
		end;
	}
	specialeffect(EF_TEIHIT3, AREA, playerattached());
	end;
}

//============================================================
// Old changelog
//============================================================
//= A Free PecoPeco and Falcon Breeder
//= 1.1 FIXED checkriding/cart/falcon funcs [Lupus]
//= 1.2 Added Rebirth/Advanced Class support [Mass Zero]
//= 1.3 Simplified the checks of job [Silentdragon]
//= 1.3a Fixed a Typo Error. [Samuray22]
//=      Thanks to ~AnnieRuru~.
//= 1.4 Optimized Script. No need for 50 million Labels. [Spre]
//============================================================
