"S5L1_finish.sce"
{
	INT joan_in_place_recno

	INT joan_recno 
	INT alencon_recno 
	INT jean_recno
	INT lahire_recno
	INT charles_recno
	INT flavy_recno

	init 
	{
		joan_recno = FUNC("get_main_character") 
		alencon_recno = FUNC("search_unit_by_code" , "Alencon")
		jean_recno = FUNC("search_unit_by_code" , "Jean_De_Metz")
		lahire_recno = FUNC("search_unit_by_code", "Lahire")
		charles_recno = FUNC("search_unit_by_code", "CHARLIE7")
		flavy_recno	  = FUNC("search_unit_by_code", "Flavy")
	}

// ********* Main Goal ******
// *** 1 *****
//	if ( FUNC("get_place_captured", jargeau_recno) )
//	{
//		FUNC("set_end_condition_finish", 1, "WIN")
//	}


// ********* Lose Goal *********
// *** 2 ****

	// Joan defeat
	if ( FUNC("is_unit_dead", joan_recno) == 1)
	{
//		FUNC("attention_call_message", "You have been defeat!")
//		WAIT{ FUNC("pause_script", 4000) }	
		FUNC("call_gameover_msg", "You have failed in your attempt to reclaim Paris for France - the war is now doomed for failure, and France will be no more!")
		FUNC("set_end_condition_finish" , 3, "LOSE")	
	}

	if ( FUNC("is_unit_dead", jean_recno) == 1)
	{
//		FUNC("attention_call_message", "You have been defeat!")
//		WAIT{ FUNC("pause_script", 4000) }	
		FUNC("call_gameover_msg", "Jean de Metz has been slain in battle - you have failed in your impertaive to maintain Jean de Metz alive throughout the mission!")
		FUNC("set_end_condition_finish" , 24, "LOSE")	
	}

	if ( FUNC("is_unit_dead", lahire_recno) == 1)
	{
//		FUNC("attention_call_message", "You have been defeat!")
//		WAIT{ FUNC("pause_script", 4000) }	
		FUNC("call_gameover_msg", "La Hire has been slain in battle - you have failed in your impertaive to maintain La Hire alive throughout the mission!")
		FUNC("set_end_condition_finish" , 9, "LOSE")	
	}

	if ( FUNC("is_unit_dead", charles_recno) == 1)
	{
		FUNC("call_gameover_msg", "Charles VII has been slain in battle - you have failed in your impertaive to maintain Charles VII alive throughout the mission!")
		FUNC("set_end_condition_finish" , 35, "LOSE")	
	}

	if ( FUNC("is_unit_dead", flavy_recno) == 1)
	{
		FUNC("call_gameover_msg", "Guillaume de Flavy has been slain in battle - you have failed in your impertaive to maintain Guillaume de Flavy alive throughout the mission!")
		FUNC("set_end_condition_finish" , 30, "LOSE")	
	}

	if ( FUNC("is_unit_dead", flavy_recno) == 1)
	{
		FUNC("call_gameover_msg", "Duke of Alencon has been slain in battle - you have failed in your impertaive to maintain Duke of Alencon alive throughout the mission!")
		FUNC("set_end_condition_finish" , 40, "LOSE")	
	}

// *** 3 ****

	// Alencon defeat
//	if ( FUNC("is_unit_dead", alencon_recno) == 1)
//	{
//		FUNC("attention_call_message", "Alencon have been defeat!")
//		WAIT{ FUNC("pause_script", 4000) }	
//		FUNC("set_end_condition_finish" , 5, "LOSE")	
//	}

// *** 4 ****

	// Jean defeat
//	if ( FUNC("is_unit_dead", jean_recno) == 1)
//	{
//		FUNC("attention_call_message", "Jean have been defeat!")
//		WAIT{ FUNC("pause_script", 4000) }	
//		FUNC("set_end_condition_finish" , 6, "LOSE")	
//	}

// *** 5 ****

	// Lahire defeat
//	if ( FUNC("is_unit_dead", lahire_recno) == 1)
//	{
//		FUNC("attention_call_message", "Lahire have been defeat!")
//		WAIT{ FUNC("pause_script", 4000) }	
//		FUNC("set_end_condition_finish" , 7, "LOSE")	
//	}

	exit
}
