// GLOBAL ACCUMS
// =============
//
// GLOBALACCUM 1:	CABINETS
//		BITFLAG 0:		Church cabinets		0=DISABLED;1=ENABLED
//		BITFLAG 1:		CP cabinets			0=DISABLED;1=ENABLED
// GLOBALACCUM 2:	AXIS CP SPAWN
// GLOBALACCUM 3:	Remove team_door at city_gate/main_entrance after breaching		0=KEEP;1=REMOVE

game_manager
{
	spawn
	{
		wait 200
		
		wm_axis_respawntime 30
		wm_allied_respawntime 20
		wm_set_defending_team 0
		wm_set_round_timelimit 20
		wm_number_of_objectives	6
		wm_setwinner 0
		
		// OBJECTIVES
		wm_objective_status 1 0 0	//1 City Gate
		wm_objective_status 1 1 0	//1 City Gate
		wm_objective_status 2 0 0	//2 Bunker Controls
		wm_objective_status 2 1 0	//2 Bunker Controls
		wm_objective_status 3 0 0	//3 Castle Gate
		wm_objective_status 3 1 0	//3 Castle Gate
		wm_objective_status 4 0 1	//4 Factory District
		wm_objective_status 4 1 2	//4 Factory District
		wm_objective_status 5 0 0	//5 Command Post
		wm_objective_status 5 1 0	//5 Command Post
		wm_objective_status 6 0 0	//6 Rear Entrance
		wm_objective_status 6 1 0	//6 Rear Entrance
		
		wm_set_main_objective		2	0
		wm_set_main_objective		2	1
		
		setautospawn "Factory District" 0
		setautospawn "Allied Spawn" 1
		
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "braundorf_allies_dyn_entrances"
		wm_teamvoiceannounce 1 "braundorf_allies_cap_oldcity"
		wm_teamvoiceannounce 0 "braundorf_axis_defend_entrances"
		wm_teamvoiceannounce 0 "braundorf_axis_defend_oldcity"
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "braundorf_allies_dyn_entrances"
		wm_addteamvoiceannounce 1 "braundorf_allies_cap_oldcity"
		wm_addteamvoiceannounce 0 "braundorf_axis_defend_entrances"
		wm_addteamvoiceannounce 0 "braundorf_axis_defend_oldcity"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*
		
		wait 100
		setstate city_gate_debris invisible
		setstate city_door_debris invisible
		setstate bunker_controls_debris invisible
		
		setstate church_cabinet_toi invisible
		setstate church_cabinet_marker invisible
		setstate church_ammo invisible
		setstate church_ammo_model invisible
		setstate church_ammo_dest default
		setstate church_health invisible
		setstate church_health_model invisible
		setstate church_health_dest default
		
		setstate cp_cabinet_toi invisible
		setstate cp_cabinet_marker invisible
		setstate cp_cabinet_door default
		setstate cp_ammo invisible
		setstate cp_ammo_model invisible
		setstate cp_ammo_dest default
		setstate cp_health invisible
		setstate cp_health_model invisible
		setstate cp_health_dest default
		setstate rear_entrance_cm invisible
		setstate rear_entrance_cm_marker invisible
		remapshader models/mapobjects/flag/flag_dam textures/common/nodraw
		remapshaderflush
		
		//====OPTIONAL SETTINGS==============================================================
		wait 1000
		// Toggle the line of the respective setting you want to change by (un-)commenting.
		//
		// globalaccum 1 bitset 0						// Church cabinets (disabled by default)
		// globalaccum 1 bitset 1						// CP cabinets (disabled by default)
		// globalaccum 2 set 1							// Axis CP spawn (disabled by default)
		// globalaccum 3 set 1							// Remove team door at city gate when blown (disabled by default)
		// setstate church_roof_clip invisible			// One-way clip preventing explosives from entering the church through the roof (enabled by default)
		// ===================================================================================
	}
	
	trigger allies_win
	{
		wm_setwinner 1
		wm_announce "^5Allied team has destroyed the Bunker Controls!"
		wait 500
		wm_endround
	}
}

city_gate
{
	spawn
	{
		wait 200
		constructible_class 3	//Dyno
	}
	
	death
	{
		setstate city_gate_debris default
		trigger flag secure
		trigger city_door invisible
		trigger bell ring
		trigger bell2 ring
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^5The Allies have destroyed the Main Gate!"
		wm_objective_status 1 0 1	//1 City Gate
		wm_objective_status 1 1 2	//1 City Gate
		
		wm_removeteamvoiceannounce 1 "braundorf_allies_dyn_entrances"
		wm_removeteamvoiceannounce 1 "braundorf_allies_cap_oldcity"
		wm_removeteamvoiceannounce 0 "braundorf_axis_defend_entrances"
		wm_removeteamvoiceannounce 0 "braundorf_axis_defend_oldcity"
		
		wm_teamvoiceannounce 1 "braundorf_allies_main_destroyed"
		wm_teamvoiceannounce 1 "braundorf_allies_dyn_bcontrols"
		wm_teamvoiceannounce 0 "braundorf_axis_main_destroyed"
		wm_teamvoiceannounce 0 "braundorf_axis_def_bcontrols"

		wm_addteamvoiceannounce 1 "braundorf_allies_dyn_bcontrols"
		wm_addteamvoiceannounce 0 "braundorf_axis_def_bcontrols"
		// *----------------------------------- vo ------------------------------------------*
		
		globalaccum 3 abort_if_equal 0
		setstate city_door invisible
		setstate city_door_debris default
	}
}

castle_gate
{
	spawn
	{
		wait 210
		constructible_class 3	//Dyno
	}
	
	death
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^5The Allies have destroyed the Side Door!"
		wm_objective_status 3 0 1	//3 Castle Gate
		wm_objective_status 3 1 2	//3 Castle Gate
		
		wm_teamvoiceannounce 1 "braundorf_allies_side_destroyed"
		wm_teamvoiceannounce 1 "braundorf_allies_dyn_bcontrols"
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		wm_teamvoiceannounce 0 "braundorf_axis_side_destroyed"
		wm_teamvoiceannounce 0 "braundorf_axis_def_bcontrols"
		wm_teamvoiceannounce 0 "braundorf_axis_con_depotdef"

		wm_addteamvoiceannounce 1 "braundorf_allies_dyn_bcontrols"
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"
		wm_addteamvoiceannounce 0 "braundorf_axis_def_bcontrols"
		wm_addteamvoiceannounce 0 "braundorf_axis_con_depotdef"
		// *----------------------------------- vo ------------------------------------------*
	}
}

rear_entrance
{
	spawn
	{
		wait 400
		constructible_class 2	// Satchel
	}

	built final
	{
		setstate rear_entrance_materials invisible
		setstate rear_entrance_cm default
		setstate rear_entrance_cm_marker default
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^1The Axis have constructed the Side Gate!"
		wm_objective_status 6 0 1	//6 Rear Entrance
		wm_objective_status 6 1 2	//6 Rear Entrance
		
		wm_removeteamvoiceannounce 0 "braundorf_axis_con_depotdef"
		wm_teamvoiceannounce 1 "braundorf_allies_depotdef_constructed"
		wm_teamvoiceannounce 0 "braundorf_axis_depotdef_constructed"

		wm_addteamvoiceannounce 1 "braundorf_allies_dest_depotdef"
		// *----------------------------------- vo ------------------------------------------*
		
		// setstate rear_door default
	}

	death
	{
		setstate rear_entrance_materials default
		setstate rear_entrance_cm invisible
		setstate rear_entrance_cm_marker invisible
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^5The Allies have destroyed the Side Gate!" 
		wm_objective_status 6 0 2	//6 Rear Entrance
		wm_objective_status 6 1 1	//6 Rear Entrance
		
		wm_removeteamvoiceannounce 1 "braundorf_allies_dest_depotdef"

		wm_teamvoiceannounce 0 "braundorf_axis_depotdef_destroyed"
		wm_teamvoiceannounce 1 "braundorf_allies_depotdef_destroyed"

		wm_addteamvoiceannounce 0 "braundorf_axis_con_depotdef"
		// *----------------------------------- vo ------------------------------------------*
		
		// setstate rear_door invisible
	}
}

flag
// ACCUM 0: FLAG STATE - DEFAULT AXIS; 0=AXIS, 1=ALLIED
{
	spawn
	{
		wait 360
		disablespeaker flag_sound
	}
	
	trigger axis_capture
	{
		enablespeaker flag_sound
		accum 0 abort_if_equal 0	//already AXIS?
		accum 0 set 0				//set AXIS

		alertentity flag_wobj
		
		setautospawn "Factory District" 0
		setautospawn "Allied Spawn" 1
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce	"^1The Axis have reclaimed the Factory District!"
		wm_objective_status 4 0 2	//4 Factory District
		wm_objective_status 4 1 1	//4 Factory District
		
		wm_teamvoiceannounce 1 "braundorf_allies_oldcity_recl"
		wm_teamvoiceannounce 0 "braundorf_axis_oldcity_recl"

		wm_addteamvoiceannounce 1 "braundorf_allies_cap_oldcity"
		wm_addteamvoiceannounce 0 "braundorf_axis_defend_oldcity"
		// *----------------------------------- vo ------------------------------------------*
	}

	trigger allied_capture
	{
		enablespeaker flag_sound
		accum 0 abort_if_equal 1	//already ALLIED?
		accum 0 set 1				//set ALLIED

		alertentity flag_wobj
		
		setautospawn "Factory District" 1
		setautospawn "Axis Spawn" 0
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce	"^5The Allies have captured the Factory District!"
		wm_objective_status 4 0 1	//4 Factory District
		wm_objective_status 4 1 2	//4 Factory District
		
		wm_removeteamvoiceannounce 1 "braundorf_allies_cap_oldcity"
		wm_removeteamvoiceannounce 0 "braundorf_axis_defend_oldcity"

		wm_teamvoiceannounce 1 "braundorf_allies_oldcity_captured"
		wm_teamvoiceannounce 1 "braundorf_allies_dyn_main"
		wm_teamvoiceannounce 0 "braundorf_axis_oldcity_lost"
		wm_teamvoiceannounce 0 "braundorf_axis_def_main"
		// *----------------------------------- vo ------------------------------------------*
	}
	
	trigger secure
	{
		setstate flag invisible
		disablespeaker flag_sound
		
		accum 0 abort_if_equal 1

		alertentity flag_wobj
		alertentity flag_spawn
		
		setautospawn "Factory District" 1
		setautospawn "Axis Spawn" 0
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce	"^5The Allies have secured the Factory District!"
		wm_objective_status 4 0 1	//4 Factory District
		wm_objective_status 4 1 2	//4 Factory District
		
		wm_removeteamvoiceannounce 1 "braundorf_allies_cap_oldcity"
		wm_removeteamvoiceannounce 0 "braundorf_axis_defend_oldcity"
		// *----------------------------------- vo ------------------------------------------*

		accum 0 set 0
	}
}

bunker_controls
{
	spawn
	{
		wait 210
		constructible_class 3	//Dyno
	}
	
	death
	{
		setstate bunker_controls_debris default
		disablespeaker generator_loop
		disablespeaker generator_loop2
		trigger generator_pistons1 stop
		trigger generator_pistons2 stop
		trigger generator_pistons3 stop
		trigger generator_pistons4 stop
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^5The Allies have destroyed the Bunker Controls!"
		wm_objective_status 2 0 1	//2 Bunker Controls
		wm_objective_status 2 1 2	//2 Bunker Controls
   		
  		wm_teamvoiceannounce 0 "axis_hq_objective_destroyed"
		wm_teamvoiceannounce 1 "allies_hq_objective_destroyed"
		// *----------------------------------- vo ------------------------------------------*
		
		trigger game_manager allies_win
	}
}

axis_cp
{
	spawn
	{
		wait 400
		constructible_class 2
		setstate axis_cp_model invisible
		setstate axis_cp_spawns_wobj invisible
		setstate axis_cp_spawns invisible
		disablespeaker axis_cp_sound
	}

	buildstart
	{
		setstate cp_closed invisible
		setstate axis_cp_model underconstruction
	}

	decayed
	{
		setstate cp_closed default
		setstate axis_cp_model invisible
	}

	built
	{
		setstate axis_cp_model default
		setstate cp_closed_clip invisible
		globalaccum 2 trigger_if_equal 1 world_clip axis_cp_spawn_enable
		
		remapshader models/mapobjects/flag/flag_dam models/multiplayer/flagpole/german
		remapshaderflush
		
		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

		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^1Axis Command Post constructed. Charge speed increased!"
		
		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"		

		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"
		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"
		
		wm_objective_status 5 0 2	//5 Command Post
		wm_objective_status 5 1 1	//5 Command Post
		
		enablespeaker axis_cp_sound
		// *---------------------------------------------------------------------------------*
		
		globalaccum 1 abort_if_not_bitset 1 // Abort if CP spawn cabinets are not desired
		setstate cp_cabinet_toi default
		setstate cp_cabinet_marker default
		setstate cp_ammo default
		setstate cp_ammo_model default
		setstate cp_ammo_dest invisible
		setstate cp_health default
		setstate cp_health_model default
		setstate cp_health_dest invisible
	}

	death
	{
		setstate axis_cp_model invisible
		setstate cp_closed default
		setstate cp_closed_clip default
		globalaccum 2 trigger_if_equal 1 world_clip axis_cp_spawn_disable
		
		remapshader models/mapobjects/flag/flag_dam textures/common/nodraw
		remapshaderflush
		
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^5The Allies have destroyed the Axis Command Post!"
		
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"

		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"
		
		wm_objective_status 5 0 0	//5 Command Post
		wm_objective_status 5 1 0	//5 Command Post
		
		disablespeaker axis_cp_sound
		// *---------------------------------------------------------------------------------*
		
		globalaccum 1 abort_if_not_bitset 1 // Abort if CP spawn cabinets are not desired
		setstate cp_cabinet_toi invisible
		setstate cp_cabinet_marker invisible
		setstate cp_ammo invisible
		setstate cp_ammo_model invisible
		setstate cp_ammo_dest default
		setstate cp_health invisible
		setstate cp_health_model invisible
		setstate cp_health_dest default
	}
}

allied_cp
{
	spawn
	{
		wait 400
		constructible_class 2
		setstate allied_cp_model invisible
		setstate allied_cp_spawns_wobj invisible
		setstate allied_cp_spawns invisible
		disablespeaker allied_cp_sound
	}

	buildstart
	{
		setstate cp_closed invisible
		setstate allied_cp_model underconstruction
	}

	decayed
	{
		setstate cp_closed default
		setstate allied_cp_model invisible
	}

	built
	{
		setstate allied_cp_model default
		setstate cp_closed_clip invisible
		setstate allied_cp_spawns default
		setstate allied_cp_spawns_wobj default
		
		remapshader models/mapobjects/flag/flag_dam models/multiplayer/flagpole/american
		remapshaderflush
		
		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
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^5Allied Command Post constructed. Charge speed increased!"
		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		
		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"
		
		wm_objective_status 5 0 1	//5 Command Post
		wm_objective_status 5 1 2	//5 Command Post
		
		enablespeaker allied_cp_sound
		// *---------------------------------------------------------------------------------*
		
		globalaccum 1 abort_if_not_bitset 1 // Abort if CP spawn cabinets are not desired
		setstate cp_cabinet_toi default
		setstate cp_cabinet_marker default
		setstate cp_ammo default
		setstate cp_ammo_model default
		setstate cp_ammo_dest invisible
		setstate cp_health default
		setstate cp_health_model default
		setstate cp_health_dest invisible
	}

	death
	{
		setstate allied_cp_model invisible
		setstate cp_closed default
		setstate cp_closed_clip default
		setstate allied_cp_spawns_wobj invisible
		setstate allied_cp_spawns invisible
		
		remapshader models/mapobjects/flag/flag_dam textures/common/nodraw
		remapshaderflush
		
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
		
		// *----------------------------------- vo ------------------------------------------*
		wm_announce "^1The Axis have destroyed the Allied Command Post!"

		wm_teamvoiceannounce 0 "axis_hq_compost_construct"
		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"
		
		wm_objective_status 5 0 0	//5 Command Post
		wm_objective_status 5 1 0	//5 Command Post
		
		disablespeaker allied_cp_sound
		// *---------------------------------------------------------------------------------*
		
		globalaccum 1 abort_if_not_bitset 1 // Abort if CP spawn cabinets are not desired
		setstate cp_cabinet_toi invisible
		setstate cp_cabinet_marker invisible
		setstate cp_ammo invisible
		setstate cp_ammo_model invisible
		setstate cp_ammo_dest default
		setstate cp_health invisible
		setstate cp_health_model invisible
		setstate cp_health_dest default
	}
}

church_health
{
	spawn
	{
		wait 3000
		globalaccum 1 abort_if_not_bitset 0			// Abort if church spawn cabinets are not desired
		setstate church_cabinet_toi default
		setstate church_cabinet_marker default
		setstate church_ammo default
		setstate church_ammo_model default
		setstate church_ammo_dest invisible
		setstate church_health default
		setstate church_health_model default
		setstate church_health_dest invisible
	}
}

cp_health
{
	spawn
	{
		wait 3100
		globalaccum 1 abort_if_not_bitset 1			// Abort if church spawn cabinets are not desired
		setstate cp_cabinet_door invisible
	}
}

generator_pistons1
{
	spawn
	{
		wait 100
		trigger self move
	}
	
	trigger move
	{
		faceangles 20 180 0 120 
		faceangles 0 180 0 120 
		trigger self move
	}
	
	trigger stop
	{
		halt
	}
}

generator_pistons2
{
	spawn
	{
		wait 200
		trigger self move
	}
	
	trigger move
	{
		faceangles 20 180 0 120 
		faceangles 0 180 0 120 
		trigger self move
	}
	
	trigger stop
	{
		halt
	}
}

generator_pistons3
{
	spawn
	{
		wait 100
		trigger self move
	}
	
	trigger move
	{
		faceangles 20 0 0 120 
		faceangles 0 0 0 120 
		trigger self move
	}
	
	trigger stop
	{
		halt
	}
}

generator_pistons4
{
	spawn
	{
		wait 200
		trigger self move
	}
	
	trigger move
	{
		faceangles 20 0 0 120 
		faceangles 0 0 0 120 
		trigger self move
	}
	
	trigger stop
	{
		halt
	}
}

loper1
{
	spawn
	{
		wait 320
		startanimation 91 11 15 nolerp norandom
		accum 0 set 1
		wait 180
		trigger loper1 run
	}
	
	trigger run
	{
		accum 0 trigger_if_equal 1 loper1 run1
		accum 0 trigger_if_equal 2 loper1 run2
		accum 0 trigger_if_equal 3 loper1 run3
		accum 0 trigger_if_equal 4 loper1 run4
	}
	
	trigger run1
	{
		accum 0 set 2
		followspline 0 loper1_spline1 85 wait length 32
		trigger loper1 run
	}
	
	trigger run2
	{
		accum 0 set 3
		followspline 0 loper1_spline2 85 wait length 32
		trigger loper1 run
	}
	
	trigger run3
	{
		accum 0 set 4
		followspline 0 loper1_spline3 85 wait length 32
		trigger loper1 run
	}
	
	trigger run4
	{
		accum 0 set 1
		followspline 0 loper1_spline4 85 wait length 32
		trigger loper1 run
	}
	
	trigger attack
	{
		accum 0 trigger_if_equal 1 loper1 attack1
		accum 0 trigger_if_equal 2 loper1 attack2
		accum 0 trigger_if_equal 3 loper1 attack3
		accum 0 trigger_if_equal 4 loper1 attack4
	}
	
	trigger attack_routine
	{
		enablespeaker loper1_elec
		followspline 0 loper1_spline5 85 wait length 32
		startanimation 206 7 5 nolerp norandom noloop	//static attack
		wait 500
		startanimation 214 2 15 nolerp norandom noloop	//reset
		startanimation 216 10 15 nolerp norandom noloop	//frenzy attack
		togglespeaker loper1_elec2
		followspline 0 loper1_spline6 500 wait length 32
		togglespeaker loper1_glass
		togglespeaker loper1_moan
		startanimation 227 20 15 nolerp norandom noloop	//roll-out
		followspline 0 loper1_spline7 300 wait length 32
		disablespeaker loper1_elec
		accum 0 set 4
		startanimation 91 11 15 nolerp norandom			//walking
		trigger loper1 run
	}
	
	trigger attack1
	{
		followspline 0 loper1_spline1_attack 500 wait length 32
		trigger loper1 attack_routine
	}
	
	trigger attack2
	{
		followspline 0 loper1_spline2_attack 500 wait length 32
		trigger loper1 attack_routine
	}
	
	trigger attack3
	{
		followspline 0 loper1_spline3_attack 500 wait length 32
		trigger loper1 attack_routine
	}
	
	trigger attack4
	{
		followspline 0 loper1_spline4_attack 500 wait length 32
		trigger loper1 attack_routine
	}
}

loper1_elec
{
	spawn
	{
		wait 413
		attachtotag loper1 tag_spinner
	}
}

loper1_hint
{
	activate
	{
		togglespeaker loper1_scream
		setstate loper1_hint invisible
		trigger loper1 attack
		wait 5000
		setstate loper1_hint default
	}		
}

loper2
{
	spawn
	{
		wait 320
		trigger loper2 idle
	}
	
	trigger idle
	{
		startanimation 91 11 15 nolerp norandom			//walking
		followspline 0 loper2_spline1 85 wait length 32
		startanimation 145 20 15 nolerp norandom		//idle
	}
	
	trigger attack
	{
		
		startanimation 206 7 5 nolerp norandom noloop	//static attack
		wait 500
		startanimation 214 2 15 nolerp norandom noloop	//reset
		startanimation 216 10 15 nolerp norandom noloop	//frenzy attack
		followspline 0 loper2_spline2 500 wait length 32
		togglespeaker loper2_metal
		togglespeaker loper2_moan
		startanimation 227 20 15 nolerp norandom noloop	//roll-out
		followspline 0 loper2_spline3 250 wait length 32
		trigger loper2 idle
	}
}

loper2_elec
{
	spawn
	{
		wait 413
		attachtotag loper2 tag_spinner
	}
}

loper2_trigger
{
	activate
	{
		togglespeaker loper2_scream
		setstate loper2_trigger invisible
		trigger loper2 attack
		wait 5000
		setstate loper2_trigger default
	}
}

world_clip
{
	trigger axis_cp_spawn_enable
	{
		globalaccum 2 abort_if_equal 0
		setstate axis_cp_spawns_wobj default
		setstate axis_cp_spawns default
	}
	
	trigger axis_cp_spawn_disable
	{
		globalaccum 2 abort_if_equal 0
		setstate axis_cp_spawns_wobj invisible
		setstate axis_cp_spawns invisible
	}
}

bell
{
	trigger ring
	{
		accum 0 set 1
		faceangles 18 0 0 500
		trigger bell_ball ring
		enablespeaker bell_sound
		wait 20
		trigger self ring_continue
	}
	
	trigger ring_continue
	{
		accum 0 inc 1
		faceangles -18 0 0 1000
		wait 20
		faceangles 18 0 0 1000
		wait 20
		
		accum 0 trigger_if_equal 7 bell_ball stop
		accum 0 trigger_if_equal 7 bell stop
		accum 0 abort_if_equal 7
		trigger self ring_continue
	}
	
	trigger stop
	{
		disablespeaker bell_sound
		faceangles -15 0 0 1000
		wait 20
		faceangles 12 0 0 1000
		wait 20
		faceangles -9 0 0 1000
		wait 20
		faceangles 6 0 0 1000
		wait 20
		faceangles -3 0 0 1000
		wait 20
		faceangles 0 0 0 1000
	}
}

bell_ball
{
	trigger ring
	{
		faceangles 3 0 0 1000
		wait 20
		trigger self ring_continue
	}
	
	trigger ring_continue
	{
		faceangles -3 0 0 1000
		wait 20
		faceangles 3 0 0 1000
		wait 20
		trigger self ring_continue
	}
	
	trigger stop
	{
		faceangles -2 0 0 1000
		wait 20
		faceangles 2 0 0 1000
		wait 20
		faceangles -1 0 0 1000
		wait 20
		faceangles 1 0 0 1000
		wait 20
		faceangles 0 0 0 1000
	}
}

bell2
{
	trigger ring
	{
		accum 0 set 1
		faceangles 18 0 0 500
		trigger bell2_ball ring
		enablespeaker bell2_sound
		wait 20
		trigger self ring_continue
	}
	
	trigger ring_continue
	{
		accum 0 inc 1
		faceangles -18 0 0 1000
		wait 20
		faceangles 18 0 0 1000
		wait 20
		
		accum 0 trigger_if_equal 7 bell2_ball stop
		accum 0 trigger_if_equal 7 bell2 stop
		accum 0 abort_if_equal 7
		trigger self ring_continue
	}
	
	trigger stop
	{
		disablespeaker bell2_sound
		faceangles -15 0 0 1000
		wait 20
		faceangles 12 0 0 1000
		wait 20
		faceangles -9 0 0 1000
		wait 20
		faceangles 6 0 0 1000
		wait 20
		faceangles -3 0 0 1000
		wait 20
		faceangles 0 0 0 1000
	}
}

bell2_ball
{
	trigger ring
	{
		faceangles 3 0 0 1000
		wait 20
		trigger self ring_continue
	}
	
	trigger ring_continue
	{
		faceangles -3 0 0 1000
		wait 20
		faceangles 3 0 0 1000
		wait 20
		trigger self ring_continue
	}
	
	trigger stop
	{
		faceangles -2 0 0 1000
		wait 20
		faceangles 2 0 0 1000
		wait 20
		faceangles -1 0 0 1000
		wait 20
		faceangles 1 0 0 1000
		wait 20
		faceangles 0 0 0 1000
	}
}