script

;made by Macchi
; init
	prepare_for_battle

;label_unit  ALLIANCE  ARMY  UNIT


label_unit 0 0 0 	ra
label_unit 0 0 1	rb
label_unit 0 0 2 	rc
label_unit 0 0 3 	rd
label_unit 0 0 4 	re
label_unit 0 0 5 	rf
label_unit 0 0 6	rg
label_unit 0 0 7	rh
label_unit 0 0 8	ri
label_unit 0 0 9	rj
label_unit 0 0 10	rk
label_unit 0 0 11	rl
label_unit 0 0 12	rm
label_unit 0 0 13	rn
label_unit 0 0 14	ro
label_unit 0 0 15	rp
label_unit 0 0 16	rq
label_unit 0 0 17	rr
label_unit 0 0 18	rs
label_unit 0 0 19	rt


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



label_unit 1 0 0	ca
label_unit 1 0 1	cb
label_unit 1 0 2	cc
label_unit 1 0 3	cd
label_unit 1 0 4	ce
label_unit 1 0 5	cf
label_unit 1 0 6	cg
label_unit 1 0 7	ch
label_unit 1 0 8	ci
label_unit 1 0 9	cj
label_unit 1 0 10	ck
label_unit 1 0 11	cl
label_unit 1 0 12	cm
label_unit 1 0 13	cn
label_unit 1 0 14	co
label_unit 1 0 15	cp
label_unit 1 0 16	cq
label_unit 1 0 17	cr
label_unit 1 0 18	cs
label_unit 1 0 19	ct


	declare_counter battle_start
	declare_counter intro_sequence
	declare_counter player_control

	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_group_order_halt julios
unit_group_order_halt julios2
unit_group_order_halt cartagineses

unit_group_immediate_place julios 355 -340 -180
unit_group_immediate_place julios2 380 -320 -180
;unit_immediate_place ca 370 -440

	unit_group_order_relative_move_formed julios 0 100 run

	unit_group_order_relative_move_formed julios2 0 100 run

			unit_order_attack_unit r10 cn run
			unit_order_attack_unit r0 cn run
			unit_order_attack_unit r14 cn run

			unit_order_attack_unit r1 cm run
			unit_order_attack_unit r9 cm run

			unit_order_attack_unit cn r10 run
			unit_order_attack_unit cm r1 run

			camera_position_at_bookmark 7

			set_counter battle_start 1

		terminate_monitor
	end_monitor
;-----------------------------------------------------------------------------------------------------------

	set_counter intro_sequence 1	;	kicks off intro sequence





; *********************************************************************************************
; ***************************************INTRO*************************************************
; *********************************************************************************************


monitor_conditions I_CompareCounter intro_sequence = 1

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



			set_camera_bookmark 0, 428.5, 187.151, -445.358 438.232, 14.451, -445.162
			set_camera_bookmark 1, 530.818, 195.061, 533.421 540.808, 194.157, 533.625
			set_camera_bookmark 2, 305.918, 189.5, -129.5 300, 189, -121.3
			set_camera_bookmark 3, 364.213, 198, -211.9 364.031, 194, -203.113
			set_camera_bookmark 4, 290.191, 185.562, -185.587 299.6, 185, -182.786
			set_camera_bookmark 5, 363.771, 181.8, -288.14 364.083, 183.926, -278.149
			set_camera_bookmark 6, -850, 173.833, -849.444 -858.439 176.503 -854.237
			set_camera_bookmark 7, 368.771, 209.747, -449.838 368.812 204.875, -441.642
			

	define_unit_group julios ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt
	define_unit_group julios2 r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14

	define_unit_group cartagineses cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct

			unit_set_skirmish_mode cn off

			unit_set_fire_at_will_mode ce on
	
			camera_restrictions_set off

			hide_ui

; *********************************************************************************************

			camera_position_at_bookmark 0

			camera_track_unit ca front 3 1

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


			battle_wait 1

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


			unit_order_move_relative ca 0 70 run

			battle_wait 2

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


			play_sound_event TREBIA_SPEECH_02 tag = trebia_SPEECH_02

			battle_wait 3.5

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

	
			camera_track_unit ca left 3 2

			play_sound_event TREBIA_SPEECH_03 tag = trebia_SPEECH_03

			battle_wait 4

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


			unit_group_set_guard_mode cartagineses on

			unit_order_move_relative ca 8 0

			battle_wait 3

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


			camera_position_at_bookmark 6

			unit_order_move_relative ca 0 2

			play_sound_event TRASIMENE_SPEECH_05 tag = TRASIMENE_SPEECH_05
			
			battle_wait 6

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


			camera_position_at_bookmark 2
			battle_wait 0.5

			play_sound_event TREBIA_SPEECH_05 tag = trebia_SPEECH_05

			battle_wait 3

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


			camera_zoom_to_bookmark 3 15	

			battle_wait 7

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


			play_sound_event TRASIMENE_SPEECH_02 tag = TRASIMENE_SPEECH_02

			battle_wait 7

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


			camera_position_at_bookmark 4

	unit_group_order_relative_move_formed julios 0 230 run
	unit_group_order_relative_move_formed julios2 0 230 run

			battle_wait 0.5

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

			camera_track_unit rs right 1.5 0.6

			set_music_state mobilize

			battle_wait 1

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

			play_sound_event TRASIMENE_SPEECH_09 tag = TRASIMENE_SPEECH_09

			battle_wait 6

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


			camera_track_unit rf front 5 3

			battle_wait 6

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


			camera_position_at_bookmark 5

			battle_wait 1

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


			play_sound_event GRAUPIUS_SPEECH_10 = GRAUPIUS_SPEECH_10

			unit_order_attack_unit r10 cn run
			unit_order_attack_unit r0 cn run
			unit_order_attack_unit r14 cn run

			unit_order_attack_unit r1 cm run
			unit_order_attack_unit r9 cm run

			battle_wait 6

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


			unit_order_attack_unit cn r10 run
			unit_order_attack_unit cm r1 run

			camera_position_at_bookmark 7
			set_music_state battle

		set_counter battle_start 1
			
		terminate_monitor
	end_monitor


; *************************************** FIN INTRO *******************************************








; *********************************************************************************************
;	COMIENZO DE BATALLA
; *********************************************************************************************

	monitor_conditions I_CompareCounter battle_start = 1

			undefine_unit_group cartagineses

			set_counter player_control 1

		terminate_monitor
	end_monitor



; *********************************************************************************************
;	devuelve la interfaz y el control de juego
; *********************************************************************************************

	monitor_conditions I_CompareCounter player_control = 1

			stop_sound_event trebia_SPEECH_02
			stop_sound_event trebia_SPEECH_03
			stop_sound_event trebia_SPEECH_05
			stop_sound_event TRASIMENE_SPEECH_05
			stop_sound_event TRASIMENE_SPEECH_02
			stop_sound_event TRASIMENE_SPEECH_09
			stop_sound_event GRAUPIUS_SPEECH_10

			;camera_restrictions_set on

			show_ui

			enable_cursor						;prevent the player clicking
			disable_shortcuts false		
			enable_entire_ui
			inhibit_camera_input false

			battle_wait 1

			steal_esc_key off

			camera_default_mode_set user_pref

			pause_battle

			suspend_unscripted_advice false

			battle_wait 40w
	ai_active_set on

		terminate_monitor
	end_monitor



	while I_InBattle
	end_while

	end_script