game_manager //needed
{
	spawn
	{
	    wait 3000
		wm_announce "^/The second mission from Helicopter Assault season!"
		wm_teamvoiceannounce 1 us_constructguncontrol
		wm_teamvoiceannounce 0 a_guncontrolstop
		wm_axis_respawntime 25
		wm_allied_respawntime 20
		wm_set_round_timelimit 20
		wm_setwinner	0
		wm_set_defending_team	0
		accum 1 set 0
		// Objectives 
        //  Primary Objective: Secure the gold!
		//  1 Construct the Cannon
		//   2 Construct tank
		//   3 Door control
		//   4 Construct the gate control
		//   5 Steal the gold
		wm_number_of_objectives 5
		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		wm_objective_status 2 0 0
		wm_objective_status 2 1 0
		wm_objective_status 3 0 0
		wm_objective_status 3 1 0
		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
	}
		        trigger allies_win   
        {   
                wm_announce "Gold Secured!" 
                wm_setwinner 1
                wait 1000
                wm_endround
 
        } 
	trigger anunt_axis1
	{
	wait 100
    wm_teamvoiceannounce 0 a_guncontrolconstructed
	wait 500
	wm_teamvoiceannounce 0 a_stopfire
	}
	trigger anunt_allies1
	{
	wait 100
	wm_teamvoiceannounce 1 us_constructioncompleted
	wait 500
	wm_teamvoiceannounce 1 us_firetherailgun
	}
	trigger fires_left
	{
	accum 1 inc 1
	accum 1 trigger_if_equal 1 game_manager anunt1
	accum 1 trigger_if_equal 2 game_manager anunt2
	accum 1 trigger_if_equal 3 game_manager anunt3
	}
	trigger anunt_allies2
	{
	wait 3000
	wm_teamvoiceannounce 1 us_stealtank
	wm_announce "Get The Tank^1!!!!"
	}
	trigger anunt_allies3
	{
	wait 150
	wm_teamvoiceannounce 1 us_tankstolen
	}
	trigger anunt_axis2
	{
	wm_teamvoiceannounce 0 a_guncontrolrecaptured
	wait 600
	wm_teamvoiceannounce 0 a_firetherailgun
	}
	trigger anunt_axis3
	{
    wm_teamvoiceannounce 0 a_stopfire
	}
	trigger anunt_axis4
	{
	wm_teamvoiceannounce 0 a_firetherailgun
	}
	trigger anunt1
	{
	wait 4000
	wm_announce "^12 ^7fires left^1!!"
	}
	trigger anunt2
	{
	wait 4000
	wm_announce "^11 ^7fire left^1!!"
	}
	trigger anunt3
	{
	wait 1000
	wm_announce "Fence destroyed^1!!!!"
	}
	trigger anunt_axis5
	{
	}
	trigger anunt_axis6
	{
	}
	trigger anunt_axis7
	{
	}
	trigger anunt_allies4
	{
	wait 600
	wm_teamvoiceannounce 1 us_mainentrancedestroyed
	wm_teamvoiceannounce 0 a_destroyedmainentrance
	wm_announce "Main entrance is destroyed^1!!!"
	}
	trigger anunt_allies5
	{
	wait 600
	wm_teamvoiceannounce 1 us_sideentrancedestroyed
	wm_teamvoiceannounce 0 a_destroyedsideentrance
	wm_announce "Second entrance is destroyed^1!!!"
	}
	trigger anunt_allies6
	{
	wait 600
    wm_teamvoiceannounce 1 us_destroyedentrances
	wm_teamvoiceannounce 0 a_entrancesdestroyed
	wm_announce "Third entrance destroyed^1!!!"
	wait 1000
	wm_teamvoiceannounce 1 us_dynamitedoorcontrol
	wm_teamvoiceannounce 0 a_protectcontrols
	wm_objective_status 2 0 2
	wm_objective_status 2 1 1
	}
	trigger us1
	{
	wm_teamvoiceannounce 1 us_constructiondestroyed
	wait 100
	wm_teamvoiceannounce 0 a_constructiondestroyed
	wait 600
	wm_teamvoiceannounce 0 a_protectgold
	wm_teamvoiceannounce 1 us_constructcp
	wait 600
	wm_teamvoiceannounce 1 us_getgold
	}

}
info_heli
{
spawn
{
wait 100
setstate info_heli default
attachtotag master_mover aici
}
}
//ELICOPTERUUUU 1
mover_shell //your original brushwork
{
	spawn
	{
	    wait 800
		attachtotag master_mover aici //matching up origins of both script_movers
		setstate mover_shell default
	}
	trigger apare
	{
	setstate mover_shell default
	}
	trigger dispare
	{
	setstate mover_shell invisible
	}
}
elice1f
{
    spawn
	{
	  wait 800
	  attachtotag master_mover elice1
	  setstate elice1f default
	}
	trigger apare
	{
	setstate elice1f default
	}
	trigger dispare
	{
	setstate elice1f invisible
	}
			trigger pauza
		{
		    faceangles 0 0 0 0
		    setrotation 0 0 0
		}
			trigger pornire
		{
		    faceangles 0 0 0 10
		    setrotation 0 750 0
		}
}
efect_elice
{
spawn
{
wait 500
attachtotag master_mover efect
setstate efect_elice invisible
}
trigger apare
{
setstate efect_elice default
}
trigger dispare
{
setstate efect_elice invisible
}
}
heal
{
spawn
{
wait 500
attachtotag master_mover healh
setstate heal default
}
}
ammo
{
spawn
{
wait 500
attachtotag master_mover ammoh
setstate ammo default
}
}
master_mover //this script_mover has everything else attached to it. 
{
	spawn
	{
		setdamagable master_mover 0 // This makes the entity invincible, a health key is needed for gun to work properly. If you want it damagable just remove this line.
		wait 500
		followspline 0 heli2_path_07 length 300 wait
	}
	trigger sunet
	{
	playsound sound/UJE_the_ghetto/heli.wav looping volume 2000
	}
	trigger dispare
	{
	setstate master_mover invisible
	}
	trigger apare
	{
	setstate master_mover default
	}

	trigger miscare
	{
alertentity zgomot_jos
followspline 0 heli2_path_07 200 wait length 304
followspline 0 heli2_path_08 200 wait length 304
followspline 0 heli2_path_09 200 wait length 304
followspline 0 heli2_path_10 200 wait length 304
followspline 0 heli2_path_11 150 wait length 304
followspline 0 heli2_path_12 150 wait length 304
trigger efect_elice dispare
wait 8000
trigger efect_elice apare
followspline 0 heli2_path_13 150 wait length 304
followspline 0 heli2_path_14 180 wait length 304
followspline 0 heli2_path_15 200 wait length 304
followspline 0 heli2_path_16 200 wait length 304
followspline 0 heli2_path_17 200 wait length 304
followspline 0 heli2_path_18 200 wait length 304
followspline 0 heli2_path_19 200 wait length 304
trigger elice1f oprire
wait 500
setstate heli2_fiu default
trigger efect_elice dispare
   }
}
   heli2_go
{
    spawn
	{
	setstate heli2_fiu default
	}
	trigger main
	{
	    alertentity elice_jos
	    //trigger h_left_door2 close
		//trigger h_right_door2 close
		trigger master_mover sunet
		setstate heli2_fiu invisible
		wait 300
		trigger master_mover miscare
		trigger elice1f pornire
		trigger efect_elice apare
	}
}
//GATA ELICOPTERUU
//TANKUL
//=============================================================================
//=== Tank Mapscript
//=============================================================================
//	accum 0, script lock
//	accum 1, current movement path position
//	accum 2, track state
//	accum 3, bit 0	death status		(0=dead, 1=alive)
//		 bit 1	stuck status		(0=not stuck, 1=stuck)
//		 bit 2	players nearby		(0=no players, 1=players)
//		 bit 3	moving status		(0=not moving, 1=moving)
//		 bit 4	temp register
//		 bit 5	message-flag		(0=no message, 1=message)
//		 bit 6	visible state		(0=alive, 1=dead)
//		 bit 7	barricade #1		(0=not built, 1=built)
//		 bit 8	barricade #2		(0=not built, 1=built)
//		 bit 9	barricade #3		(0=not built, 1=built)
//		 bit 10	barricade #4		(0=not built, 1=built)
//	accum 4, stop counter
//

//info_notnull
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 death
	{
		trigger tank sound_death
		wait 3400
		trigger tank sound_idle
	}
	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 3400
		trigger tank sound_idle
	}
}

//script_mover
tank
{
	// ===========================================================================================
	spawn
	{
		wait 50

		constructible_chargebarreq 1.0
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
		accum 5 set 1
		accum 6 set 1
		followspline 0 path_00 10000 wait length -64

		trigger self sound_idle
		trigger self tracks_stop
		trigger tank barricade1_constructed
		trigger tank barricade2_constructed
		trigger tank barricade3_constructed
	}
	trigger dezactivat1
	{
	 trigger self barricade1_destroyed
	}
	trigger deactivat2
	{
		trigger self barricade2_destroyed
	}
	trigger dezactivat3
	{
	trigger self barricade3_destroyed
    }	


	// ===========================================================================================
	// script lockouts
	trigger script_lock
	{
		accum 0 inc 1
	}

	trigger script_unlock
	{
		accum 0 inc -1
	}


	// ===========================================================================================
	// tracks
	trigger tracks_forward
	{
		accum 2 abort_if_equal 1
		accum 2 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 2 abort_if_equal 0
		accum 2 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 2 abort_if_equal 2
		accum 2 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 2 abort_if_equal 3
		accum 2 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
	}


	// ========================================
	// sound stuff
	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
	}


	// ===========================================================================================
	// enable/disable
	trigger tank_enable
	{
		trigger self stuck_check
		accum 3 abort_if_bitset 1 		// stuck check
		accum 4 set 0				// reset stop counter
		accum 3 bitreset 2			// reset player check
		accum 3 abort_if_bitset 3 		// already following spline
		accum 0 abort_if_not_equal 0		// are we not in a script lockout?
		accum 3 abort_if_bitset 0 		// death check

		trigger self script_lock
		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_unlock

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 2		// 2 second ride
		accum 3 bitset 2			// set player check
		trigger self deathcheck
	}


	// ===========================================================================================
	// stuck checking
	trigger stuck_check
	{
		accum 3 bitreset 1			// accum 3, bit 1	stuck status	(0=not stuck, 1=stuck)
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
		trigger self stuck_check_barrier1_built
		trigger self stuck_check_barrier2_built
		trigger self stuck_check_barrier3_built
	}

	trigger stuck_check_barrier1_built
	{
		accum 1 abort_if_not_equal 13
		accum 3 abort_if_not_bitset 7
		accum 3 bitset 1	// stuck
	}

	trigger stuck_check_barrier2_built
	{
		accum 1 abort_if_not_equal 15
		accum 3 abort_if_not_bitset 8
		accum 3 bitset 1	// stuck
	}

	trigger stuck_check_barrier3_built
	{
		accum 1 abort_if_not_equal 18
		accum 3 abort_if_not_bitset 9
		accum 3 bitset 1	// stuck
	}

	trigger stuck_check_finished
	{
		accum 1 abort_if_less_than 19
		accum 3 bitset 1
	}


	trigger stuck_check_scriptlockout
	{
		accum 0 abort_if_equal 0
		accum 3 bitset 1
	}

	// ===========================================================================================
	// stop check
	trigger stopcheck_setup
	{
		accum 3 bitset 4			// stop if we're stuck/no-one's pushing :)
		accum 3 abort_if_bitset 2		// no one in the trigger, abort
		trigger self stuck_check		// call the stop check function
		accum 3 abort_if_bitset 1		// we're stuck so break out
		accum 3 bitreset 4			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 3 abort_if_not_bitset 4

		trigger self script_lock
		// 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_unlock

		resetscript
	}


	// ===========================================================================================
	// death / rebirth
	trigger deathcheck
	{
		accum 3 abort_if_not_bitset 0		// are we dead?
		accum 3 abort_if_bitset 6		// are we not already visibly dead?
		accum 3 abort_if_bitset 3		// are we not following a spline?
		accum 0 abort_if_not_equal 0		// are we not in a script lockout?
		accum 3 bitset 6			// we're now visibly dead
		accum 3 bitset 5

		wm_announce "The tank has been damaged^1!!!"

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks2.md3
		setstate tank_smoke default
		kill tank_construct
		trigger self sound_death
		trigger self tracks_stop

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

		resetscript
	}

	rebirth
	{
		accum 3 bitreset 6 			// we're visibly alive
		accum 3 bitreset 0 			// we're alive again

		trigger self script_lock
		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks.md3
		setstate tank_smoke invisible
		trigger tank_sound rebirth
		wait 500
		trigger self script_unlock
	}

	death
	{
		accum 3 bitset 0
	}


	// ===========================================================================================
	// movement
	trigger run_continue
	{
		accum 1 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}

	trigger move
	{
		trigger self move_check
		wait 500
		trigger self move
	}

	trigger move_check
	{
		trigger self stuck_check
		accum 3 abort_if_bitset 1
		accum 1 trigger_if_equal 0 tank move_to_0
		accum 1 trigger_if_equal 1 tank move_to_1
		accum 1 trigger_if_equal 2 tank move_to_2
		accum 1 trigger_if_equal 3 tank move_to_3
		accum 1 trigger_if_equal 4 tank move_to_4
		accum 1 trigger_if_equal 5 tank move_to_5
		accum 1 trigger_if_equal 6 tank move_to_6
		accum 1 trigger_if_equal 7 tank move_to_7
		accum 1 trigger_if_equal 8 tank move_to_8
		accum 1 trigger_if_equal 9 tank move_to_9
		accum 1 trigger_if_equal 10 tank move_to_10
		accum 1 trigger_if_equal 11 tank move_to_11
		accum 1 trigger_if_equal 12 tank move_to_12
		accum 1 trigger_if_equal 13 tank move_to_13
		accum 1 trigger_if_equal 14 tank move_to_14
		accum 1 trigger_if_equal 15 tank move_to_15
		accum 1 trigger_if_equal 16 tank move_to_16
		accum 1 trigger_if_equal 17 tank move_to_17
		accum 1 trigger_if_equal 18 tank move_to_18
		accum 1 trigger_if_equal 19 tank move_to_19
	}

	trigger move_to_0
	{
		trigger self run_continue
	}

	trigger move_to_1
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_0 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_2
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_1 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_3
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_2 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_4
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_3 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_5
	{
		trigger self tracks_forward
		accum 3 bitset 3
		trigger game_manager anunt_allies3
		followspline 0 path_4 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_6
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_5 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_7
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_6 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_8
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_7 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_9
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_8 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_10
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_9 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_11
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_10 75 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_12
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_11 65 wait length -64
		trigger tank_turret facewall
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_13
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_12 55 wait length -64
		trigger self schimbaretun1
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_14
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_13 40 wait length -64
		trigger tank_turret facewall2
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_15
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_14 50 wait length -64
		trigger self schimbaretun2
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_16
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_15 50 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger move_to_17
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_16 20 wait length -64
		trigger tank_turret facewall3
		accum 3 bitreset 3
		trigger self run_continue
	}
    trigger schimbaretun1
	{
	accum 5 abort_if_not_equal 1
	setstate atac1_fiu invisible
	setstate atac2_fiu default
	accum 5 inc 1
	trigger game_manager anunt_axis4
	wm_announce "Cannon target changed^1!!!"
	}
	trigger schimbaretun2
	{
	accum 6 abort_if_not_equal 1
	setstate atac2_fiu invisible
	setstate atac3_fiu default
	trigger game_manager anunt_axis4
	wm_announce "Cannon target changed^1!!!"
	}
	trigger move_to_18
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_17 20 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}
	trigger move_to_19
	{
		trigger self tracks_forward
		accum 3 bitset 3
		followspline 0 path_18 20 wait length -64
		accum 3 bitreset 3
		trigger self run_continue
	}

	trigger barricade1_constructed
	{
		accum 3 bitset 7
	}
	trigger barricade1_destroyed
	{
		accum 3 bitreset 7
	}

	trigger barricade2_constructed
	{
		accum 3 bitset 8
	}
	trigger barricade2_destroyed
	{
		accum 3 bitreset 8
	}

	trigger barricade3_constructed
	{
		accum 3 bitset 9
	}
	trigger barricade3_destroyed
	{
		accum 3 bitreset 9
	}

	//-----------------------------------
	// Turret
	//-----------------------------------
	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom noloop
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}
}
	mainwall
{
	spawn
	{
		wait 200
	}
	death
	{
		alertentity mainwall_explo
		trigger game_manager anunt_allies4
	}
}
	secondwall
{
	spawn
	{
		wait 200
	}
	death
	{
		alertentity secondwall_explo
		trigger game_manager anunt_allies5
	}
}
	thirdwall
{
	spawn
	{
		wait 200
	}
	death
	{
		alertentity thirdwall_explo
		trigger game_manager anunt_allies6
	}
}
mainwall_explo
{
	spawn
	{
		wait 200
	}
}
secondwall_explo
{
spawn
{
wait 200
}
}
thirdwall_explo
{
spawn
{
wait 200
}
}
tank_shell
{
	spawn
	{
		wait 400
		attachtotag tank tag_tank
	}
}

//target_script_trigger
tank_disabler
{
	trigger run
	{
		trigger tank tank_disable
	}
}

//target_script_trigger
tank_enabler
{
	trigger run
	{
		trigger tank tank_enable
	}
}

//trigger_multiple
tank_trigger
{
	spawn
	{
		wait 100
		attachtotag tank_shell tag_turret
	}
}

//trigger_objective_info
tank_build
{
	spawn
	{
		wait 100
		attachtotag tank_shell tag_turret
	}
}

//func_constructible
tank_construct
{
	spawn
	{
		wait 400

		kill tank

		constructible_class 2
		constructible_health 1200
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank
		wm_announce "^5The tank has been repaired"
	}

	trigger final_pos
	{
		constructible_constructxpbonus 2
		constructible_destructxpbonus 5
	}
}

//misc_gamemodel
tank_turret
{
	spawn
	{
		wait 500
		attachtotag tank_shell tag_turret
	}
		trigger facewall
	{
		//trigger tank_turret spin_start
		//faceangles 0 150 0 4000
		//trigger tank_turret spin_stop
		wait 1000
		trigger tank_turret spin_fire
		trigger tank_flash runner
		alertentity mainwall
		wait 2000
		trigger tank dezactivat1
	}
	trigger facewall2
	{
		trigger tank_turret spin_start
		faceangles 0 -30 0 3000
		trigger tank_turret spin_stop
		trigger tank_turret spin_fire
		trigger tank_flash runner
		alertentity secondwall
		wait 2000
		trigger tank_turret spin_start
		faceangles 0 0 0 3000
		trigger tank_turret spin_stop
		wait 800
		trigger tank barricade2_destroyed
		trigger tank dezactivat2
	}
	trigger facewall3
	{
		trigger tank_turret spin_start
		faceangles 0 -30 0 3000
		trigger tank_turret spin_stop
		trigger tank_turret spin_fire
		trigger tank_flash runner
		alertentity thirdwall
		wait 2000
		trigger tank_turret spin_start
		faceangles 0 0 0 3000
		trigger tank_turret spin_stop
		wait 800
		trigger tank barricade3_destroyed
		trigger tank dezactivat3
	}
	
	trigger spin_fire
	{
		playsound sound/vehicles/tank/tank_fire.wav volume 560
	}

	trigger spin_start
	{
		stopsound
		playsound sound/vehicles/tank/turret_spin.wav looping volume 155
	}

	trigger spin_stop
	{
		stopsound
		playsound sound/vehicles/tank/turret_end.wav volume 135
	}
}

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

tank_flash
{
	spawn
	{
		setstate tank_flash default
		wait 100
		trigger tank_flash run
	}
	trigger run
	{
 		attachtotag tank_turret tag_flash
		faceangles 0 90 0 50
		//resetscript
		wait 50
		setstate tank_flash invisible
	}
	trigger runner
	{
	   setstate tank_flash default
	   wait 300
	   setstate tank_flash invisible
	 }
}
//=============================================================================
//=== Barricade 1 Mapscript
//=============================================================================
defense1
{
	spawn
	{
		wait 400
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default
		constructible_class 1
		constructible_chargebarreq 1.0
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}
	buildstart final
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default
	}
	built final
	{
		setstate defense1_materials invisible
		setstate defense1_materials_clip invisible
		setstate defense1_flag invisible
		//inform the tank that this barricade has been built
		trigger tank barricade1_constructed
		wm_announce "Barricade 1 has been constructed."
	}
	decayed final
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default
	}
	death
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default
		trigger tank barricade1_destroyed
	}
	trigger remove
	{
		setstate defense1_toi invisible
		setstate defense1_materials invisible
		setstate defense1_materials_clip invisible
		setstate defense1_flag invisible
		remove
	}
}
//=============================================================================
//=== Barricade 2 Mapscript
//=============================================================================
defense2
{
	spawn
	{
		wait 400
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
		constructible_class 1
		constructible_chargebarreq 1.0
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}
	buildstart final
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
	}
	built final
	{
		setstate defense2_materials invisible
		setstate defense2_materials_clip invisible
		setstate defense2_flag invisible
		//inform the tank that this barricade has been built
		trigger tank barricade2_constructed
		wm_announce "Barricade 2 has been constructed."
	}
	decayed final
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
	}
	death
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
		trigger tank barricade2_destroyed
	}
	trigger remove
	{
		setstate defense2_toi invisible
		setstate defense2_materials invisible
		setstate defense2_materials_clip invisible
		setstate defense2_flag invisible
		remove
	}
}
//=============================================================================
//=== Barricade 3 Mapscript
//=============================================================================
defense3
{
	spawn
	{
		wait 400
		setstate defense3_materials default
		setstate defense3_materials_clip default
		setstate defense3_flag default
		constructible_class 1
		constructible_chargebarreq 1.0
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}
	buildstart final
	{
		setstate defense3_materials default
		setstate defense3_materials_clip default
		setstate defense3_flag default
	}
	built final
	{
		setstate defense3_materials invisible
		setstate defense3_materials_clip invisible
		setstate defense3_flag invisible
		//inform the tank that this barricade has been built
		trigger tank barricade3_constructed
		wm_announce "Barricade 3 has been constructed."
	}
	decayed final
	{
		setstate defense3_materials default
		setstate defense3_materials_clip default
		setstate defense3_flag default
	}
	death
	{
		setstate defense3_materials default
		setstate defense3_materials_clip default
		setstate defense3_flag default
		trigger tank barricade3_destroyed
	}
	trigger remove
	{
		setstate defense3_toi invisible
		setstate defense3_materials invisible
		setstate defense3_materials_clip invisible
		setstate defense3_flag invisible
		remove
	}
}
//Restul de script din heli27
lock_cp
{
    spawn
	    {
		   wait 100
		   setstate lock_cp default
		   accum 1 set 0
		 }
	trigger dispare
	     {
		 wait 50
		 setstate lock_cp invisible
		 trigger blocada2 dispare
		 }
	trigger apare
	{
	setstate lock_cp default
	}
}
control_usa
{
	spawn
	{
		wait 200
                constructible_class 3
                setstate fum_porti_distrus invisible
	}

	death
	{
                wm_announce "Door control is destroyed^1!!!"
				trigger game_manager us1
                trigger phasedoor2 move_up
                trigger lock_cp dispare
				trigger doorbutton setup
				wm_objective_status 3 0 2
		        wm_objective_status 3 1 1
	}
}
//CAMIOANE BUTOANE PORTI ROTITOARE AURE bla bla..
lever
{
	spawn
	{
	}

	trigger move_up
	{
		playsound sound/movers/switches/switch.wav
	}
	
	trigger move_down
	{
		playsound sound/movers/switches/butn2.wav
	}
}

lever_trigger
{
	spawn
	{
		accum 1 set 1
	}

	trigger up
	{
		accum 1 abort_if_not_equal 1
		accum 1 set 0

		trigger lever move_up
		trigger door2 move_up
		//trigger door3 move_up

		alertentity door_open_trigger

		trigger sounds off

		wm_announce "The Loading Doors are Opening!"

		wm_objective_status 5 0 2
		wm_objective_status 5 1 1

		wait 2500

		setstate allies_lever_trigger invisible
		setstate axis_lever_trigger default

		trigger lever_trigger2	setaccum0

		
		//trigger golddoor1 auf
		//trigger golddoor2 auf
	}
	
	trigger setaccum1
	{
		accum 1 set 1
	}

}

sounds
{
	spawn
	{
	}

	off
	{
		wait 10000

		alertentity door_open_trigger
	}
	
	offer
	{
		wait 5000
		
		alertentity door_open_trigger
	}
}

lever_trigger2
{
	spawn
	{
		accum 2 set 1
	}
	
	trigger down
	{
		accum 2 abort_if_not_equal 0
		accum 2 set 1

		trigger lever move_down
		trigger door2 move_down
		//trigger door3 move_down

		wm_announce "The Loading Doors are Closing!"

		wait 2500

		setstate allies_lever_trigger default
		setstate axis_lever_trigger invisible

		alertentity door_open_trigger

		trigger sounds offer

		trigger lever_trigger setaccum1

		//trigger golddoor1 zu
		//trigger golddoor2 zu
	}

	trigger setaccum0
	{
		accum 2 set 0
	}
}


door2
{
	spawn
	{
	}

	trigger move_up
	{
		wait 500

		playsound sound/movers/misc/big_gate1.wav

		wait 400

		playsound sound/movers/misc/big_gate2.wav looping forever

		gotomarker door2_uppos 32 wait

		stopsound

		playsound sound/movers/misc/big_gate3.wav
	}
	
	trigger move_down
	{
		wait 500

		playsound sound/movers/misc/big_gate1.wav

		wait 400

		playsound sound/movers/misc/big_gate2.wav looping forever

		gotomarker door2_downpos 32 wait

		stopsound

		playsound sound/movers/misc/big_gate3.wav
	}
}

door3
{
	spawn
	{
	}

	trigger move_up
	{
		wait 500

		playsound sound/movers/misc/big_gate1.wav

		wait 400

		playsound sound/movers/misc/big_gate2.wav looping forever

		gotomarker door3_uppos 32 wait

		stopsound

		playsound sound/movers/misc/big_gate3.wav
	}
	
	trigger move_down
	{
		wait 500

		playsound sound/movers/misc/big_gate1.wav

		wait 400

		playsound sound/movers/misc/big_gate2.wav looping forever

		gotomarker door3_downpos 32 wait

		stopsound

		playsound sound/movers/misc/big_gate3.wav
	}
}

golddoor1
{
	spawn
	{
	}

	trigger auf
	{
		wait 500

		playsound sound/movers/doors/door5_open.wav

		faceangles 0 270 0 3000

	}
	
	trigger zu
	{
		wait 500

		playsound sound/movers/doors/door5_close.wav

		faceangles 0 0 0 3000


	}

	trigger bewege
	{
		gotomarker golddoor1point 1000 wait
	}
}

golddoor2
{
	spawn
	{
	}

	trigger auf
	{
		wait 500

		playsound sound/movers/doors/door5_open.wav

		faceangles 0 270 0 3000

	}
	
	trigger zu
	{
		wait 500

		playsound sound/movers/doors/door5_close.wav

		faceangles 0 0 0 3000
		
	}

	trigger bewege
	{
		gotomarker golddoor2point 1000 wait
	}

	trigger schnellzu
	{
		faceangles 0 0 0 1
	}
}
doorbutton
{
	spawn
	{
		wait 400
		trigger doorbutton nosetup

		constructible_class 2

		setstate axis_lever_trigger invisible
		setstate allies_lever_trigger invisible
	}

	trigger setup
	{
		setstate doorbutton_materials default
		setstate doorbutton_materials_clip default
		setstate doorbutton_toi default
	}
	trigger nosetup
	{
		 setstate doorbutton_materials invisible
		 setstate doorbutton_materials_clip invisible
		 setstate doorbutton_toi invisible
    }
	buildstart final
	{
		setstate doorbutton_materials default
		setstate doorbutton_materials_clip default
	}

	built final
	{
		setstate axis_lever_trigger default
		setstate allies_lever_trigger default

		setstate doorbutton_materials invisible
		setstate doorbutton_materials_clip invisible
		setstate doorbutton_toi invisible

		setstate forwardbunkerflag invisible

		setstate forwardbunker_wo default

		accum 0 trigger_if_equal 0 forwardbunkerflag switchit	
		wm_announce "Gate Controls have been constructed."

		trigger golddoor1 auf

		wm_teamvoiceannounce 0 us_constructioncompleted
		wm_teamvoiceannounce 1 us_constructioncompleted
		wm_objective_status 4 0 2
		wm_objective_status 4 1 1
	}

	decayed final
	{
		setstate doorbutton_materials default
		setstate doorbutton_materials_clip default
	}

	death
	{	
	}

	trigger remove
	{
		setstate doorbutton_toi invisible
		setstate doorbutton_materials invisible
		setstate doorbutton_materials_clip invisible

		remove
	}
}
//ALTE PORTI
phasedoor2
{
	spawn
	{
		wait 200
		gotomarker phasedoor2_pc2 1000
	}
	
	trigger move_up
	{
		wait 500
		playsound sound/movers/misc/garage_door_start_01.wav
		wait 400
		playsound sound/movers/misc/garage_door_loop_01.wav looping forever
		gotomarker phasedoor2_pc1 80 wait
		stopsound
		playsound sound/movers/misc/garage_door_end_01.wav
	}
}
spatep2
{
	spawn
	{
		wait 200
		gotomarker spatep1_pc2 1000
	}
	
	trigger move_up
	{
		wait 500
		playsound sound/movers/misc/garage_door_start_01.wav
		wait 400
		playsound sound/movers/misc/garage_door_loop_01.wav looping forever
		gotomarker spatep1_pc1 80 wait
		stopsound
		playsound sound/movers/misc/garage_door_end_01.wav
	}
	trigger move_down
	{
	wait 500
	playsound sound/movers/misc/garage_door_start_01.wav
	wait 400
	playsound sound/movers/misc/garage_door_loop_01.wav looping forever
	gotomarker spatep1_pc2 80 wait
	stopsound
	playsound sound/movers/misc/garage_door_end_01.wav	
	}
}
//AURE MALAURE
//####FIRST
allied_gold_captured 
{
        spawn 
        {
                setstate allied_gold_captured invisible
        }
        trigger enable 
        {
                setstate allied_gold_captured default
                //attachtotag truck tag_obj1
                //faceangles 0 83 0 10
				trigger allied_goldtwo_captured check
        }
}
allied_goldone_red
    {
        spawn
		{
		        wait 100
				//attachtotag truck tag_obj1
                //faceangles 0 83 0 10
				setstate allied_goldone_red default
		}
		trigger disparitie
		{
		        wait 100
				setstate allied_goldone_red invisible
		}
}
allied_gold 
{ 
spawn 
{
wait 200 
accum 1 set 0
} 
trigger stolen 
{ 
wm_announce "Return the Allied gold to the getaway truck" 
wm_announce "Allies stolen the First Gold^1!!" 
setstate allied_gold_cm_marker invisible 
} 
trigger returned 
{ 
wm_announce "Axis have retrieved the gold" 
setstate allied_gold_cm_marker default 
wm_teamvoiceannounce 1 us_firstgoldcratereturned
wm_teamvoiceannounce 0 a_firstgoldcratereturned
} 
trigger captured 
{ 
trigger conditie_castigare check
wm_announce "Allied secured the First Gold^1!!" 
trigger allied_gold_captured enable
trigger allied_goldone_red  disparitie
wm_teamvoiceannounce 1 us_firstgoldcratesecured
wm_teamvoiceannounce 0 a_securedfirstgoldcrate
trigger allied_gold  check
} 
trigger check
{
accum 1 inc 1
accum 1 abort_if_not_equal 2
trigger game_manager allies_win
}
} 
//###SECOND
allied_goldtwo_captured 
{
        spawn 
        {
		        wait 500
                setstate allied_goldtwo_captured invisible
        }
        trigger enable 
        {
                setstate allied_goldtwo_captured default
                //attachtotag truck tag_obj2
                //faceangles 0 83 0 10
        }
}
allied_goldtwo_red
    {
        spawn
		{
		        wait 100
				//attachtotag truck tag_obj2
                //faceangles 0 83 0 10
				setstate allied_goldtwo_red default
		}
		trigger disparitie
		{
		        wait 100
				setstate allied_goldtwo_red invisible
		}
}
allied_goldtwo 
{ 
spawn 
{ 
wait 200 
} 
trigger stolen 
{ 
wm_announce "Allies stolen the Second Gold^1!!" 
setstate marcator_secundar invisible 
} 
trigger returned 
{ 
wm_announce "Axis returned the gold^1!!" 
wm_teamvoiceannounce 1 us_secondgoldcratereturned
wm_teamvoiceannounce 0 a_secondgoldcratereturned
setstate marcator_secundar default 
} 
trigger captured 
{ 
trigger conditie_castigare check
wm_announce "Allied captured the Second Gold^1!!" 
trigger allied_goldtwo_captured enable
trigger allied_goldtwo_red  disparitie
wm_teamvoiceannounce 1 us_secondgoldcratesecured
wm_teamvoiceannounce 0 a_securedsecondgoldcrate
wait 100
trigger allied_gold check
} 
} 
blocada2
{
spawn
{
setstate blocada2 default
}
trigger dispare
{
setstate blocada2 invisible
}
}
//=============================================================================
//=== CP Allies Mapscript
//=============================================================================
//func_constructible
allies_cp_built
{
	spawn
	{
		wait 50
		constructible_class 2
		constructible_chargebarreq 1.0
		constructible_constructxpbonus 7
		constructible_destructxpbonus 7
		trigger self closed
	}

	buildstart final
	{
		trigger self underconstruction
	}
	built final
	{
		trigger self fixed
		trigger self enable
		trigger tank_spawn_wobj on
        trigger axosu_wobj on
		wm_announce "Command Post constructed/Spawn changed^1!!!"
		wm_teamvoiceannounce 1 us_cpconstructed
		wm_teamvoiceannounce 0 a_cpconstructed
		wait 700
		 wm_teamvoiceannounce 1 us_westbunkercaptured
	     wm_teamvoiceannounce 0 a_bunkercaptured
	}
	decayed final
	{
		trigger self closed
	}
	death
	{
		trigger self damaged
		trigger self disable
		wait 100
		trigger tank_spawn_wobj off
		trigger axosu_wobj off
		wm_announce "Command Post destroyed^1!!!"
		wm_teamvoiceannounce 1 us_cpdamaged
		wm_teamvoiceannounce 0 a_constructiondestroyed
		wait 700
		wm_teamvoiceannounce 1 us_bunkerretaken
		wm_teamvoiceannounce 0 a_bunkerrecaptured
	}

	trigger underconstruction
	{
		setstate allies_cp_closed_model invisible
		setstate allies_cp_built_model underconstruction
		setstate allies_cp_damaged_model invisible
	}
	trigger closed
	{
		setstate allies_cp_closed_model default
		setstate allies_cp_built_model invisible
		setstate allies_cp_damaged_model invisible
	}
	trigger fixed
	{
		setstate allies_cp_closed_model invisible
		setstate allies_cp_built_model default
		setstate allies_cp_damaged_model invisible
	}
	trigger damaged
	{
		setstate allies_cp_closed_model invisible
		setstate allies_cp_built_model invisible
		setstate allies_cp_damaged_model default
	}

	trigger enable
	{
		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 1 1
		//enablespeaker sound_cp_allies
	}
	trigger disable
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
		//disablespeaker sound_cp_allies
	}
}
//Spawnuri deochiate
axosu_wobj
{
   	spawn
	{
	  wait 200
	  setstate axosu_wobj invisible
	}
	trigger off
    {
	  trigger axsp1 on
	  setautospawn "Heli Spawn" 0
      setstate axosu_wobj invisible
      setstate axosu_pioni invisible
	  alertentity axosu_pioni
    }
    trigger on
    {
      setstate axosu_wobj default
      setstate axosu_pioni default
	  alertentity axosu_pioni
	  setautospawn    "axosu"   0
	  trigger axsp1 off
    }
	trigger allied_capture 
	{
		//
	}
    trigger axis_capture
    {
	    //
    }
}
tank_spawn_wobj
{
   	spawn
	{
	  wait 200
	  setstate tank_spawn_wobj invisible
	}
	trigger off
    {
	  setautospawn "elicopteru" 1
      setstate tank_spawn_wobj invisible
      setstate tank_spawn_spawns invisible
	  alertentity tank_spawn_spawns
	  //wm_announce ""
    }
    trigger on
    {
      setstate tank_spawn_wobj default
      setstate tank_spawn_spawns default
	  alertentity tank_spawn_spawns
	  setautospawn    "tank spawn"   1
	  wait 700
	  }
	trigger allied_capture 
	{
		//
	}
    trigger axis_capture
    {
	    //
    }
}
axsp1
{
   	spawn
	{
	}
	trigger off
    {
      setstate axsp1 invisible
      setstate axis_spawn invisible
	  //alertentity tank_spawn_spawns
	  //wm_announce "Allied spawn lost.."
    }
    trigger on
    {
      setstate axsp1 default
      setstate axis_spawn default
	  alertentity axis_spawn
    }
	trigger allied_capture 
	{
		//
	}
    trigger axis_capture
    {
	    //
    }
} 
//CANON CANON
gun_control
{
	spawn
	{
	    accum 2 set 0
		wait 200
		constructible_class 2
		trigger gun_control setup
	}

	trigger setup
	{
		setstate gun_control invisible
		//trigger control_stricat apare
		trigger fum_control apare
	}

	buildstart final
	{
		setstate gun_control underconstruction
		//trigger buton_cannon apare
	}

	built final
	{
	    wait 100
		trigger game_manager anunt_axis1
		trigger game_manager anunt_allies1
		setstate gun_control invisible
		setstate buton_rosu invisible
		setstate buton_verde default
        wm_announce	"Gun control constructed^1!!!"
		setstate us_fire default
		trigger fum_control dispare
		trigger tun_sanatos apare
		trigger tun_mort dispare
		trigger heeli2_go apare
		wait 500
		setstate heeli2_fiu default
		accum 2 inc 1
		accum 2 abort_if_not_equal 1
		wait 50
	}
	death
	{
		setstate gun_control invisible
		//trigger control_stricat apare
		wm_announce	"The Allied gun control has been destroyed^1!!"
		//trigger buton_cannon dispare
		//setstate buton_cannon invisible
		trigger fum_control apare
		setstate tun_sanatos invisible
		setstate tun_mort default
		wait 500
		setstate heeli2_fiu default
	}

	decayed final
	{
		setstate gun_control invisible
	}
}
//control_stricat
//{
//spawn
//{
//setstate control_stricat invisible
//}
//trigger apare
//{
//setstate control_stricat default
//}
//trigger dispare
//{
//setstate control_stricat invisible
//}
//}
fum_control
{
spawn
{
setstate fum_control invisible
}
trigger apare
{
setstate fum_control default
}
trigger dispare
{
setstate fum_control invisible
}
}
tun_sanatos
{
spawn
{
wait 100
setstate tun_sanatos invisible
}
trigger apare
{
setstate tun_sanatos default
}
trigger dispare
{
wait 100
setstate tun_sanatos invisible
}
}
tun_mort
{
spawn
{
wait 100
setstate tun_mort default
}
trigger apare
{
wait 100
setstate tun_mort default
}
trigger dispare
{
wait 100
setstate tun_mort invisible
}
}
gunflash
{
spawn
{
wait 500
setstate gunflash invisible
}
trigger apare
{
setstate gunflash default
wait 500
setstate gunflash invisible
}
}
//Actionare buton aliati
  heeli2_go
{
    spawn
	{
	accum 1 set 0
	accum 2 set 0
	accum 3 set 0
	wait 100
	setstate heeli2_fiu invisible
	}
	trigger main
	{
	setstate heeli2_fiu invisible
	alertentity gunsound
	trigger heeli2_go secondscreen
	setstate us_fire invisible
	trigger game_manager fires_left
	accum 1 inc 1
	//wait 50
	accum 2 inc 1
	trigger gunflash apare
	//wait 50
	trigger buton_rosu actionare
	trigger heeli2_go intermediar
	//wait 50
	trigger heeli2_go deathgate
	}
	trigger secondscreen
	{
	trigger clock reset
	trigger clock scadentul
	 //trigger self secondscreen
	accum 3 inc 1
	accum 3 abort_if_greater_than 2
	setstate us_charging default
	//da
	}
	trigger secondscreenback
	{
	accum 3 abort_if_greater_than 2
	setstate us_fire default
	setstate us_charging invisible
	}
	trigger intermediar
	{
	accum 2 abort_if_not_equal 1
	wait 600
	setstate tankwall_h invisible
	setstate tankwall_d default
	}
	trigger deathgate
	{
	accum 1 abort_if_not_equal 3
	wait 750
	setstate tankwall_d invisible
	setstate heeli2_fiu invisible
	trigger game_manager anunt_allies2
	wm_objective_status 1 0 2
	wm_objective_status 1 1 1
	}
	
    trigger apare
	{
	setstate heeli2fiu default
	}
	trigger dispare
	{
	setstate heeli2fiu invisible
	}
}
clock
{
spawn
{
accum 3 set 21
accum 4 set 0
accum 5 set 16
}
	trigger scadentul
	{
	wait 1000
	accum 3 inc -1
	trigger self timer
	}
	trigger reset
	{
	accum 3 set 21
	}
	trigger timer
	{
	accum 3 trigger_if_equal 20 clock run20
	accum 3 trigger_if_equal 19 clock run19   
   	accum 3 trigger_if_equal 18 clock run18
	accum 3 trigger_if_equal 17 clock run17
	accum 3 trigger_if_equal 16 clock run16
	accum 3 trigger_if_equal 15 clock run15
	accum 3 trigger_if_equal 14 clock run14
	accum 3 trigger_if_equal 13 clock run13
	accum 3 trigger_if_equal 12 clock run12
	accum 3 trigger_if_equal 11 clock run11
	accum 3 trigger_if_equal 10 clock run10
	accum 3 trigger_if_equal 9 clock run9
	accum 3 trigger_if_equal 8 clock run8
	accum 3 trigger_if_equal 7 clock run7
	accum 3 trigger_if_equal 6 clock run6
	accum 3 trigger_if_equal 5 clock run5
	accum 3 trigger_if_equal 4 clock run4
	accum 3 trigger_if_equal 3 clock run3
	accum 3 trigger_if_equal 2 clock run2
	accum 3 trigger_if_equal 1 clock run1
	accum 3 trigger_if_equal 0 clock run0
	trigger self scadentul
	}
	trigger run20
	{
	remapshader textures/digits/time_xx0x textures/digits/time_xxx2
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx0
	remapshaderflush
	}
	trigger run19
	{
	remapshader textures/digits/time_xx0x textures/digits/time_xxx1
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx9
	remapshaderflush
	}
	trigger run18
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx8
	remapshaderflush
	}
	trigger run17
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx7
	remapshaderflush
	}
	trigger run16
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx6
	remapshaderflush
	}
	trigger run15
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx5
	remapshaderflush
	}
	trigger run14
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx4
	remapshaderflush
	}
	trigger run13
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx3
	remapshaderflush
	}
	trigger run12
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx2
	remapshaderflush
	}
	trigger run11
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx1
	remapshaderflush
	}
	trigger run10
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx0
	remapshaderflush
	}
	trigger run9
	{
	remapshader textures/digits/time_xx0x textures/digits/time_xxx0
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx9
	remapshaderflush
	}
	trigger run8
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx8
	remapshaderflush
	}
	trigger run7
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx7
	remapshaderflush
	}
	trigger run6
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx6
	remapshaderflush
	}
	trigger run5
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx5
	remapshaderflush
	}
	trigger run4
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx4
	remapshaderflush
	}
	trigger run3
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx3
	remapshaderflush
	}
	trigger run2
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx2
	remapshaderflush
	alertentity gunreload
	}
	trigger run1
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx1
	remapshaderflush
	accum 4 abort_if_less_than  2
	setstate us_charging invisible
	setstate us_fire invisible
	setstate a_fire default
	setstate atac1_fiu default
	trigger game_manager anunt_axis2
	}
	trigger run0
	{
	trigger clock axis_time_conditie
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx0
	remapshaderflush
	accum 4 inc 1
	accum 4 abort_if_greater_than 2
	setstate heeli2_fiu default
	trigger heeli2_go secondscreenback
	trigger game_manager anunt_axis3
	wm_teamvoiceannounce 1 us_firetherailgun
	}
	//TIMER NEMTI
	trigger scadentul2
	{
	wait 1000
	accum 5 inc -1
	trigger self timer2
	}
	trigger reset2
	{
	accum 5 set 16
	}
	trigger timer2
	{
	accum 5 trigger_if_equal 15 clock run15b
	accum 5 trigger_if_equal 14 clock run14b
	accum 5 trigger_if_equal 13 clock run13b
	accum 5 trigger_if_equal 12 clock run12b
	accum 5 trigger_if_equal 11 clock run11b
	accum 5 trigger_if_equal 10 clock run10b
	accum 5 trigger_if_equal 9 clock run9b
	accum 5 trigger_if_equal 8 clock run8b
	accum 5 trigger_if_equal 7 clock run7b
	accum 5 trigger_if_equal 6 clock run6b
	accum 5 trigger_if_equal 5 clock run5b
	accum 5 trigger_if_equal 4 clock run4b
	accum 5 trigger_if_equal 3 clock run3b
	accum 5 trigger_if_equal 2 clock run2b
	accum 5 trigger_if_equal 1 clock run1b
	accum 5 trigger_if_equal 0 clock run0b
	trigger self scadentul2
	}
	trigger run15b
	{
	remapshader textures/digits/time_xx0x textures/digits/time_xxx1
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx5
	remapshaderflush
	}
	trigger run14b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx4
	remapshaderflush
	}
	trigger run13b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx3
	remapshaderflush
	}
	trigger run12b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx2
	remapshaderflush
	}
	trigger run11b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx1
	remapshaderflush
	}
	trigger run10b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx0
	remapshaderflush
	}
	trigger run9b
	{
	remapshader textures/digits/time_xx0x textures/digits/time_xxx0
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx9
	remapshaderflush
	}
	trigger run8b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx8
	remapshaderflush
	}
	trigger run7b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx7
	remapshaderflush
	}
	trigger run6b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx6
	remapshaderflush
	}
	trigger run5b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx5
	remapshaderflush
	}
	trigger run4b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx4
	remapshaderflush
	}
	trigger run3b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx3
	remapshaderflush
	}
	trigger run2b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx2
	remapshaderflush
	alertentity gunreload
	}
	trigger run1b
	{
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx1
	remapshaderflush
	}
	trigger run0b
	{
	//trigger clock axis_time_conditie
	remapshader textures/digits/time_xxx0 textures/digits/time_xxx0
	remapshaderflush
	setstate a_charging invisible
	setstate a_fire default
	setstate buton_rosu invisible
	setstate buton_verde default
	}
}
//Actionare buton nemti
atac1_go
{
    spawn
	{
	wait 150
	setstate atac1_fiu invisible
	}
	trigger launch
	{
	alertentity gunsound
	trigger gunflash apare
	setstate a_fire invisible
	setstate a_charging default
	trigger clock reset2
	trigger clock scadentul2
	setstate buton_verde invisible
	setstate buton_rosu default
	}
	trigger dispare
	{
	setstate atac1_fiu invisible
	}
	trigger apare
	{
	setstate atac1_fiu default
	}
}
atac2_go
{
    spawn
	{
	wait 100
	setstate atac2_fiu invisible
	}
	trigger launch2
	{
	alertentity gunsound
	setstate a_fire invisible
	setstate a_charging default
	trigger clock reset2
	trigger clock scadentul2
	trigger gunflash apare
	setstate buton_verde invisible
	setstate buton_rosu default
	}
	trigger efectuare
	{
	}
	trigger dispare
	{
	setstate atac2_fiu invisible
	}
	trigger apare
	{
	setstate atac2_fiu default
	}
}
atac3_go
{
    spawn
	{
	wait 100
	setstate atac3_fiu invisible
	}
	trigger launch3
	{
	alertentity gunsound
	setstate a_fire invisible
	setstate a_charging default
	trigger clock reset2
	trigger clock scadentul2
	trigger gunflash apare
	setstate buton_verde invisible
	setstate buton_rosu default
	}
	trigger dispare
	{
	setstate atac3_fiu invisible
	}
	trigger apare
	{
	setstate atac3_fiu default
	}
}
tankwall_h
{
spawn
{
setstate tankwall_h default
}
trigger dispare
{
setstate tankwall_h invisible
}
}
tankwall_d
{
spawn
{
setstate tankwall_d invisible
}
trigger apare
{
setstate tankwall_d default
}
trigger dispare
{
setstate tankwall_d invisible
}
}
//Butoane
buton_rosu
{
spawn
{
setstate buton_rosu default
}
trigger apare
{
setstate buton_rosu default
}
trigger dispare
{
setstate buton_rosu invisible
}
trigger actionare
{
setstate buton_rosu default
setstate buton_verde invisible
wait 20000
setstate buton_rosu invisible
setstate buton_verde default
}
}
buton_verde
{
spawn
{
setstate buton_verde invisible
}
trigger apare
{
setstate buton_verde default
}
trigger dispare
{
setstate buton_verde invisible
}
}
us_charging
{
spawn
{
wait 1000
setstate us_charging invisible
}
}
us_fire
{
spawn
{
wait 1000
setstate us_fire invisible
}
}
a_charging
{
spawn
{
wait 1000
setstate a_charging invisible
}
}
a_fire
{
spawn
{
wait 1000
setstate a_fire invisible
}
}


