-	script	party_search	FAKE_NPC,{

OnInit:
	//-------------------------------------------------------------------------------------------------	
		set .svn,1;			// 0 - rAthena/eAthena, 1 - Hercules
		set .towncdtime,10;		// 5 = 5 minutes Town
		set .globalcdtime,1;		// 1 = 1 minute Global
		set .need,5000;
		set .n$, "^FF0000[ Party Search ]^000000";
		//set .Map$,"prontera";
		bindatcmd "sparty","party_search::OnDoSearch",0,100;		// Admin reset command
end;

OnDoSearch:
	if(BaseLevel >=80){
		mes .n$;
		mes "Using this service, you agree to pay 5,000z";
		next;
	
		if (select("Never Mind", "I agree.") == 2) {	
			set .@time,gettimetick(2);
			set .@cd,(60*.globalcdtime);
			if(.@time - #globalannouncetimer < .@cd) {
				set .@k,#globalannouncetimer - (gettimetick(2)-.@cd);
				set .@m,.@k % 3600 / 60;
				set .@s,.@k % 60;
				set .@m$, .@m+" minute"+((.@m <= 1)?"":"s");
				set .@s$, .@s+" second"+((.@s <= 1)?"":"s");
				set .@time$,""+.@m$+" "+.@s$+"";
				mes "[^ff0000 System ^000000]"; 
				mes "I'm sorry but you have to wait"; 
				mes ""+.@time$+" before you can request again.";
				close;	
			}
			if(Zeny < .need){
				mes .n$;	
				mes "Sorry you don't have enough zeny.";
				mes "We need at least 5,000 zeny.";
				close;
			}
			set #globalannouncetimer,gettimetick(2);
			close2;
			set Zeny, Zeny - .need;
			chanmsg("#recruit","Player [ "+strcharinfo(PC_NAME)+" ] is a [ lv:"+BaseLevel+" "+jobname(Class)+" ] looking for a party!");
			close;
		}
		mes .n$;
		mes "Okay, come back when you are ready.";
		close;
	} else {
		set .@time,gettimetick(2);
		set .@cd,(60*.globalcdtime);
		if(.@time - #globalannouncetimer < .@cd) {
			set .@k,#globalannouncetimer - (gettimetick(2)-.@cd);
			set .@m,.@k % 3600 / 60;
			set .@s,.@k % 60;
			set .@m$, .@m+" minute"+((.@m <= 1)?"":"s");
			set .@s$, .@s+" second"+((.@s <= 1)?"":"s");
			set .@time$,""+.@m$+" "+.@s$+"";
			mes "[^ff0000 System ^000000]"; 
			mes "I'm sorry but you have to wait"; 
			mes ""+.@time$+" before you can request again.";
			close;	
		}
		set #globalannouncetimer,gettimetick(2);
		chanmsg("#recruit","Player [ "+strcharinfo(PC_NAME)+" ] is a [ lv:"+BaseLevel+" "+jobname(Class)+" ] looking for a party!");
		close;
	}
}