game_manager
{
	spawn
	{
		wm_axis_respawntime	10
		wm_allied_respawntime	10
		wm_set_round_timelimit	30
		wm_number_of_objectives 2

		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies, -1=Nobody)
		wm_setwinner 0

		wait 100
		// Objectives
		// 1: Primary Objective: Allies destroy rockets
		// 2: Secondary1 : Capture forward spawn point
		// obj nbr, team, status (0=none, 1=passed, 2=failed)
		
		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		
		setautospawn "Old City"		1
		setautospawn "Old City"		0		
		//setautospawn "Axis Spawn" 0
		//setautospawn "Allied Spawn" 1

		// forward spawn
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0
		
		trigger allieddefaultspawns_obj on
	}
	
	trigger allies_win  	 
	{ 	 
  	wm_announce "^1The Allies blew up the Axis rockets!"

	wm_setwinner 1

	wait 3000

	wm_endround
	}
}

// =================================================
axis_rockets
{
	spawn
	{
		wait 300
		constructible_class 3 // 2=satchel  3=dyna
	}

	death
	{
		alertentity axis_rockets_bits1
		trigger axis_rockets_toi remove

		wm_announce "The Allies have destroyed the axis_rockets!"
		wm_objective_status 1 0 2
		wm_objective_status 1 1 1
		trigger game_manager allies_win

	}
}

axis_rockets_toi
{
	trigger remove
	{
		remove
	}
}
//=====================================================================
cmdctr
{
	spawn
	{
		wait 100
		constructible_class 2
				
		wait 200
		trigger cmdctr setup
		
	
	}

	trigger setup
	{
		setstate cmdctr invisible
		setstate cptruck1 invisible
		setstate cptruck_bw1 invisible
		setstate cptruck_fw1 invisible
		//setstate cpmg42 invisible
		setstate cpgenwls1 invisible
		wait 200
		setstate cmdctr_materials1 default
		setstate cmdctr_materials_clip1 default
		setstate cmdctr_flag1 default
		disablespeaker sound_01
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		//wm_addteamvoiceannounce 0 "allies_hq_compost_construct"
		//wm_teamvoiceannounce 0 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*
	}

	buildstart final
	{
		setstate cmdctr underconstruction

		setstate cmdctr_materials1 default
		setstate cmdctr_materials_clip1 default
		setstate cmdctr_flag1 default
	}

	built final
	{
		setstate cmdctr default
		enablespeaker sound_01

		setstate cmdctr_materials1 invisible
		setstate cmdctr_materials_clip1 invisible
		setstate cmdctr_flag1 invisible
		setstate cptruck1 default
		setstate cptruck_bw1 default
		setstate cptruck_fw1 default
		//setstate cpmg42 default
		setstate cpgenwls1 default
		trigger alliedcpspawns_obj on
		trigger cmdctr enable_allied_features

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_compost_constructed"
		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"
		wm_addteamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		// *---------------------------------------------------------------------------------*

		// Some kind of UI pop-up to alert players
		wm_announce	"The Allies have built the field command post!"

	}

	decayed final
	{
		setstate cmdctr invisible

		setstate cmdctr_materials1 default
		setstate cmdctr_materials_clip1 default
		setstate cmdctr_flag1 default
	}

	death
	{
		setstate cmdctr invisible

		setstate cmdctr_materials1 default
		setstate cmdctr_materials_clip1 default
		setstate cmdctr_flag1 default
		setstate cptruck1 invisible
		setstate cptruck_bw1 invisible
		setstate cptruck_fw1 invisible
		//setstate cpmg42 invisible
		setstate cpgenwls1 invisible
		trigger alliedcpspawns_obj off
		trigger cmdctr disable_allied_features
		disablespeaker sound_01
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_compost_damaged"
		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		wm_addteamvoiceannounce 0 "axis_hq_objective_destroyed"
		wm_teamvoiceannounce 0 "axis_hq_objective_destroyed"
		// *---------------------------------------------------------------------------------*
		

		// Some kind of UI pop-up to alert players
		//wm_announce	"The Axis have breeched the depot defenses."

	}


	
	trigger enable_allied_features
	{
		// allies built it
		accum 1 set 1 // Is this ever used? - Wils
		accum 2 set 1 // State of com post as far as VO is concerned (1=built)
		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75
		sethqstatus 0 1

		//wm_objective_status	4 1 1
		//wm_objective_status	4 0 2


		wm_announce	"Allied Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		//wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		//wm_teamvoiceannounce 1 "allies_hq_compost_constructed"
		//wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*
	}

	trigger disable_allied_features
	{
		// allies lost it
		accum 2 set 0 // state of com post as far as VO is concerned (0=destroyed)
		wm_announce	"Axis team has destroyed the Allied Command Post!"

		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 0 0

		//wm_objective_status	4 1 0
		//wm_objective_status	4 0 0


		// *----------------------------------- vo ------------------------------------------*
		//wm_addteamvoiceannounce 1 "allies_hq_compost_construct"
		//wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *---------------------------------------------------------------------------------*
	}
}

// ================================================
axis_cp_open
{
	spawn
	{
		wait 100
		accum 0 set 0			// 0=CP Closed, 1=CP Damaged
		constructible_class 2			// Dyno+Satchel

		trigger self disable_cp_features		// Default charge bar times
		setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate axis_cp_damaged_model invisible

		wait 1000
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"
		disablespeaker sound_02
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger disable_cp_features
	{
		setstate axis_cp_open_model invisible	// Hide Open CP model

		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1

		sethqstatus 0 0			// Landmines team warning message
		disablespeaker speaker_axis_cp		// Disable morse code sound
	}

	trigger enable_cp_features
	{
		setstate axis_cp_open_model default	// Show open CP model

		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75

		sethqstatus 0 1			// Landmines team warning message
		enablespeaker speaker_axis_cp		// Enable morse code sound
	}

	buildstart final
	{
		setstate axis_cp_closed invisible		// Hide closed CP clipbrush+model
		setstate axis_cp_closed_model invisible
		setstate axis_cp_damaged invisible	// Hide damaged CP clipbrush+model
		setstate axis_cp_damaged_model invisible
	}

	built final
	{
		accum 0 set 1			// Only show the damaged CP model
		trigger self enable_cp_features		// Increase charge bar times

		wm_announce "Axis Command Post constructed. Charge speed increased!"
		enablespeaker sound_02
		// *----------------------------------- vo ------------------------------------------*
		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		wm_addteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		// *----------------------------------- vo ------------------------------------------*
	}

	decayed final
	{
		setstate axis_cp_open_model invisible	// Hide Open CP model
		trigger self show_damaged_cabinet	// Show previous cabinet state
		trigger self show_closed_cabinet
	}

	death
	{
		trigger self show_damaged_cabinet	// Show damaged CP model
		trigger self disable_cp_features		// Default charge bar times

		wm_announce "Allied team has destroyed the Axis Command Post!"
		disablespeaker sound_02
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger show_closed_cabinet
	{
		accum 0 abort_if_equal 1		// Closed cabinet active yet?
		setstate axis_cp_closed default
		setstate axis_cp_closed_model default
	}

	trigger show_damaged_cabinet
	{
		accum 0 abort_if_equal 0		// Damaged cabinet active yet?
		setstate axis_cp_damaged default
		setstate axis_cp_damaged_model default
	}
}

// =================================================
heka
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity heka_bits
		trigger heka_toi remove

		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		
		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

heka_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
hekb
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity hekb_bits
		trigger hekb_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

hekb_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
hekc
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity hekc_bits
		trigger hekc_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

hekc_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
hekd
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity hekc_bits
		trigger hekd_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

hekd_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
heke
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity heke_bits
		trigger heke_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

heke_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
hekf
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity hekf_bits
		trigger hekf_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

hekf_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
hekg
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity hekg_bits
		trigger hekg_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

hekg_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
hekh
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity hekh_bits
		trigger hekh_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

hekh_toi
{
	trigger remove
	{
		remove
	}
}

// =================================================
heki
{
	spawn
	{
		wait 300
		constructible_class 2 // 2=satchel  3=dyna
	}

	death
	{
		alertentity heki_bits
		trigger heki_toi remove
		wm_addteamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_depotdef_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_depotdef_destroyed"

		wm_announce "^1The Allies have destroyed a part of the Rocket protection Fence!"
	}
}

heki_toi
{
	trigger remove
	{
		remove
	}
}

//======================================
//===TANK===TANK===TANK===TANK===TANK===
//======================================

// *************************************************
// ***************** TANK STUFF ********************
// *************************************************

tank_sound
{
	trigger start
	{
		trigger tank sound_start
		wait 3400
		trigger tank sound_move
	}

	trigger stop
	{
		trigger tank sound_stop
		wait 1400
		trigger tank sound_idle
	}

	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 1400
		trigger tank sound_idle
	}
}


tank
{
	spawn
	{
		wait 400
		followspline 0 spln1 50000 length 32 wait
		trigger tank sound_idle
		trigger tank tracks_stop
		wait 400
		
		wm_addteamvoiceannounce 1 "allies_hq_tank_escort"
		wm_teamvoiceannounce 1 "allies_hq_tank_escort"
		wm_addteamvoiceannounce 0 "axis_hq_tank_stop"
		wm_teamvoiceannounce 0 "axis_hq_tank_stop"
		wm_addteamvoiceannounce 1 "allies_hq_need_engineer"
		wm_teamvoiceannounce 1 "allies_hq_need_engineer"
	}

	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}




// ===========================================================================================
// ===========================================================================================
	trigger tracks_forward
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_left
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_right
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_left
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_right
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_left
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_right

		remapshaderflush
	}

	trigger tracks_turn_left
	{
		accum 0 abort_if_equal 2
		accum 0 set 2

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_turn_right
	{
		accum 0 abort_if_equal 3
		accum 0 set 3

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_backward

		remapshaderflush
	}

// ===========================================================================================
// ===========================================================================================

	trigger run_continue
	{
		accum 3 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}


// ===========================================================================================
// movement

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
        
        //================ ADD EXTRA SPLINE POINTS HERE TO MAKE A LARGER PATH ================================//

		accum 3 trigger_if_equal 47 tank run_47
		accum 3 trigger_if_equal 48 tank run_48
		accum 3 trigger_if_equal 49 tank run_49
		accum 3 trigger_if_equal 50 tank run_50
		accum 3 trigger_if_equal 51 tank run_51
		accum 3 trigger_if_equal 52 tank run_52
		accum 3 trigger_if_equal 53 tank run_53

        //================ ADD EXTRA SPLINE POINTS HERE TO MAKE A LARGER PATH ================================//

		accum 3 trigger_if_equal 86 tank run_86
		accum 3 trigger_if_equal 87 tank run_87
		accum 3 trigger_if_equal 88 tank run_88
		accum 3 trigger_if_equal 89 tank run_89
		accum 3 trigger_if_equal 90 tank run_90
		accum 3 trigger_if_equal 91 tank run_91
		accum 3 trigger_if_equal 92 tank run_92
		accum 3 trigger_if_equal 93 tank run_93
		accum 3 trigger_if_equal 94 tank run_94
		accum 3 trigger_if_equal 95 tank run_95
		accum 3 trigger_if_equal 96 tank run_96
	}

	trigger run_0
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln2 75 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_1
	{
		trigger self tracks_forward

		accum 1 bitset 2
		followspline 0 spln3 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}

	trigger run_2
	{
		trigger self tracks_forward

		accum 1 bitset 2
		followspline 0 spln4 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}

	trigger run_3
	{
		accum 1 bitset 2
		followspline 0 spln5 75 wait length 32
		accum 1 bitreset 2
        
        // Cheat to skip splines and get further : (delete or replace this to adapt script)
        //trigger self run_continue
        accum 3 set 47
	}
    
    //================ ADD EXTRA SPLINE POINTS HERE TO MAKE A LARGER PATH ================================//
    
	trigger run_47
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln49 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_48
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln50 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_49
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln51 75 wait length 32
		accum 1 bitreset 2
		trigger tank stuck_check_barrier2_built_msg
		trigger self run_continue
	}
	
	trigger run_50
	{
		trigger self tracks_forward
		
		wm_addteamvoiceannounce 1 "goldrush_allies_tank_barrier1"
		wm_teamvoiceannounce 1 "goldrush_allies_tank_barrier1"
		wm_addteamvoiceannounce 0 "goldrush_axis_tank_barrier1"
		wm_teamvoiceannounce 0 "goldrush_axis_tank_barrier1"
		
		wm_announce	"the tank has passed the first barrier"
		trigger barrier2 remove
		accum 1 bitset 2
		followspline 0 spln52 75 wait length 32
		accum 1 bitreset 2
		
		trigger self run_continue
	}
	trigger run_51
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln53 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_52
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln54 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_53
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln55 75 wait length 32
		accum 1 bitreset 2
        
        // Cheat to skip splines and get further : (delete or replace this to adapt script)
        //trigger self run_continue
        accum 3 set 86
	}
    
    //================ ADD EXTRA SPLINE POINTS HERE TO MAKE A LARGER PATH ================================//
    
    trigger run_86
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln88 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_87
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln89 75 wait length 32
		accum 1 bitreset 2
		trigger tank stuck_check_barrier1_built_msg
		trigger self run_continue
	}
	trigger run_88
	{
		trigger self tracks_forward
		
		wm_addteamvoiceannounce 1 "goldrush_allies_tank_barrier2"
		wm_teamvoiceannounce 1 "goldrush_allies_tank_barrier2"
		wm_addteamvoiceannounce 0 "goldrush_axis_tank_barrier2"
		wm_teamvoiceannounce 0 "goldrush_axis_tank_barrier2"
		
		wm_announce	"the tank has passed the second barrier"
		trigger barrier1 remove
		
		//trigger forward_flag off
		//trigger alliedcpspawns_obj on
		//trigger allieddefaultspawns_obj off
		
		trigger oldcityflag kill //nbiet meer capture
		trigger oldcityflag force_allied // Switch forward spawn to Allied ONLY
		
		
		accum 1 bitset 2
		followspline 0 spln90 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_89
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln91 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_90
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln92 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_91
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln93 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_92
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln94 75 wait length 32
		accum 1 bitreset 2
		wm_announce "^1WARNING: ^3Allied tank approaching Axis base entrance !!!!"
	trigger game_manager approach
		trigger self run_continue
	}
	trigger run_93
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln95 75 wait length 32
		accum 1 bitreset 2
		trigger self run_continue
	}
	trigger run_94
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln96 50 wait length 32
		accum 1 bitreset 2

//		trigger self 		tracks_stop
//		trigger tank_sound 	stop

		//startanimation 45 10 15 nolerp norandom
		//wait 666
		//startanimation 0 1 15 nolerp norandom
		//wait 900

//		trigger tank_turret turn
//		accum 3 inc 1

		trigger self script_lockout

		trigger self 		tracks_stop
		trigger tank_sound 	stop

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		wait 900

		trigger tank_turret turn

		accum 3 inc 1
	}



	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

// ===========================================================================================
// ===========================================================================================
// enable/disable

	trigger tank_enable
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here

		trigger self script_lockout

		trigger tank_sound start

		startanimation 55 10 15 nolerp norandom
		wait 666
		startanimation 5 40 15 nolerp norandom
		wait 500
		trigger self tracks_forward

		trigger self script_lockout_stop

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4

		accum 1 bitset 8			// set stop check

		trigger self deathcheck
	}

    // ===========================================================================================
    // ===========================================================================================
    // death / rebirth

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again

		trigger self script_lockout

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks.md3

		setstate tank_smoke invisible
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_tank_repaired"
		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"
		wm_addteamvoiceannounce 0 "axis_hq_tank_repaired_allies"
		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"
		// *---------------------------------------------------------------------------------*
		
		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9		// are we not already visibly dead?
		accum 1 abort_if_bitset 2		// are we not following a spline?
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 bitset 9				// we're now visibly dead

		trigger self deathcheck_message
		accum 1 bitset 4

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks2.md3

		setstate tank_smoke default
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		wm_teamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		wm_addteamvoiceannounce 0 "axis_hq_tank_damaged"
		wm_teamvoiceannounce 0 "axis_hq_tank_damaged"
		// *---------------------------------------------------------------------------------*

		kill tank_construct

		trigger self sound_death
		trigger self tracks_stop

		trigger self script_lockout

		trigger self tracks_stop
		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		trigger self script_lockout_stop

		resetscript
	}

	trigger deathcheck_message
	{
		accum 1 abort_if_not_bitset 4

		wm_announce "The Tank has been damaged!"

	}

	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom noloop
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}

	trigger enable_stage2
	{
		accum 1 bitreset 0
	}

	trigger disable_stage2
	{
		accum 1 bitset 0
	}

	trigger enable_stage4
	{
		accum 1 bitreset 1
	}

	trigger disable_stage4
	{
		accum 1 bitset 1
	}

	trigger enable_stage5
	{
		accum 1 bitreset 5
	}

	trigger disable_stage5
	{
		accum 1 bitset 5
	}

	// stuck checking
	// digibob: since we cant return variables, just use bit 3 of accum 1 as a register... mmmm assembly...
	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_barrier2_built
		trigger self stuck_check_barrier1_built
		
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}

	trigger stuck_check_finished
	{
		accum 3 abort_if_less_than 95
		accum 1 bitset 3

	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0
		accum 1 bitset 3
	}
	
	trigger stuck_check_barrier2_built
	{
		accum 3 abort_if_not_equal 50
		accum 1 abort_if_not_bitset 1
		accum 1 bitset 3
	}


	trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 87
		accum 1 abort_if_not_bitset 5
		accum 1 bitset 3
	}


	trigger stuck_check_barrier2_built_msg
	{
		accum 1 abort_if_not_bitset 1

	}

	trigger stuck_check_barrier1_built_msg
	{
		accum 1 abort_if_not_bitset 5
	}


// ===========================================================================================
// stop check

	trigger stopcheck_setup
	{
		accum 1 bitset 6			// stop if we're stuck/no-one's pushing :)

		accum 1 abort_if_bitset 8		// no one in the trigger, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop
		trigger self 		tracks_stop
		startanimation 45 	10 	15 nolerp norandom
		wait 666
		startanimation 0 	1 	15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}


// ===========================================================================================
// ===========================================================================================
// script lockouts

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}


}

tank_trigger
{
	spawn
	{
		wait 500

		attachtotag tank_shell tag_turret

		trigger tank_trigger bot_goal_loop
	}

	trigger bot_goal_loop
	{
		wait 4000	// check every 4 seconds
		trigger tank bot_active_check
		trigger tank_trigger bot_goal_loop
	}
}

tank_build
{
	spawn
	{
		wait 500

		attachtotag tank_shell tag_turret
	}
}

tank_construct
{
	spawn
	{
		wait 1000

		kill tank

		constructible_class 2
		constructible_health 700
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank

		wm_announce "The Tank has been repaired!"
	}
}

tank_shell
{
	spawn
	{
		wait 400
		attachtotag tank tag_tank
	}
}

tank_turret
{
	spawn
	{
		wait 500

		attachtotag tank_shell tag_turret
		setstate wall_destroyed invisible
	}

	trigger turn
	{

		wait 1000

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 -30 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		wait 500
		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav
		trigger tank_flash run
	}

	trigger blow_doors
	{
		trigger tank_flash invis
		wait 200
		trigger tank stopfire
		trigger bank_door1 boom
		setstate alliedconstruct_n_materials default	// Crate Models
		setstate alliedconstruct_n_clip default		// Clip brushes
		setstate alliedconstruct_n_flag default
		setstate alliedconstruct_n_toi default
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "battery_allies_ramp_construct"
		wm_teamvoiceannounce 1 "battery_allies_ramp_construct"
		// *---------------------------------------------------------------------------------*
				
		alertentity hurt_bankblast

		wait 200
		alertentity hurt_bankblast
		wm_announce "The tank has destroyed the entrance gate"

    	wait 100
		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 -360 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		trigger tank sound_death
		trigger tank script_lockout_stop
	}
	trigger turn2
	{

		wait 1000

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles -13 -25 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		wait 1000
		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav
		trigger tank_flash run2
	}

}

tank_flash
{
	spawn
	{
		setstate tank_flash invisible
	}

	trigger run
	{
		setstate tank_flash default
 		attachtotag tank_turret tag_flash
		faceangles 0 -360 0 50

		wait 50

		trigger tank_turret blow_doors
	}
	trigger run2
	{
		setstate tank_flash default
 		attachtotag tank_turret tag_flash
		faceangles 0 -360 0 50

		wait 50

		trigger tank_turret blow_doors2
	}

	trigger invis
	{
		setstate tank_flash invisible
	}

}

tank_disabler
{
	trigger run
	{
		trigger tank tank_disable
	}
}

tank_enabler
{
	trigger run
	{
		trigger tank tank_enable
	}
}

tank_smoke
{
	spawn
	{
		wait 300
		attachtotag tank_shell tag_smoke
		setstate tank_smoke invisible
	}
}

barrier2
{
	spawn
	{
		wait 400
		trigger barrier2 setup
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "goldrush_axis_tankbar_construct"
		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_construct"
		// *---------------------------------------------------------------------------------*

		constructible_class 3
	}

	trigger setup
	{
		setstate barrier2_materials default
		setstate barrier2_materials_clip default
		setstate barrier2_flag default
	}

	buildstart final
	{
		setstate barrier2_materials default
		setstate barrier2_materials_clip default
		setstate barrier2_flag default
	}

	built final
	{
		setstate barrier2_materials invisible
		setstate barrier2_materials_clip invisible
		setstate barrier2_flag invisible
		trigger tank disable_stage4
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "goldrush_axis_tankbar_constructed"
		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_constructed"
		// *---------------------------------------------------------------------------------*
		wm_announce "Tank Barrier #1 has been constructed."
	}

	decayed final
	{
		setstate barrier2_materials default
		setstate barrier2_materials_clip default
		setstate barrier2_flag default
	}

	death
	{
		setstate barrier2_materials default
		setstate barrier2_materials_clip default
		setstate barrier2_flag default
		trigger tank enable_stage4
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "goldrush_axis_tankbar_destroyed"
		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_destroyed"
		wm_addteamvoiceannounce 1 "goldrush_allies_tankbar_destroyed"
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroyed"
		// *---------------------------------------------------------------------------------*
		
		wm_announce "Tank Barrier #1 has been destroyed."
	}

	trigger remove
	{
		setstate barrier2_toi invisible
		setstate barrier2_materials invisible
		setstate barrier2_materials_clip invisible
		setstate barrier2_flag invisible
		remove
	}
}

barrier1
{
	spawn
	{
		wait 400
		trigger barrier1 setup

		constructible_class 3
	}

	trigger setup
	{
		setstate barrier1_materials default
		setstate barrier1_materials_clip default
		setstate barrier1_flag default
	}

	buildstart final
	{
		setstate barrier1_materials default
		setstate barrier1_materials_clip default
		setstate barrier1_flag default
	}

	built final
	{
		setstate barrier1_materials invisible
		setstate barrier1_materials_clip invisible
		setstate barrier1_flag invisible
		trigger tank disable_stage5
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "goldrush_axis_tankbar_constructed"
		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_constructed"
		// *---------------------------------------------------------------------------------*
		wm_announce "Tank Barrier #2 has been constructed."
	}

	decayed final
	{
		setstate barrier1_materials default
		setstate barrier1_materials_clip default
		setstate barrier1_flag default
	}

	death
	{
		setstate barrier1_materials default
		setstate barrier1_materials_clip default
		setstate barrier1_flag default
        trigger tank enable_stage5
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "goldrush_axis_tankbar_destroyed"
		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_destroyed"
		wm_addteamvoiceannounce 1 "goldrush_allies_tankbar_destroyed"
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroyed"
		// *---------------------------------------------------------------------------------*
		wm_announce "Tank Barrier #2 has been destroyed."
	}

	trigger remove
	{
		setstate barrier1_toi invisible
		setstate barrier1_materials invisible
		setstate barrier1_materials_clip invisible
		setstate barrier1_flag invisible
		remove
	}
}

bank_door1
{
	spawn
	{
		wait 200
		setstate bank_door1 default
	}

	trigger boom
	{

		alertentity bank_door1
		setstate bankdoors_toi invisible
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "fueldump_axis_wall_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_wall_destroyed"
		wm_addteamvoiceannounce 0 "fueldump_axis_gates_destroyed"
		wm_teamvoiceannounce 0 "fueldump_axis_gates_destroyed"
		wm_addteamvoiceannounce 1 "fueldump_allies_wall_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_wall_destroyed"
		wm_addteamvoiceannounce 1 "fueldump_allies_gates_destroyed"
		wm_teamvoiceannounce 1 "fueldump_allies_gates_destroyed"
		// *---------------------------------------------------------------------------------*

		wait 2000

	}
}

//==============================================================
//==============================================================
//==============================================================

alliedcpspawns_obj
{
	spawn
	{
		wait 50
		setstate alliedcpspawns_obj invisible
		setstate alliedcpspawns invisible
	}

	trigger on
	{
		setstate alliedcpspawns_obj default
		setstate alliedcpspawns default
	}

	trigger off
	{
		setstate alliedcpspawns_obj invisible
		setstate alliedcpspawns invisible
	}
}

alliedcpspawns
{
	spawn
	{
		wait 50
		setstate alliedcpspawns invisible
	}
}

allieddefaultspawns_obj
{
	spawn
	{
		wait 50
		setstate allieddefaultspawns_obj invisible
		setstate allieddefaultspawns invisible
	}

	trigger on
	{
		setstate allieddefaultspawns_obj default
		setstate allieddefaultspawns default
	}

	trigger off
	{
		setstate allieddefaultspawns_obj invisible
		setstate allieddefaultspawns invisible
	}
}

allieddefaultspawns
{
	spawn
	{
		wait 50
		setstate allieddefaultspawns invisible
	}
}

//=============================================
oldcityflag
{
	spawn
	{
		accum 0 set 0	// Who has the flag: 0-Axis, 1-Allied
	}

	trigger axis_capture	// Flag has been touched by an Axis player
	{
		accum 0 abort_if_equal 0 // do Axis own flag?

		accum 0 set 0 // Axis own the pole
		wm_announce	"Axis reclaim the Forward Spawn!"

		// *----------------------------------- vo ------------------------------------------*
		//wm_addteamvoiceannounce 0 "oasis_axis_city_defend"
		//wm_addteamvoiceannounce 1 "oasis_allies_city_capture"
		//wm_teamvoiceannounce 0 "oasis_axis_city_captured"
		//wm_teamvoiceannounce 1 "oasis_allies_city_lost"
		//wm_removeteamvoiceannounce 0 "oasis_axis_wall_defend"
		//wm_removeteamvoiceannounce 1 "oasis_allies_wall_destroy"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		2 0 1
		wm_objective_status 		2 1 2

		alertentity old_city_wobj
	}

	trigger allied_capture	// Flag has been touched by an allied player
	{
		accum 0 abort_if_equal 1 // do Allies own flag?

		accum 0 set 1 // Allied own the flag
		wm_announce	"Allies capture the Forward Spawn!"

		// *----------------------------------- vo ------------------------------------------*
		//wm_addteamvoiceannounce 0 "oasis_axis_wall_defend"
		//wm_addteamvoiceannounce 1 "oasis_allies_wall_destroy"
		//wm_teamvoiceannounce 0 "oasis_axis_city_lost"
		//wm_teamvoiceannounce 0 "oasis_axis_wall_defend"
		//wm_teamvoiceannounce 1 "oasis_allies_city_captured"
		//wm_teamvoiceannounce 1 "oasis_allies_wall_destroy"
		//wm_removeteamvoiceannounce 0 "oasis_axis_city_defend"
		//wm_removeteamvoiceannounce 1 "oasis_allies_city_capture"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 		2 0 2
		wm_objective_status 		2 1 1

		alertentity old_city_wobj
	}

	trigger check_obj
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?

		wm_objective_status 		2 0 2
		wm_objective_status 		2 1 1

	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?

		alertentity old_city_wobj
		alertentity oldcityspawns
	}

	trigger kill
	{
		remove
	}
}

// ================================================
alliedconstruct_n
{
	spawn
	{
		wait 50
		trigger self setup
		constructible_class	2	// 2=Satchel 3=Dyna
	}

	trigger setup
	{
		setstate alliedconstruct_n_materials invisible	// Crate Models
		setstate alliedconstruct_n_clip invisible		// Clip brushes
		setstate alliedconstruct_n_flag invisible
		setstate alliedconstruct_n_toi invisible
	}

	built final
	{
		setstate alliedconstruct_n_materials invisible	// Crate Models
		setstate alliedconstruct_n_clip invisible	// Clip brushes
		setstate alliedconstruct_n_flag invisible
		
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "battery_allies_ramp_constructed"
		wm_teamvoiceannounce 1 "battery_allies_ramp_constructed"
		wm_addteamvoiceannounce 0 "battery_axis_ramp_constructed"
		wm_teamvoiceannounce 0 "battery_axis_ramp_constructed"
		// *---------------------------------------------------------------------------------*
		
		wm_announce "Allied Team have built the assault ladder!"
	}

	decayed final
	{
		trigger self setup
	}

	death
	{
		setstate alliedconstruct_n_materials default	// Crate Models
		setstate alliedconstruct_n_clip default		// Clip brushes
		setstate alliedconstruct_n_flag default
		setstate alliedconstruct_n_toi default
		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "battery_allies_ramp_destroyed"
		wm_teamvoiceannounce 1 "battery_allies_ramp_destroyed"
		wm_addteamvoiceannounce 0 "battery_axis_ramp_destroyed"
		wm_teamvoiceannounce 0 "battery_axis_ramp_destroyed"
		// *---------------------------------------------------------------------------------*
		wm_announce "Axis have destroyed the assault ladder!" 
	}
}