//============================================================ 
//===== rAthena Script =======================================
//= Global Functions
//===== Description: =========================================
//= General script functions.
//===== Changelogs: ==========================================
//= 1.0 WoeTECheckHour(X) function check if the woe
//	will start in X seconds. [Capuche]
//============================================================

// WoeTETimeStart(<seconds>) : return 1 if the woe te will start in less than X seconds, 0 otherwise
function	script	WoeTETimeStart	{
	.@woe_status = agitcheck3();
	.@min_today  = gettime(2);
	.@hour_today = gettime(3);
	.@day_today  = gettime(4);

	if (getvariableofnpc( getd( ".day_"+ .@day_today ),"woe_TE_contoller" )) {
		.@h = getvariableofnpc( getd( ".hour_start_"+ .@hour_today ),"woe_TE_contoller" );
		if (.@h > .@hour_today) {
			.@time = (60 - .@min_today) *60 + ( .@h - .@hour_today -1 ) *3600;
			if (.@time <= getarg(0))
				return 1;
		}
	}
	return 0;
}
