"S1L1_tactic.sce"
{
	INT dialog_recno

	INT joan_recno 
	INT jean_recno
	INT retreat_place_recno
	INT joan_in_place_recno

	//1st camp
	INT camp_place_recno
	
	//english units
	INT elinfant_id
	INT elinfcap_id
	INT earcher_id
	INT earchcap_id

	//1st camp troops
	INT BIC_captain_recno

	// castle animation places
	INT camp_bridge_place_recno
	INT camp_gate_place_recno

	// castle gate and bridge
	INT cgate_recno
	INT cbridge_recno

	INT current_scenario_stage

	// Tactic event 1
	INT BIC_captain_recno
	INT CI_one_recno
	INT CI_two_recno
	INT BI_two_recno
	INT BI_three_recno
	INT event_one_camp_entrance_place_recno
	INT event_one_call_support_place_recno

	// Tactic event 2
	INT DIC_captain_recno
	INT EIC_captain_recno
	INT event_two_ambush_zone_place_recno
	INT event_two_DIC_place_recno

	// Tactic event 3
	INT FIC_captain_recno
	INT event_three_archer_defender_recno
	INT FIC_two_recno
	INT event_three_bridge_place_recno
	INT event_three_FIC_two_place_recno

	// Tactic event 4
	INT messenger_recno
	INT reinforcement2_recno
	INT reinforcement_horse_recno

	// Tactic event 5
	INT HIC_captain_recno
	INT JIC_captain_recno
//	INT KAC_captain_recno
	INT MAC_captain_recno
	INT MAC_light_infantry_one_recno
	INT MAC_light_infantry_two_recno
	INT LAC_captain_recno
	INT LAC_light_infantry_one_recno
	INT LAC_light_infantry_two_recno
	INT event_five_healing_place_recno
	INT event_five_archer_fire_zone
	INT event_five_HIC_place_recno
	INT event_five_IIC_place_recno
	INT event_five_JIC_place_recno
	INT event_five_KAC_place_recno
	INT event_five_LAC_place_recno
	INT event_five_MAC_place_recno

	// Tactic event 6
	INT NIC_captain_recno
//	INT OIC_captain_recno
	INT PIC_captain_recno
	INT QAC_captain_recno
	INT event_six_ambush_zone_recno
	INT event_six_call_support_zone_recno

	INT english_light_infantry_recno

	INT enemy_recno
	INT talk_unit1_recno
	INT talk_unit2_recno

	INT enemy_in_healing_place
	INT enemy_in_fire_zone

	// Tutorial
	INT start_point_place
	INT attack_key_place
	INT break_box_place
	INT event1_waypoint
	INT event2_waypoint
	INT event3_waypoint
	INT event4_waypoint
	INT event5_waypoint
	INT event6_waypoint
	INT event3_message_place
	INT horse_message_place
	INT messenger_detect_place

	INT imperial_scroll_id

	INT condition_recno

	INT castle_guard1_recno
	INT castle_guard2_recno

	INT imperial_scroll_recno

	INT castle_top_guard_recno
	INT castle_top_guard2_recno
	INT jean_message_place_recno

	INT cut_scene_type
	INT come_again
	INT retreat_place_recno

	INT bridge_detect_palce_recno

	INT main_character_recno

//	STRING objective_tutorial_message

	init 
	{
		// get unit id
		elinfant_id = FUNC("unit_code_to_id", "ENGLISH_LIGHT_INFANTRY") 

		// get unit recno
		joan_recno = FUNC("get_main_character") 		
		jean_recno = FUNC("search_unit_by_code" , "JEAN_DE_METZ") 
		BIC_captain_recno = FUNC("search_unit_by_name" , "Geffrey Oakham")

		// get place recno
		retreat_place_recno = FUNC("search_place_by_name", "retreat")
		camp_place_recno = FUNC("search_place_by_name", "Camp 1 Place") 

		BIC_captain_recno = FUNC("search_unit_by_name", "Geffrey Oakham")
		BI_two_recno = FUNC("search_unit_by_name", "BIC02")
		BI_three_recno = FUNC("search_unit_by_name", "BIC03")
		CI_one_recno = FUNC("search_unit_by_name", "CI01")
		CI_two_recno = FUNC("search_unit_by_name", "CI02")
		event_one_camp_entrance_place_recno = FUNC("search_place_by_name", "Captain goes back")
		event_one_call_support_place_recno = FUNC("search_place_by_name", "Captain calls support")

		DIC_captain_recno = FUNC("search_unit_by_name", "Hamond Ridlington")
		EIC_captain_recno = FUNC("search_unit_by_name", "Owaine Casterton")
		event_two_ambush_zone_place_recno = FUNC("search_place_by_name", "Tactic Event 2 Ambush Zone")
		event_two_DIC_place_recno = FUNC("search_place_by_name", "DIC placement")

		FIC_captain_recno = FUNC("search_unit_by_name", "Laurence Wardley")
		event_three_bridge_place_recno = FUNC("search_place_by_name", "Tactic Event 3 Bridge")
		event_three_archer_defender_recno = FUNC("search_unit_by_name", "GIC05")
		event_three_FIC_two_place_recno = FUNC("search_place_by_name", "FIC02 placement")
		FIC_two_recno = FUNC("search_unit_by_name", "FIC02")

		messenger_recno = FUNC("search_unit_by_name", "Marcel Parcheminier")
		reinforcement2_recno = FUNC("search_unit_by_name", "Gobert Fourmagier")
		reinforcement_horse_recno = FUNC("search_unit_by_name", "Reinforcement horse")

		HIC_captain_recno = FUNC("search_unit_by_name", "Bertram Braunston")
		JIC_captain_recno = FUNC("search_unit_by_name", "Hugh Hambleton")
//		KAC_captain_recno = FUNC("search_unit_by_name", "KAC01")
		MAC_captain_recno = FUNC("search_unit_by_name", "Bernard Lyngedraper")
		MAC_light_infantry_one_recno = FUNC("search_unit_by_name", "MAC05")
		MAC_light_infantry_two_recno = FUNC("search_unit_by_name", "MAC06")
		LAC_captain_recno = FUNC("search_unit_by_name", "Lewis Leighfield")
		LAC_light_infantry_one_recno = FUNC("search_unit_by_name", "LAC05")
		LAC_light_infantry_two_recno = FUNC("search_unit_by_name", "LAC06")
		event_five_healing_place_recno = FUNC("search_place_by_name", "Healing Place")
		event_five_archer_fire_zone = FUNC("search_place_by_name", "Acher Fire Zone")
		event_five_HIC_place_recno = FUNC("search_place_by_name", "HIC Placement")
		event_five_IIC_place_recno = FUNC("search_place_by_name", "JIC Placement")
		event_five_JIC_place_recno = FUNC("search_place_by_name", "JIC Placement")
		event_five_KAC_place_recno = FUNC("search_place_by_name", "KAC Placement")
		event_five_LAC_place_recno = FUNC("search_place_by_name", "LAC Placement")
		event_five_MAC_place_recno = FUNC("search_place_by_name", "MAC Placement")

		NIC_captain_recno = FUNC("search_unit_by_name", "Thomas Webber")
//		OIC_captain_recno = FUNC("search_unit_by_name", "OIC01")
		PIC_captain_recno = FUNC("search_unit_by_name", "Morys Martinsthorpe")
		QAC_captain_recno = FUNC("search_unit_by_name", "Charles Parmenter")
		event_six_ambush_zone_recno = FUNC("search_place_by_name", "Tactic Event 6 Ambush Zone")
		event_six_call_support_zone_recno = FUNC("search_place_by_name", "Tactic Event 6 Support Zone")

		start_point_place = FUNC("search_place_by_name", "StartPointPlace")
		attack_key_place = FUNC("search_place_by_name", "AttackKeyPlace")
		break_box_place = FUNC("search_place_by_name", "BreakBoxPlace")
		event1_waypoint = FUNC("search_place_by_name", "event 1 waypoint")
		event2_waypoint = FUNC("search_place_by_name", "Event2 waypoint")
		event3_waypoint = FUNC("search_place_by_name", "event 3 waypoint")
		event3_message_place = FUNC("search_place_by_name", "Event3 Message")
		horse_message_place = FUNC("search_place_by_name", "Horse Message")
		event4_waypoint = FUNC("search_place_by_name", "Event4 waypoint")
		messenger_detect_place = FUNC("search_place_by_name", "Messenger Detect")
		jean_message_place_recno = FUNC("search_place_by_name", "JeanMessage")

		imperial_scroll_id = FUNC("item_code_to_id", "flyletter01")

		retreat_place_recno = FUNC("search_place_by_name", "StartPointPlace")

		castle_guard1_recno = FUNC("search_unit_by_name", "Othon Corbelinier")
		castle_guard2_recno = FUNC("search_unit_by_name", "Clarembaud Chamberier")
		castle_top_guard_recno = FUNC("search_unit_by_name", "Ferry Charnisseur")
		castle_top_guard2_recno = FUNC("search_unit_by_name", "Clarembaud Marechal")

		bridge_detect_palce_recno = FUNC("search_place_by_name", "Bridge Detect")

		if( FUNC("get_scenario_stage") == 0 )
		{
			// get init task for unit
//			ACTION("give_task", jean_recno, "IDLE", 1, 0, 0, 0, 0) 

			FUNC("set_unit_drop_item_id", messenger_recno, imperial_scroll_id)

			// Tactic Event 1
			ACTION("give_task", BIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", CI_one_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", CI_two_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", BI_two_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", BI_three_recno, "IDLE", 1, 0, 0, 0, 0)

			// Tactic Event 2
			ACTION("give_task", DIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "DIC03"), "TOWER_ATTACK", 1, 0, 0, 0, 0)
			ACTION("give_task", EIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "EIC03"), "TOWER_ATTACK", 1, 0, 0, 0, 0)

			// Tactic Event 3
			ACTION("give_task", FIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", FIC_two_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "FIC04"), "TOWER_ATTACK", 1, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "FIC05"), "TOWER_ATTACK", 1, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "GIC05"), "TOWER_ATTACK", 1, 0, 0, 0, 0)

			// Tactic Event 5
			ACTION("give_task", HIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", JIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
//			ACTION("give_task", KAC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", MAC_captain_recno, "TOWER_ATTACK", 1, 2500, 0, 0, 0)
			ACTION("give_task", MAC_light_infantry_one_recno, "DEFEND_PLACE", 1, event_five_MAC_place_recno, 0, 0, 0)
			ACTION("give_task", MAC_light_infantry_two_recno, "DEFEND_PLACE", 1, event_five_MAC_place_recno, 0, 0, 0)
			ACTION("give_task", LAC_captain_recno, "TOWER_ATTACK", 1, 2500, 0, 0, 0)
			ACTION("give_task", LAC_light_infantry_one_recno, "DEFEND_PLACE", 1, event_five_LAC_place_recno, 0, 0, 0)
			ACTION("give_task", LAC_light_infantry_two_recno, "DEFEND_PLACE", 1, event_five_LAC_place_recno, 0, 0, 0)

			// Tactic Event 6
			ACTION("give_task", NIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
//			ACTION("give_task", OIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", PIC_captain_recno, "IDLE", 1, 0, 0, 0, 0)
			ACTION("give_task", QAC_captain_recno, "IDLE", 1, 0, 0, 0, 0)

			ACTION("give_task", messenger_recno, "DEFEND_PLACE", 1, event4_waypoint, 0, 0, 0)
			FUNC("set_control_flag", messenger_recno, 0)
			ACTION("give_task", reinforcement2_recno, "IDLE", 1, 0, 0, 0, 0)
			FUNC("set_control_flag", reinforcement2_recno, 0)
			ACTION("give_task", castle_guard1_recno, "IDLE", 1, 0, 0, 0, 0)
			FUNC("set_control_flag", castle_guard1_recno, 0)
			ACTION("give_task", castle_guard2_recno, "IDLE", 1, 0, 0, 0, 0)
			FUNC("set_control_flag", castle_guard2_recno, 0)
			ACTION("give_task", castle_top_guard_recno, "TOWER_ATTACK", 2000, 0, 0, 0, 0)
			ACTION("give_task", castle_top_guard2_recno, "TOWER_ATTACK", 2000, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "CTG1"), "TOWER_ATTACK", 2000, 0, 0, 0, 0)
			ACTION("give_task", FUNC("search_unit_by_name", "CTG2"), "TOWER_ATTACK", 2000, 0, 0, 0, 0)

//			FUNC("set_unit_can_rided_flag", reinforcement_horse_recno, 0)

			FUNC("give_item_to_unit", "fd_bread_s", 1, 2, jean_recno)
			FUNC("give_item_to_unit", "bkstar", 7, 1, jean_recno)
			FUNC("give_item_to_unit", "arrow", 1, 50, jean_recno)

			FUNC("set_unit_retreat", jean_recno, 1)
		}


		camp_gate_place_recno = FUNC("search_place_by_name", "Castle Gate Place")
		camp_bridge_place_recno = FUNC("search_place_by_name", "Castle Bridge Place")

		cgate_recno = FUNC("search_item_by_name", "Castle Gate")
		cbridge_recno = FUNC("search_item_by_name", "Castle Bridge")
		FUNC("set_item_can_interact_flag", cgate_recno, 0)
		FUNC("set_item_can_interact_flag", cbridge_recno, 0)

		FUNC("set_scenario_bit_flag", 20, 1)

		if ( FUNC("get_place_captured", camp_place_recno) ) 
		{
			FUNC("set_minimap_icon_display_enable", "fcampS1L1", 1)
			FUNC("set_minimap_icon_display_enable", "ecampS1L1", 0)
		}
		else
		{
			FUNC("set_minimap_icon_display_enable", "fcampS1L1", 0)
			FUNC("set_minimap_icon_display_enable", "ecampS1L1", 1)
		}

		FUNC("set_item_can_interact_flag", cgate_recno, 0)
		FUNC("set_item_can_interact_flag", camp_bridge_place_recno, 0)

		FUNC("set_scenario_bit_flag", 30, 0)
	} 

	main_character_recno = FUNC("get_main_character")

	if( FUNC("get_scenario_bit_flag", 31) == 0 )
	{ 
		if ( FUNC("is_unit_dead", jean_recno) || FUNC("get_unit_retreat", jean_recno) == -1 )
		{
			if ( FUNC("get_unit_dist", main_character_recno, jean_recno) < 2000 )
			{
				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("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, "[0001N]I am afraid I can no longer assist you. My weakening health prevents me from fighting any more!") }

				FUNC("enable_unit_bounding_volume", jean_recno, 0)

				WAIT{ ACTION("give_order", jean_recno, "APPROACH_PLACE", 1, 1, 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", 2)
				jean_recno = 0
				WAIT{ FUNC("is_cut_scene_finished") }
			}
			else
			{
				FUNC("attention_call_message_2", "[0001N]I am afraid I can no longer assist you. My weakening health prevents me from fighting any more!", jean_recno)
				FUNC("del_unit_team", 2)
				jean_recno = 0
			}

			FUNC("set_scenario_bit_flag", 31, 1) 
			FUNC("attention_call_message", "[0002N]Once a warrior's HP drops too low, they will retreat to safety, and will no longer assist you until your next mission.", 1)
		}
	}

	if ( FUNC("get_scenario_bit_flag", 26) == 0 )
	{
		FUNC("set_scenario_count_time")
		FUNC("set_scenario_bit_flag", 26, 1)
		FUNC("set_critical_attack_enabled", 0)
	}
	else if ( FUNC("get_scenario_count_time") > 600000 )
	{
		FUNC("set_critical_attack_enabled", 1)
	}
	else
	{
		FUNC("set_critical_attack_enabled", 0)
	}

	current_scenario_stage = FUNC("get_scenario_stage")
	if ( FUNC("get_scenario_bit_flag", 9) == 0 && FUNC("get_unit_level", joan_recno) == 2 )
	{
		FUNC("attention_call_message", "[0003N]You have leveled up, as can be seen by the green arrows next to your commander portrait! You can now increase your Hit Points (HP), Energy Points (EP), enhance your attributes or combos, or even learn new combos!", 1)
//		FUNC("attention_call_message", FUNC("format_string", "[0001N]Assign the experience points you've earned by pressing _%1s_. To learn new combos, press _%2s_.", FUNC("get_key_string", "CHARACTER_INTERFACE"), FUNC("get_key_string", "COMBO_INTERFACE")), 1)
		FUNC("attention_call_message", FUNC("format_string", "[0004N]Assign the experience points you've earned and learn new combos by pressing _%1s_.", FUNC("get_key_string", "CHARACTER_INTERFACE")), 1)

		FUNC("set_scenario_bit_flag", 9, 1)
	}
	if ( FUNC("get_scenario_bit_flag", 3) == 0 )
	{
		if ( FUNC("get_scenario_bit_flag", 18) == 0 && FUNC("is_unit_dead", messenger_recno) )
		{
			FUNC("set_scenario_bit_flag", 17, 1)
			FUNC("set_scenario_bit_flag", 18, 1)
//			FUNC("set_scenario_bit_flag", 20, 1)
			if ( FUNC("get_scenario_bit_flag", 1) )
			{
				if ( FUNC("get_scenario_event_bit_flag", 2) )
				{
					FUNC("attention_call_message_2", "[0005N]I have succumbed in battle! You will have to deliver the message in my stead!", messenger_recno)
				}
				if ( FUNC("get_end_condition_finish", 7) != 2 )
				{
					FUNC("set_end_condition_finish", 7, "LOSE")
				}
			}
			messenger_recno = 0
		}
		if ( FUNC("is_unit_dead", reinforcement2_recno) )
		{
			FUNC("set_scenario_bit_flag", 17, 1)
			reinforcement2_recno = 0
			if ( FUNC("get_scenario_bit_flag", 1) )
			{
				if ( FUNC("get_end_condition_finish", 7) != 2)
				{
					FUNC("set_end_condition_finish", 7, "LOSE")
				}
			}
		}
	}
//	if ( FUNC("get_scenario_bit_flag", 1) && FUNC("get_scenario_bit_flag", 17) )
//	{
//		FUNC("set_end_condition_finish", 6, "LOSE")
//	}
//	if ( FUNC("get_scenario_bit_flag", 16) == 0 && FUNC("get_unit_horse_recno", joan_recno) )
//	{
//		FUNC("attention_call_message", "[0001N]Now ride to the next waypoint. You can knock down enemies when your horse is running.")
//		FUNC("set_scenario_bit_flag", 16, 1)
//	}
//	if ( FUNC("get_scenario_bit_flag", 22) == 0 && FUNC("get_scenario_bit_flag", 18) && FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, joan_recno) )
//	if ( FUNC("get_scenario_bit_flag", 22) == 0 
//			&& ( FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, joan_recno)
//						|| FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, jean_recno) ) )
//	{
//		FUNC("set_scenario_bit_flag", 22, 1)
//		FUNC("set_scenario_bit_flag", 20, 1)
//	}
	if ( FUNC("get_scenario_bit_flag", 24) == 0 && FUNC("is_in_danger", jean_recno) )
	{
		FUNC("attention_call_message", "[0006N]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", FUNC("format_string", "[0007N]Transfer healing items by pressing _%1s_ to open the Character interface, then drag the healing item on to a wounded commander in the bottom right corner.", FUNC("get_key_string", "CHARACTER_INTERFACE")), 1)
		FUNC("set_scenario_bit_flag", 24, 1)
	}
	if ( FUNC("get_scenario_bit_flag", 29) == 0 && FUNC("get_unit_hp_percentage", joan_recno) <= 75 )
	{
		FUNC("attention_call_message", FUNC("format_string", "[0008N]To heal yourself, press _%1s_ to open the Character interface and use any healing items you have. You can also press _%2s_ to automatically heal yourself as long as you possess healing items.", FUNC("get_key_string", "CHARACTER_INTERFACE"), FUNC("get_key_string", "USE_HEAL_ITEM")), 1)
		FUNC("set_scenario_bit_flag", 29, 1)
	}

	if ( FUNC("get_scenario_bit_flag", 20) )
	{
		FUNC("set_scenario_bit_flag", 20, 0)
		FUNC("minimap_set_way_point", 1, 12364.0, 13759.0, 109.484, 0, 0)
		if ( FUNC("get_scenario_bit_flag", 3) )
		{
		}
		else if ( FUNC("get_scenario_bit_flag", 21) )
		{
			if ( FUNC("get_scenario_bit_flag", 1) )
			{
				FUNC("minimap_set_way_point_follow_unit", 1, 0, 0)
//				if ( messenger_recno  
//						|| FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, joan_recno) 
//						|| FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, jean_recno) )
//				{
					FUNC("minimap_set_way_point", 1, 8084.49, 1444.31, 1280.0, 1, 0)
//				}
//				else
//				{
//					imperial_scroll_recno = FUNC("search_item_by_name", "Królewski list")
//
//					if ( imperial_scroll_recno && FUNC("is_item_on_floor", imperial_scroll_recno) )
//					{
//						FUNC("minimap_set_way_point", 1, FUNC("get_item_pos_x", imperial_scroll_recno), FUNC("get_item_pos_y", imperial_scroll_recno), FUNC("get_item_pos_z", imperial_scroll_recno), 1, 0)
//					}
//					else
//					{
//						FUNC("set_scenario_bit_flag", 20, 1)
//					}
//				}
			}
			else
			{
				if ( messenger_recno )
				{
					FUNC("minimap_set_way_point", 1, 8084.49, 1444.31, 1280.0, 1, 0)
					FUNC("minimap_set_way_point_follow_unit", 1, messenger_recno, 0)
				}
				else if ( FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, joan_recno)
								|| FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, jean_recno) )
				{
					FUNC("minimap_set_way_point", 1, 8084.49, 1444.31, 1280.0, 1, 0)
				}
				else
				{
					FUNC("minimap_set_way_point", 1, 8084.49, 1444.31, 1280.0, 1, 0)
//					FUNC("minimap_set_way_point", 1, 8084.49, 1444.31, 1280.0, 1, 0)

//					imperial_scroll_recno = FUNC("search_item_by_name", "Królewski list")

//					if ( imperial_scroll_recno && FUNC("is_item_on_floor", imperial_scroll_recno) )
//					{
//						FUNC("minimap_set_way_point", 1, FUNC("get_item_pos_x", imperial_scroll_recno), FUNC("get_item_pos_y", imperial_scroll_recno), FUNC("get_item_pos_z", imperial_scroll_recno), 1, 0)
//					}
//					else
//					{
//						FUNC("set_scenario_bit_flag", 20, 1)
//					}
				}
			}
		}
		else if ( FUNC("get_scenario_bit_flag", 19) )
		{
			FUNC("minimap_set_way_point", 1, 3131.0, 9227.0, -169.188, 1, 0)
		}
		else if ( FUNC("get_scenario_bit_flag", 11) )
		{
			FUNC("minimap_set_way_point", 1, 6819.0, 11507.0, -37.0781, 1, 0)
		}
		else
		{
			FUNC("minimap_set_way_point", 1, 12364.0, 13759.0, 109.484, 1, 0)
		}
	}
	if ( FUNC("get_place_captured", camp_place_recno) == 0
			&& FUNC("search_for_unit_in_place", camp_place_recno, "F") == 0 
			&& FUNC("search_for_unit_in_place", camp_place_recno, "E") > 0 )
	{
		FUNC("set_minimap_icon_display_enable", "fcampS1L1", 1)
		FUNC("set_minimap_icon_display_enable", "ecampS1L1", 0)
		FUNC("attention_call_message", "[0009N]You have captured an enemy camp!")
		FUNC("set_place_captured", camp_place_recno, 1)
		FUNC("set_territory_nation", "de la belle ombre", "French")

//		if ( FUNC("get_scenario_bit_flag", 30) == 0 )
//		{
//			objective_tutorial_message = FUNC("format_string", "[0011N]You can press _%1s_ to view the mission brief.", FUNC("get_key_string", "GAME_OBJECTIVE_KEY"))
//			FUNC("attention_call_message", objective_tutorial_message, 1)
//			FUNC("set_scenario_bit_flag", 30, 1)
//		}
	}
	else if ( FUNC("get_place_captured", camp_place_recno) 
				&& ( FUNC("search_for_unit_in_place", camp_place_recno, "E") == 0 )
				&& ( FUNC("search_for_unit_in_place", camp_place_recno, "F") > 0) )
	{
		FUNC("set_minimap_icon_display_enable", "fcampS1L1", 0)
		FUNC("set_minimap_icon_display_enable", "ecampS1L1", 1)
		FUNC("set_place_captured", camp_place_recno, 0)
		FUNC("set_territory_nation", "de la belle ombre", "English")
	}
//	if ( FUNC("get_scenario_bit_flag", 30)
//					&& ( FUNC("is_objective_menu_opened_in_scenario") == 0 )
//					&& FUNC("is_attention_call_message_shown", objective_tutorial_message) )
//	{
//		WAIT{ FUNC("show_scenario_brief") }
//	}

	if ( FUNC("is_unit_inside_place", start_point_place, joan_recno) )
	{
		if ( FUNC("get_scenario_bit_flag", 4) == 1 )
		{
			FUNC("attention_call_message", "[0010N]You cannot go beyond the battlefield - your duties beckon.")
			FUNC("set_scenario_bit_flag", 4, 0)
		}
	}
	else
	{
		FUNC("set_scenario_bit_flag", 4, 1)
	}
	if ( FUNC("get_read_letter_once") 
			&& FUNC("get_scenario_event_bit_flag", 2) == 0 
			&& FUNC("get_scenario_event_bit_flag", 1) == 0 )
	{
		if ( jean_recno )
		{
			FUNC("attention_call_message_2", "[0011N]It seems to be a royal letter! We would be prudent in delivering this message to the gate guards in Orléans!", jean_recno)
		}
		else
		{
			FUNC("attention_call_message", "[0012N]It seems to be a royal letter! You would be prudent in delivering this message to the gate guards in Orléans!")
		}
		FUNC("set_scenario_event_bit_flag", 1, 1)
	}

	// tactic event 1
	if ( current_scenario_stage == 2 )
	{
		if ( FUNC("get_scenario_bit_flag", 23) == 0 )
		{
			// set main character to idle
			FUNC("set_idle", jean_recno)
			FUNC("set_idle", joan_recno) 

			ACTION("stop_all_order", jean_recno) 
			WAIT{ FUNC("pause_script", 1) }

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

			FUNC("change_camera_in_cut_scene", 0, 14988, 12783, 16, 187, 91, -4)
			WAIT { DIALOG("add_dialog", jean_recno, "[0013N]We must make haste and reach Orléans safely - the Duke of Orléans is expecting us. Perchance we will meet with our enemies, however if we are protective of each other we shall both survive the journey.") }
			WAIT { 
				dialog_recno = DIALOG("add_dialog", jean_recno, FUNC("format_string", "[0014N]Your sword is at your disposal when the need arises (_%1s_ for Light attack, _%2s_ for Heavy attack, and _%3s_ to defend). Let's move along, shall we?", FUNC("get_key_string", "A_ATTACK"), FUNC("get_key_string", "B_ATTACK"), FUNC("get_key_string", "DEFEND")))
				DIALOG("set_dialog_voice", dialog_recno, "[0014N]Your sword is at your disposal when the need arises (_%1s_ for Light attack, _%2s_ for Heavy attack, and _%3s_ to defend). Let's move along, shall we?")
			}

			DIALOG("del_all_dialog") 

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

			WAIT{ FUNC("is_cut_scene_finished") }
//			WAIT { FUNC("show_scenario_brief") }
			
			if ( FUNC("get_charmove_mode") == 0 )		// keyboard mode
			{
				FUNC("attention_call_message", FUNC("format_string", "[0015N]Press _%1s_ and _%2s_ to move forward and backwards. To turn left or right, use _%3s_ and _%4s_, respectively. To move sideways, press and hold _%5s_ while turning. Press the _%6s_ and _%7s_ keys to zoom the camera view in or out.", FUNC("get_key_string", "FORWARD"), FUNC("get_key_string", "BACKWARD"), FUNC("get_key_string", "TURN_LEFT"), FUNC("get_key_string", "TURN_RIGHT"), FUNC("get_key_string", "SHIFT"), FUNC("get_key_string", "ZOOM_IN"), FUNC("get_key_string", "ZOOM_OUT")), 1)
			}
			else if ( FUNC("get_charmove_mode") == 1 )			// joypad mode
			{
				FUNC("attention_call_message", FUNC("format_string", "[0016N]Use the D-Pad or the analog thumbstick to move around. To move sideways, press and hold _%1s_ while turning. Press the _%2s_ and _%3s_ keys to zoom the camera view in or out.", FUNC("get_key_string", "SHIFT_CAMERA"), FUNC("get_key_string", "ZOOM_IN"), FUNC("get_key_string", "ZOOM_OUT")), 1)
			}
			else			// keyboard and mouse mode
			{
				FUNC("attention_call_message", FUNC("format_string", "[0017N]Press _%1s_ and _%2s_ to move forward or back. To move sideways, press _%3s_ to go left, and _%4s_ to go right. Spin the mouse wheel to zoom the camera view in or out.", FUNC("get_key_string", "FORWARD"), FUNC("get_key_string", "BACKWARD"), FUNC("get_key_string", "SHIFT_LEFT"), FUNC("get_key_string", "SHIFT_RIGHT")), 1)
			}
//			FUNC("attention_call_message_2", FUNC("format_string", "[0014N]Your sword is at your disposal when the need arises (_%1s_ for Light attack, _%2s_ for Heavy attack, and _%3s_ to defend). Let's move along, shall we?", FUNC("get_key_string", "A_ATTACK"), FUNC("get_key_string", "B_ATTACK"), FUNC("get_key_string", "DEFEND")), "Jean de Metz")
			FUNC("attention_call_message", FUNC("format_string", "[0018N]You can also perform combo attacks, by pressing the Light (A) attack (_%1s_) several times, followed by a Heavy (B) attack (_%2s_). Try out the AAAB attack when engaging the enemy.", FUNC("get_key_string", "A_ATTACK"), FUNC("get_key_string", "B_ATTACK")), 1)

			FUNC("set_charmove_detect_block_flag", 0)

			FUNC("set_scenario_bit_flag", 23, 1)
		}

		if ( FUNC("get_scenario_bit_flag", 5) == 0 && FUNC("is_unit_inside_place", attack_key_place, joan_recno) )
		{
//			FUNC("attention_call_message", FUNC("format_string", "[0001N]Press _%1s_ to perform a light attack (A). Press _%2s_ to perform powerful energy attacks (B).", FUNC("get_key_string", "A_ATTACK"), FUNC("get_key_string", "B_ATTACK")))
//			FUNC("attention_call_message", FUNC("format_string", "[0001N]Press _%1s_ (A) several times to chain a combo attack.  To defend, press _%2s_.", FUNC("get_key_string", "A_ATTACK"), FUNC("get_key_string", "DEFEND")))
//			FUNC("attention_call_message", FUNC("format_string", "[0001N]To execute a Down Attack, press _%1s_.", FUNC("get_key_string", "DEFEND")))
//			FUNC("attention_call_message", "Try the AB or AAB combo. By combining both methods of attack you can unleash even more powerful combos.")
			FUNC("attention_call_message", FUNC("format_string", "[0019N]The enemy is just ahead.  If the enemy is down, strike them before they get up (_%1s_)!", FUNC("get_key_string", "DOWN_ATTACK")), 1)
			FUNC("set_scenario_bit_flag", 5, 1)
		}

		enemy_recno = FUNC("search_for_unit_in_place", event_one_camp_entrance_place_recno, "E")
		if ( enemy_recno )
		{
//			ACTION("give_task", CI_one_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
//			ACTION("give_task", CI_two_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)

//			FUNC("change_animation_special", BIC_captain_recno, "CAMP")
//			ACTION("give_task", BIC_captain_recno, "APPROACH_PLACE", 2, event_one_call_support_place_recno, 0, 0 , 0)

//			FUNC("set_scenario_stage", 3)

			FUNC("stop_curr_task", BI_two_recno)
			FUNC("stop_curr_task", BI_three_recno)
			FUNC("stop_curr_task", CI_one_recno)
			FUNC("stop_curr_task", CI_two_recno)
			FUNC("set_unit_team", BI_two_recno, 10)
			FUNC("set_unit_team", BI_three_recno, 10)

			ACTION("give_task", BIC_captain_recno, "DEFEND_PLACE", 3, camp_place_recno, 0, 0, 0)

			FUNC("set_scenario_stage", 4)
		}
		exit
	}
//	if ( current_scenario_stage == 3 )
//	{
//		if ( FUNC("is_unit_dead", BIC_captain_recno)
//				|| FUNC("is_attacked", BIC_captain_recno)
//				|| FUNC("is_unit_inside_place", event_one_call_support_place_recno, BIC_captain_recno) )
//		{
//			FUNC("change_animation_special", BIC_captain_recno, "DEFAULT")
//
//			FUNC("stop_curr_task", BI_two_recno)
//			FUNC("stop_curr_task", BI_three_recno)
//			FUNC("stop_curr_task", CI_one_recno)
//			FUNC("stop_curr_task", CI_two_recno)
//			FUNC("set_unit_team", BI_two_recno, 10)
//			FUNC("set_unit_team", BI_three_recno, 10)
//
//			ACTION("give_task", BIC_captain_recno, "DEFEND_PLACE", 3, camp_place_recno, 0, 0, 0)
//
//			FUNC("set_scenario_stage", 4)
//		}
//		exit		
//	}

	if ( ( FUNC("get_scenario_bit_flag", 6) == 0 ) && FUNC("is_unit_inside_place", break_box_place, joan_recno) )
	{
		FUNC("attention_call_message", FUNC("format_string", "[0020N]There's bound to be food and items you can use inside these barrels and crates if you break into them (_%1s_)!", FUNC("get_key_string", "A_ATTACK")), 1)
		FUNC("attention_call_message", FUNC("format_string", "[0021N]You can look in your inventory to use the items you encounter (_%1s_).", FUNC("get_key_string", "CHARACTER_INTERFACE")), 1)
		FUNC("set_scenario_bit_flag", 6, 1)
	}
	if ( ( FUNC("get_scenario_bit_flag", 7) == 0 ) && FUNC("get_unit_arrow_quantity", joan_recno) )
	{
		FUNC("attention_call_message", FUNC("format_string", "[0022N]You have found a cache of arrows. To attack with arrows, press _%1s_ to enter range-firing mode.", FUNC("get_key_string", "ARROW_SHOOTING")), 1)
		FUNC("set_scenario_bit_flag", 7, 1)
	}

	// tactic event 2
	if ( current_scenario_stage == 4 )
	{
		if ( FUNC("get_scenario_bit_flag", 11) == 0 
					&& FUNC("is_unit_inside_place", event1_waypoint, joan_recno) == 0 )
		{
			if ( FUNC("get_scenario_bit_flag", 6) == 0 )
			{
				FUNC("attention_call_message", FUNC("format_string", "[0020N]There's bound to be food and items you can use inside these barrels and crates if you break into them (_%1s_)!", FUNC("get_key_string", "A_ATTACK")), 1)
				FUNC("attention_call_message", FUNC("format_string", "[0021N]You can look in your inventory to use the items you encounter (_%1s_).", FUNC("get_key_string", "CHARACTER_INTERFACE")), 1)
				FUNC("set_scenario_bit_flag", 6, 1)
			}
			FUNC("attention_call_message", "[0023N]Continue to the next waypoint, but look around - there are also hidden paths along the way.", 1)
			FUNC("set_scenario_bit_flag", 20, 1)
			FUNC("set_scenario_bit_flag", 11, 1)
		}

		enemy_recno = FUNC("search_for_unit_in_place", event_two_DIC_place_recno, "E")
		if ( enemy_recno )
		{
			ACTION("give_task", DIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
		}
		enemy_recno = FUNC("search_for_unit_in_place", event_two_ambush_zone_place_recno, "E")
		if ( enemy_recno )
		{
			if ( FUNC("get_curr_task", DIC_captain_recno) == 7 )
			{
				ACTION("give_task", DIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
			}
			ACTION("give_task", EIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)

//			if ( FUNC("get_charmove_mode") == 1 )			// joypad mode
//			{
//				if ( FUNC("is_unit_dead_by_name", jean_recno, "Jean De Metz") )
//				{
//					FUNC("attention_call_message", "[0001N]Beat your enemy to the draw by unleashing your charge attack on them (move the thumbstick forward twice in rapid succession - cannot be performed while on a horse)!", 1)
//				}
//				else
//				{
//					FUNC("attention_call_message_2", "[0001N]Beat your enemy to the draw by unleashing your charge attack on them (move the thumbstick forward twice in rapid succession - cannot be performed while on a horse)!", jean_recno)
//				}
//			}
//			else
//			{
//				if ( FUNC("is_unit_dead_by_name", jean_recno, "Jean De Metz") )
//				{
//					FUNC("attention_call_message", FUNC("format_string", "[0001N]Beat your enemy to the draw by unleashing your charge attack on them (_%1s_+_%1s_ - cannot be performed while on a horse)!", FUNC("get_key_string", "FORWARD")), 1)
//				}
//				else
//				{
//					FUNC("attention_call_message_2", FUNC("format_string", "[0001N]Beat your enemy to the draw by unleashing your charge attack on them (_%1s_+_%1s_ - cannot be performed while on a horse)!", FUNC("get_key_string", "FORWARD")), jean_recno)
//				}
//			}

			FUNC("set_scenario_stage", 5)
		}
		exit
	}

	// tactic event 3
	if ( current_scenario_stage == 5 )
	{
		if ( FUNC("get_scenario_bit_flag", 10) == 0 && FUNC("is_unit_inside_place", event3_message_place, joan_recno) )
		{
			if ( FUNC("search_for_unit_in_place", bridge_detect_palce_recno, "F") )
			{
				FUNC("attention_call_message", "[0024N]There are some enemy units blocking the bridge ahead. Be careful, there are archers among them!", 1)
			}
			FUNC("set_scenario_bit_flag", 10, 1)
			FUNC("set_scenario_bit_flag", 20, 1)
			FUNC("set_scenario_bit_flag", 19, 1)
		}
		if ( FUNC("get_scenario_bit_flag", 19) == 0 
					&& FUNC("search_for_unit_in_place", event2_waypoint, "F") == 1 )
		{
			FUNC("set_scenario_bit_flag", 20, 1)
			FUNC("set_scenario_bit_flag", 19, 1)
		}

		enemy_recno = FUNC("search_for_unit_in_place", event_three_bridge_place_recno, "E")
		if ( enemy_recno )
		{
			ACTION("give_task", FIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
			FUNC("stop_curr_task", FIC_two_recno)

			FUNC("set_scenario_stage", 6)
		}
		else if ( FUNC("get_curr_task", FIC_two_recno) == 7 )
		{
			enemy_recno = FUNC("search_for_unit_in_place", event_three_FIC_two_place_recno, "E")
			if ( enemy_recno )
			{
				ACTION("give_task", FIC_two_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
			}
		}
		exit
	}

	// tactic event 4
	if ( ( current_scenario_stage >= 6 ) && ( FUNC("get_scenario_bit_flag", 1) == 0 ) )
	{
		if ( FUNC("get_scenario_bit_flag", 21) == 0 
				&& ( FUNC("search_for_unit_in_place", event3_waypoint, "F") == 0 
						|| FUNC("search_for_unit_in_place", event3_waypoint, "E") == 0 ) )
		{
			FUNC("set_scenario_bit_flag", 20, 1)
			FUNC("set_scenario_bit_flag", 21, 1)
			FUNC("attention_call_message", "[0025N]Now proceed to the next waypoint.", 1)
		}

		if ( FUNC("search_for_unit_in_place", event4_waypoint, "P") )
		{
			if ( messenger_recno && reinforcement2_recno )
			{
				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)
				FUNC("set_unit_can_process_in_cut_scene", joan_recno, 1)
				FUNC("set_unit_can_process_in_cut_scene", messenger_recno, 1)
				if ( reinforcement2_recno)
				{
					FUNC("set_unit_can_process_in_cut_scene", reinforcement2_recno, 1)
				}

				ACTION("give_task", messenger_recno, "IDLE", 2, 0, 0, 0, 0)
				ACTION("give_task", reinforcement2_recno, "IDLE", 2, 0, 0, 0, 0)

				// set main character to idle
				FUNC("set_idle", messenger_recno) 
				FUNC("set_idle", reinforcement2_recno)
				FUNC("set_idle", joan_recno) 

				ACTION("stop_all_order", messenger_recno) 
				ACTION("stop_all_order", reinforcement2_recno)

				FUNC("set_unit_dir", joan_recno, FUNC("get_rotation", joan_recno, messenger_recno))
				FUNC("turn_camera")
				ACTION("give_order" , messenger_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , messenger_recno , joan_recno) , 0 , 0 , 0, 2500)
				ACTION("give_order" , reinforcement2_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , reinforcement2_recno , joan_recno) , 0 , 0 , 0, 2500)

				WAIT { DIALOG("add_dialog", reinforcement2_recno, "[0026N]Good day. I see your amour bears the fleur-de-lys. It is always good to meet with a friendly face!") }
				WAIT { DIALOG("add_dialog", messenger_recno, "[0027N]We carry an urgent message from the Duke of Alencon but despite our efforts we have been unable to make headway towards Orléans. We beg your aid in escorting us to the city so the message can be delivered!") }

				ACTION("give_order" , messenger_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , messenger_recno , reinforcement2_recno) , 0 , 0 , 0, 2500)
				ACTION("give_order" , reinforcement2_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , reinforcement2_recno , messenger_recno) , 0 , 0 , 0, 2500)

				WAIT { DIALOG("add_dialog", reinforcement2_recno, "[0028N]Hmph... If they are the reinforcements that our Dauphin promised it will prove to be a long march toward Orléans...") }
				WAIT { DIALOG("add_dialog", messenger_recno, "[0029N]It is true, the road ahead is fraught with perils and the enemy has full knowledge of our presence, but, alas, deliver the message we must.") }

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

				WAIT { DIALOG("add_dialog", messenger_recno, "[0030N]Lead the way - we shall follow.") }
				WAIT { DIALOG("add_dialog", messenger_recno, "[0031N]I am the messenger. If some ill fortune befalls me, retrieve the letter from my stricken body and deliver it to the guards at the city of Orléans - they will know what to do.") }

	//			WAIT { DIALOG("add_dialog", messenger_recno, FUNC("format_string", DIALOG("dialog_text", "[0009N]You may ride the horse (_%1s_ to mount and dismount) - the horse can knock down enemy units."), FUNC("get_key_string", "RIDE"))) }

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

	//			FUNC("set_unit_can_rided_flag", reinforcement_horse_recno, 1)

	//			condition_recno = FUNC("add_end_condition") 
	//			FUNC("set_end_condition_type", condition_recno, 0) // 0 for win
	//			FUNC("set_end_condition_des", condition_recno, "Deliver Duke of Orléans' message to the dauphin Charles") 

	//			condition_recno = FUNC("add_end_condition") 
	//			FUNC("set_end_condition_type", condition_recno, 2) // 2 for side quest
	//			FUNC("set_end_condition_des", condition_recno, "Escort the French soliders safely to Orléans") 

				FUNC("set_end_condition_enabled", 6, 1) 
				if ( reinforcement2_recno )
				{
					FUNC("set_end_condition_enabled", 7, 1) 
				}

				FUNC("set_unit_team", messenger_recno, 1)
				FUNC("set_unit_team", reinforcement2_recno, 1)
				FUNC("set_control_flag", messenger_recno, 1)
				FUNC("set_control_flag", reinforcement2_recno, 1)

				FUNC("stop_curr_task", messenger_recno)
				FUNC("stop_curr_task", reinforcement2_recno)

				// auto save
				WAIT { FUNC("is_cut_scene_finished") }

				FUNC("set_scenario_event_bit_flag", 2, 1)
			}
			else if ( messenger_recno )
			{
				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)
				FUNC("set_unit_can_process_in_cut_scene", joan_recno, 1)
				FUNC("set_unit_can_process_in_cut_scene", messenger_recno, 1)

				ACTION("give_task", messenger_recno, "IDLE", 2, 0, 0, 0, 0)

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

				ACTION("stop_all_order", messenger_recno) 

				FUNC("set_unit_dir", joan_recno, FUNC("get_rotation", joan_recno, messenger_recno))
				FUNC("turn_camera")
				ACTION("give_order" , messenger_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , messenger_recno , joan_recno) , 0 , 0 , 0, 2500)

				WAIT { DIALOG("add_dialog", messenger_recno, "[0026N]Good day. I see your amour bears the fleur-de-lys. It is always good to meet with a friendly face!") }
				WAIT { DIALOG("add_dialog", messenger_recno, "[0032N]I am carrying an message of vital importance from the Duke of Alencon but despite my efforts I have been unable to make headway towards Orléans.") }
				WAIT { DIALOG("add_dialog", messenger_recno, "[0033N]I beg your aid in aiding me in delivering this message to the gate guards in Orléans!") }

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

				FUNC("set_end_condition_enabled", 6, 1) 

				FUNC("set_unit_team", messenger_recno, 1)
				FUNC("set_control_flag", messenger_recno, 1)

				FUNC("stop_curr_task", messenger_recno)

				// auto save
				WAIT { FUNC("is_cut_scene_finished") }

				FUNC("set_scenario_event_bit_flag", 2, 1)
			}
			else if ( jean_recno )
			{
				FUNC("attention_call_message_2", "[0034N]Hmm. there seems to be a letter lying in the near vicinity of these crates before us. It is highly advisable that we pick up the letter and see what information it contains.", jean_recno)
			}
			else
			{
				FUNC("attention_call_message", "[0035N]There seems to be a letter lying nearby these crates. It is highly advisable that you pick up the letter and see what information it contains.")
			}

			FUNC("set_scenario_bit_flag", 1, 1)
			FUNC("set_scenario_bit_flag", 20, 1)

			FUNC("save_game", "Misja 1-Autozapis", "Misja 1-Autozapis") 
		}
//		if ( talk_unit1_recno == reinforcement_horse_recno )
//		{
//			FUNC("attention_call_message", "[0001N]If you want to ride the horse, talk first with the French soldiers here.")
//		}			
	}
	if ( FUNC("get_scenario_bit_flag", 1) == 1 && FUNC("get_scenario_bit_flag", 12) == 0 && FUNC("is_unit_inside_place", horse_message_place, joan_recno) )
	{
//		FUNC("attention_call_message", FUNC("format_string", "[0001N]Press _%1s_ to mount the horse. Press _%1s_ again to dismount.", FUNC("get_key_string", "RIDE")))
		FUNC("set_scenario_bit_flag", 12, 1)
	}			
	if ( current_scenario_stage == 6  )
	{
		if ( FUNC("get_scenario_bit_flag", 13) == 0 )
		{
			if ( FUNC("is_unit_inside_place", event3_waypoint, joan_recno) )
			{
				FUNC("set_scenario_bit_flag", 20, 1)
				FUNC("set_scenario_bit_flag", 13, 1)
			}
		}
	}
		

	// tactic event 5
	enemy_in_healing_place = FUNC("search_for_unit_in_place", event_five_healing_place_recno, "E")
	enemy_in_fire_zone = FUNC("search_for_unit_in_place", event_five_archer_fire_zone, "E")
	if ( enemy_in_fire_zone && current_scenario_stage == 6)
	{
		FUNC("set_scenario_stage", 7)
	}
	if ( FUNC("get_curr_task", HIC_captain_recno) == 7 )
	{
		enemy_recno = FUNC("search_for_unit_in_place", event_five_HIC_place_recno, "E") 

		if ( enemy_recno )
		{
			ACTION("give_task", HIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
		}
		else if ( enemy_in_healing_place )
		{
			ACTION("give_task", HIC_captain_recno, "FOLLOW_UNIT", 2, enemy_in_healing_place, 0, 0, 0)
		}
		else if ( enemy_in_fire_zone )
		{
			ACTION("give_task", HIC_captain_recno, "FOLLOW_UNIT", 2, enemy_in_fire_zone, 0, 0, 0)
		}
	}
	if ( FUNC("get_curr_task", JIC_captain_recno) == 7 )
	{
		enemy_recno = FUNC("search_for_unit_in_place", event_five_JIC_place_recno, "E") 

		if ( enemy_recno )
		{
			ACTION("give_task", JIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
		}
		else if ( enemy_in_healing_place )
		{
			ACTION("give_task", JIC_captain_recno, "FOLLOW_UNIT", 2, enemy_in_healing_place, 0, 0, 0)
		}
		else if ( enemy_in_fire_zone )
		{
			ACTION("give_task", JIC_captain_recno, "FOLLOW_UNIT", 2, enemy_in_fire_zone, 0, 0, 0)
		}
	}

	// tactic event 6
	if ( current_scenario_stage == 7 )
	{
		enemy_recno = FUNC("search_for_unit_in_place", event_six_ambush_zone_recno, "E") 
		if ( enemy_recno )
		{
			if ( FUNC("get_scenario_bit_flag", 27) == 0 )
			{
				if ( FUNC("is_unit_dead", NIC_captain_recno) == 0
						&& FUNC("search_unit_by_name", "Thomas Webber") 
						&& FUNC("get_curr_task", NIC_captain_recno) == 7 )
				{
					FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
					FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process

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

					ACTION("stop_all_order", joan_recno) 
					ACTION("stop_all_order", jean_recno)
					ACTION("stop_all_order", messenger_recno) 
					ACTION("stop_all_order", reinforcement2_recno)

					FUNC("change_camera_in_cut_scene", 0, 11698, 7169, 877, 187, -172, 20)
					WAIT { DIALOG("add_dialog", NIC_captain_recno, "[0036N]Lads! The French swine are ahead of us! Kill them all - take no prisoners!") }

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

					FUNC("set_scenario_bit_flag", 27, 1)

					WAIT{ FUNC("is_cut_scene_finished") }
				}

//				if ( FUNC("get_charmove_mode") == 1 )			// joypad mode
//				{
//					if ( FUNC("is_unit_dead_by_name", jean_recno, "Jean De Metz") )
//					{
//						FUNC("attention_call_message", FUNC("format_string", "[0001N]There are many enemies in our midst! Use your energy attack on them (press light(_%1s_) and heavy(_%2s_) attack simultaneously - cannot be performed while on a horse) to strike them down!", FUNC("get_key_string", "A_ATTACK_KEY"), FUNC("get_key_string", "B_ATTACK_KEY")), 1)
//					}
//					else
//					{
//						FUNC("attention_call_message_2", FUNC("format_string", "[0001N]There are many enemies in our midst! Use your energy attack on them (press light(_%1s_) and heavy(_%2s_) attack simultaneously - cannot be performed while on a horse) to strike them down!", FUNC("get_key_string", "B_ATTACK_KEY"), FUNC("get_key_string", "B_ATTACK_KEY")), jean_recno)
//					}
//				}
//				else
//				{
//					if ( FUNC("is_unit_dead_by_name", jean_recno, "Jean De Metz") )
//					{
//						FUNC("attention_call_message", FUNC("format_string", "[0001N]There are many enemies in our midst! Use your energy attack on them (_%1s_ - cannot be performed while on a horse) to strike them down!", FUNC("get_key_string", "ENERGY_ATTACK")), 1)
//					}
//					else
//					{
//						FUNC("attention_call_message_2", FUNC("format_string", "[0001N]There are many enemies in our midst! Use your energy attack on them (_%1s_ - cannot be performed while on a horse) to strike them down!", FUNC("get_key_string", "ENERGY_ATTACK")), jean_recno)
//					}
//				}
			}


			ACTION("give_task", NIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
		}
		if ( FUNC("get_team_size", 21) <= 2 )
		{
			english_light_infantry_recno = FUNC("search_unit_by_name", "NIC02")
			if ( ( english_light_infantry_recno == 0 ) || FUNC("is_unit_dead", english_light_infantry_recno) )
			{
				english_light_infantry_recno = FUNC("search_unit_by_name", "NIC03")
				if ( ( english_light_infantry_recno == 0 ) || FUNC("is_unit_dead", english_light_infantry_recno) )
				{
					english_light_infantry_recno = FUNC("search_unit_by_name", "NIC04")
					if ( ( english_light_infantry_recno == 0 ) || FUNC("is_unit_dead", english_light_infantry_recno) )
					{
						english_light_infantry_recno = NIC_captain_recno
					}
				}
			}
			if ( english_light_infantry_recno )
			{
//				ACTION("give_task", english_light_infantry_recno, "APPROACH_PLACE", 2, event_six_call_support_zone_recno, 0, 0, 0)
				ACTION("give_task", english_light_infantry_recno, "DEFEND_PLACE", 2, event_six_call_support_zone_recno, 0, 0, 0)
			}
			FUNC("set_scenario_stage", 8)
		}
		else if ( FUNC("search_for_unit_in_place", event_six_call_support_zone_recno, "E") )
		{
			FUNC("set_scenario_stage", 8)
		}
//		exit
	}
	if ( current_scenario_stage == 8 )
	{
		english_light_infantry_recno = FUNC("search_for_unit_in_place", event_six_call_support_zone_recno, "F")
		if ( english_light_infantry_recno && ( FUNC("get_curr_task", english_light_infantry_recno) == 14 ) )
		{
//			ACTION("give_task", OIC_captain_recno, "APPROACH_PLACE", 2, event_six_call_support_zone_recno, 1, 0, 0)
			ACTION("give_task", PIC_captain_recno, "APPROACH_PLACE", 2, event_six_call_support_zone_recno, 1, 0, 0)
//			ACTION("give_task", QAC_captain_recno, "DEFEND_PLACE", 2, event_six_call_support_zone_recno, 1, 0, 0)
			FUNC("stop_curr_task", QAC_captain_recno)
			FUNC("stop_curr_task", english_light_infantry_recno)
			
			FUNC("set_scenario_stage", 9)
		}
	}
	enemy_recno = FUNC("search_for_unit_in_place", event_six_call_support_zone_recno, "E")
	if ( enemy_recno )
	{
//		ACTION("give_task", OIC_captain_recno, "FOLLOW_UNIT", 2, enemy_recno, 0, 0, 0)
		ACTION("give_task", PIC_captain_recno, "FOLLOW_UNIT", 3, enemy_recno, 0, 0, 0)
		ACTION("give_task", QAC_captain_recno, "DEFEND_PLACE", 3, event_six_call_support_zone_recno, 1, 0, 0)

		FUNC("set_scenario_stage", 10)
	}

	if ( FUNC("get_scenario_bit_flag", 25) == 0 && FUNC("is_unit_inside_place", jean_message_place_recno, joan_recno) && jean_recno )
	{
		FUNC("attention_call_message_2", "[0037N]Only a short way to go - I believe that is Orléans in the distance, and not a moment too soon!", jean_recno)
		FUNC("set_scenario_bit_flag", 25, 1)
	}

	if ( current_scenario_stage == 10 )
	{
		if ( FUNC("search_for_unit_in_place", camp_bridge_place_recno, "P") ) 
		{
			if( FUNC("get_scenario_bit_flag", 2) == 0 )
			{	
				FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
				FUNC("set_unit_can_process_in_cut_scene", 0, 0)	// all unit can process

				// set main character to idle
				FUNC("set_idle", joan_recno) 
				WAIT { DIALOG("add_dialog", castle_top_guard_recno, "[0038N]Zoot alors! Troops are approaching the castle - lower the drawbridge!") }
				
				DIALOG("del_all_dialog") 
				FUNC("set_cut_scene_flag" , 0)	// leave cut scene!

				FUNC("add_gate_trigger", cbridge_recno, 0)
				FUNC("set_scenario_bit_flag", 2, 1)

				WAIT{ FUNC("is_cut_scene_finished") }
			}
		}

		if ( FUNC("search_for_unit_in_place", camp_gate_place_recno, "P") ) 
		{
			if( FUNC("get_scenario_bit_flag", 3) == 0 )
			{	
				come_again = FUNC("get_scenario_bit_flag", 28)
				cut_scene_type = 0
//				if ( FUNC("is_unit_inside_place", messenger_detect_place, messenger_recno) )
//				{
					// archer come before the castle
//					cut_scene_type = 3
//				}
//				else if ( FUNC("get_scenario_bit_flag", 15) == 0 )
				if ( FUNC("get_scenario_bit_flag", 15) == 0 )
				{
					// enter the place from outside
					if ( FUNC("is_unit_inside_place", messenger_detect_place, messenger_recno) )
					{
						cut_scene_type = 3
					}
					else if ( FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, joan_recno) 
								|| FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, jean_recno) )
					{
						cut_scene_type = 4
					}
					else if ( FUNC("get_scenario_bit_flag", 28) == 0 )
					{
						cut_scene_type = 1
					}
				}
	
				if ( cut_scene_type )
				{
					FUNC("set_cut_scene_flag" , 1)	// enter cut scene! 
					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
					if ( castle_guard1_recno )
					{
						FUNC("set_unit_can_process_in_cut_scene", castle_guard1_recno, 1)	// all unit can process
					}
					if ( castle_guard2_recno )
					{
						FUNC("set_unit_can_process_in_cut_scene", castle_guard2_recno, 1)	// all unit can process
					}

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

					FUNC("set_unit_dir", joan_recno, 270)
					FUNC("turn_camera")

					if ( cut_scene_type == 3 )
					{
						if ( messenger_recno )
						{
							FUNC("set_unit_can_process_in_cut_scene", messenger_recno, 1)	// all unit can process
						}
						FUNC("set_idle", messenger_recno) 
						FUNC("set_idle", reinforcement2_recno)
						ACTION("stop_all_order", messenger_recno) 
						ACTION("stop_all_order", reinforcement2_recno)
						ACTION("give_task", messenger_recno, "IDLE", 1, 0, 0, 0, 0)

						if ( FUNC("search_unit_by_name", "Gobert Fourmagier")
								&& FUNC("is_unit_dead", messenger_recno) == 0
								&& FUNC("search_unit_by_name", "Marcel Parcheminier")
								&& FUNC("is_unit_dead", reinforcement2_recno) == 0 )
						{
//							FUNC("set_end_condition_finish" , 7, "WIN")	
//							FUNC("attention_call_message", "[0001N]You have been given 200 gold!")
//							FUNC("add_gold", 200)
						}
						FUNC("set_scenario_bit_flag", 3, 1)
						FUNC("set_scenario_bit_flag", 20, 1)
					}
					if ( cut_scene_type == 4 )
					{
						if ( FUNC("get_item_quantity_in_unit_inventory", imperial_scroll_id, joan_recno) )
						{
							FUNC("remove_item_from_unit_inventory", imperial_scroll_id, joan_recno)
						}
						else
						{
							FUNC("remove_item_from_unit_inventory", imperial_scroll_id, jean_recno)
						}
						FUNC("set_scenario_bit_flag", 3, 1)
						FUNC("set_scenario_bit_flag", 20, 1)
					}

					ACTION("give_order" , castle_guard1_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , castle_guard1_recno , joan_recno) , 0 , 0 , 0, 2500)
					if ( come_again )
					{
						WAIT { DIALOG("add_dialog", castle_guard1_recno, "[0039N]You again? You know I cannot admit you without Duke Alencon's letter.") }
					}
					else
					{
						WAIT { DIALOG("add_dialog", castle_guard1_recno, "[0040N]You are not the Duke of Alencon! My orders say I must only open these gates to either Alencon himself or to the bearer of the Alencon's letter.") }
					}

					if ( cut_scene_type == 3 || cut_scene_type == 4 )
					{
						if ( cut_scene_type == 3 )
						{
							DIALOG("del_all_dialog") 
							ACTION("stop_all_order", messenger_recno)
							WAIT{ ACTION("give_order", messenger_recno, "MOVE_TO_TARGET", 2, 0, 8155, 1250, 1265, 0, 10000) }
							WAIT{ ACTION("give_order", messenger_recno, "TURN", 1, 0, 270, 0, 0, 0, 2500) }
							WAIT{ DIALOG("add_dialog", messenger_recno, "[0041N]Greetings, fellow Frenchmen! See I bear the royal seal of the Duke of Alencon - allow us entry - we have been traveling for many leagues, we need lodging, food and rest!") }
//							FUNC("stop_curr_task", messenger_recno)
						}
						else if ( cut_scene_type == 4 )
						{
							WAIT { DIALOG("add_dialog", castle_guard2_recno, "[0042N]Ah, you have a message from Alencon?") }
						}
						ACTION("give_order" , castle_guard2_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , castle_guard2_recno , castle_guard1_recno) , 0 , 0 , 0, 2500)
						ACTION("give_order" , castle_guard1_recno, "TURN" , 3 , 0 , FUNC("get_rotation" , castle_guard1_recno , castle_guard2_recno) , 0 , 0 , 0, 2500)
						WAIT { DIALOG("add_dialog", castle_guard1_recno, "[0043N]Quick - deliver this message to our Duke of Orléans while I open the gates for our visitors!") }

						FUNC("set_end_condition_finish" , 6, "WIN")	

						FUNC("add_gate_trigger", cgate_recno, 1)
					}
					else
					{
						WAIT { DIALOG("add_dialog", castle_guard1_recno, "[0044N]We must have confirmation from our Duke before we may permit your entrance!") }
						if ( FUNC("get_scenario_bit_flag", 18) )
						{
							FUNC("attention_call_message", "[0045N]You must retrieve the letter from the stricken French archer.")
						}
						else
						{
							FUNC("attention_call_message", "[0046N]You must arrive with the bearer of the Duke's letter.")
						}
					}

					DIALOG("del_all_dialog") 
					FUNC("set_interact_unit_recno", joan_recno, 0) 
					FUNC("set_cut_scene_flag" , 0)	// leave cut scene!
					WAIT{ FUNC("is_cut_scene_finished") }
					FUNC("set_scenario_bit_flag", 28, 1)

					FUNC("set_scenario_bit_flag", 15, 1)
					if ( cut_scene_type == 3 )
					{
						if ( FUNC("search_unit_by_name", "Gobert Fourmagier")
								&& FUNC("is_unit_dead", messenger_recno) == 0
								&& FUNC("search_unit_by_name", "Marcel Parcheminier")
								&& FUNC("is_unit_dead", reinforcement2_recno) == 0 )
						{
							FUNC("set_end_condition_finish" , 7, "WIN")	
						}
						FUNC("stop_curr_task", messenger_recno)
						FUNC("set_unit_drop_item_id", messenger_recno, imperial_scroll_id)
					}
				}
			}
		}
		else if ( FUNC("get_scenario_bit_flag", 15) )
		{
			FUNC("set_scenario_bit_flag", 15, 0)
		}
		exit
	}
}  