script
; init
prepare_for_battle
;label_unit  ALLIANCE  ARMY  UNIT

label_unit 0 0 0	r1
label_unit 0 0 1	r2
label_unit 0 0 2	r3
label_unit 0 0 3	r4
label_unit 0 0 4	r5
label_unit 0 0 5	r6
label_unit 0 0 6	r7
label_unit 0 0 7	r8
label_unit 0 0 8	r9
label_unit 0 0 9	r10
label_unit 0 0 10	r11
label_unit 0 0 11	r12
label_unit 0 0 12	r13
label_unit 0 0 13	r14
label_unit 0 0 14	r15


label_unit 1 0 0	c1
label_unit 1 0 1	c2
label_unit 1 0 2	c3
label_unit 1 0 3	c4
label_unit 1 0 4	c5
label_unit 1 0 5	c6
label_unit 1 0 6	c7
label_unit 1 0 7	c8
label_unit 1 0 8	c9
label_unit 1 0 9	c10
label_unit 1 0 10	c11
label_unit 1 0 11	c12
label_unit 1 0 12	c13
label_unit 1 0 13	c14
label_unit 1 0 14	c15
label_unit 1 0 15	c16




label_location -500 195 rr0	; mercenary scutarii edetano
label_location -500 165 rr1	; merc turdulo
label_location -500 140 rr2	; merc noble celtibero
label_location -500 110 rr3	; merc scutarii edetano
label_location -500 80 rr4	; merc scutarii ilergete
label_location -480 230 rr5	; samnita
label_location -460 230 rr6	; samnita
label_location -470 45 rr7	; hastati
label_location -470 25 rr8	; principes
label_location -490 35 rr9	; triarii
label_location -450 5 rr10	; velites
label_location -435 230 rr11	; velites
label_location -430 264 rr12	; caballeria ligera
label_location -534 80 rr13	; general
label_location -470 -24 rr14	; caballeria ligera


label_location -360 60 cc0	; sacred
label_location -360 90 cc1	; sacred
label_location -370 40 cc2	; pesada
label_location -370 75 cc3	; pesada
label_location -370 110 cc4	; pesada
label_location -370 150 cc5	; luso
label_location -370 184 cc6	; luso
label_location -370 -30 cc7	; scutarii ligero
label_location -360 -30 cc8	; lancero jabalinero turdetano
label_location -350 -15 cc9	; mastieno
label_location -360 1 cc10	; lancero jabalinero
label_location -370 1 cc11	; scturii ligero	
label_location -370 234 cc12	; jinetes
label_location -370 -92 cc13	; jinetes celtiberos
label_location -370 -54 cc14	; elefantes
label_location -350 84 cc15	; general


	declare_counter battle_start
	declare_counter intro_sequence
	declare_counter player_control
	declare_counter van_clash

	disable_cursor						;prevent the player clicking
	suspend_unscripted_advice true
	disable_shortcuts true		
	disable_entire_ui
	inhibit_camera_input true

;BATTLE SCRIPT

	while ! I_BattleStarted					; wait FOR DEPLOYMENT
	end_while

	ai_active_set off

	camera_default_mode_set tw

	battle_default_camera



;-----------------------------------------------------------------------------------------------------------
	steal_esc_key

	monitor_event EscPressed TrueCondition

	unit_immediate_place r1 rr0 90
	unit_immediate_place r2 rr1 90
	unit_immediate_place r3 rr2 90
	unit_immediate_place r4 rr3 90
	unit_immediate_place r5 rr4 90
	unit_immediate_place r6 rr5 90 
	unit_immediate_place r7 rr6 90 
	unit_immediate_place r8 rr7 90
	unit_immediate_place r9 rr8 90
	unit_immediate_place r10 rr9 90
	unit_immediate_place r11 rr10 90
	unit_immediate_place r12 rr11 90
	unit_immediate_place r13 rr12 90
	unit_immediate_place r14 rr13 90
	unit_immediate_place r15 rr14 90


	unit_immediate_place c1 cc0 -90
	unit_immediate_place c2 cc1 -90
	unit_immediate_place c3 cc2 -90
	unit_immediate_place c4 cc3 -90
	unit_immediate_place c5 cc4 -90
	unit_immediate_place c6 cc5 -90
	unit_immediate_place c7 cc6 -90
	unit_immediate_place c8 cc7 -90
	unit_immediate_place c9 cc8 -90
	unit_immediate_place c10 cc9 -90
	unit_immediate_place c11 cc10 -90
	unit_immediate_place c12 cc11 -90
	unit_immediate_place c13 cc12 -90
	unit_immediate_place c14 cc13 -90
	unit_immediate_place c15 cc14 -90
	unit_immediate_place c16 cc15 -90


camera_look_at_unit c15

			set_counter battle_start 1
		terminate_monitor
	end_monitor
;-----------------------------------------------------------------------------------------------------------

	set_counter intro_sequence 1	;	kicks off intro sequence







; *********************************************************************************************
; ********************* BEGINNING INTRO SEQUENCE MONITOR **************************************
; *********************************************************************************************




monitor_conditions I_CompareCounter intro_sequence = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   groups

set_camera_bookmark 0, -738, 352.12, 107.87 	-706.955, 333.96, 109.8769


define_unit_group romanos r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15

define_unit_group falanges c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16

camera_restrictions_set off
hide_ui


while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while					; ESC DUMP




; *********************************************************************************************
unit_group_order_relative_move_formed falanges 0 290 run
camera_position_at_bookmark 0
battle_wait 3
unit_group_order_relative_move_formed romanos 0 120
battle_wait 6
camera_look_at_unit r3
battle_wait 6
camera_track_unit r8 right 25 3 
battle_wait 18
camera_track_unit r3 front 22 10
camera_look_at_unit r5
battle_wait 34

while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP





;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
unit_group_order_relative_move_formed falanges 0 120

camera_look_at_unit c13
battle_wait 3


while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	unit_order_move r1 rr0 run
	unit_order_move r2 rr1 run
	unit_order_move r3 rr2 run
	unit_order_move r4 rr3 run
	unit_order_move r5 rr4 run
	unit_order_move r6 rr5 run
	unit_order_move r7 rr6 run
	unit_order_move r8 rr7 run
	unit_order_move r9 rr8 run
	unit_order_move r10 rr9 run
	unit_order_move r11 rr10 run
	unit_order_move r12 rr11 run
	unit_order_move r13 rr12 run
	unit_order_move r14 rr13 run
	unit_order_move r15 rr14 run




camera_track_unit c4 front 20 4
battle_wait 10

;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;


unit_order_move_relative r11 40 0 run
; unit_order_move_relative r15 40 20 run

camera_look_at_unit c13
battle_wait 4
camera_track_unit c4 front 40 4
camera_look_at_unit c6
battle_wait 3
camera_track_unit c4 front 40 4
camera_look_at_unit c2
battle_wait 3
camera_look_at_unit c11

;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;


unit_use_special_ability r11
unit_order_attack_unit r11 c15 run

battle_wait 7

while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
unit_use_special_ability r6
unit_use_special_ability r7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


battle_wait 15





while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP

camera_look_at_unit r11
battle_wait 6
camera_track_unit r11 left 12 5
battle_wait 6
camera_track_unit r11 back 8 3





battle_wait 6

;camera_look_at_unit r7

while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP




battle_wait 14
while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP



unit_use_special_ability c3
unit_use_special_ability c4
unit_use_special_ability c5

while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP



battle_wait 6

camera_track_unit r11 back 8 3
	
	unit_immediate_place r1 rr0 90
	unit_immediate_place r2 rr1 90
	unit_immediate_place r3 rr2 90
	unit_immediate_place r4 rr3 90
	unit_immediate_place r5 rr4 90
	unit_immediate_place r6 rr5 90 
	unit_immediate_place r7 rr6 90 
	unit_immediate_place r8 rr7 90
	unit_immediate_place r9 rr8 90
	unit_immediate_place r10 rr9 90
	unit_immediate_place r14 rr13 90



battle_wait 12

unit_order_attack_unit r15 c14

battle_wait 2
camera_track_unit r15 front 8 3

battle_wait 3
	


unit_order_attack_unit r6 c6 




while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while				; ESC DUMP

unit_order_attack_unit r12 c7 run
battle_wait 12
unit_use_special_ability r13
battle_wait 4
unit_order_attack_unit r13 c13

camera_look_at_unit r13

battle_wait 5
camera_track_unit r12 right 20 5
battle_wait 15


while I_CompareCounter battle_start = 1		; ESC DUMP
	terminate_monitor
	end_while
				; ESC DUMP
camera_track_unit r14 back 3 2
;battle_general_camera

set_music_state battle
;battle_wait 20

set_counter battle_start 1
			
		terminate_monitor
	end_monitor
; *********************************************************************************************
; ********************* END OF INTRO SEQUENCE MONITOR *******************************************
; *********************************************************************************************


; *********************************************************************************************
; *********************************************************************************************
;	Start of battle - BATTLESTART MONITORS
; *********************************************************************************************

monitor_conditions I_CompareCounter battle_start = 1

	steal_esc_key off

set_counter player_control 1

		terminate_monitor
	end_monitor

; *********************************************************************************************
;	unit settings
; *********************************************************************************************

monitor_conditions I_CompareCounter player_control = 1

steal_esc_key off

			hiding_enabled_set false

camera_restrictions_set on

			show_ui

			enable_cursor						;prevent the player clicking
			disable_shortcuts false		
			enable_entire_ui
			inhibit_camera_input false
pause_battle

			suspend_unscripted_advice false

			camera_default_mode_set user_pref

			battle_wait 1

			ai_active_set on

		terminate_monitor
	end_monitor

	while I_InBattle
	end_while

	end_script


