game_manager
{
	spawn
	{
		wait 50
		wm_axis_respawntime 10		// Axis respawn time
		wm_allied_respawntime 10	// Allied respawn time
		wm_set_round_timelimit 30	// Map timelimit
		
		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team 0
		
		// Winner on expiration of round timer (0=Axis, 1=Allies)
		wm_setwinner 0
	}
	trigger allies_win
	{
		wm_setwinner	1
		wm_announce "^1Allied team got trough with the ammo!"
		wait 3000
		wm_endround
	}
}

//=============================================================================
//=== Truck Mapscript
//=============================================================================
truck_smoke
{
	spawn
	{
		wait 300
		attachtotag truck tag_wfront
		setstate truck_smoke invisible
	}
}

// sound "thread"
truck_engine
{
	spawn
	{
		wait 200
		attachtotag truck tag_wfront
		trigger truck_engine sound_idle
	}
	trigger start
	{
		trigger truck_engine sound_start
		wait 950
		trigger truck_engine sound_move
	}
	trigger stop
	{
		trigger truck_engine sound_stop
		wait 950
		trigger truck_engine sound_idle
	}

	// ========================================
	// sound events
	trigger sound_idle
	{
		playsound sound/vehicles/truck/truck_idle.wav looping
	}
	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/truck/truck_revup.wav volume 96
	}
	trigger sound_move
	{
		playsound sound/vehicles/truck/truck_move.wav looping
	}
	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/truck/truck_revdown.wav volume 96
	}
	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/truck/truck_stop.wav volume 96
	}
	// ========================================
}

truck_build
{
	spawn
	{
		wait 500
		attachtotag truck tag_wback
	}
}

truck_construct
{
	spawn
	{
		constructible_class 2
		constructible_health 1050
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}
	built final
	{
		alertentity truck
		wm_announce "The truck has been repaired!"
	}
}

// script_mover
//=============================================================================
//	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
//
truck
{
	spawn
	{
		wait 50
		constructible_chargebarreq 1.0
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
		followspline 0 path_00 10000 wait length -64
		trigger self barricade1_destroyed
		trigger self barricade2_destroyed
		trigger self barricade3_destroyed
	}
	// ========================================
	trigger script_lock
	{
		accum 0 inc 1
	}
	trigger script_unlock
	{
		accum 0 inc -1
	}
	// ========================================
	trigger wheels_forward
	{
		trigger truck_bwheel2 forward
		trigger truck_fwheel forward
	}
	trigger wheels_backward
	{
		trigger truck_bwheel2 backward
		trigger truck_fwheel backward
	}
	trigger wheels_stop
	{
		trigger truck_bwheel2 stop
		trigger truck_fwheel stop
	}
	// ========================================
	trigger truck_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 truck_engine start
		trigger self wheels_forward
		trigger self script_unlock

		trigger self move
	}
	trigger truck_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
	}
	// ========================================
	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 25
		accum 3 abort_if_not_bitset 7
		accum 3 bitset 1	// stuck
	}

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

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

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

	trigger stuck_check_scriptlockout
	{
		accum 0 abort_if_equal 0
		accum 3 bitset 1
	}
	// ========================================
	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
		trigger truck_engine stop
		trigger self wheels_stop
		trigger self script_unlock
		resetscript
	}
	// ========================================
	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 "^5The truck has been damaged"
		changemodel models/mapobjects/blitz_sd/blitzbody_damaged.md3
		setstate truck_smoke default
		kill truck_construct
		trigger truck_engine sound_death
		trigger self wheels_stop
		resetscript
	}
	rebirth
	{
		accum 3 bitreset 6 			// we're visibly alive
		accum 3 bitreset 0 			// we're alive again
		changemodel models/mapobjects/blitz_sd/blitzbody.md3
		setstate truck_smoke invisible
		trigger truck_engine sound_idle
	}
	death
	{
		accum 3 bitset 0
	}
	// ========================================
	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 truck move_to_0
		accum 1 trigger_if_equal 1 truck move_to_1
		accum 1 trigger_if_equal 2 truck move_to_2
		accum 1 trigger_if_equal 3 truck move_to_3
		accum 1 trigger_if_equal 4 truck move_to_4
		accum 1 trigger_if_equal 5 truck move_to_5
		accum 1 trigger_if_equal 6 truck move_to_6
		accum 1 trigger_if_equal 7 truck move_to_7
		accum 1 trigger_if_equal 8 truck move_to_8
		accum 1 trigger_if_equal 9 truck move_to_9
		accum 1 trigger_if_equal 10 truck move_to_10
		accum 1 trigger_if_equal 11 truck move_to_11
		accum 1 trigger_if_equal 12 truck move_to_12
		accum 1 trigger_if_equal 13 truck move_to_13
		accum 1 trigger_if_equal 14 truck move_to_14
		accum 1 trigger_if_equal 15 truck move_to_15
		accum 1 trigger_if_equal 16 truck move_to_16
		accum 1 trigger_if_equal 17 truck move_to_17
		accum 1 trigger_if_equal 18 truck move_to_18
		accum 1 trigger_if_equal 19 truck move_to_19
		accum 1 trigger_if_equal 20 truck move_to_20
		accum 1 trigger_if_equal 21 truck move_to_21
		accum 1 trigger_if_equal 22 truck move_to_22
		accum 1 trigger_if_equal 23 truck move_to_23
		accum 1 trigger_if_equal 24 truck move_to_24
		accum 1 trigger_if_equal 25 truck move_to_25
		accum 1 trigger_if_equal 26 truck move_to_26
		accum 1 trigger_if_equal 27 truck move_to_27
		accum 1 trigger_if_equal 28 truck move_to_28
		accum 1 trigger_if_equal 29 truck move_to_29
		accum 1 trigger_if_equal 30 truck move_to_30
		accum 1 trigger_if_equal 31 truck move_to_31
		accum 1 trigger_if_equal 32 truck move_to_32
		accum 1 trigger_if_equal 33 truck move_to_33
		accum 1 trigger_if_equal 34 truck move_to_34
		accum 1 trigger_if_equal 35 truck move_to_35
		accum 1 trigger_if_equal 36 truck move_to_36
		accum 1 trigger_if_equal 37 truck move_to_37
		accum 1 trigger_if_equal 38 truck move_to_38
		accum 1 trigger_if_equal 39 truck move_to_39
		accum 1 trigger_if_equal 40 truck move_to_40
		accum 1 trigger_if_equal 41 truck move_to_41
		accum 1 trigger_if_equal 42 truck move_to_42
		accum 1 trigger_if_equal 43 truck move_to_43
		accum 1 trigger_if_equal 44 truck move_to_44
		accum 1 trigger_if_equal 45 truck move_to_45
		accum 1 trigger_if_equal 46 truck move_to_46
		accum 1 trigger_if_equal 47 truck move_to_47
		accum 1 trigger_if_equal 48 truck move_to_48
		accum 1 trigger_if_equal 49 truck move_to_49
		accum 1 trigger_if_equal 50 truck move_to_50
		accum 1 trigger_if_equal 51 truck move_to_51
		accum 1 trigger_if_equal 52 truck move_to_52
		accum 1 trigger_if_equal 53 truck move_to_53
		accum 1 trigger_if_equal 54 truck move_to_54
		accum 1 trigger_if_equal 55 truck move_to_55
		accum 1 trigger_if_equal 56 truck move_to_56
		accum 1 trigger_if_equal 57 truck move_to_57
		accum 1 trigger_if_equal 58 truck move_to_58
		accum 1 trigger_if_equal 59 truck move_to_59
		accum 1 trigger_if_equal 60 truck move_to_60
		accum 1 trigger_if_equal 61 truck move_to_61
		accum 1 trigger_if_equal 62 truck move_to_62
		accum 1 trigger_if_equal 63 truck move_to_63
		accum 1 trigger_if_equal 64 truck move_to_64
		accum 1 trigger_if_equal 65 truck move_to_65
		accum 1 trigger_if_equal 66 truck move_to_66
		accum 1 trigger_if_equal 67 truck move_to_67
		accum 1 trigger_if_equal 68 truck move_to_68
		accum 1 trigger_if_equal 69 truck move_to_69
		accum 1 trigger_if_equal 70 truck move_to_70
		accum 1 trigger_if_equal 71 truck move_to_71
		accum 1 trigger_if_equal 72 truck move_to_72
		accum 1 trigger_if_equal 73 truck move_to_73
		accum 1 trigger_if_equal 74 truck move_to_74
		accum 1 trigger_if_equal 75 truck move_to_75
		accum 1 trigger_if_equal 76 truck move_to_76
		accum 1 trigger_if_equal 77 truck move_to_77
		accum 1 trigger_if_equal 78 truck move_to_78
		accum 1 trigger_if_equal 79 truck move_to_79
		accum 1 trigger_if_equal 80 truck move_to_80
		accum 1 trigger_if_equal 81 truck move_to_81
		accum 1 trigger_if_equal 82 truck move_to_82
		accum 1 trigger_if_equal 83 truck move_to_83
		accum 1 trigger_if_equal 84 truck move_to_84
		accum 1 trigger_if_equal 85 truck move_to_85
		accum 1 trigger_if_equal 86 truck move_to_86
		accum 1 trigger_if_equal 87 truck move_to_87
		accum 1 trigger_if_equal 88 truck move_to_88
		accum 1 trigger_if_equal 89 truck move_to_89
		accum 1 trigger_if_equal 90 truck move_to_90
		accum 1 trigger_if_equal 91 truck move_to_91
		accum 1 trigger_if_equal 92 truck move_to_92
		accum 1 trigger_if_equal 93 truck move_to_93
		accum 1 trigger_if_equal 94 truck move_to_94
		accum 1 trigger_if_equal 95 truck move_to_95
		accum 1 trigger_if_equal 96 truck move_to_96
		accum 1 trigger_if_equal 97 truck move_to_97
		accum 1 trigger_if_equal 98 truck move_to_98
		accum 1 trigger_if_equal 99 truck move_to_99
	}

	trigger move_to_0
	{
		trigger self run_continue
	}

	trigger move_to_1
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_0 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_2
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_1 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_3
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_2 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_4
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_3 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_5
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_4 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_6
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_5 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_7
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_6 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_8
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_7 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_9
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_8 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_10
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_9 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_11
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_10 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_12
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_11 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_13
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_12 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_14
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_13 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_15
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_14 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_16
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_15 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_17
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_16 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_18
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_17 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_19
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_18 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_20
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_19 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_21
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_20 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_22
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_21 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_23
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_22 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_24
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_23 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_25
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_24 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_26
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_25 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_27
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_26 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_28
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_27 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_29
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_28 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_30
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_29 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_31
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_30 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_32
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_31 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_33
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_32 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_34
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_33 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_35
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_34 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_36
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_35 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_37
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_36 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_38
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_37 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_39
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_38 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_40
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_39 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_41
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_40 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_42
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_41 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_43
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_42 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_44
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_43 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_45
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_44 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_46
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_45 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_47
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_46 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_48
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_47 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_49
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_48 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_50
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_49 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_51
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_50 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_52
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_51 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_53
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_52 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_54
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_53 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_55
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_54 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_56
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_55 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_57
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_56 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_58
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_57 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_59
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_58 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_60
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_59 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_61
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_60 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_62
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_61 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_63
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_62 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_64
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_63 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_65
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_64 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_66
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_65 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_67
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_66 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_68
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_67 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_69
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_68 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_70
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_69 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_71
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_70 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_72
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_71 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_73
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_72 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_74
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_73 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_75
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_74 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_76
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_75 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_77
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_76 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_78
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_77 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_79
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_78 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger self run_continue
	}

	trigger move_to_80
	{
		trigger self wheels_forward
		accum 3 bitset 3
		followspline 0 path_79 100 wait length -64
		accum 3 bitreset 3
		trigger self wheels_stop
		trigger game_manager allies_win
	}
	

	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
	}

}

truck_bwheel2
{
	spawn
	{
		wait 500
		attachtotag truck tag_wback
	}
	trigger forward
	{
		setrotation 130 0 0
	}
	trigger backward
	{
		setrotation -130 0 0
	}
	trigger stop
	{
		stoprotation
	}
}
truck_fwheel
{
	spawn
	{
		wait 500
		attachtotag truck tag_wfront
	}
	trigger forward
	{
		setrotation 130 0 0
	}
	trigger backward
	{
		setrotation -130 0 0
	}
	trigger stop
	{
		stoprotation
	}
}

truck_trigger
{
	spawn
	{
		wait 500
		attachtotag truck tag_wback
	}
}

truck_disabler
{
	trigger run
	{
		trigger truck truck_disable
	}
}

truck_enabler
{
	trigger run
	{
		trigger truck truck_enable
	}
}

//=============================================================================
//=== Barricade 1 Mapscript
//=============================================================================
defense1
{
	spawn
	{
		wait 400
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default
		constructible_class 3
		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 truck that this barricade has been built
		trigger truck 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 truck 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 3
		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 truck that this barricade has been built
		trigger truck 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 truck 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 3
		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 truck that this barricade has been built
		trigger truck 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 truck barricade3_destroyed
	}
	trigger remove
	{
		setstate defense3_toi invisible
		setstate defense3_materials invisible
		setstate defense3_materials_clip invisible
		setstate defense3_flag invisible
		remove
	}
}

//=============================================================================
//=== 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
	}
	decayed final
	{
		trigger self closed
	}
	death
	{
		trigger self damaged
		trigger self disable
	}

	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
	}
}


//=============================================================================
//=== CP Axis Mapscript
//=============================================================================
//func_constructible
axis_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
	}
	decayed final
	{
		trigger self closed
	}
	death
	{
		trigger self damaged
		trigger self disable
	}

	trigger underconstruction
	{
		setstate axis_cp_closed_model invisible
		setstate axis_cp_built_model underconstruction
		setstate axis_cp_damaged_model invisible
	}
	trigger closed
	{
		setstate axis_cp_closed_model default
		setstate axis_cp_built_model invisible
		setstate axis_cp_damaged_model invisible
	}
	trigger fixed
	{
		setstate axis_cp_closed_model invisible
		setstate axis_cp_built_model default
		setstate axis_cp_damaged_model invisible
	}
	trigger damaged
	{
		setstate axis_cp_closed_model invisible
		setstate axis_cp_built_model invisible
		setstate axis_cp_damaged_model default
	}

	trigger enable
	{
		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
		//enablespeaker sound_cp_axis
	}
	trigger disable
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
		//disablespeaker sound_cp_axis
	}
}

