"S3L1_tactic.sce"
{
	INT count_time

	INT unit_recno 
	INT talk_unit_recno 
	INT talk_unit_recno2
	INT interact_unit_recno

	INT sell_potion_list_id2

	INT citizen_one_recno 
	INT citizen_two_recno 
	INT weapon_seller_recno 
	INT potion_seller_recno

	INT joan_recno
	INT jean_recno
	//INT la_hire_recno
	INT orlean_recno

	INT tower_guard_recno

	INT jean_arrow_count

	INT gate_bridge_recno
	INT gate_door_recno
	INT spy_guard_recno
	INT john_recno
	INT	gate_spawn_leader_recno_a
	INT	gate_spawn_leader_recno_b
	INT	gate_spawn_leader_recno_c
	INT	gate_spawn_leader_recno_d
	INT	gate_spawn_leader_recno_e
	INT	gate_spawn_leader_recno_f
	INT	gate_spawn_leader_recno_g
	INT	gate_spawn_leader_recno_h

	INT additional_spawn_leader_1
	INT additional_spawn_leader_2
	INT additional_spawn_leader_3

	INT left_battle_place_recno
	INT middle_battle_place_recno
	INT right_battle_place_recno_a
	INT right_battle_place_recno_b
	INT right_battle_place_recno_c

	INT john_retreat_place_recno

	INT staircase_citizen_recno
	INT old_citizen_recno

	INT farcher_recno_a
	INT farcher_recno_b
	INT farcher_recno_c
	INT farcher_recno_d
	INT barrack_spawn_point_a
	INT barrack_spawn_point_b
	INT barrack_spawn_point_c
	INT barrack_spawn_point_d
	INT castle_wall_place_recno_r
	INT castle_wall_place_recno_l

	INT	william_recno
	INT archer_cap_recno_a
	INT archer_cap_recno_b
	INT infantry_cap_recno_a
	INT poleman_cap_recno_a
	INT poleman_cap_recno_b
	INT bur_inf_cap_recno_a
	INT bur_inf_cap_recno_b
	//INT infantry_cap_recno_b
	INT additional_reinforcement_leader_1
	INT additional_reinforcement_leader_2
	INT additional_reinforcement_leader_3
	INT additional_reinforcement_leader_4
	INT additional_reinforcement_leader_5
	INT additional_reinforcement_leader_6

	INT town_b_cap_recno_a
	INT town_b_cap_recno_b

	INT	lahire_guard_a_recno
	INT	lahire_guard_b_recno
	INT	lahire_guard_c_recno
	INT	lahire_guard_d_recno
	INT	orlean_guard_a_recno
	INT	orlean_guard_b_recno
	INT	joan_guard_a_recno
	INT	joan_guard_b_recno
	INT	jean_guard_a_recno
	INT	jean_guard_b_recno

	INT weapon_shop_recno 
	INT potion_shop_recno

	INT	orlean_building_place_recno
	INT	barrack_place_recno
	
	INT joan_team_place_recno
	INT jean_defend_place_recno
	INT defend_gate_place_recno
	INT check_enemy_place_recno
	INT check_enemy_place_recno_2
	INT no_spawn_place_recno
	INT introduce_orlean_place_recno
	INT joan_spawn_point_a
	INT joan_spawn_point_b
	INT jean_spawn_point_a
	INT jean_spawn_point_b

	INT gate_place_recno
	INT gate_spawn_point_a
	INT gate_spawn_point_b
	INT gate_spawn_point_c
	INT gate_spawn_point_d
	INT gate_spawn_point_e
	INT gate_spawn_point_f
	INT gate_spawn_point_g
	INT gate_spawn_point_h

	INT additional_spawn_1
	INT additional_spawn_2
	INT additional_spawn_3
	INT additional_spawn_4
	INT additional_spawn_5
	INT additional_spawn_6
	INT additional_spawn_7
	INT additional_spawn_8
	INT additional_spawn_9

	//INT gate_enemy_num
	INT gate_spawn_count

	INT town_place_recno_a
	INT town_place_recno_b
	INT block_place_recno
	INT block_item_recno

	INT reinforcement_place_recno
	INT reinforcement_spawn_point_a
	INT reinforcement_spawn_point_b
	INT reinforcement_spawn_point_c
	INT reinforcement_spawn_point_d
	INT reinforcement_spawn_point_e
	INT reinforcement_spawn_point_f
	INT reinforcement_spawn_point_g
	INT reinforcement_spawn_point_h
	INT reinforcement_spawn_point_i
	INT reinforcement_spawn_point_j
	INT reinforcement_spawn_point_k
	INT reinforcement_spawn_point_l
	INT reinforcement_spawn_point_m
	INT reinforcement_spawn_point_n
	INT reinforcement_spawn_point_o
	INT reinforcement_spawn_point_p
	INT reinforcement_spawn_point_q
	INT reinforcement_spawn_point_r
	INT reinforcement_spawn_point_s
	INT reinforcement_spawn_point_t
	INT reinforcement_spawn_point_u
	INT reinforcement_spawn_point_v
	INT reinforcement_spawn_point_w
	INT reinforcement_spawn_point_x
	INT reinforcement_spawn_point_y

	INT additional_reinforcement_1
	INT additional_reinforcement_2
	INT additional_reinforcement_3
	INT additional_reinforcement_4
	INT additional_reinforcement_5
	INT additional_reinforcement_6

	INT cannon_recno_a
	INT cannon_controller_recno_a
	INT cannon_controller_recno_d
	INT cannon_recno_b
	INT cannon_controller_recno_b
	INT cannon_controller_recno_e
	INT cannon_recno_c
	INT cannon_controller_recno_c
	INT cannon_controller_recno_f
	INT cannon_attach_index
	INT cannon_attach_x
	INT cannon_attach_y
	INT cannon_attach_z
	INT cannon_distance

	INT engarch_id
	INT engarchcap_id
	INT elinfant_id
	INT ehinfant_id
	INT ehinfcap_id
	INT elinfcap_id
	INT flinfcap_id
	INT flinfant_id
	INT fhinfant_id
	INT farchcap_id
	INT farch_id
	INT blinfcap_id
	INT blinfant_id
	INT epoleman_id
	INT epolecap_id
	INT john_id
	INT william_id

	INT joan_sword_id
	INT bow_id
	INT at_warrior_id 
	INT yhwh_id
	INT citrine_id

	INT group_id

	INT dist 

	INT dialog_recno


	INT user_choice

	init 
	{
		FUNC("set_kill_citizen_limit", 18)
//		FUNC("set_minimap_rectangular_vision_area_enable", 1, 2810, 2808, 11531, 11524)

		joan_recno = FUNC("search_unit_by_name", "Joanna d'Arc")
		citizen_one_recno = FUNC("search_unit_by_name", "Citizen 1")
		citizen_two_recno = FUNC("search_unit_by_name", "Citizen 2")
		staircase_citizen_recno = FUNC("search_unit_by_name", "Thierry Cuirier")
		old_citizen_recno = FUNC("search_unit_by_name", "Macaire Houlier")

		orlean_building_place_recno = FUNC("search_place_by_name", "The Building of Orlean") 
		barrack_place_recno = FUNC("search_place_by_name", "Barrack") 

		jean_defend_place_recno = FUNC("search_place_by_name", "Jean Defend Place")
		defend_gate_place_recno = FUNC("search_place_by_name", "Defend Gate Place")
		check_enemy_place_recno = FUNC("search_place_by_name", "Check Enemy Place")
		check_enemy_place_recno_2 = FUNC("search_place_by_name", "Check Enemy Place 2")
		no_spawn_place_recno = FUNC("search_place_by_name", "No Spawn Place")
		introduce_orlean_place_recno = FUNC("search_place_by_name", "Introduce Orlean Place")
		joan_team_place_recno = FUNC("search_place_by_name", "Joan Team Place") 
		joan_spawn_point_a = FUNC("search_facility_by_name", "Joan Team Spawn Point 1")
		joan_spawn_point_b = FUNC("search_facility_by_name", "Joan Team Spawn Point 2")
		jean_spawn_point_a = FUNC("search_facility_by_name", "Jean Team Spawn Point 1")
		jean_spawn_point_b = FUNC("search_facility_by_name", "Jean Team Spawn Point 2")

		gate_place_recno = FUNC("search_place_by_name", "Gate Spawn Place") 
		gate_spawn_point_a = FUNC("search_facility_by_name", "Gate Spawn Point 1")
		gate_spawn_point_b = FUNC("search_facility_by_name", "Gate Spawn Point 2")
		gate_spawn_point_c = FUNC("search_facility_by_name", "Gate Spawn Point 3")
		gate_spawn_point_d = FUNC("search_facility_by_name", "Gate Spawn Point 4")
		gate_spawn_point_e = FUNC("search_facility_by_name", "Gate Spawn Point 5")
		gate_spawn_point_f = FUNC("search_facility_by_name", "Gate Spawn Point 6")
		gate_spawn_point_g = FUNC("search_facility_by_name", "Gate Spawn Point 7")
		gate_spawn_point_h = FUNC("search_facility_by_name", "Gate Spawn Point 8")

		additional_spawn_1 = FUNC("search_facility_by_name", "Additional Spawn 1")
		additional_spawn_2 = FUNC("search_facility_by_name", "Additional Spawn 2")
		additional_spawn_3 = FUNC("search_facility_by_name", "Additional Spawn 3")
		additional_spawn_4 = FUNC("search_facility_by_name", "Additional Spawn 4")
		additional_spawn_5 = FUNC("search_facility_by_name", "Additional Spawn 5")
		additional_spawn_6 = FUNC("search_facility_by_name", "Additional Spawn 6")
		additional_spawn_7 = FUNC("search_facility_by_name", "Additional Spawn 7")
		additional_spawn_8 = FUNC("search_facility_by_name", "Additional Spawn 8")
		additional_spawn_9 = FUNC("search_facility_by_name", "Additional Spawn 9")

		left_battle_place_recno = FUNC("search_place_by_name", "Left Battle Place")
		middle_battle_place_recno = FUNC("search_place_by_name", "Middle Battle Place")
		right_battle_place_recno_a = FUNC("search_place_by_name", "Right Battle Place 1")
		right_battle_place_recno_b = FUNC("search_place_by_name", "Right Battle Place 2")
		right_battle_place_recno_c = FUNC("search_place_by_name", "Right Battle Place 3")

		john_retreat_place_recno = FUNC("search_place_by_name", "John Retreat Place")

		barrack_spawn_point_a = FUNC("search_facility_by_name", "Barrack Spawn Point 1")
		barrack_spawn_point_b = FUNC("search_facility_by_name", "Barrack Spawn Point 2")
		barrack_spawn_point_c = FUNC("search_facility_by_name", "Barrack Spawn Point 3")
		barrack_spawn_point_d = FUNC("search_facility_by_name", "Barrack Spawn Point 4")
		castle_wall_place_recno_r = FUNC("search_place_by_name", "Castle Wall Place R")
		castle_wall_place_recno_l = FUNC("search_place_by_name", "Castle Wall Place L")

		town_place_recno_a = FUNC("search_place_by_name", "S3L1_2_Town_1_Place")
		town_place_recno_b = FUNC("search_place_by_name", "S3L1_2_Town_2_Place")
		block_place_recno = FUNC("search_place_by_name", "S3L1_2_Block_Place")
		block_item_recno = FUNC("search_item_by_name", "S3_Block")

		reinforcement_place_recno = FUNC("search_place_by_name", "Reinforcement Place") 
		reinforcement_spawn_point_a = FUNC("search_facility_by_name", "Reinforcement Spawn Point 1")
		reinforcement_spawn_point_b = FUNC("search_facility_by_name", "Reinforcement Spawn Point 2")
		reinforcement_spawn_point_c = FUNC("search_facility_by_name", "Reinforcement Spawn Point 3")
		reinforcement_spawn_point_d = FUNC("search_facility_by_name", "Reinforcement Spawn Point 4")
		reinforcement_spawn_point_e = FUNC("search_facility_by_name", "Reinforcement Spawn Point 5")
		reinforcement_spawn_point_f = FUNC("search_facility_by_name", "Reinforcement Spawn Point 6")
		reinforcement_spawn_point_g = FUNC("search_facility_by_name", "Reinforcement Spawn Point 7")
		reinforcement_spawn_point_h = FUNC("search_facility_by_name", "Reinforcement Spawn Point 8")
		reinforcement_spawn_point_i = FUNC("search_facility_by_name", "Reinforcement Spawn Point 9")
		reinforcement_spawn_point_j = FUNC("search_facility_by_name", "Reinforcement Spawn Point 10")
		reinforcement_spawn_point_k = FUNC("search_facility_by_name", "Reinforcement Spawn Point 11")
		reinforcement_spawn_point_l = FUNC("search_facility_by_name", "Reinforcement Spawn Point 12")
		reinforcement_spawn_point_m = FUNC("search_facility_by_name", "Reinforcement Spawn Point 13")
		reinforcement_spawn_point_n = FUNC("search_facility_by_name", "Reinforcement Spawn Point 14")
		reinforcement_spawn_point_o = FUNC("search_facility_by_name", "Reinforcement Spawn Point 15")
		reinforcement_spawn_point_p = FUNC("search_facility_by_name", "Reinforcement Spawn Point 16")
		reinforcement_spawn_point_q = FUNC("search_facility_by_name", "Reinforcement Spawn Point 17")
		reinforcement_spawn_point_r = FUNC("search_facility_by_name", "Reinforcement Spawn Point 18")
		reinforcement_spawn_point_s = FUNC("search_facility_by_name", "Reinforcement Spawn Point 19")
		reinforcement_spawn_point_t = FUNC("search_facility_by_name", "Reinforcement Spawn Point 20")
		reinforcement_spawn_point_u = FUNC("search_facility_by_name", "Reinforcement Spawn Point 21")
		reinforcement_spawn_point_v = FUNC("search_facility_by_name", "Reinforcement Spawn Point 22")
		reinforcement_spawn_point_w = FUNC("search_facility_by_name", "Reinforcement Spawn Point 23")
		reinforcement_spawn_point_x = FUNC("search_facility_by_name", "Reinforcement Spawn Point 24")
		reinforcement_spawn_point_y = FUNC("search_facility_by_name", "Reinforcement Spawn Point 25")

		additional_reinforcement_1 = FUNC("search_facility_by_name", "Additional Reinforcement 1")
		additional_reinforcement_2 = FUNC("search_facility_by_name", "Additional Reinforcement 2")
		additional_reinforcement_3 = FUNC("search_facility_by_name", "Additional Reinforcement 3")
		additional_reinforcement_4 = FUNC("search_facility_by_name", "Additional Reinforcement 4")
		additional_reinforcement_5 = FUNC("search_facility_by_name", "Additional Reinforcement 5")
		additional_reinforcement_6 = FUNC("search_facility_by_name", "Additional Reinforcement 6")

		engarch_id = FUNC("unit_code_to_id", "ENGLISH_ARCHER") 
		FUNC("add_unit_ref", "ENGLISH_ARCHER") 
		engarchcap_id = FUNC("unit_code_to_id", "ENGLISH_ARCHER_CAPTAIN")
		FUNC("add_unit_ref", "ENGLISH_ARCHER_CAPTAIN") 
		elinfant_id = FUNC("unit_code_to_id", "ENGLISH_LIGHT_INFANTRY") 
		FUNC("add_unit_ref", "ENGLISH_LIGHT_INFANTRY") 
		ehinfant_id = FUNC("unit_code_to_id", "ENGLISH_HEAVY_INFANTRY") 
		FUNC("add_unit_ref", "ENGLISH_HEAVY_INFANTRY") 
		ehinfcap_id = FUNC("unit_code_to_id", "ENGLISH_HEAVY_INFANTRY_CAPTAIN")
		FUNC("add_unit_ref", "ENGLISH_HEAVY_INFANTRY_CAPTAIN") 
		elinfcap_id = FUNC("unit_code_to_id", "ENGLISH_LIGHT_INFANTRY_CAPTAIN")
		FUNC("add_unit_ref", "ENGLISH_LIGHT_INFANTRY_CAPTAIN") 
		flinfant_id = FUNC("unit_code_to_id", "FRENCH_LIGHT_INFANTRY")
		FUNC("add_unit_ref", "FRENCH_LIGHT_INFANTRY") 
		fhinfant_id = FUNC("unit_code_to_id", "FRENCH_HEAVY_INFANTRY")
		FUNC("add_unit_ref", "FRENCH_HEAVY_INFANTRY") 
		farchcap_id = FUNC("unit_code_to_id", "FRENCH_ARCHER_CAPTAIN")
		FUNC("add_unit_ref", "FRENCH_ARCHER_CAPTAIN") 
		farch_id = FUNC("unit_code_to_id", "FRENCH_ARCHER")
		FUNC("add_unit_ref", "FRENCH_ARCHER")
		blinfcap_id = FUNC("unit_code_to_id", "BUR_LIGHTINFANTRY_CAPTAIN")
		FUNC("add_unit_ref", "BUR_LIGHTINFANTRY_CAPTAIN") 
		blinfant_id = FUNC("unit_code_to_id", "BUR_LIGHTINFANTRY")
		FUNC("add_unit_ref", "BUR_LIGHTINFANTRY") 
		epolecap_id = FUNC("unit_code_to_id", "ENGLISH_POLEMAN_CAPTAIN")
		FUNC("add_unit_ref", "ENGLISH_POLEMAN_CAPTAIN") 
		epoleman_id = FUNC("unit_code_to_id", "ENGLISH_POLEMAN")
		FUNC("add_unit_ref", "ENGLISH_POLEMAN") 
		john_id = FUNC("unit_code_to_id", "john_de_la_pole")
		FUNC("add_unit_ref", "john_de_la_pole") 
		william_id = FUNC("unit_code_to_id", "william_de_la_pole")
		FUNC("add_unit_ref", "william_de_la_pole") 

		at_warrior_id = FUNC("item_code_to_id", "Warrior")
		yhwh_id = FUNC("item_code_to_id", "Yhwh")

		if( FUNC("get_scenario_stage") == 0 )
		{
			FUNC("set_can_interact_flag", staircase_citizen_recno, 1)
			ACTION("give_task", staircase_citizen_recno, "IDLE", 1, 0, 0, 0, 0) 
			//FUNC("set_idle", staircase_citizen_recno)
			FUNC("set_can_interact_flag", old_citizen_recno, 1)
			ACTION("give_task", old_citizen_recno, "IDLE", 1, 0, 0, 0, 0) 
			//FUNC("set_idle", old_citizen_recno)
		}

		weapon_seller_recno = FUNC("search_unit_by_name", "Achard Gantier")
		potion_seller_recno = FUNC("search_unit_by_name", "Gilles Tollot")
		jean_recno = FUNC("search_unit_by_name", "Jean de Metz")
		orlean_recno = FUNC("search_unit_by_name", "Bastard z Orleanu")

		tower_guard_recno = FUNC("search_unit_by_name", "Stra¿nik Wie¿y")

		if( FUNC("get_scenario_stage") == 0 )
		{
			FUNC("set_control_flag", jean_recno, 0)
			FUNC("set_unit_ranking", orlean_recno, "CAPTAIN")
			FUNC("set_can_interact_flag", orlean_recno, 1)

			jean_arrow_count = FUNC("get_item_quantity_in_unit_inventory", FUNC("item_code_to_id", "arrow"), jean_recno)
			if ( jean_arrow_count < 90 )
			{
				FUNC("give_item_to_unit", "arrow", 1, ( 90 - jean_arrow_count ), jean_recno)
			}
		}
		//la_hire_recno = FUNC("search_unit_by_name", "La Hire")

		if( FUNC("get_scenario_stage") == 2 )
		{
			ACTION("give_task", jean_recno, "DEFEND_PLACE", 1, joan_team_place_recno, 0, 0, 0) 
			//ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 1, barrack_place_recno, 0, 0, 0)
			ACTION("give_task", orlean_recno, "DEFEND_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
		}

		FUNC("set_unit_retreat", jean_recno, 1)
		//FUNC("set_unit_retreat", la_hire_recno, 1)

		spy_guard_recno = FUNC("search_unit_by_name", "Wartownik")

		gate_bridge_recno = FUNC("search_item_by_name", "Castle Bridge")
		if( FUNC("get_scenario_stage") == 0 )
		{
			FUNC("add_gate_trigger", gate_bridge_recno, 0)
		}
		FUNC("set_item_can_interact_flag", gate_bridge_recno, 0)
		gate_door_recno = FUNC("search_item_by_name", "Castle Gate")

		town_b_cap_recno_a = FUNC("search_unit_by_name", "Philip Essendine")
		town_b_cap_recno_b = FUNC("search_unit_by_name", "Stephan Baldewyne")

		lahire_guard_a_recno = FUNC("search_unit_by_name", "Barrack Guard 1")
		lahire_guard_b_recno = FUNC("search_unit_by_name", "Barrack Guard 2")
		lahire_guard_c_recno = FUNC("search_unit_by_name", "Barrack Guard 3")
		lahire_guard_d_recno = FUNC("search_unit_by_name", "Barrack Guard 4")
		orlean_guard_a_recno = FUNC("search_unit_by_name", "Building Guard 1")
		orlean_guard_b_recno = FUNC("search_unit_by_name", "Building Guard 2")

		if( FUNC("get_scenario_stage") == 0 )
		{
			FUNC("set_control_flag", orlean_guard_a_recno, 0)
			FUNC("set_control_flag", orlean_guard_b_recno, 0)

			FUNC("set_item_can_interact_flag", gate_door_recno, 0 )
		}


		sell_potion_list_id2 = FUNC("search_item_sell_list_by_code", "S3L1_potion2")

		weapon_shop_recno = FUNC("search_facility_by_name" , "Weapon Shop") 
		potion_shop_recno = FUNC("search_facility_by_name" , "Potion Shop") 

		//FUNC("set_scenario_mode", "SCENARIO_INTERACT_MODE") 

		//ACTION("give_task", citizen_one_recno, "IDLE", 1, 0, 0, 0, 0) 
		//ACTION("give_task", citizen_two_recno, "IDLE", 1, 0, 0, 0, 0) 
		//ACTION("give_task", spy_guard_recno, "IDLE", 1, 0, 0, 0, 0) 

		if( FUNC("get_scenario_stage") < 3 )
		{
			FUNC("set_parking_dir", orlean_building_place_recno, 180)
		}
		else if( FUNC("get_scenario_stage") == 3 && FUNC("get_scenario_event_bit_flag", 0) == 0 )
		{
			FUNC("set_parking_dir", orlean_building_place_recno, 180)
		}
		else
		{
			FUNC("set_parking_dir", orlean_building_place_recno, 0)
		}
		if( FUNC("get_scenario_stage") == 0)
		{
			FUNC("set_scenario_mode", "SCENARIO_NORMAL_MODE")

//	 		FUNC("set_can_interact_flag", citizen_one_recno, 1)
//			FUNC("set_can_interact_flag", citizen_two_recno, 1)
			FUNC("set_can_interact_flag", weapon_seller_recno, 1)
			FUNC("set_can_interact_flag", potion_seller_recno, 1)
			FUNC("set_can_interact_flag", joan_recno, 1)
			FUNC("set_can_interact_flag", jean_recno, 1)
			//FUNC("set_can_interact_flag", orlean_recno, 1)
			//FUNC("set_can_interact_flag", la_hire_recno, 1)
			FUNC("set_can_interact_flag", spy_guard_recno, 1)

			FUNC("set_unit_team", joan_recno, 1)

			ACTION("give_task", weapon_seller_recno, "IDLE", 1, 0, 0, 0, 0) 
			ACTION("give_task", potion_seller_recno, "IDLE", 1, 0, 0, 0, 0) 

//			FUNC("facility_barrack_add_member", joan_spawn_point_a, flinfant_id, 1, 2, 2)
//			FUNC("facility_barrack_add_member", joan_spawn_point_b, fhinfant_id, 1, 2, 2)
//			FUNC("facility_barrack_add_member", jean_spawn_point_a, flinfant_id, 2, 2, 2)
//			FUNC("facility_barrack_add_member", jean_spawn_point_b, flinfant_id, 2, 2, 2)
		}

		if( FUNC("get_scenario_stage") == 2 )
		{
			if( FUNC("get_scenario_event_bit_flag", 0) == 0 )
			{
				FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 1, 0) 
			}
			else
			{
				FUNC("minimap_set_way_point", 1, 3268.6, 10691.0, 2.0, 1, 0)
				FUNC("minimap_set_way_point", 2, 9371.8, 8658.0, 0.0, 1, 0)

				//if( FUNC("get_scenario_event_bit_flag", 2) == 1)
				//{
				//	if( FUNC("get_scenario_event_bit_flag", 1) == 0)
				//	{
				//		FUNC("minimap_set_way_point", 9371.8, 8658.0, 0.0, 1)
				//	}
				//}
				//else
				//{
				//	if( FUNC("get_scenario_event_bit_flag", 1) == 0)
				//	{
				//		FUNC("minimap_set_way_point", 9371.8, 8658.0, 0.0, 1)
				//	}
				//	else
				//	{
				//		FUNC("minimap_set_way_point", 3268.6, 10691.0, 2.0, 1)
				//	}
				//}
			}
		}

		if( FUNC("get_scenario_stage") < 3 )
		{
			FUNC("set_scenario_mode", "SCENARIO_NORMAL_MODE")
		}
		else if( FUNC("get_scenario_stage") == 4 )
		{
			FUNC("set_scenario_mode", "SCENARIO_NORMAL_MODE")
		}
		else
		{
			FUNC("set_scenario_mode", "SCENARIO_BATTLE_MODE")
		}

		if( FUNC("get_end_condition_finish", 12) == 0 )
		{
			FUNC("set_minimap_icon_display_enable", "fcamp_s3l2_1f", 0)
			FUNC("set_minimap_icon_display_enable", "ecamp_s3l2_1e", 1)
		}
		else
		{
			FUNC("set_minimap_icon_display_enable", "fcamp_s3l2_1f", 1)
			FUNC("set_minimap_icon_display_enable", "ecamp_s3l2_1e", 0)
		}
		if( FUNC("get_end_condition_finish", 11) == 0 )
		{
			FUNC("set_minimap_icon_display_enable", "fcamp_s3l2_2f", 0)
			FUNC("set_minimap_icon_display_enable", "ecamp_s3l2_2e", 1)
		}
		else
		{
			FUNC("set_minimap_icon_display_enable", "fcamp_s3l2_2f", 1)
			FUNC("set_minimap_icon_display_enable", "ecamp_s3l2_2e", 0)
		}
	} 

	unit_recno = FUNC("get_main_character")

	//first cut scene
	if( FUNC("get_scenario_stage") == 1 )
	{

		FUNC("display_title_screen", "", 10, 0, 0)	// to cover the scene first!
		FUNC("set_stop_unit_process_flag" , 1)	// enter cut scene! 
		WAIT{ FUNC("pause_script", 50) }	// wait for the loading of the scene
		FUNC("set_stop_unit_process_flag" , 0)	// enter cut scene! 


		WAIT
		{
			FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
			FUNC("set_end_cut_scene_type", 1)
		}

		FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
		FUNC("set_unit_can_process_in_cut_scene", jean_recno, 1)
		FUNC("set_unit_can_process_in_cut_scene", joan_recno, 1)

		// set main character to idle
		FUNC("set_idle", jean_recno)
		FUNC("set_idle", joan_recno) 
		//FUNC("set_idle", la_hire_recno)

		ACTION("stop_all_order", jean_recno) 
		//ACTION("stop_all_order", la_hire_recno) 

		WAIT { DIALOG("add_dialog", jean_recno, "[0001N]Madamoselle, one of France's foremost generals, the Bastard of Orléans, is awaiting your acquaintance at the town hall. Please, come with me.") }
		//WAIT { DIALOG("add_dialog", la_hire_recno, "[0001N]Please - don't mind his self-proclaimed ''title''. Jean de Metz will lead you there whilst I remain at the barracks to train more units - we will need all possible help!") }
		DIALOG("del_all_dialog") 

		ACTION("give_order" , jean_recno, "APPROACH_PLACE" , 1 , 1 , joan_team_place_recno , 0 , 0 , 0, 30000)
		//ACTION("give_order" , la_hire_recno, "APPROACH_PLACE" , 1 , 1 , barrack_place_recno , 0 , 0 , 0, 30000)
		if ( FUNC("is_cut_scene_finished", 1) == 0 )
		{
			WAIT { FUNC("pause_script", 1000) }
		}

		// leave cut scene
		//FUNC("set_cut_scene_flag" , 0)
		//WAIT { FUNC("is_cut_scene_finished") }
		//FUNC("show_scenario_brief")
		FUNC("end_cut_scene_2", 0, 1)
		WAIT{ FUNC("is_cut_scene_status_black_screen") }
		WAIT{ FUNC("show_scenario_brief") }
		FUNC("set_charmove_detect_block_flag", 0)

		ACTION("give_task", jean_recno, "DEFEND_PLACE", 1, joan_team_place_recno, 0, 0, 0) 
		ACTION("give_task", joan_recno, "FOLLOW_UNIT", 1, jean_recno, 90, 0, 0) 
		//ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 1, barrack_place_recno, 0, 0, 0)

		//FUNC("attention_call_message_2", "", "Jean de Metz")
		//FUNC("attention_call_message_2", "", "La Hire")

		FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 1, 0) 

		FUNC("set_citizen_killed_count")
			
		FUNC("set_scenario_stage", 2)

		exit		
	}

	//talk_unit_recno = FUNC("get_interact_unit_recno", joan_recno) 
	////talk_unit_recno2 = FUNC("get_interact_unit_recno", la_hire_recno)

	interact_unit_recno = FUNC("get_interact_unit_recno", unit_recno)

	if( spy_guard_recno > 0 && interact_unit_recno == spy_guard_recno )
	{
		FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
		FUNC("set_unit_can_process_in_cut_scene", spy_guard_recno, 1)	// all unit can process

		//FUNC("stop_curr_task", unit_recno)
		ACTION("stop_all_order", unit_recno) 

		FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

		// set main character to idle
		FUNC("set_idle", unit_recno) 

		ACTION("stop_all_order", spy_guard_recno ) 

		ACTION("give_order" , spy_guard_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , spy_guard_recno , unit_recno) , 0 , 0 , 0, 2500)
		ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , spy_guard_recno) , 0 , 0 , 0, 2500)

		WAIT { DIALOG("add_dialog", spy_guard_recno, "[0002N]Bonjour mes amis. We are repairing the castle gates. During their last attack the English swine damaged the drawbridge. It will take a few more days to restore but alas it cannot be raised until these repairs are complete.") }

		// leave cut scene
		DIALOG("del_all_dialog") 

		FUNC("set_interact_unit_recno", unit_recno, 0) 

		FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 
		WAIT { FUNC("is_cut_scene_finished") }
		FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process
	}

	// block path
	if( FUNC("get_scenario_stage") < 5 )
	{
		if( FUNC("get_scenario_bit_flag", 17) == 0 )
		{
			if( FUNC("is_unit_inside_place", block_place_recno, unit_recno) == 1 )
			{
				if( FUNC("get_scenario_stage") < 4 )
				{
					FUNC("attention_call_message", "[0003N]You cannot go beyond the battlefield - your duties beckon.")
				}
				else if( FUNC("get_scenario_stage") == 4 && FUNC("get_scenario_event_bit_flag", 0) == 0 )
				{
					FUNC("attention_call_message", "[0003N]You cannot go beyond the battlefield - your duties beckon.")
				}
				FUNC("set_scenario_bit_flag", 17, 1)
			}
		}
	}


	if( FUNC("get_scenario_stage") == 2 )
	{
		if( staircase_citizen_recno > 0 && interact_unit_recno == staircase_citizen_recno )
		{
			FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
			FUNC("set_unit_can_process_in_cut_scene", staircase_citizen_recno, 1)	// all unit can process

			//FUNC("stop_curr_task", unit_recno)
			ACTION("stop_all_order", unit_recno) 

			FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

			// set main character to idle
			FUNC("set_idle", unit_recno) 

			ACTION("stop_all_order", staircase_citizen_recno ) 

			ACTION("give_order" , staircase_citizen_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , staircase_citizen_recno , unit_recno) , 0 , 0 , 0, 2500)
			ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , staircase_citizen_recno) , 0 , 0 , 0, 2500)

			WAIT { DIALOG("add_dialog", staircase_citizen_recno, "[0004N]Mas oui! ... The joint assault by the English and Burgundians seriously damaged our walls.") }
			WAIT { DIALOG("add_dialog", staircase_citizen_recno, "[0005N]Although it occurred just two fortnights ago we have already managed to rebuild and strengthen our walls, however the staircases are still in need of repair.") }

			// leave cut scene
			DIALOG("del_all_dialog") 

			FUNC("set_interact_unit_recno", unit_recno, 0) 

			FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 
			WAIT { FUNC("is_cut_scene_finished") }
			FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

			FUNC("set_can_interact_flag", staircase_citizen_recno, 0)
		}
	}

	if( FUNC("get_scenario_stage") == 2 )
	{
		if( old_citizen_recno > 0 && interact_unit_recno == old_citizen_recno )
		{
			FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
			FUNC("set_unit_can_process_in_cut_scene", old_citizen_recno, 1)	// all unit can process

			//FUNC("stop_curr_task", unit_recno)
			ACTION("stop_all_order", unit_recno) 

			FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

			// set main character to idle
			FUNC("set_idle", unit_recno) 

			ACTION("stop_all_order", old_citizen_recno ) 

			ACTION("give_order" , old_citizen_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , old_citizen_recno , unit_recno) , 0 , 0 , 0, 2500)
			ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , old_citizen_recno) , 0 , 0 , 0, 2500)

			WAIT { DIALOG("add_dialog", old_citizen_recno, "[0006N]I have witnessed the birth of many springs here in Orléans and lived long through both good and bad tidings. Let me show you something...") }
			WAIT{ FUNC("change_camera_in_cut_scene", 0, 4194, 5815, 654, 350, 60, 8) }
			WAIT { DIALOG("add_dialog", old_citizen_recno, "[0007N]This tree... I remember when it was just a sapling! As time has passed us by this tree has aged gracefully, sadly the same cannot be said of my debilitating condition.") }
			WAIT { DIALOG("add_dialog", old_citizen_recno, "[0008N]I long for the day when once again peace may rule over our country. That I may still see this tree standing 'till the day I am lain to mine rest.") }

			// leave cut scene
			DIALOG("del_all_dialog") 

			FUNC("set_interact_unit_recno", unit_recno, 0) 

			//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 
			//WAIT { FUNC("is_cut_scene_finished") }
			FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process
			FUNC("end_cut_scene", 0)
			WAIT{ FUNC("is_cut_scene_finished") }

			FUNC("set_can_interact_flag", old_citizen_recno, 0)
		}
	}

	if( FUNC("get_scenario_stage") == 2 )
	{
		if( joan_recno > 0 && interact_unit_recno == joan_recno )
		{
			FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
			FUNC("set_unit_can_process_in_cut_scene", joan_recno, 1)	// all unit can process
			//FUNC("stop_curr_task", joan_recno)
			ACTION("stop_all_order", joan_recno) 

			//FUNC("stop_curr_task", unit_recno)
			ACTION("stop_all_order", unit_recno) 

			FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

			// set main character to idle
			FUNC("set_idle", unit_recno)

			ACTION("stop_all_order", joan_recno ) 

			ACTION("give_order" , joan_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , joan_recno , unit_recno) , 0 , 0 , 0, 2500)
			ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , joan_recno) , 0 , 0 , 0, 2500)

			WAIT { DIALOG("add_dialog", jean_recno, "[0009N]Going to meet Orléans, I presume, milady...") }

			// leave cut scene
			DIALOG("del_all_dialog") 

			FUNC("set_interact_unit_recno", unit_recno, 0) 

			FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 
			WAIT { FUNC("is_cut_scene_finished") }
			FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process
		}
	}

	if( jean_recno > 0 && interact_unit_recno == jean_recno )
	{
		FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
		FUNC("set_unit_can_process_in_cut_scene", jean_recno, 1)	// all unit can process
		FUNC("stop_curr_task", jean_recno)
		ACTION("stop_all_order", jean_recno) 

		//FUNC("stop_curr_task", unit_recno)
		ACTION("stop_all_order", unit_recno) 

		FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

		// set main character to idle
		FUNC("set_idle", unit_recno) 

		ACTION("stop_all_order", jean_recno ) 

		ACTION("give_order" , jean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , jean_recno , unit_recno) , 0 , 0 , 0, 2500)
		ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , jean_recno) , 0 , 0 , 0, 2500)

		if(unit_recno == joan_recno)
		{
			WAIT { DIALOG("add_dialog", jean_recno, "[0010N]Come with me, mademoiselle - the Bastard of Orléans is anxious to meet with you.") }
		}
		//if(unit_recno == la_hire_recno)
		//{
		//	WAIT { DIALOG("add_dialog", jean_recno, "[0004N]A fine day isn't it, La Hire? I'm taking Joan to meet with the Duke.") }
		//}

		// leave cut scene
		DIALOG("del_all_dialog") 

		FUNC("set_interact_unit_recno", unit_recno, 0) 

		FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 
		WAIT { FUNC("is_cut_scene_finished") }
		FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

		ACTION("give_task", jean_recno, "DEFEND_PLACE", 1, joan_team_place_recno, 0, 0, 0) 
	}

	//if( la_hire_recno > 0 && interact_unit_recno == la_hire_recno )
	//{
	//	FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
	//	FUNC("set_unit_can_process_in_cut_scene", la_hire_recno, 1)	// all unit can process
	//	FUNC("stop_curr_task", la_hire_recno)
	//	ACTION("stop_all_order", la_hire_recno) 
	//
	//	// set main character to idle
	//	//FUNC("stop_curr_task", unit_recno)
	//	ACTION("stop_all_order", unit_recno) 
	//	FUNC("set_idle", unit_recno) 
	//
	//	FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
	//
	//	ACTION("stop_all_order", la_hire_recno ) 
	//
	//	ACTION("give_order" , la_hire_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , la_hire_recno , unit_recno) , 0 , 0 , 0, 2500)
	//	ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , la_hire_recno) , 0 , 0 , 0, 2500)
	//	if(unit_recno == joan_recno)
	//	{
	//		if( FUNC("get_scenario_event_bit_flag", 0) == 0 )
	//		{
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]The Bastard of Orléans is expecting to meet with you at the town hall now.") }
	//		}
	//		else if( FUNC("get_interact_stage", la_hire_recno) == 0 )
	//		{
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]Bonjour! I am training some new recruits for combat.") }
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]If I may say, some of our units still need some polish, but mainly they're shaping up nicely. Now, you must excuse me - time stops for nobody!") }
	//
	//			FUNC("set_interact_stage", la_hire_recno, 1)
	//		}
	//		else
	//		{
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]If I may say, some of our units still need some polish, but mainly they're shaping up nicely. Now, you must excuse me - time stops for nobody!") }
	//		}
	//	}
	//	if(unit_recno == jean_recno)
	//	{
	//		if( FUNC("get_interact_stage", la_hire_recno) == 0 )
	//		{
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]Bonjour! I am training some new recruits for combat.") }
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]If I may say, some of our units still need some polish, but mainly they're shaping up nicely. Now, you must excuse me - time stops for nobody!") }
	//
	//			FUNC("set_interact_stage", la_hire_recno, 1)
	//		}
	//		else
	//		{
	//			WAIT { DIALOG("add_dialog", la_hire_recno, "[0004N]If I may say, some of our units still need some polish, but mainly they're shaping up nicely. Now, you must excuse me - time stops for nobody!") }
	//		}
	//	}
	//
	//	// leave cut scene
	//	DIALOG("del_all_dialog") 
	//
	//	FUNC("set_interact_unit_recno", unit_recno, 0) 
	//
	//	FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 
	//	WAIT { FUNC("is_cut_scene_finished") }
	//	FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process
	//
	//	ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 1, barrack_place_recno, 0, 0, 0)
	//}

	if( weapon_seller_recno > 0 && interact_unit_recno == weapon_seller_recno )	// talking with Weapon Shop Keeper~~~~~ 
	{
		FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
		FUNC("set_unit_can_process_in_cut_scene", weapon_seller_recno, 1)	// all unit can process

		//FUNC("stop_curr_task", unit_recno)
		ACTION("stop_all_order", unit_recno) 

		FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

		// set main character to idle
		FUNC("set_idle", unit_recno) 

		// set weapon seller to idle and rotate him
		ACTION("stop_all_order", weapon_seller_recno ) 

		ACTION("give_order" , weapon_seller_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , weapon_seller_recno , unit_recno) , 0 , 0 , 0, 2500)
		ACTION("give_order" , unit_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , unit_recno , weapon_seller_recno) , 0 , 0 , 0, 2500)

		if( ( FUNC("get_scenario_stage") <= 3 ) )
		{			
			if( FUNC("get_interact_stage", weapon_seller_recno) == 0 )
			{
				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0011N]Welcome to my humble workshop! I am Achard, I'm the local blacksmith, maker of fine weapons and armor. Please feel free to look around.") }

				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", weapon_shop_recno, weapon_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0012N]Thank you for your patronage - do come again.") }
				DIALOG("del_all_dialog") 

				FUNC("set_interact_stage", weapon_seller_recno, 1)
			}
			else if( FUNC("get_interact_stage", weapon_seller_recno) == 1 )
			{
				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0013N]Welcome back. I have nothing new I'm afraid, but if there is anything that catches your fancy, just let me know.") }

				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", weapon_shop_recno, weapon_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0012N]Thank you for your patronage - do come again.") }
				DIALOG("del_all_dialog") 
			}
			else
			{
				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0014N]The enemy is approaching - what are you waiting for? Make haste, go - defend us!") }
				// leave cut scene
				DIALOG("del_all_dialog") 
			}
		}
		else if( ( FUNC("get_scenario_stage") == 4 ) ) 
		{
			if ( FUNC("get_interact_stage", weapon_seller_recno) == 1 )
			{
				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0013N]Welcome back. I have nothing new I'm afraid, but if there is anything that catches your fancy, just let me know.") }
				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", weapon_shop_recno, weapon_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0012N]Thank you for your patronage - do come again.") }
				DIALOG("del_all_dialog") 
			}
			else if ( FUNC("get_interact_stage", weapon_seller_recno) == 2 )
			{
				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0015N]Many thanks for saving us from the English attack! Please, take this - I trust you will put it to good use.") }

				// leave cut scene
				DIALOG("del_all_dialog") 

				// receive arrows
				FUNC( "give_item_to_unit", "ARROW_EXPLOSIVE", 1, 20, unit_recno )

				FUNC("set_interact_stage", weapon_seller_recno, 3)
			}
			else
			{
				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0013N]Welcome back. I have nothing new I'm afraid, but if there is anything that catches your fancy, just let me know.") }

				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", weapon_shop_recno, weapon_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0012N]Thank you for your patronage - do come again.") }
				DIALOG("del_all_dialog") 
			}
		}
		else
		{
			WAIT { DIALOG("add_dialog", weapon_seller_recno, "[0014N]The enemy is approaching - what are you waiting for? Make haste, go - defend us!") }

			// leave cut scene
			DIALOG("del_all_dialog") 
		}

		FUNC("set_interact_unit_recno", unit_recno, 0) 

		FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
		WAIT{ FUNC("is_cut_scene_finished") }

		FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process
	}

	// potion shop
	if( potion_seller_recno > 0 && interact_unit_recno == potion_seller_recno )	// talking with Potion shop keeper~~~~~ 
	{
		FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
		FUNC("set_unit_can_process_in_cut_scene", potion_seller_recno, 1)	// all unit can process

		//FUNC("stop_curr_task", unit_recno)
		ACTION("stop_all_order", unit_recno) 

		FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

		// set main character to idle
		FUNC("set_idle", unit_recno) 

		// set weapon seller to idle and rotate him
		ACTION("stop_all_order", potion_seller_recno ) 

		ACTION("give_order" , potion_seller_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , potion_seller_recno , unit_recno) , 0 , 0 , 0, 2500)

		if( ( FUNC("get_scenario_stage") <= 3 ) )
		{			
			if( FUNC("get_interact_stage", potion_seller_recno) == 0)
			{
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0016N]Bonjour, I'm Gilles Tollot, at your service. I carry all the freshest produce to help combat your wartime fatigue. Feel free to look around!") }

				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", potion_shop_recno, potion_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0017N]Do come by anytime if you ever need more provisions!") }
				DIALOG("del_all_dialog") 

				FUNC("set_interact_stage", potion_seller_recno, 1)
			}
			else if( FUNC("get_interact_stage", potion_seller_recno) == 1 )
			{
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0018N]Welcome back. One can never stock up enough on food - if only it weren't so unwieldy to carry in battle.") }

				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", potion_shop_recno, potion_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0017N]Do come by anytime if you ever need more provisions!") }
				DIALOG("del_all_dialog") 
			}
			else
			{
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0019N]As much as I'd like to attend to your purchasing needs, I am too scared to move! Mon dieu - Please, help us!") }

				// leave cut scene
				DIALOG("del_all_dialog") 
			}
		}
		else if( ( FUNC("get_scenario_stage") == 4 ) )
		{
			if ( FUNC("get_interact_stage", potion_seller_recno) == 1 )
			{
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0018N]Welcome back. One can never stock up enough on food - if only it weren't so unwieldy to carry in battle.") }

				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", potion_shop_recno, potion_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0017N]Do come by anytime if you ever need more provisions!") }
				DIALOG("del_all_dialog") 
			}
			else if ( FUNC("get_interact_stage", potion_seller_recno) == 2 )
			{
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0020N]Welcome, welcome, our savior!") }
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0021N]Merci - We are eternally grateful - Thanks to you, we are unscathed by the surprise English invasion.") }
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0022N]Allow me to extend a token of my esteem...") }

				// receive potions
				FUNC( "give_item_to_unit", "fd_im_chicken", 1, 1, unit_recno )
				FUNC( "give_item_to_unit", "fd_chicken", 1, 2, unit_recno )
//				FUNC( "give_item_to_unit", "fd_chicken", 1, 1, unit_recno )
				FUNC( "give_item_to_unit", "fd_apple", 1, 2, unit_recno )
//				FUNC( "give_item_to_unit", "fd_apple", 1, 1, unit_recno )
				FUNC( "give_item_to_unit", "fd_fish", 1, 2, unit_recno )
//				FUNC( "give_item_to_unit", "fd_fish", 1, 1, unit_recno )
				FUNC( "give_item_to_unit", "Quartz", 1, 1, unit_recno )

				FUNC("set_interact_stage", potion_seller_recno, 3)
			}
			else
			{
				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0018N]Welcome back. One can never stock up enough on food - if only it weren't so unwieldy to carry in battle.") }

				// leave cut scene
				DIALOG("del_all_dialog") 
				//FUNC("set_cut_scene_flag" , 0)	// stop cut scene! 

				// change to buy weapon interface, wait until finish buying
				WAIT { FUNC("start_buy_interface", potion_shop_recno, potion_seller_recno) } 

				//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				WAIT { DIALOG("add_dialog", potion_seller_recno, "[0017N]Do come by anytime if you ever need more provisions!") }
				DIALOG("del_all_dialog") 
			}
		}
		else
		{
			WAIT { DIALOG("add_dialog", potion_seller_recno, "[0019N]As much as I'd like to attend to your purchasing needs, I am too scared to move! Mon dieu - Please, help us!") }
		}

		FUNC("set_interact_unit_recno", unit_recno, 0) 

		FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
		WAIT{ FUNC("is_cut_scene_finished") }
		FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

		if( FUNC("get_scenario_stage") < 3 && FUNC("get_scenario_event_bit_flag", 0) == 1 )
		{
			//ACTION("give_task", joan_recno, "DEFEND_PLACE", 1, defend_gate_place_recno, 0, 0, 0) 

			if(FUNC("get_scenario_event_bit_flag", 1) == 0 && FUNC("get_scenario_event_bit_flag", 2) == 0)
			{
				//FUNC("facility_barrack_add_member", jean_spawn_point_a, flinfant_id, 2, 2, 2)
				//FUNC("facility_barrack_add_member", jean_spawn_point_b, flinfant_id, 2, 2, 2)
				//FUNC("attention_call_message_2", "[0001N]Frenchmen! I see the enemy in the distance, and it appears they are headed our way!", tower_guard_recno)

				FUNC("set_scenario_event_bit_flag", 1, 1)
				FUNC("set_scenario_event_bit_flag", 2, 1)
			//}
			//else if(FUNC("get_scenario_event_bit_flag", 2) == 0 )
			//{
				FUNC("set_scenario_stage", 3)
				FUNC("reset_scenario_event_bit_flag")
				FUNC("set_scenario_count_time")

				FUNC("set_unit_team", lahire_guard_a_recno, 3)
				FUNC("set_unit_team", lahire_guard_b_recno, 3)
				FUNC("set_unit_team", lahire_guard_c_recno, 3)
				FUNC("set_unit_team", lahire_guard_d_recno, 3)

				FUNC("set_can_interact_flag", staircase_citizen_recno, 0)
				FUNC("set_can_interact_flag", old_citizen_recno, 0)
				FUNC("set_can_interact_flag", orlean_recno, 0)
				//FUNC("set_can_interact_flag", la_hire_recno, 0)

			//	FUNC("set_parking_dir", orlean_building_place_recno, 0)

				FUNC("minimap_set_way_point", 1, 3268.6, 10691.0, 2.0, 0, 0)
				FUNC("minimap_set_way_point", 2, 9371.8, 8658.0, 0.0, 0, 0)
			}
		}
	}

	//jean de metz retreat
	if(FUNC("get_unit_retreat", jean_recno) == -1)
	{
		if( FUNC("get_unit_dist", jean_recno, unit_recno ) < 4000 )
		{
			FUNC("start_cut_scene_2", 1, 0, jean_recno, 200, ( 180 - FUNC("get_unit_dir", jean_recno) ), 10, 1)
			FUNC("set_unit_can_process_in_cut_scene", 0, 0)
			FUNC("set_unit_can_process_in_cut_scene", jean_recno, 1)

			FUNC("set_idle", jean_recno)
			FUNC("stop_curr_task", jean_recno)
			ACTION("give_task", jean_recno, "IDLE", 1, 1, 0, 0, 0)
			ACTION("stop_all_order", jean_recno)
						
			WAIT{ FUNC("pause_script", 1) }
			ACTION("give_task", jean_recno, "IDLE", 1, 1, 0, 0, 0)
			ACTION("stop_all_order", jean_recno)
			FUNC("set_idle", jean_recno)

			WAIT{ FUNC("is_cut_scene_status_black_screen") }
			FUNC("change_camera_in_cut_scene", 0, jean_recno, 200, ( 180 - FUNC("get_unit_dir", jean_recno) ), 10)

			WAIT{ DIALOG("add_dialog", jean_recno, "[0023N]Mademoiselle, I am afraid I cannot assist you further! My weakening health no longer allows me to fight!") }

			FUNC("enable_unit_bounding_volume", jean_recno, 0)

			WAIT{ ACTION("give_order", jean_recno, "APPROACH_PLACE", 1, 1, barrack_place_recno, 0, 0, 0, 3000) }

			DIALOG("del_all_dialog") 
			FUNC("end_cut_scene_2", 0, 1)
			WAIT{ FUNC("is_cut_scene_status_black_screen") }
			FUNC("del_unit_team", 2)
			WAIT{ FUNC("is_cut_scene_finished") }
		}
		else
		{
			//ACTION("give_task", jean_recno, "RETREAT", 99, barrack_place_recno, 1, 45000, 0)
			FUNC("attention_call_message_2", "[0024N]Milady, I can assist you no longer, for my weakening health no longer allows me to fight!", jean_recno )
			FUNC("del_unit_team", 2)
		}

		if( FUNC("get_scenario_bit_flag", 14) == 0 )
		{
			FUNC("set_scenario_bit_flag", 14, 1)
		}
	}
	////la hire retreat
	//if(FUNC("get_unit_retreat", la_hire_recno) == -1)
	//{
	//	if( FUNC("get_unit_dist", la_hire_recno, unit_recno ) < 4000 )
	//	{
	//		FUNC("start_cut_scene_2", 1, 0, la_hire_recno, 200, ( 180 - FUNC("get_unit_dir", la_hire_recno) ), 10, 1)
	//		FUNC("set_unit_can_process_in_cut_scene", 0, 0)
	//		FUNC("set_unit_can_process_in_cut_scene", la_hire_recno, 1)

	//		FUNC("set_idle", la_hire_recno)
	//		FUNC("stop_curr_task", la_hire_recno)
	//		ACTION("give_task", la_hire_recno, "IDLE", 1, 1, 0, 0, 0)
	//		ACTION("stop_all_order", la_hire_recno)
						
	//		WAIT{ FUNC("pause_script", 1) }
	//		ACTION("give_task", la_hire_recno, "IDLE", 1, 1, 0, 0, 0)
	//		ACTION("stop_all_order", la_hire_recno)
	//		FUNC("set_idle", la_hire_recno)

	//		WAIT{ FUNC("is_cut_scene_status_black_screen") }
	//		FUNC("change_camera_in_cut_scene", 0, la_hire_recno, 200, ( 180 - FUNC("get_unit_dir", la_hire_recno) ), 10)

	//		WAIT{ DIALOG("add_dialog", la_hire_recno, "[0001N]Joan, the enemy has inflicted grave hurt upon me! I'm afraid I can battle no longer!") }

	//		FUNC("enable_unit_bounding_volume", la_hire_recno, 0)

	//		WAIT{ ACTION("give_order", la_hire_recno, "APPROACH_PLACE", 1, 1, barrack_place_recno, 0, 0, 0, 3000) }

	//		DIALOG("del_all_dialog") 
	//		FUNC("end_cut_scene_2", 0, 1)
	//		WAIT{ FUNC("is_cut_scene_status_black_screen") }
	//		FUNC("del_unit_team", 3)
	//	}
	//	else
	//	{
	//		//ACTION("give_task", la_hire_recno, "RETREAT", 99, barrack_place_recno, 1, 45000, 0)
	//		FUNC("attention_call_message_2", "[0001N]Joan, the enemy has inflicted on me grave damage! I'm afraid I can battle no longer!", "La Hire")
	//		FUNC("del_unit_team", 3)
	//	}

	//	if( FUNC("get_scenario_bit_flag", 15) == 0 )
	//	{
	//		FUNC("set_scenario_bit_flag", 15, 1)
	//	}
	//}

	// interact with unit
	if( FUNC("get_scenario_stage") == 2)
	{
		//ACTION("give_task", jean_recno, "DEFEND_PLACE", 1, joan_team_place_recno, 0, 0, 0) 
		////ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 1, barrack_place_recno, 0, 0, 0)

		if( FUNC("get_scenario_event_bit_flag", 0) == 0 )
		{
			if( FUNC("get_scenario_bit_flag", 10) == 0 )
			{
				if( unit_recno == jean_recno )
				{
					FUNC("set_can_interact_flag", orlean_recno, 1)
				}
				else
				{
					FUNC("set_can_interact_flag", orlean_recno, 0)
				}

				if( FUNC("is_unit_inside_place", joan_team_place_recno, jean_recno) == 1 && FUNC("is_unit_inside_place", introduce_orlean_place_recno, joan_recno) == 1 )
				{
					FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
					FUNC("set_unit_can_process_in_cut_scene", orlean_recno, 1)	// all unit can process
					FUNC("set_unit_can_process_in_cut_scene", jean_recno, 1)	// all unit can process
					FUNC("set_unit_can_process_in_cut_scene", joan_recno, 1)	// all unit can process
					//FUNC("set_unit_can_process_in_cut_scene", unit_recno, 0)
					FUNC("stop_curr_task", joan_recno)
					FUNC("stop_curr_task", jean_recno)
					FUNC("stop_curr_task", orlean_recno)
					ACTION("stop_all_order", joan_recno)
					ACTION("stop_all_order", orlean_recno) 
					FUNC("set_idle", joan_recno) 
					ACTION("stop_all_order", jean_recno ) 

					//FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
					WAIT { FUNC("start_cut_scene", 0, 0, 6809, 5796, 233, 350, -131, 22) }

					ACTION("give_order" , orlean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , orlean_recno, joan_recno) , 0 , 0 , 0, 2500)
					ACTION("give_order" , jean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , jean_recno, joan_recno) , 0 , 0 , 0, 2500)
					ACTION("give_order" , joan_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , joan_recno, orlean_recno) , 0 , 0 , 0, 2500)

					WAIT { DIALOG("add_dialog", jean_recno, "[0025N]Mademoiselle allow me to introduce you to the Bastard of Orléans.") }
					WAIT { DIALOG("add_dialog", orlean_recno, "[0026N]...You must be Joan! Well met, I am the Bastard of Orléans. I am here to assist you to protect our Dauphin and to rid gentle France of the English aggressor.") }
					WAIT { DIALOG("add_dialog", orlean_recno, "[0027N]While I discuss strategies with my troops and Jean de Metz, please visit the blacksmith and the shop in Orléans - they offer many goods that may prove useful in our future encounters.") }
			
					FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 0, 0) 
					FUNC("minimap_set_way_point", 1, 3268.6, 10691.0, 2.0, 1, 0)
					FUNC("minimap_set_way_point", 2, 9371.8, 8658.0, 0.0, 1, 0) 

					FUNC("set_can_interact_flag", joan_recno, 0)
					FUNC("set_can_interact_flag", jean_recno, 0)
					////FUNC("set_can_interact_flag", la_hire_recno, 0)
					FUNC("set_can_interact_flag", orlean_recno, 1)

					FUNC("set_scenario_count_time")
					FUNC("set_scenario_event_bit_flag", 0, 1)

					//FUNC("set_unit_ranking", orlean_recno, "GENERAL")

					// leave cut scene
					DIALOG("del_all_dialog") 

					//FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
					//WAIT { FUNC("is_cut_scene_finished") }
					FUNC("end_cut_scene", 0)
					WAIT{ FUNC("is_cut_scene_finished") }

					FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

					FUNC("set_scenario_bit_flag", 10, 1)

					ACTION("give_task", jean_recno, "DEFEND_PLACE", 1, joan_team_place_recno, 0, 0, 0) 
					ACTION("give_task", orlean_recno, "DEFEND_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
				}
			}

			////talk_unit_recno2 = FUNC("get_interact_unit_recno", la_hire_recno) 
			if( orlean_recno > 0  && interact_unit_recno == orlean_recno )	// talking with Orlean~~~~~ 
			{
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
				FUNC("set_unit_can_process_in_cut_scene", orlean_recno, 1)	// all unit can process
				FUNC("stop_curr_task", orlean_recno)
				ACTION("stop_all_order", orlean_recno) 
				//FUNC("stop_curr_task", unit_recno)
				ACTION("stop_all_order", unit_recno) 
				// set main character to idle
				FUNC("set_idle", unit_recno)

				// set citizen one to idle and rotate him
				ACTION("stop_all_order", orlean_recno ) 
				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
				ACTION("give_order" , orlean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , orlean_recno, unit_recno) , 0 , 0 , 0, 2500)
				//WAIT { DIALOG("add_dialog", orlean_recno, "[0001N]I am waiting for Joan of Arc.") }
				if( unit_recno == jean_recno )
				{
					WAIT { DIALOG("add_dialog", jean_recno, "[0028N]Good day, Duke. Joan should be coming any minute now.") }
					WAIT { DIALOG("add_dialog", orlean_recno, "[0029N]I am anxious to meet with her. I have heard that she is the most resilient and brave woman - that positions her favorably in my annals.") }
					WAIT { DIALOG("add_dialog", orlean_recno, "[0030N]I just hope that she is able to withstand the daily rigors of warfare - she is a woman, you know...") }
				}

				// leave cut scene
				DIALOG("del_all_dialog") 
				FUNC("set_interact_unit_recno", unit_recno, 0)
				FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
				WAIT { FUNC("is_cut_scene_finished") }
				FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

				ACTION("give_task", orlean_recno, "DEFEND_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
				exit
			}
		}
		else
		{
			if( orlean_recno > 0 && interact_unit_recno == orlean_recno )	// talking with Orlean~~~~~ 
			{
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
				FUNC("set_unit_can_process_in_cut_scene", orlean_recno, 1)	// all unit can process
				FUNC("stop_curr_task", orlean_recno)
				ACTION("stop_all_order", orlean_recno) 
				ACTION("give_task", orlean_recno, "IDLE", 1, 0, 0, 0, 0)

				//FUNC("stop_curr_task", unit_recno)
				ACTION("stop_all_order", unit_recno) 
				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				// set main character to idle
				FUNC("set_idle", unit_recno) 

				// set citizen one to idle and rotate him
				ACTION("stop_all_order", orlean_recno ) 

				ACTION("give_order" , orlean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , orlean_recno, unit_recno) , 0 , 0 , 0, 2500)

				if( FUNC("get_interact_stage", orlean_recno) == 0 && unit_recno == joan_recno )
				{
					WAIT { DIALOG("add_dialog", orlean_recno, "[0031N]There are still many plans to make if we are to sway the tides of war in our favor. Please excuse me, there are still details we have to discuss, and time stops for no one...") }
					WAIT { DIALOG("add_dialog", orlean_recno, "[0032N]Yes, I have been discussing our future battle plans with Alencon. I must comment that underpowered forces here in City of Orléans cause me concern.") }
					// Hopefully La Hire will soon have troops ready and able to assist our cause.") }
			
					//FUNC("set_can_interact_flag", orlean_recno, 0)
				}
				else if( unit_recno == jean_recno )
				{
					WAIT { DIALOG("add_dialog", orlean_recno, "[0032N]Yes, I have been discussing our future battle plans with Alencon. I must comment that underpowered forces here in City of Orléans cause me concern.") }
				}
				//else if( unit_recno == la_hire_recno )
				//{
				//	WAIT { DIALOG("add_dialog", orlean_recno, "[0001N]How goes it? I've been busy planning our strategies for our journey to Reims. I hope that you have all our troops primed for combat!") }
				//}

				// leave cut scene
				DIALOG("del_all_dialog") 

				FUNC("set_interact_unit_recno", unit_recno, 0) 

				FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
				WAIT { FUNC("is_cut_scene_finished") }
				FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

				ACTION("give_task", orlean_recno, "DEFEND_PLACE", 5, orlean_building_place_recno, 0, 0, 0)

				exit
			}
		}
	}

	if( FUNC("is_item_deleted_by_name", gate_door_recno, "Castle Gate") == 1 )
	{
		gate_door_recno = 0 
	}

	// first wave
	if(FUNC("get_scenario_stage") == 3)
	{
		if( FUNC("get_scenario_event_bit_flag", 0) == 1 )
		{
			if( FUNC("get_gate_state", gate_door_recno) == 1 )
			{
				FUNC("minimap_set_way_point", 1, 8454.0, 11305.0, 1.0, 1, 0)
			}
			else
			{
				FUNC("minimap_set_way_point", 1, 8454.0, 11305.0, 1.0, 0, 0)
			}
		}

		if( FUNC("get_scenario_event_bit_flag", 3) == 1 && FUNC("get_end_condition_finish", 1 ) == 0 )
		{
			FUNC("start_kill_interface")
		}

		if( FUNC("get_scenario_count_time") > 180000 && FUNC("is_unit_inside_place", no_spawn_place_recno, joan_recno) == 0 )
		{
			if(FUNC("get_scenario_event_bit_flag", 1) == 0)
			{
				if( gate_door_recno > 0 )
				{
					if( FUNC("get_gate_state", gate_door_recno) == 1 && john_recno > 0 && FUNC("get_interact_stage", jean_recno) == 0 )
					{
						FUNC("facility_barrack_add_leader", gate_spawn_point_e, epolecap_id, 16, 4, "Rouland Fraunk", "Fraunk")
						FUNC("facility_barrack_add_member", gate_spawn_point_f, epoleman_id, 16, 1, 4)
						FUNC("facility_barrack_add_member", gate_spawn_point_g, engarch_id, 16, 1, 4)
						FUNC("facility_barrack_add_member", gate_spawn_point_h, engarch_id, 16, 1, 4)

						FUNC("facility_barrack_add_leader", reinforcement_spawn_point_m, epolecap_id, 17, 4, "Hugh Machun", "Machun")
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_n, epoleman_id, 17, 1, 4)
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_o, engarch_id, 17, 1, 4)
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_p, engarch_id, 17, 1, 4)

						FUNC("facility_barrack_add_leader", reinforcement_spawn_point_j, epolecap_id, 18, 4, "Bartholomew Gurneys", "Gurneys")
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_h, epoleman_id, 18, 1, 4)
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_i, engarch_id, 18, 1, 4)
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_j, engarch_id, 18, 1, 4)

						FUNC("facility_barrack_add_leader", reinforcement_spawn_point_a, epolecap_id, 19, 4, "Manselm Mercator", "Mercator")
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_c, epoleman_id, 19, 1, 4)
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_d, engarch_id, 19, 1, 4)
						FUNC("facility_barrack_add_member", reinforcement_spawn_point_e, engarch_id, 19, 1, 4)

						FUNC("set_scenario_event_bit_flag", 1, 1)
					}
				}
			}
		}
		else if( FUNC("get_scenario_count_time") > 30000 )
		{
			if(FUNC("get_scenario_event_bit_flag", 3) == 0)
			{
				//FUNC("attention_call_message_2", "[0001N]Quick, we must defend the city! Prevent the enemy from taking the lives of our citizens, lest Orléans will not have enough manpower to keep the city alive!", orlean_recno )
				FUNC("set_kill_citizen_limit", 18)
				FUNC("start_kill_interface")
				FUNC("set_scenario_event_bit_flag", 3, 1)
			}
		}
		else if( FUNC("get_scenario_count_time") > 5000 )
		{
			john_recno = FUNC("search_unit_by_name", "John de la Pole")

			if(FUNC("get_scenario_event_bit_flag", 0) == 0 && john_recno > 0 )
			{
	
				//**********1st wave start here**********
				FUNC("set_scenario_mode", "SCENARIO_BATTLE_MODE")

				FUNC("set_interact_stage", weapon_seller_recno, 2)
				FUNC("set_interact_stage", potion_seller_recno, 2)

				if( FUNC("get_gate_state", gate_door_recno) == 0 )
				{
					FUNC("add_gate_trigger", gate_door_recno, 0)
				}
				FUNC("set_item_can_interact_flag", gate_door_recno, 1 )

				//if( fUNC("get_gate_state", gate_bridge_recno) > 0 )
				//{
				//	FUNC("add_gate_trigger", gate_bridge_recno, 0)
				//}
//				FUNC("set_item_nation", gate_door_recno, "NONE")

				//FUNC("attention_call_message_2", "[0001N]We must protect the innocent citizens of Orléans at all cost!", orlean_recno )

				// spy retreat
				FUNC("set_can_interact_flag", spy_guard_recno, 0)
				//FUNC("attention_call_message", "[0001N]The spy has gone away!")
				FUNC("set_unit_nation", spy_guard_recno, "english")
				//ACTION("give_task", spy_guard_recno, "RETREAT", 99, john_retreat_place_recno, 1, 45000, 0)
				//FUNC("del_unit", spy_guard_recno)

				FUNC("set_unit_can_process_in_cut_scene", 0, 0)
				FUNC("set_unit_can_process_in_cut_scene", john_recno, 1)
				//FUNC("stop_curr_task", jean_recno)
				ACTION("stop_all_order", jean_recno)
				FUNC("set_idle", jean_recno)
				//FUNC("start_cut_scene_2", 1, 0, john_recno, 200, 90, 5, 1)
				//WAIT{ FUNC("is_cut_scene_status_black_screen") }
				//FUNC("change_camera_in_cut_scene", 0, john_recno, 200, 90, 5)
				WAIT{ FUNC("start_cut_scene", 0, 1, john_recno, 200, 90, 5) }
				WAIT { DIALOG("add_dialog", john_recno, "[0033N]Treacherous French! As you are unwilling to accept the enlightened rule of our King, you and all your worthless citizens of Orléans will suffer the wrath of our superior English might!") }
				ACTION("give_order" , john_recno, "TURN" , 3 , 0 , 0 , 0 , 0 , 0, 2500)
				WAIT { FUNC("change_camera_in_cut_scene", 0, 8934, 12728, 93, 350, 133, 6) }
				WAIT { DIALOG("add_dialog", john_recno, "[0034N]Hurry men! Storm the entrance! Enter and seek out their town hall - we must destroy their military plans! Kill any contemptible French you find on the way, soldiers or otherwise!") }
				ACTION("give_order" , john_recno, "TURN" , 4 , 0 , 270 , 0 , 0 , 0, 2500)
				WAIT { FUNC("change_camera_in_cut_scene", 0, 6551, 5601, 146, 188, -110, 14) }
				//WAIT { FUNC("change_camera_in_cut_scene", 1, jean_recno, 200, 180, 5) }
				WAIT { DIALOG("add_dialog", jean_recno, "[0035N]Fellow warriors - The callous English are up to their blood thirsty tricks once again.") }
				WAIT { DIALOG("add_dialog", jean_recno, "[0036N]Quickly, protect the lives of the innocents - do not allow the citizens of Orléans to die at the hands of the English dogs, lest we will not have enough manpower to keep the city alive!") }
				WAIT { DIALOG("add_dialog", orlean_recno, "[0037N]I shall protect the town hall, should the invaders decide to attack the heart of our military operations! We cannot allow months of planning to go to waste!") }
				DIALOG("del_all_dialog") 
				FUNC("set_unit_can_process_in_cut_scene", 0, 1)
				FUNC("end_cut_scene", 1)
				WAIT{ FUNC("is_cut_scene_finished") }
				//WAIT { FUNC("end_cut_scene_2", 0, 1) }
				//WAIT{ FUNC("is_cut_scene_finished") }

				FUNC("facility_barrack_add_member", jean_spawn_point_a, flinfant_id, 2, 2, 2)
				FUNC("facility_barrack_add_member", jean_spawn_point_b, flinfant_id, 2, 2, 2)

				FUNC("attention_call_message", FUNC("format_string", "[0038N]You may switch among other warriors to control them directly (_%1s_).", FUNC("get_key_string", "SWITCH_CHARACTER")), 1)

				FUNC("attention_call_message", "[0039N]If you notice one of your warriors in dire need of help, their icon will flash on the mini-map, and are desperately seeking your assistance.", 1)

				FUNC("attention_call_message", "[0040N]If other warriors have leveled up (as indicated by a series of green arrows on their portrait), you can switch to that character to assign their available points.", 1)

				FUNC("set_scenario_event_bit_flag", 0, 1)
				ACTION("give_task", john_recno, "DEFEND_PLACE", 1, gate_place_recno, 0, 0, 0)
				ACTION("give_task", joan_recno, "DEFEND_PLACE", 1, defend_gate_place_recno, 0, 0, 0)
				ACTION("give_task", jean_recno, "ATTACK_PLACE", 5, left_battle_place_recno, 0, 0, 0)
				//ACTION("give_task", la_hire_recno, "ATTACK_PLACE", 10, right_battle_place_recno_c, 0, 0, 0)
				FUNC("set_parking_dir", orlean_building_place_recno, 0)
				FUNC("set_unit_team", orlean_guard_a_recno, 4)
				FUNC("set_unit_team", orlean_guard_b_recno, 4)

				FUNC("attention_call_message_2", "[0041N]Enemies are rushing the castle! Someone must approach and close the gate to prevent the enemy any entrance!", tower_guard_recno )
				FUNC("attention_call_message_2", "[0042N]Our gate guard must have been a spy and opened the gate - the traitor! At arms, men, for a fight awaits us!", orlean_recno )

				FUNC("set_unit_ranking", orlean_recno, "GENERAL")
				FUNC("set_control_flag", jean_recno, 1)
			}
		}
		else
		{
			exit
		}

		if( FUNC("get_gate_state", gate_door_recno) == 1 && FUNC("get_scenario_bit_flag", 11) == 0 )
		{
			//ACTION("give_task", spy_guard_recno, "RETREAT", 99, john_retreat_place_recno, 1, 45000, 0)
			FUNC("del_unit", spy_guard_recno)
			FUNC("set_scenario_bit_flag", 11, 1)
		}

		FUNC("set_end_condition_enabled", 1, 1)
		FUNC("set_end_condition_enabled", 2, 1)
		FUNC("set_end_condition_enabled", 5, 1)
		FUNC("set_end_condition_finish", 13, "WIN")

		spy_guard_recno = FUNC("search_unit_by_name", "Wartownik")
		orlean_recno = FUNC("search_unit_by_name", "Bastard z Orleanu")
		//la_hire_recno = FUNC("search_unit_by_name", "La Hire")
		jean_recno = FUNC("search_unit_by_name", "Jean de Metz")
		john_recno = FUNC("search_unit_by_name", "John de la Pole")
		
		if( john_recno > 0 )
		{
			FUNC("set_unit_drop_item_id", john_recno, at_warrior_id)
			FUNC("set_unit_drop_item_level", john_recno, 4)
		}	

		//gate_enemy_num = FUNC("number_of_enemy_in_place", gate_place_recno, joan_recno)
		gate_spawn_count = FUNC("get_spawn_unit_count_in_place", gate_place_recno ) 

		if( john_recno > 0 && FUNC("get_unit_retreat", john_recno) == 0)
		{
			FUNC("set_unit_retreat", john_recno, 1)
		}

		gate_spawn_leader_recno_a = FUNC("search_unit_by_name", "Laurentius Fryuell")
		gate_spawn_leader_recno_b = FUNC("search_unit_by_name", "Manselm Ketton")
		if(gate_spawn_leader_recno_b > 0)
		{
			if(FUNC("is_unit_dead", gate_spawn_leader_recno_b) == 0)
			{
				FUNC("set_unit_drop_item_id", gate_spawn_leader_recno_b, yhwh_id)
				FUNC("set_unit_drop_item_level", gate_spawn_leader_recno_b, 1)
			}
		}
		gate_spawn_leader_recno_c = FUNC("search_unit_by_name", "Gregory Peroun")
		gate_spawn_leader_recno_d = FUNC("search_unit_by_name", "Albredus Coifer")
		gate_spawn_leader_recno_e = FUNC("search_unit_by_name", "Rouland Fraunk")
		gate_spawn_leader_recno_f = FUNC("search_unit_by_name", "Hugh Machun")
		gate_spawn_leader_recno_g = FUNC("search_unit_by_name", "Bartholomew Gurneys")
		gate_spawn_leader_recno_h = FUNC("search_unit_by_name", "Manselm Mercator")
		additional_spawn_leader_1 = FUNC("search_unit_by_name", "Davy Crucem")
		additional_spawn_leader_2 = FUNC("search_unit_by_name", "Lowis Kelsey")
		additional_spawn_leader_3 = FUNC("search_unit_by_name", "Jok Tickencote")

		//left troop, will fight with Jean
		if(gate_spawn_leader_recno_a > 0)
		{
			if(FUNC("is_unit_inside_place", left_battle_place_recno, gate_spawn_leader_recno_a) == 1)
			{
				if(FUNC("get_scenario_bit_flag", 1) == 0)
				{
					ACTION("give_task", gate_spawn_leader_recno_a, "ATTACK_PLACE", 2, orlean_building_place_recno, 0, 0, 0)
					if( additional_spawn_leader_1 > 0 )
					{
						ACTION("give_task", additional_spawn_leader_1, "ATTACK_PLACE", 2, orlean_building_place_recno, 0, 0, 0)
					}
					FUNC("set_scenario_bit_flag", 1, 1)
				}
			}
			if(FUNC("is_unit_inside_place", left_battle_place_recno, gate_spawn_leader_recno_a) == 0)
			{
				if(FUNC("get_scenario_bit_flag", 1) == 0)
				{
					ACTION("give_task", gate_spawn_leader_recno_a, "ATTACK_PLACE", 1, left_battle_place_recno, 0, 0, 0)
					if( additional_spawn_leader_1 > 0 )
					{
						ACTION("give_task", additional_spawn_leader_1, "ATTACK_PLACE", 1, left_battle_place_recno, 0, 0, 0)
					}
				}
			}

			if(FUNC("is_unit_inside_place", left_battle_place_recno, jean_recno) == 1)
			{
				if(FUNC("get_scenario_bit_flag", 2) == 0)
				{
					if(FUNC("get_scenario_bit_flag", 1) == 1)
					{
						//jean will attck this team
						ACTION("give_task", jean_recno, "FOLLOW_UNIT", 10, gate_spawn_leader_recno_a, 0, 0, 0)
						FUNC("set_scenario_bit_flag", 2, 1)
					}
				}
			}
			//if(FUNC("is_unit_inside_place", left_battle_place_recno, jean_recno) == 0)
			//{
			//	if(FUNC("get_scenario_bit_flag", 2) == 0)
			//	{
			//		ACTION("give_task", jean_recno, "ATTACK_PLACE", 5, left_battle_place_recno, 0, 0, 0)
			//	}
			//}
		}

		//middle troop, will fight with Joan
		if(gate_spawn_leader_recno_b > 0)
		{
			if(FUNC("is_unit_inside_place", middle_battle_place_recno, gate_spawn_leader_recno_b) == 1)
			{
				if(FUNC("get_scenario_bit_flag", 3) == 0)
				{
					ACTION("give_task", gate_spawn_leader_recno_b, "ATTACK_PLACE", 2, orlean_building_place_recno, 0, 0, 0)
					if( additional_spawn_leader_2 > 0 )
					{
						ACTION("give_task", additional_spawn_leader_2, "ATTACK_PLACE", 2, orlean_building_place_recno, 0, 0, 0)
					}
					FUNC("set_scenario_bit_flag", 3, 1)
				}
			}
			if(FUNC("is_unit_inside_place", middle_battle_place_recno, gate_spawn_leader_recno_b) == 0)
			{
				if(FUNC("get_scenario_bit_flag", 3) == 0)
				{
					ACTION("give_task", gate_spawn_leader_recno_b, "ATTACK_PLACE", 1, middle_battle_place_recno, 0, 0, 0)
					if( additional_spawn_leader_2 > 0 )
					{
						ACTION("give_task", additional_spawn_leader_2, "ATTACK_PLACE", 1, middle_battle_place_recno, 0, 0, 0)
					}
				}
			}
		}

		//right troop, will fight with La Hire
		if(gate_spawn_leader_recno_c > 0)
		{
			// go to place 1
			if(FUNC("is_unit_inside_place", right_battle_place_recno_a, gate_spawn_leader_recno_c) == 1)
			{
				if(FUNC("get_scenario_bit_flag", 4) == 0)
				{
					ACTION("give_task", gate_spawn_leader_recno_c, "ATTACK_PLACE", 2, right_battle_place_recno_b, 0, 0, 0)
					if( additional_spawn_leader_3 > 0 )
					{
						ACTION("give_task", additional_spawn_leader_3, "ATTACK_PLACE", 2, right_battle_place_recno_b, 0, 0, 0)
					}
					FUNC("set_scenario_bit_flag", 4, 1)
				}
			}
			if(FUNC("is_unit_inside_place", right_battle_place_recno_a, gate_spawn_leader_recno_c) == 0)
			{
				if(FUNC("get_scenario_bit_flag", 4) == 0)
				{
					ACTION("give_task", gate_spawn_leader_recno_c, "ATTACK_PLACE", 1, right_battle_place_recno_a, 0, 0, 0)
					if( additional_spawn_leader_3 > 0 )
					{
						ACTION("give_task", additional_spawn_leader_3, "ATTACK_PLACE", 1, right_battle_place_recno_a, 0, 0, 0)
					}
				}
			}

			// go to place 2
			if(FUNC("get_scenario_bit_flag", 4) == 1)
			{
				if(FUNC("is_unit_inside_place", right_battle_place_recno_b, gate_spawn_leader_recno_c) == 1)
				{
					if(FUNC("get_scenario_bit_flag", 5) == 0)
					{
						ACTION("give_task", gate_spawn_leader_recno_c, "ATTACK_PLACE", 3, right_battle_place_recno_c, 0, 0, 0)
						if( additional_spawn_leader_3 > 0 )
						{
							ACTION("give_task", additional_spawn_leader_3, "ATTACK_PLACE", 3, right_battle_place_recno_c, 0, 0, 0)
						}
						FUNC("set_scenario_bit_flag", 5, 1)
					}
				}
				if(FUNC("is_unit_inside_place", right_battle_place_recno_b, gate_spawn_leader_recno_c) == 0)
				{
					if(FUNC("get_scenario_bit_flag", 5) == 0)
					{
						ACTION("give_task", gate_spawn_leader_recno_c, "ATTACK_PLACE", 2, right_battle_place_recno_b, 0, 0, 0)
						if( additional_spawn_leader_3 > 0 )
						{
							ACTION("give_task", additional_spawn_leader_3, "ATTACK_PLACE", 2, right_battle_place_recno_b, 0, 0, 0)
						}
					}
				}
			}

			// go to place 3
			if(FUNC("get_scenario_bit_flag", 5) == 1)
			{
				if(FUNC("is_unit_inside_place", right_battle_place_recno_c, gate_spawn_leader_recno_c) == 1)
				{
					if(FUNC("get_scenario_bit_flag", 6) == 0)
					{
						ACTION("give_task", gate_spawn_leader_recno_c, "ATTACK_PLACE", 4, orlean_building_place_recno, 0, 0, 0)
						if( additional_spawn_leader_3 > 0 )
						{
							ACTION("give_task", additional_spawn_leader_3, "ATTACK_PLACE", 4, orlean_building_place_recno, 0, 0, 0)
						}
						FUNC("set_scenario_bit_flag", 6, 1)
					}
				}
				if(FUNC("is_unit_inside_place", right_battle_place_recno_c, gate_spawn_leader_recno_c) == 0)
				{
					if(FUNC("get_scenario_bit_flag", 6) == 0)
					{
						ACTION("give_task", gate_spawn_leader_recno_c, "ATTACK_PLACE", 3, right_battle_place_recno_c, 0, 0, 0)
						if( additional_spawn_leader_3 > 0 )
						{
							ACTION("give_task", additional_spawn_leader_3, "ATTACK_PLACE", 3, right_battle_place_recno_c, 0, 0, 0)
						}
					}
				}
			}

			//if(FUNC("get_scenario_bit_flag", 7) == 1)
			//{
			//	//la hire will attack this team
			////	//ACTION("give_task", la_hire_recno, "FOLLOW_UNIT", 10, gate_spawn_leader_recno_c, 0, 0, 0)
			////	ACTION("give_task", la_hire_recno, "ATTACK_PLACE", 20, right_battle_place_recno_a, 0, 0, 0)
			//}
			if( FUNC("get_scenario_bit_flag", 7) == 0)
			{
				//if(FUNC("is_unit_inside_place", right_battle_place_recno_c, la_hire_recno) == 1)
				//{
				//	ACTION("give_task", la_hire_recno, "ATTACK_PLACE", 20, right_battle_place_recno_a, 0, 0, 0)
				//	FUNC("set_scenario_bit_flag", 7, 1)
				//}
			}
			////if(FUNC("is_unit_inside_place", right_battle_place_recno_c, la_hire_recno) == 0)
			////{
			////	if(FUNC("get_scenario_bit_flag", 7) == 0)
			////	{
			////		ACTION("give_task", la_hire_recno, "ATTACK_PLACE", 10, right_battle_place_recno_c, 0, 0, 0)
			////	}
			////}
		}

		if(gate_spawn_leader_recno_d > 0)
		{
			ACTION("give_task", gate_spawn_leader_recno_d, "ATTACK_PLACE", 1, orlean_building_place_recno, 0, 0, 0)
		}
		if(gate_spawn_leader_recno_e > 0)
		{
			ACTION("give_task", gate_spawn_leader_recno_e, "ATTACK_PLACE", 1, orlean_building_place_recno, 0, 0, 0)
		}
		if(gate_spawn_leader_recno_f > 0)
		{
			ACTION("give_task", gate_spawn_leader_recno_f, "ATTACK_PLACE", 1, orlean_building_place_recno, 0, 0, 0)
		}
		if(gate_spawn_leader_recno_g > 0)
		{
			ACTION("give_task", gate_spawn_leader_recno_g, "ATTACK_PLACE", 1, orlean_building_place_recno, 0, 0, 0)
		}
		if(gate_spawn_leader_recno_h > 0)
		{
			ACTION("give_task", gate_spawn_leader_recno_h, "ATTACK_PLACE", 1, orlean_building_place_recno, 0, 0, 0)
		}

		if( jean_recno > 0 )
		{
			if( FUNC("get_scenario_count_time") > 30000 )
			{
				if(gate_spawn_leader_recno_a == 0 && gate_spawn_leader_recno_b == 0)
				{
					if(FUNC("get_interact_stage", jean_recno) == 0)
					{
						ACTION("give_task", jean_recno, "DEFEND_PLACE", 20, defend_gate_place_recno, 0, 0, 0)

						if( FUNC("get_gate_state", gate_door_recno) == 1 || FUNC("get_gate_state", gate_door_recno) == 3 )
						{
							FUNC("attention_call_message_2", "[0043N]Take care of the enemy, Joan! Metz, we need you to close the gate!", orlean_recno )
						}

						FUNC("set_interact_stage", jean_recno, 1)
					}
				}

				if(FUNC("is_unit_inside_place", defend_gate_place_recno, jean_recno) == 1)
				{
					if(FUNC("get_interact_stage", jean_recno) == 1)
					{
						//if( FUNC("get_gate_state", gate_door_recno) == 1 || FUNC("get_gate_state", gate_door_recno) == 3 )
						//{
						//	FUNC("add_gate_trigger", gate_door_recno, 0)
						//}
						//FUNC("add_gate_trigger", gate_door_recno, 0)
						//FUNC("set_item_nation", gate_door_recno, "FRENCH")
						//FUNC("attention_call_message_2", "[0045N]The castle gate has been closed - the English troops can no longer enter Orléans.", jean_recno )
						//FUNC("attention_call_message_2", "[0001N]...but I fear this is not the last we will hear of our invaders. Meet me at the town hall - there is much to discuss!", orlean_recno )
						//FUNC("stop_curr_task, jean_recno)
						//ACTION("give_task", jean_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)

						FUNC("set_interact_stage", jean_recno, 2)
					}
				}
			}
		}

		// first time spawn enemy
		if(gate_spawn_count == 0)
		{
			FUNC("facility_barrack_add_leader", gate_spawn_point_a, john_id, 11, 10, "John de la Pole", "John")
			FUNC("facility_barrack_add_member", gate_spawn_point_b, blinfant_id, 11, 1, 4)
			FUNC("facility_barrack_add_member", gate_spawn_point_c, ehinfant_id, 11, 1, 4)
			FUNC("facility_barrack_add_member", gate_spawn_point_d, epoleman_id, 11, 1, 4)

			FUNC("facility_barrack_add_leader", reinforcement_spawn_point_j, epolecap_id, 15, 4, "Albredus Coifer", "Coifer")
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_h, epoleman_id, 15, 1, 4)
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_i, engarch_id, 15, 1, 4)
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_j, engarch_id, 15, 1, 4)

			FUNC("facility_barrack_add_leader", reinforcement_spawn_point_m, blinfcap_id, 12, 4, "Laurentius Fryuell", "Fryuell")
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_n, blinfant_id, 12, 1, 4)
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_o, blinfant_id, 12, 1, 4)
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_p, ehinfant_id, 12, 1, 4)

			FUNC("facility_barrack_add_leader", gate_spawn_point_e, blinfcap_id, 13, 4, "Manselm Ketton", "Ketton")
			FUNC("facility_barrack_add_member", gate_spawn_point_f, blinfant_id, 13, 1, 4)
			FUNC("facility_barrack_add_member", gate_spawn_point_g, blinfant_id, 13, 1, 4)
			FUNC("facility_barrack_add_member", gate_spawn_point_h, ehinfant_id, 13, 1, 4)

			FUNC("facility_barrack_add_leader", reinforcement_spawn_point_a, blinfcap_id, 14, 4, "Gregory Peroun", "Peroun")
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_c, blinfant_id, 14, 1, 4)
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_d, blinfant_id, 14, 1, 4)
			FUNC("facility_barrack_add_member", reinforcement_spawn_point_e, ehinfant_id, 14, 1, 4)


			FUNC("facility_barrack_add_leader", additional_spawn_1, ehinfcap_id, 31, 4, "Davy Crucem", "Crucem")
			FUNC("facility_barrack_add_member", additional_spawn_1, ehinfant_id, 31, 3, 4)
			FUNC("facility_barrack_add_member", additional_spawn_2, ehinfant_id, 31, 3, 4)
			FUNC("facility_barrack_add_member", additional_spawn_3, ehinfant_id, 31, 3, 4)

			FUNC("facility_barrack_add_leader", additional_spawn_4, epolecap_id, 32, 4, "Lowis Kelsey", "Kelsey")
			FUNC("facility_barrack_add_member", additional_spawn_4, epoleman_id, 32, 3, 4)
			FUNC("facility_barrack_add_member", additional_spawn_5, epoleman_id, 32, 3, 4)
			FUNC("facility_barrack_add_member", additional_spawn_6, epoleman_id, 32, 3, 4)

			FUNC("facility_barrack_add_leader", additional_spawn_7, blinfcap_id, 33, 4, "Jok Tickencote", "Tickencote")
			FUNC("facility_barrack_add_member", additional_spawn_7, blinfant_id, 33, 3, 4)
			FUNC("facility_barrack_add_member", additional_spawn_8, blinfant_id, 33, 3, 4)
			FUNC("facility_barrack_add_member", additional_spawn_9, blinfant_id, 33, 3, 4)
		}

		if( FUNC("get_scenario_event_bit_flag", 2) == 0 && FUNC("get_scenario_count_time") > 10000 )
		{
			if( gate_door_recno > 0 )
			{
				if( FUNC("get_gate_state", gate_door_recno) == 0 )
				{
					if(john_recno > 0)
					{
						FUNC("start_cut_scene_2", 1, 0, john_recno, 200, ( 180 - FUNC("get_unit_dir", john_recno) ), 10, 1)
						FUNC("set_unit_can_process_in_cut_scene", 0, 0)
						FUNC("set_unit_can_process_in_cut_scene", john_recno, 1)

						FUNC("set_idle", john_recno)
						FUNC("stop_curr_task", john_recno)
						ACTION("give_task", john_recno, "IDLE", 1, 1, 0, 0, 0)
						ACTION("stop_all_order", john_recno)
						
						WAIT{ FUNC("pause_script", 1) }
						ACTION("give_task", john_recno, "IDLE", 1, 1, 0, 0, 0)
						ACTION("stop_all_order", john_recno)
						FUNC("set_idle", john_recno)

						WAIT{ FUNC("is_cut_scene_status_black_screen") }
						FUNC("change_camera_in_cut_scene", 0, john_recno, 200, ( 180 - FUNC("get_unit_dir", john_recno) ), 10)

						WAIT{ DIALOG("add_dialog", john_recno, "[0044N]You wretched vassals! I have underestimated you and your worthless scum this time, but I will return, and you all shall suffer!") }

						FUNC("enable_unit_bounding_volume", john_recno, 0)

						WAIT{ ACTION("give_order", john_recno, "APPROACH_PLACE", 1, 1, john_retreat_place_recno, 0, 0, 0, 3000) }

						DIALOG("del_all_dialog") 
						FUNC("end_cut_scene_2", 0, 1)
						WAIT{ FUNC("is_cut_scene_status_black_screen") }
						FUNC("del_unit_team", 11)
						WAIT{ FUNC("is_cut_scene_finished") }

						//all team member retreat
						//ACTION("give_task", john_recno, "RETREAT", 99, john_retreat_place_recno, 1, 45000, 0)
						//FUNC("attention_call_message_2", "[0001N]You wretched vassals! I may have underestimated you and your worthless lot this time. But I will return, and you all shall suffer for it!", john_recno )
						//FUNC("set_scenario_event_bit_flag", 2, 1)

						//FUNC("set_end_condition_finish" , 1, "WIN")	
						//FUNC("end_kill_interface")
					}
				}
			}
			if(john_recno > 0)
			{
				if( FUNC("get_unit_retreat", john_recno) == -1 )
				{
					FUNC("start_cut_scene_2", 1, 0, john_recno, 200, ( 180 - FUNC("get_unit_dir", john_recno) ), 10, 1)
					FUNC("set_unit_can_process_in_cut_scene", 0, 0)
					FUNC("set_unit_can_process_in_cut_scene", john_recno, 1)

					FUNC("set_idle", john_recno)
					FUNC("stop_curr_task", john_recno)
					ACTION("give_task", john_recno, "IDLE", 1, 1, 0, 0, 0)
					ACTION("stop_all_order", john_recno)
					
					WAIT{ FUNC("pause_script", 1) }
					ACTION("give_task", john_recno, "IDLE", 1, 1, 0, 0, 0)
					ACTION("stop_all_order", john_recno)
					FUNC("set_idle", john_recno)

					WAIT{ FUNC("is_cut_scene_status_black_screen") }
					FUNC("change_camera_in_cut_scene", 0, john_recno, 200, ( 180 - FUNC("get_unit_dir", john_recno) ), 10)

					WAIT{ DIALOG("add_dialog", john_recno, "[0044N]You wretched vassals! I have underestimated you and your worthless scum this time, but I will return, and you all shall suffer!") }

					FUNC("enable_unit_bounding_volume", john_recno, 0)

					WAIT{ ACTION("give_order", john_recno, "APPROACH_PLACE", 1, 1, john_retreat_place_recno, 0, 0, 0, 3000) }

					DIALOG("del_all_dialog") 
					FUNC("end_cut_scene_2", 0, 1)
					WAIT{ FUNC("is_cut_scene_status_black_screen") }
					FUNC("del_unit", john_recno)
					WAIT{ FUNC("is_cut_scene_finished") }
				}
				//if( FUNC("get_unit_retreat", john_recno) == -1 )
				//{
				//	//FUNC("set_unit_retreat", john_recno, 1)
				//	ACTION("give_task", john_recno, "RETREAT", 99, john_retreat_place_recno, 1, 45000, 0)
				//	FUNC("attention_call_message_2", "[0001N]You wretched vassals! I may have underestimated you and your worthless lot this time. But I will return, and you all shall suffer for it!", john_recno )
				//	FUNC("attention_call_message", "[0001N]You have defeated John de la Pole, and all his units are retreating along with him!")
				//	//FUNC("attention_call_message", "[0001N]John de la Pole is retreating!")
				//	FUNC("set_scenario_event_bit_flag", 2, 1)

				//	//FUNC("set_end_condition_finish" , 1, "WIN")	
				//	//FUNC("end_kill_interface")
				//}
			}
		}

		if( FUNC("get_scenario_count_time") > 30000 && FUNC("get_end_condition_finish", 5) > 0 )
		{
			if( john_recno == 0 && FUNC("get_gate_state", gate_door_recno) == 0 )
			{
				FUNC("set_scenario_stage", 4 )
				FUNC("set_can_interact_flag", orlean_recno, 1)
				FUNC("reset_scenario_event_bit_flag")
				FUNC("set_scenario_count_time")
				FUNC("shop_set_sell_item_list", potion_shop_recno, sell_potion_list_id2) 

				if( jean_recno > 0 )
				{
					FUNC("attention_call_message_2", "[0045N]The castle gate has been closed - the English troops can no longer enter Orléans.", jean_recno )
					FUNC("attention_call_message_2", "[0046N]...but I fear this is not the last we will hear of our invaders. Meet me at the town hall, Joan - there is much to discuss!", orlean_recno )
				}
				else
				{
					FUNC("attention_call_message_2", "[0045N]The castle gate has been closed - the English troops can no longer enter Orléans.", orlean_recno )
					FUNC("attention_call_message_2", "[0046N]...but I fear this is not the last we will hear of our invaders. Meet me at the town hall, Joan - there is much to discuss!", orlean_recno )
				}

				if( jean_recno > 0 )
				{
					FUNC("stop_curr_task", jean_recno)
					ACTION("give_task", jean_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)
				}

				//if( jean_recno > 0 )
				//{
				//	FUNC("stop_curr_task", jean_recno)
				//	ACTION("give_task", jean_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)
				//}

				exit
			}
			//else if( john_recno == 0 )	//&& FUNC("get_scenario_count_time") > 360000)
			//{
			//	FUNC("set_scenario_stage", 4 )
			//	FUNC("set_can_interact_flag", orlean_recno, 1)
			//	FUNC("reset_scenario_event_bit_flag")
			//	FUNC("set_scenario_bit_flag", 8, 1)
			//	//FUNC("set_scenario_bit_flag", 9, 1)
			//	FUNC("set_scenario_count_time")
			//	FUNC("shop_set_sell_item_list", potion_shop_recno, sell_potion_list_id2) 
//
//				if( jean_recno > 0 )
//				{
//					FUNC("attention_call_message_2", "[0045N]The castle gate has been closed - the English troops can no longer enter Orléans.", jean_recno )
//					FUNC("attention_call_message_2", "[0046N]...but I fear this is not the last we will hear of our invaders. Meet me at the town hall, Joan - there is much to discuss!", orlean_recno )
//				}
//				else
//				{
//					FUNC("attention_call_message_2", "[0045N]The castle gate has been closed - the English troops can no longer enter Orléans.", orlean_recno )
//					FUNC("attention_call_message_2", "[0046N]...but I fear this is not the last we will hear of our invaders. Meet me at the town hall, Joan - there is much to discuss!", orlean_recno )
//				}
//
//				if( jean_recno > 0 )
//				{
//					FUNC("stop_curr_task, jean_recno)
//					ACTION("give_task", jean_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)
//				}

				//if( jean_recno > 0 )
				//{
				//	FUNC("stop_curr_task", jean_recno)
				//	ACTION("give_task", jean_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)
				//}

//			}
		}

	}


	//************between 1st wave and 2nd wave**************
	if(FUNC("get_scenario_stage") == 4)
	{
		orlean_recno = FUNC("search_unit_by_name", "Bastard z Orleanu")

		FUNC("set_scenario_mode", "SCENARIO_NORMAL_MODE")

		if( FUNC("get_scenario_event_bit_flag", 1) == 0 )
		{
			if( FUNC("get_scenario_event_bit_flag", 0) == 0 )
			{
				FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 1, 0) 
			}

			if( orlean_recno > 0 && interact_unit_recno == orlean_recno )	// talking with Orlean~~~~~ 
			{
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
				FUNC("set_unit_can_process_in_cut_scene", orlean_recno, 1)	// all unit can process

				//FUNC("stop_curr_task", unit_recno)
				ACTION("stop_all_order", unit_recno) 

				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				FUNC("set_idle", unit_recno) 

				FUNC("stop_curr_task", orlean_recno)
				ACTION("stop_all_order", orlean_recno ) 

				FUNC("del_item_by_name", "S3_Block")

				ACTION("give_order" , orlean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , orlean_recno, unit_recno) , 0 , 0 , 0, 2500)

				WAIT { DIALOG("add_dialog", orlean_recno, "[0047N]I fear that although we have staved the enemy's intentions, it is only a temporary respite. They may be amassing more siege machines and troops to attempt to re-enter Orléans by force as we speak!") }
				WAIT { FUNC("change_camera_in_cut_scene", 0, 8240, 11960, 1192, 188, 69, 39) }
				WAIT { DIALOG("add_dialog", orlean_recno, "[0048N]Further along the path lie two towns - that of de Bourges and de Blois. Although we cannot be certain, it is better to be safe than sorry.") }
				WAIT { DIALOG("add_dialog", orlean_recno, "[0049N]Eliminate all enemies occupying these two towns, for we must not allow the enemy to gather any more resources!") }
				// leave cut scene
				DIALOG("del_all_dialog") 

				FUNC("set_interact_unit_recno", unit_recno, 0) 

				FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
				WAIT { FUNC("is_cut_scene_finished") }
				FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process

				if( FUNC("get_scenario_event_bit_flag", 0) == 0 )
				{
					FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 0, 0) 

					//FUNC("del_item", block_item_recno)

					FUNC("set_end_condition_enabled", 11, 1)
					FUNC("set_end_condition_enabled", 12, 1)

					FUNC("set_scenario_event_bit_flag", 0, 1)
				}
			}

			if( FUNC("get_scenario_bit_flag", 18) == 0 )
			{
				if( FUNC("people_by_nation_exist_in_place", town_place_recno_b, "FRENCH") > 0 )
				{
					//start cut scene
					FUNC("set_unit_can_process_in_cut_scene", 0, 0)
					WAIT{ FUNC("start_cut_scene", 0, 1, 10598, 25588, 550, 188, -175, 15) }
					WAIT { DIALOG("add_dialog", town_b_cap_recno_a, "[0050N]I do hope our commanders return soon - I, for one, anxiously await the prospect of looting and pillaging Orléans and those silly French fools!") }
					WAIT{ FUNC("change_camera_in_cut_scene", 0, 9972, 25334, 521, 350, 60, 8) }
					WAIT { DIALOG("add_dialog", town_b_cap_recno_b, "[0051N]Indeed! As we failed to capture Orléans this time around, our generals have gone to re-equip themselves.") }
					WAIT{ FUNC("change_camera_in_cut_scene", 0, 9965, 25465, 479, 350, -125, 1) }
					WAIT { DIALOG("add_dialog", town_b_cap_recno_b, "[0052N]And this time I believe they will bring a battery of siege cannons - at least we will be better prepared for the second onslaught!") }
					DIALOG("del_all_dialog") 
					FUNC("set_unit_can_process_in_cut_scene", 0, 1)
					FUNC("end_cut_scene", 1)
					WAIT{ FUNC("is_cut_scene_finished") }

					FUNC("set_scenario_bit_flag", 18, 1)

					FUNC("attention_call_message_2", "[0053N]The enemy will return shortly! Finish off the enemies along the path and return as soon as you can!", orlean_recno )
					FUNC("attention_call_message_2", "[0054N]We will have our hands full once the English return with siege cannons, if what we have just overheard is true.", orlean_recno )
				}
			}

			//check if captured or not
			if( FUNC("get_end_condition_finish", 11) == 0 )
			{
				if( FUNC("people_by_nation_exist_in_place", town_place_recno_a, "ENGLISH") == 0 )
				{
					FUNC("set_end_condition_finish", 11, "WIN")
					FUNC("set_territory_nation", "de Bourges", "French")
					FUNC("set_minimap_icon_display_enable", "fcamp_s3l2_2f", 1)
					FUNC("set_minimap_icon_display_enable", "ecamp_s3l2_2e", 0)
				}
			}
			if( FUNC("get_end_condition_finish", 12) == 0 )
			{
				if( FUNC("people_by_nation_exist_in_place", town_place_recno_b, "ENGLISH") == 0 )
				{
					FUNC("set_end_condition_finish", 12, "WIN")
					FUNC("set_territory_nation", "de Blois", "French")
					FUNC("set_minimap_icon_display_enable", "fcamp_s3l2_1f", 1)
					FUNC("set_minimap_icon_display_enable", "ecamp_s3l2_1e", 0)
				}
			}

			if( FUNC("get_end_condition_finish", 11) == 1 && FUNC("get_end_condition_finish", 12) == 1 )
			{
				FUNC("attention_call_message_2", "[0055N]That should damper the spirits of the English if they decide to return to Orléans - only to see their comrades slain in battle!", orlean_recno )
				FUNC("attention_call_message_2", "[0056N]Great work! Now return to the city of Orléans, for now we shall have to ready our defense!", orlean_recno )
				FUNC("set_scenario_event_bit_flag", 1, 1)
			}
		}
		else
		{
			if( FUNC("get_scenario_bit_flag", 16) == 0 )
			{
				FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 1, 0) 
			}

			//la_hire_recno = FUNC("search_unit_by_name", "La Hire")
			jean_recno = FUNC("search_unit_by_name", "Jean de Metz")
	//		weapon_seller_recno = FUNC("search_unit_by_name", "Achard Gantier")
	//		potion_seller_recno = FUNC("search_unit_by_name", "Gilles Tollot")

	//		FUNC("set_can_interact_flag", orlean_recno, 1)

			if( orlean_recno > 0 && interact_unit_recno == orlean_recno )	// talking with Orlean~~~~~ 
			{
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process
				FUNC("set_unit_can_process_in_cut_scene", orlean_recno, 1)	// all unit can process

				//FUNC("stop_curr_task", unit_recno)
				ACTION("stop_all_order", unit_recno) 

				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 

				FUNC("set_idle", unit_recno) 

				FUNC("stop_curr_task", orlean_recno)
				ACTION("stop_all_order", orlean_recno ) 

				ACTION("give_order" , orlean_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , orlean_recno, unit_recno) , 0 , 0 , 0, 2500)

				WAIT { DIALOG("add_dialog", orlean_recno, "[0057N]It seems we have underestimated our foe's ability to deceive, they managed to infiltrate a spy into our city!") }
				WAIT { FUNC("change_camera_in_cut_scene", 0, 6581, 5598, 128, 350, -82, 9) }
				WAIT { DIALOG("add_dialog", orlean_recno, "[0058N]According to my scouts, the English have a large convoy with a battery of siege cannons heading our way.") }
				WAIT { FUNC("change_camera_in_cut_scene", 0, 6571, 5570, 124, 350, 129, 5) }
				WAIT { DIALOG("add_dialog", orlean_recno, "[0059N]If the enemy breaches our defenses, they will try to appropriate whatever military secrets we hold. This action must be prevented!") }
				WAIT { DIALOG("add_dialog", orlean_recno, "[0060N]I will arrange for our archers to line the castle walls. Prepare to defend the castle. Take this gem of the Tiger's eye - it should serve you well.") }

				// leave cut scene
				DIALOG("del_all_dialog") 

				FUNC("set_interact_unit_recno", unit_recno, 0) 

				if( FUNC("get_scenario_bit_flag", 9) == 0 )
				{
					FUNC("facility_barrack_add_leader", barrack_spawn_point_a, farchcap_id, 5, 2, "Archimbaud Trumelier", "Trumelier")
					FUNC("facility_barrack_add_member", barrack_spawn_point_a, farch_id, 5, 1, 2)
					FUNC("facility_barrack_add_leader", barrack_spawn_point_b, farchcap_id, 6, 2, "Foulques Paintre", "Paintre")
					FUNC("facility_barrack_add_member", barrack_spawn_point_b, farch_id, 6, 1, 2)
					FUNC("facility_barrack_add_leader", barrack_spawn_point_c, farchcap_id, 7, 2, "Orry Chaperonnier", "Chaperonnier")
					FUNC("facility_barrack_add_member", barrack_spawn_point_c, farch_id, 7, 1, 2)
					FUNC("facility_barrack_add_leader", barrack_spawn_point_d, farchcap_id, 8, 2, "Renaud Boutier", "Boutier")
					FUNC("facility_barrack_add_member", barrack_spawn_point_d, farch_id, 8, 1, 2)

					FUNC("set_scenario_bit_flag", 9, 1)
				}

				FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
				WAIT { FUNC("is_cut_scene_finished") }
				FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process


				FUNC( "give_item_to_unit", "Tiger", 1, 1, unit_recno )

				FUNC("attention_call_message", "[0061N]The Bastard of Orléans has given you the gem of the Tiger's eye.")
				FUNC("set_can_interact_flag", orlean_recno, 0)

				FUNC("minimap_set_way_point", 1, 6578.0, 5544.0, 103.5, 0, 0) 

				ACTION("give_task", orlean_recno, "DEFEND_PLACE", 10, orlean_building_place_recno, 0, 0, 0)

				WAIT{ FUNC("pause_script", 10000) }

				farcher_recno_a = FUNC("search_unit_by_name", "Archimbaud Trumelier")
				farcher_recno_b = FUNC("search_unit_by_name", "Foulques Paintre")
				farcher_recno_c = FUNC("search_unit_by_name", "Orry Chaperonnier")
				farcher_recno_d = FUNC("search_unit_by_name", "Renaud Boutier")

				if( FUNC("get_scenario_bit_flag", 9) ==  1 )
				{
					if(farcher_recno_a > 0)
					{
						ACTION("give_task", farcher_recno_a, "DEFEND_PLACE", 1, castle_wall_place_recno_l, 0, 0, 0)
					}
					if(farcher_recno_b > 0)
					{
						ACTION("give_task", farcher_recno_b, "DEFEND_PLACE", 1, castle_wall_place_recno_l, 0, 0, 0)
					}
					if(farcher_recno_c > 0)
					{
						ACTION("give_task", farcher_recno_c, "DEFEND_PLACE", 1, castle_wall_place_recno_r, 0, 0, 0)
					}
					if(farcher_recno_d > 0)
					{
						ACTION("give_task", farcher_recno_d, "DEFEND_PLACE", 1, castle_wall_place_recno_r, 0, 0, 0)
					}
				}

				FUNC("attention_call_message", "[0062N]Archers are recruited to protect the castle. They will camp on the castle wall.")

				WAIT{ FUNC("pause_script", 10000) }
			}

			if( FUNC("get_scenario_bit_flag", 8) == 0 )
			{
				if( FUNC("get_scenario_count_time") > 5000 )
				{
					if( jean_recno > 0 )
					{
						FUNC("set_scenario_bit_flag", 8, 1)
					}
				}
			}


			farcher_recno_a = FUNC("search_unit_by_name", "Archimbaud Trumelier")
			farcher_recno_b = FUNC("search_unit_by_name", "Foulques Paintre")
			farcher_recno_c = FUNC("search_unit_by_name", "Orry Chaperonnier")
			farcher_recno_d = FUNC("search_unit_by_name", "Renaud Boutier")

			if(farcher_recno_a > 0)
			{
				if( FUNC("is_unit_parked", farcher_recno_a) == 1)
				{
					ACTION("give_task", farcher_recno_a, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
				}
			}
			if(farcher_recno_b > 0)
			{
				if( FUNC("is_unit_parked", farcher_recno_b) == 1)
				{
					ACTION("give_task", farcher_recno_b, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
				}
			}
			if(farcher_recno_c > 0)
			{
				if( FUNC("is_unit_parked", farcher_recno_c) == 1)
				{
					ACTION("give_task", farcher_recno_c, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
				}
			}
			if(farcher_recno_d > 0)
			{
				if( FUNC("is_unit_parked", farcher_recno_d) == 1)
				{
					ACTION("give_task", farcher_recno_d, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
				}
			}

	//		if( FUNC("get_scenario_count_time") > 120000 )
			if( FUNC("get_can_interact_flag", orlean_recno) == 0 )
			{
				if( FUNC("is_unit_inside_place", check_enemy_place_recno, joan_recno) == 0 && FUNC("is_unit_inside_place", check_enemy_place_recno_2, joan_recno) == 0 )
				{
					if( FUNC("get_scenario_bit_flag", 16) == 0 )
					{
						FUNC("attention_call_message_2", "[0063N]Return to the castle immediately, and close the gate! We need all the manpower and reinforcements we can afford!", orlean_recno )
						FUNC("set_scenario_bit_flag", 16, 1)
					}
				}
				//else if( la_hire_recno > 0 && FUNC("is_unit_inside_place", check_enemy_place_recno, la_hire_recno) == 0 )
				//{
				//	if( FUNC("get_scenario_bit_flag", 16) == 0 )
				//	{
				//		FUNC("attention_call_message_2", "[0063N]Return to the castle immediately, and close the gate! We need all the manpower and reinforcements we can afford!", orlean_recno )
				//		FUNC("set_scenario_bit_flag", 16, 1)
				//	}
				//}
				else if( jean_recno > 0 && FUNC("is_unit_inside_place", check_enemy_place_recno, jean_recno) == 0 && FUNC("is_unit_inside_place", check_enemy_place_recno_2, jean_recno) == 0 )
				{
					if( FUNC("get_scenario_bit_flag", 16) == 0 )
					{
						FUNC("attention_call_message_2", "[0063N]Return to the castle immediately, and close the gate! We need all the manpower and reinforcements we can afford!", orlean_recno )
						FUNC("set_scenario_bit_flag", 16, 1)
					}
				}
				else if( FUNC("get_gate_state", gate_door_recno) > 0 )
				{
					if( FUNC("get_scenario_bit_flag", 16) == 0 )
					{
						FUNC("attention_call_message_2", "[0063N]Return to the castle immediately, and close the gate! We need all the manpower and reinforcements we can afford!", orlean_recno )
						FUNC("set_scenario_bit_flag", 16, 1)
					}
				}
				else
				{
					// archer team 1
					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_a, engarchcap_id, 24, 5, "Rowland Bond", "Bond")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_f, engarch_id, 24, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_c, engarch_id, 24, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_d, engarch_id, 24, 1, 5)
					//FUNC("facility_barrack_add_member", reinforcement_spawn_point_e, engarch_id, 24, 1, 5)

					// William de la Pole team
					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_q, william_id, 22, 10, "William de la Pole", "William")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_r, ehinfant_id, 22, 1, 6)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_s, ehinfant_id, 22, 1, 6)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_t, epoleman_id, 22, 1, 6)
					//FUNC("facility_barrack_add_member", reinforcement_spawn_point_b, elinfant_id, 22, 1, 6)

					// John de la Pole team
					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_u, john_id, 20, 10, "John de la Pole", "John")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_v, ehinfant_id, 20, 1, 6)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_w, ehinfant_id, 20, 1, 6)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_x, epoleman_id, 20, 1, 6)
					//FUNC("facility_barrack_add_member", reinforcement_spawn_point_y, elinfant_id, 20, 1, 6)

					//light infantry team 1
					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_l, ehinfcap_id, 21, 5, "Lucas Barker", "Barker")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_i, ehinfant_id, 21, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_h, ehinfant_id, 21, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_g, ehinfant_id, 21, 1, 5)
					//FUNC("facility_barrack_add_member", reinforcement_spawn_point_j, ehinfant_id, 21, 1, 5)

					//light infantry team 2
					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_p, engarchcap_id, 23, 5, "Vivian Bosse", "Bosse")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_o, engarch_id, 23, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_n, engarch_id, 23, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_m, engarch_id, 23, 1, 5)
					//FUNC("facility_barrack_add_member", reinforcement_spawn_point_k, engarch_id, 23, 1, 5)

					FUNC("facility_barrack_add_leader", additional_reinforcement_1, ehinfcap_id, 34, 5, "Richard Waly", "Waly")
					FUNC("facility_barrack_add_member", additional_reinforcement_1, ehinfant_id, 34, 5, 5)
					FUNC("facility_barrack_add_leader", additional_reinforcement_2, blinfcap_id, 35, 5, "Thoma Manton", "Manton")
					FUNC("facility_barrack_add_member", additional_reinforcement_2, blinfant_id, 35, 5, 5)
					FUNC("facility_barrack_add_leader", additional_reinforcement_3, epolecap_id, 36, 5, "Johes Exton", "Exton")
					FUNC("facility_barrack_add_member", additional_reinforcement_3, epoleman_id, 36, 5, 5)
					FUNC("facility_barrack_add_leader", additional_reinforcement_4, ehinfcap_id, 37, 5, "Elis Teigh", "Teigh")
					FUNC("facility_barrack_add_member", additional_reinforcement_4, ehinfant_id, 37, 5, 5)
					FUNC("facility_barrack_add_leader", additional_reinforcement_5, blinfcap_id, 38, 5, "Owaine Seaton", "Seaton")
					FUNC("facility_barrack_add_member", additional_reinforcement_5, blinfant_id, 38, 5, 5)
					FUNC("facility_barrack_add_leader", additional_reinforcement_6, epolecap_id, 39, 5, "Denston Luffenham", "Luffenham")
					FUNC("facility_barrack_add_member", additional_reinforcement_6, epoleman_id, 39, 5, 5)

					// cannon
					cannon_recno_a = FUNC("add_unit", "CANNON", "ENGLISH")
					FUNC("set_unit_name", cannon_recno_a, "Cannon 1")
					FUNC("set_unit_ranking", cannon_recno_a, "CAPTAIN")
					FUNC("set_unit_team", cannon_recno_a, 40)
					FUNC("set_unit_pos", cannon_recno_a, 8514.0, 13211.0, 2.0)
					FUNC("set_unit_dir", cannon_recno_a, 270) 
					cannon_controller_recno_a = FUNC("add_unit", "ENGLISH_LIGHT_INFANTRY", "ENGLISH")
					FUNC("set_unit_name", cannon_controller_recno_a, "Cannon Controller 1")
					FUNC("set_unit_pos", cannon_controller_recno_a, 8550.0, 13385.0, 3.0)
					FUNC("set_unit_dir", cannon_controller_recno_a, 270) 
					FUNC("set_unit_team", cannon_controller_recno_a, 40)
					ACTION("give_task", cannon_controller_recno_a, "LARGE_WEAPON_PUSH", 10, cannon_recno_a, 1, 0, 0)
					cannon_controller_recno_d = FUNC("add_unit", "ENGLISH_LIGHT_INFANTRY", "ENGLISH")
					FUNC("set_unit_name", cannon_controller_recno_d, "Cannon Controller 4")
					FUNC("set_unit_pos", cannon_controller_recno_d, 8574.0, 13473.0, 12.0)
					FUNC("set_unit_dir", cannon_controller_recno_d, 270) 
					FUNC("set_unit_team", cannon_controller_recno_d, 40)
					ACTION("give_task", cannon_controller_recno_d, "LARGE_WEAPON_PUSH", 10, cannon_recno_a, 0, 0, 0)

					cannon_recno_b = FUNC("add_unit", "CANNON", "ENGLISH")
					FUNC("set_unit_name", cannon_recno_b, "Cannon 2")
					FUNC("set_unit_ranking", cannon_recno_b, "CAPTAIN")
					FUNC("set_unit_team", cannon_recno_b, 41)
					FUNC("set_unit_pos", cannon_recno_b, 8714.0, 13211.0, 6.0)
					FUNC("set_unit_dir", cannon_recno_b, 270) 
					cannon_controller_recno_b = FUNC("add_unit", "ENGLISH_LIGHT_INFANTRY", "ENGLISH")
					FUNC("set_unit_name", cannon_controller_recno_b, "Cannon Controller 2")
					FUNC("set_unit_pos", cannon_controller_recno_b, 8750.0, 13385.0, 6.0)
					FUNC("set_unit_dir", cannon_controller_recno_b, 270) 
					FUNC("set_unit_team", cannon_controller_recno_b, 41)
					ACTION("give_task", cannon_controller_recno_b, "LARGE_WEAPON_PUSH", 10, cannon_recno_b, 1, 0, 0)
					cannon_controller_recno_e = FUNC("add_unit", "ENGLISH_LIGHT_INFANTRY", "ENGLISH")
					FUNC("set_unit_name", cannon_controller_recno_e, "Cannon Controller 5")
					FUNC("set_unit_pos", cannon_controller_recno_e, 8747.0, 13529.0, 16.0)
					FUNC("set_unit_dir", cannon_controller_recno_e, 270) 
					FUNC("set_unit_team", cannon_controller_recno_e, 41)
					ACTION("give_task", cannon_controller_recno_e, "LARGE_WEAPON_PUSH", 10, cannon_recno_b, 0, 0, 0)

					cannon_recno_c = FUNC("add_unit", "CANNON", "ENGLISH")
					FUNC("set_unit_name", cannon_recno_c, "Cannon 3")
					FUNC("set_unit_ranking", cannon_recno_c, "CAPTAIN")
					FUNC("set_unit_team", cannon_recno_c, 42)
					FUNC("set_unit_pos", cannon_recno_c, 8314.0, 13211.0, 6.0)
					FUNC("set_unit_dir", cannon_recno_c, 270) 
					cannon_controller_recno_c = FUNC("add_unit", "ENGLISH_LIGHT_INFANTRY", "ENGLISH")
					FUNC("set_unit_name", cannon_controller_recno_c, "Cannon Controller 3")
					FUNC("set_unit_pos", cannon_controller_recno_c, 8350.0, 13385.0, 1.0)
					FUNC("set_unit_dir", cannon_controller_recno_c, 270) 
					FUNC("set_unit_team", cannon_controller_recno_c, 42)
					ACTION("give_task", cannon_controller_recno_c, "LARGE_WEAPON_PUSH", 10, cannon_recno_c, 1, 0, 0)
					cannon_controller_recno_f = FUNC("add_unit", "ENGLISH_LIGHT_INFANTRY", "ENGLISH")
					FUNC("set_unit_name", cannon_controller_recno_f, "Cannon Controller 6")
					FUNC("set_unit_pos", cannon_controller_recno_f, 8343.0, 13561.0, 34.0)
					FUNC("set_unit_dir", cannon_controller_recno_f, 270) 
					FUNC("set_unit_team", cannon_controller_recno_f, 42)
					ACTION("give_task", cannon_controller_recno_f, "LARGE_WEAPON_PUSH", 10, cannon_recno_c, 0, 0, 0)

					//FUNC("attention_call_message", "[0001N]The English reinforcement troops appear outside the city!")
					//FUNC("attention_call_message", "[0001N]You can press ENTER when in front of the castle entrance to open or close the gate.")

					FUNC("set_can_interact_flag", orlean_recno, 0)
					//ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)
					ACTION("give_task", orlean_recno, "DEFEND_PLACE", 10, orlean_building_place_recno, 0, 0, 0)


					FUNC("set_scenario_stage", 5)
					FUNC("reset_scenario_event_bit_flag")
					FUNC("set_scenario_count_time")
					FUNC("set_scenario_mode", "SCENARIO_BATTLE_MODE")
					
					//FUNC("attention_call_message", "[0001N]English reinforcement troops have arrived outside the castle walls!")
					//WAIT { FUNC("pause_script", 10000) }

					exit
				}
			}
		}
	}

	if(FUNC("get_scenario_stage") == 4)
	{
		orlean_recno = FUNC("search_unit_by_name", "Bastard z Orleanu")
		//la_hire_recno = FUNC("search_unit_by_name", "La Hire")
		jean_recno = FUNC("search_unit_by_name", "Jean de Metz")

		gate_spawn_leader_recno_a = FUNC("search_unit_by_name", "Laurentius Fryuell")
		gate_spawn_leader_recno_b = FUNC("search_unit_by_name", "Manselm Ketton")

		if( jean_recno > 0 )
		{
			if(gate_spawn_leader_recno_a == 0 && gate_spawn_leader_recno_b == 0)
			{
				if(FUNC("get_interact_stage", jean_recno) == 0)
				{
					ACTION("give_task", jean_recno, "DEFEND_PLACE", 2, defend_gate_place_recno, 0, 0, 0)
					////ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 2, orlean_building_place_recno, 0, 0, 0)
					//FUNC("attention_call_message", "[0001N]Jean is trying to close the castle gate now!")
					//FUNC("attention_call_message", "[0001N]La Hire is going to protect Orlean!")

					FUNC("set_interact_stage", jean_recno, 1)
					////FUNC("set_interact_stage", la_hire_recno, 1)
				}
			}

			if(FUNC("is_unit_inside_place", defend_gate_place_recno, jean_recno) == 1)
			{
				if(FUNC("get_interact_stage", jean_recno) == 1)
				{
//					FUNC("add_gate_trigger", gate_door_recno, 0)
//					FUNC("set_item_nation", gate_door_recno, "FRENCH")
//					FUNC("attention_call_message", "[0001N]Jean has closed the gate successfully!")

					FUNC("set_interact_stage", jean_recno, 2)
				}
			}
		}

	}

//second wave
	if(FUNC("get_scenario_stage") == 5)
	{
		FUNC("set_end_condition_enabled", 3, 1)
		FUNC("set_end_condition_enabled", 4, 1)

		//ACTION("give_task", la_hire_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)
		//ACTION("give_task", joan_recno, "DEFEND_PLACE", 30, defend_gate_place_recno, 0, 0, 0)

		john_recno = FUNC("search_unit_by_name", "John de la Pole")
		william_recno = FUNC("search_unit_by_name", "William de la Pole")

		if( FUNC("get_scenario_event_bit_flag", 0) == 0)
		{
			if( william_recno > 0 && FUNC("get_unit_retreat", william_recno) == 0)
			{
				joan_sword_id = FUNC("item_code_to_id", "JOAN_SWORD_LV3")
				FUNC("set_unit_drop_item_id", william_recno, joan_sword_id)
				FUNC("set_unit_retreat", william_recno, 1)
			}

			if( john_recno > 0 && FUNC("get_unit_retreat", john_recno) == 0)
			{
				citrine_id = FUNC("item_code_to_id", "citrine")
				FUNC("set_unit_drop_item_id", john_recno, citrine_id)
				FUNC("set_unit_drop_item_level", joan_recno, 7)
				FUNC("set_unit_retreat", john_recno, 1)
			}

			if( william_recno > 0 && john_recno > 0 && FUNC("get_cut_scene_flag") == 0 )
			{
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)
				//WAIT{ FUNC("start_cut_scene", 0, 1, william_recno, 200, 90, 5) }
				WAIT{ FUNC("start_cut_scene", 0, 1, 8839, 13227, 90, 188, 128, 15) }
				WAIT { DIALOG("add_dialog", john_recno, "[0064N]Fools! You thought it would be that easy to rid yourselves of our presence? Ha! I have returned, this time armed with our elite siege units. Now prepare for your doom!") }
				WAIT { FUNC("change_camera_in_cut_scene", 0, 8473, 13414, 31, 188, 89, 15) }
				WAIT { DIALOG("add_dialog", william_recno, "[0065N]Stupid French - Resistance is futile! Your meager efforts to defend your city are in vain. How can you impotent scum possibly prevent us from capturing the city now?") }
				WAIT { FUNC("change_camera_in_cut_scene", 0, 8858, 13407, 33, 188, 89, 18) }
				WAIT { DIALOG("add_dialog", john_recno, "[0066N]Man the cannons lads! Ignite the gunpowder! Blow the entrance, and this time, spare no one!") }
				DIALOG("del_all_dialog") 
				FUNC("set_unit_can_process_in_cut_scene", 0, 1)
				FUNC("end_cut_scene", 1)
				WAIT{ FUNC("is_cut_scene_finished") }
				FUNC("set_scenario_event_bit_flag", 0, 1)
				FUNC("set_end_condition_enabled", 10, 1)

				FUNC( "give_item_to_unit", "fd_bread_S", 1, 2, william_recno )
				FUNC( "give_item_to_unit", "fd_bread_S", 1, 1, john_recno )
			}
		}
		else
		{

			archer_cap_recno_a = FUNC("search_unit_by_name", "Rowland Bond")
			archer_cap_recno_b = FUNC("search_unit_by_name", "Vivian Bosse")
			bow_id = FUNC("item_code_to_id", "Crossbow")

			if( archer_cap_recno_b > 0 )
			{
				FUNC("set_unit_drop_item_id", archer_cap_recno_b, bow_id)
			}
			
			infantry_cap_recno_a = FUNC("search_unit_by_name", "Lucas Barker")

			poleman_cap_recno_a = FUNC("search_unit_by_name", "Jordan Rudde")
			poleman_cap_recno_b = FUNC("search_unit_by_name", "Filbert Stykenay")
			bur_inf_cap_recno_a = FUNC("search_unit_by_name", "Reginald Temple")
			bur_inf_cap_recno_b = FUNC("search_unit_by_name", "Leonard Wenton")

			additional_reinforcement_leader_1 = FUNC("search_unit_by_name", "Richard Waly")
			additional_reinforcement_leader_2 = FUNC("search_unit_by_name", "Thoma Manton")
			additional_reinforcement_leader_3 = FUNC("search_unit_by_name", "Johes Exton")
			additional_reinforcement_leader_4 = FUNC("search_unit_by_name", "Elis Teigh")
			additional_reinforcement_leader_5 = FUNC("search_unit_by_name", "Owaine Seaton")
			additional_reinforcement_leader_6 = FUNC("search_unit_by_name", "Denston Luffenham")

			//infantry_cap_recno_b = FUNC("search_unit_by_name", "Manselm Ketton")

			farcher_recno_a = FUNC("search_unit_by_name", "Archimbaud Trumelier")
			farcher_recno_b = FUNC("search_unit_by_name", "Foulques Paintre")
			farcher_recno_c = FUNC("search_unit_by_name", "Orry Chaperonnier")
			farcher_recno_d = FUNC("search_unit_by_name", "Renaud Boutier")

	//		if( FUNC("can_attach", cannon_recno_a) == 1)
	//		{
	//			cannon_attach_index = FUNC("get_nearest_attach_point", cannon_controller_recno_a, cannon_recno_a)
	//			cannon_attach_x = FUNC("get_nearest_attach_point_x", cannon_recno_a, cannon_attach_index)
	//			cannon_attach_y = FUNC("get_nearest_attach_point_y", cannon_recno_a, cannon_attach_index)
	//			cannon_attach_z = FUNC("get_nearest_attach_point_z", cannon_recno_a, cannon_attach_index)
	//			cannon_distance = FUNC("get_distance", cannon_controller_recno_a, cannon_attach_x, cannon_attach_y, cannon_attach_z)
	//
	//			if(cannon_distance > 100)
	//			{
	//				ACTION("give_order", cannon_controller_recno_a, "MOVE_TO_TARGET", 1 , 0, cannon_attach_x, cannon_attach_y, cannon_attach_z, 0, 10000)
	//			}
	//
	//			FUNC("attach_unit", cannon_controller_recno_a, cannon_recno_a, 100)
	//		}
	//
	//		if( FUNC("can_attach", cannon_recno_b) == 1)
	//		{
	//			cannon_attach_index = FUNC("get_nearest_attach_point", cannon_controller_recno_b, cannon_recno_b)
	//			cannon_attach_x = FUNC("get_nearest_attach_point_x", cannon_recno_b, cannon_attach_index)
	//			cannon_attach_y = FUNC("get_nearest_attach_point_y", cannon_recno_b, cannon_attach_index)
	//			cannon_attach_z = FUNC("get_nearest_attach_point_z", cannon_recno_b, cannon_attach_index)
	//			cannon_distance = FUNC("get_distance", cannon_controller_recno_b, cannon_attach_x, cannon_attach_y, cannon_attach_z)
	//
	//			if(cannon_distance > 100)
	//			{
	//				ACTION("give_order", cannon_controller_recno_b, "MOVE_TO_TARGET", 1 , 0, cannon_attach_x, cannon_attach_y, cannon_attach_z, 0, 10000)
	//			}
	//
	//			FUNC("attach_unit", cannon_controller_recno_b, cannon_recno_b, 100)
	//		}
	//
	//		if( FUNC("can_attach", cannon_recno_c) == 1)
	//		{
	//			cannon_attach_index = FUNC("get_nearest_attach_point", cannon_controller_recno_c, cannon_recno_c)
	//			cannon_attach_x = FUNC("get_nearest_attach_point_x", cannon_recno_c, cannon_attach_index)
	//			cannon_attach_y = FUNC("get_nearest_attach_point_y", cannon_recno_c, cannon_attach_index)
	//			cannon_attach_z = FUNC("get_nearest_attach_point_z", cannon_recno_c, cannon_attach_index)
	//			cannon_distance = FUNC("get_distance", cannon_controller_recno_c, cannon_attach_x, cannon_attach_y, cannon_attach_z)
	//
	//			if(cannon_distance > 100)
	//			{
	//				ACTION("give_order", cannon_controller_recno_c, "MOVE_TO_TARGET", 1 , 0, cannon_attach_x, cannon_attach_y, cannon_attach_z, 0, 10000)
	//			}
	//
	//			FUNC("attach_unit", cannon_controller_recno_c, cannon_recno_c, 100)
	//		}
	//
			if( FUNC("is_unit_parked", farcher_recno_a) == 1)
			{
				ACTION("give_task", farcher_recno_a, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
			}
			if( FUNC("is_unit_parked", farcher_recno_b) == 1)
			{
				ACTION("give_task", farcher_recno_b, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
			}
			if( FUNC("is_unit_parked", farcher_recno_c) == 1)
			{
				ACTION("give_task", farcher_recno_c, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
			}
			if( FUNC("is_unit_parked", farcher_recno_d) == 1)
			{
				ACTION("give_task", farcher_recno_d, "TOWER_ATTACK", 2, 3000, 0, 0, 0)
			}

			if(farcher_recno_a > 0 || farcher_recno_b > 0 || farcher_recno_c > 0 || farcher_recno_d > 0)
			{
				ACTION("give_team_task", archer_cap_recno_a, "TOWER_ATTACK", 5, 3000, 0, 0, 0)
				ACTION("give_team_task", archer_cap_recno_b, "TOWER_ATTACK", 5, 3000, 0, 0, 0)
			}

			if( gate_door_recno > 0 )
			{
				if( FUNC("get_gate_hp", gate_door_recno) <= 0 )
				{
					if(FUNC("get_scenario_bit_flag", 12) == 0)
					{
						ACTION("give_task", john_recno, "ATTACK_PLACE", 5, left_battle_place_recno, 0, 0, 0)
						ACTION("give_task", william_recno, "ATTACK_PLACE", 5, right_battle_place_recno_c, 0, 0, 0)
						ACTION("give_task", infantry_cap_recno_a, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_1, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_2, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_3, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_4, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_5, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_6, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						//ACTION("give_task", infantry_cap_recno_b, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)

			//			if(farcher_recno_a == 0 && farcher_recno_b == 0 && farcher_recno_c == 0 && farcher_recno_d == 0)
			//			{
			//				ACTION("give_task", archer_cap_recno_a, "ATTACK_PLACE", 10, orlean_building_place_recno, 0, 0, 0)
			//				ACTION("give_task", archer_cap_recno_b, "ATTACK_PLACE", 10, orlean_building_place_recno, 0, 0, 0)
			//			}

						FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process

						//WAIT{ FUNC("start_cut_scene", 0, 1, william_recno, 200, 90, 5) }
						WAIT{ FUNC("start_cut_scene", 0, 0, 8459, 10879, 142, 188, 91, 10) }

						ACTION("stop_all_order", unit_recno) 
						FUNC("set_idle", unit_recno) 

						WAIT { DIALOG("add_dialog", orlean_recno, "[0067N]The English have breached our castle gates! We must stop them from destroying the town!") }

						DIALOG("del_all_dialog") 

						FUNC("set_scenario_bit_flag", 12, 1)
						FUNC("set_scenario_count_time")

						//for demo only
						//WAIT { FUNC("pause_script", 5000) }
						//FUNC("set_victory_display_flag", 1)

						FUNC("end_cut_scene", 0)
						WAIT{ FUNC("is_cut_scene_finished") }

						FUNC("set_unit_can_process_in_cut_scene", 0, 1)	// all unit can process
					}
				}

				if( FUNC("get_gate_state", gate_door_recno) == 1 )
				{
					if(FUNC("get_scenario_bit_flag", 12) == 0)
					{
						ACTION("give_task", john_recno, "ATTACK_PLACE", 5, left_battle_place_recno, 0, 0, 0)
						ACTION("give_task", william_recno, "ATTACK_PLACE", 5, right_battle_place_recno_c, 0, 0, 0)

		//				if(farcher_recno_a == 0 && farcher_recno_b == 0 && farcher_recno_c == 0 && farcher_recno_d == 0)
		//				{
		//					ACTION("give_task", archer_cap_recno_a, "ATTACK_PLACE", 10, orlean_building_place_recno, 0, 0, 0)
		//					ACTION("give_task", archer_cap_recno_b, "ATTACK_PLACE", 10, orlean_building_place_recno, 0, 0, 0)
		//				}

						ACTION("give_task", infantry_cap_recno_a, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_1, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_2, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_3, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_4, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_5, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						ACTION("give_task", additional_reinforcement_leader_6, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
						//ACTION("give_task", infantry_cap_recno_b, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)

						FUNC("attention_call_message_2", "[0068N]What are you doing? We are to prevent, not invite, the English from entering!", orlean_recno )
						FUNC("set_scenario_bit_flag", 12, 1)
						FUNC("set_scenario_count_time")

						//for demo only
						//WAIT { FUNC("pause_script", 15000) }
						//FUNC("set_victory_display_flag", 1)
					}
				}
			}

			if(FUNC("get_scenario_bit_flag", 12) == 1 && FUNC("get_scenario_bit_flag", 13) == 0)
			{
				if(FUNC("get_scenario_count_time") > 120000 && FUNC("is_unit_inside_place", no_spawn_place_recno, joan_recno) == 0)
				{
					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_a, epolecap_id, 25, 5, "Jordan Rudde", "Rudde")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_f, epoleman_id, 25, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_c, epoleman_id, 25, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_d, epoleman_id, 25, 1, 5)

					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_q, epolecap_id, 26, 5, "Filbert Stykenay", "Stykenay")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_r, epoleman_id, 26, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_s, epoleman_id, 26, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_t, epoleman_id, 26, 1, 5)

					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_u, blinfcap_id, 27, 5, "Reginald Temple", "Temple")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_v, blinfant_id, 27, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_w, blinfant_id, 27, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_x, elinfant_id, 27, 1, 5)

					FUNC("facility_barrack_add_leader", reinforcement_spawn_point_l, blinfcap_id, 28, 5, "Leonard Wenton", "Wenton")
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_i, blinfant_id, 28, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_h, blinfant_id, 28, 1, 5)
					FUNC("facility_barrack_add_member", reinforcement_spawn_point_g, elinfant_id, 28, 1, 5)

					FUNC("set_scenario_bit_flag", 13, 1)
				}
			}

			if( FUNC("get_scenario_bit_flag", 13) == 1)
			{
				if(poleman_cap_recno_a > 0)
				{
					ACTION("give_task", poleman_cap_recno_a, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
				}
				if(poleman_cap_recno_b > 0)
				{
					ACTION("give_task", poleman_cap_recno_b, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
				}
				if(bur_inf_cap_recno_a > 0)
				{
					ACTION("give_task", bur_inf_cap_recno_a, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
				}
				if(bur_inf_cap_recno_b > 0)
				{
					ACTION("give_task", bur_inf_cap_recno_b, "ATTACK_PLACE", 5, orlean_building_place_recno, 0, 0, 0)
				}
			}

			if(FUNC("is_unit_inside_place", left_battle_place_recno, john_recno) == 1)
			{
				ACTION("give_task", john_recno, "ATTACK_PLACE", 10, orlean_building_place_recno, 0, 0, 0)
			}
			if(FUNC("is_unit_inside_place", right_battle_place_recno_c, william_recno) == 1)
			{
				ACTION("give_task", william_recno, "ATTACK_PLACE", 10, orlean_building_place_recno, 0, 0, 0)
			}


			//if( FUNC("is_in_danger", john_recno) == 1 || FUNC("get_unit_retreat", john_recno) == -1)
			//{
			//	//FUNC("set_unit_retreat", john_recno, 1)
			//	ACTION("give_task", john_recno, "RETREAT", 99, john_retreat_place_recno, 1, 45000, 0)
			//}
			//if( FUNC("is_in_danger", william_recno) == 1 || FUNC("get_unit_retreat", william_recno) == -1)
			//{
			//	//FUNC("set_unit_retreat", william_recno, 1)
			//	ACTION("give_task", william_recno, "RETREAT", 99, john_retreat_place_recno, 1, 45000, 0)
			//}

			//if( FUNC("get_scenario_count_time") > 10000 )
			//{
			//	if( john_recno == 0 && william_recno == 0)
			//	{
			//		//FUNC("attention_call_message", "[0001N]Here is the end of the demo. Thanks for playing!")
			//		FUNC("set_scenario_stage", 6)
			//	}
			//}

			//if( FUNC("is_all_attached", cannon_recno) == 1 )
			//{
			//	ACTION("stop_curr_task", cannon_recno) 
			//	ACTION("give_task", cannon_recno, "RETREAT", 2, 0, 0, 0, 0) 
			//}

		}
	}
}