main()
{
maps\mp\_load::main();

if(level.wwx_ambmapsound) ambientPlay("ambient_mp_secretairfield");

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

setCvar("r_glowbloomintensity0", ".25");
setCvar("r_glowbloomintensity1", ".25");
setcvar("r_glowskybleedintensity0",".3");

level.OSmoke = loadfx("fx/smoke/orange_smoke_20sec.efx");
level.TourExp = loadfx("fx/explosions/silo_explode.efx");
level.RoqFlamme = loadfx("fx/smoke/smoke_panzerscrheck.efx");
level.Avion=0;

level.Bomber = getent("bomber","targetname");
level.Bomber hide();
level.Roq1 = getent("roquette","targetname");
level.Roq1 hide();

level.Tour1D = getent("tour1d","targetname");
level.Tour2D = getent("tour2d","targetname");
level.Tour1E = getent("tour1e","targetname");
level.Tour2E = getent("tour2e","targetname");

level.TrigHurtExplo = getent ("TrigHurtPorte","targetname");
level.TrigHurtExplo2 = getent ("TrigHurtPorte2","targetname");
level.Mg1 = getent ("mg1","targetname");
level.Mg2 = getent ("mg2","targetname");

level.Tour1D hide();
level.Tour2D hide();



thread SmokeBomber1();
thread SmokeBomber2();
thread Porte();
 //thread SmokeBomber2()



}


SmokeBomber1()
{
	Trig=getent("trig1","targetname");
	Org=getent("org1","targetname");
	
		Trig waittill("trigger");
		if(level.Avion==0)
		{
			fx=playfx(level.OSmoke, Org.origin);
			Org playsound("smokegrenade_explode_default");
			level.Avion=1;
			wait(7);

			Org playsound("passage_avion");

			
			level.Roq1 moveto((-4370,64,800),0.01);
			
			level.Bomber moveto((-12000,224,1770),0.01);
			wait(0.2);
			level.Bomber show();
			level.Bomber moveto((-9600,224,2200),1.2);
			level.Bomber rotatepitch(-10,0.5);			
			wait(1.2);
			level.Bomber moveto((-6380,224,1360),1.7);
			level.Bomber rotatepitch(25,0.5);			
			wait(1.7);
			level.Bomber moveto((-4400,224,800),1);
			level.Bomber rotatepitch(-1,0.5);			
			wait(0.5);
			level.Bomber rotateroll(-32,0.5);			
			wait(0.5);

			// Tir
			level.Roq1 rotatepitch(12,0.01);
			level.Roq1 show();
			level.Roq1 moveto((-2400,224,384),0.5);
			

			//fx2=playfx(level.RoqFlamme,(-4370,64,800));
			level.Bomber moveto((-2400,224,1200),1);
			level.Bomber rotatepitch(-27,0.5);
			for(i = 1; i <= 10; i++)
			{
				fx=playfx(level.RoqFlamme,(-4370+197*i,64,800-42*i),(197,0,-42));
				wait(0.05);
			}
			//wait(0.5);
			//Explosion
			fx=playfx(level.TourExp, (-2400,224,384));
			Org playsound("rocket_explode_grass");

			level.Roq1 delete();
			level.Tour1E delete();
			level.Tour1D show();
			
			level.TrigHurtExplo useby(Trig);
			level.Mg1 delete();
			

			level.Bomber rotateroll(-16,0.5);
			wait(0.5);

			level.TrigHurtExplo useby(Trig);

			level.Bomber moveto((-1100,600,1500),0.7);
			level.Bomber rotatepitch(-1,0.5);
			level.Bomber rotateyaw(16,0.5);
			wait(0.5);
			level.Bomber rotateroll(-6,0.2);
			wait(0.2);
			level.Bomber moveto((310,1800,1900),0.9);
			level.Bomber rotateyaw(24,0.5);
			wait(0.5);
			level.Bomber rotateroll(38,0.4);
			wait(0.4);
			level.Bomber moveto((1130,3720,2160),1.1);
			level.Bomber rotatepitch(5,0.5);
			level.Bomber rotateyaw(27,0.5);
			wait(1.1);
			level.Bomber moveto((2400,8500,1920),2.5);
			level.Bomber rotateroll(16,0.5);
			wait(1.1);
			level.Bomber hide();
			level.Bomber rotateto((0,0,0),1);

			
		}
	
}


SmokeBomber2()
{
	Trig=getent("trig2","targetname");
	Org=getent("org2","targetname");
	
		Trig waittill("trigger");
		if(level.Avion==0)
		{
			fx=playfx(level.OSmoke, Org.origin);
			Org playsound("smokegrenade_explode_default");
			level.Avion=1;
			wait(7);

			Org playsound("passage_avion");

			
			level.Roq1 moveto((-4370,-1020,800),0.01);
			
			level.Bomber moveto((-12000,-1140,1770),0.01);
			wait(0.2);
			level.Bomber show();
			level.Bomber moveto((-9600,-1140,2200),1.2);
			level.Bomber rotatepitch(-10,0.5);			
			wait(1.2);
			level.Bomber moveto((-6380,-1140,1360),1.7);
			level.Bomber rotatepitch(25,0.5);			
			wait(1.7);
			level.Bomber moveto((-4400,-1140,800),1);
			level.Bomber rotatepitch(1,0.5);			
			wait(0.5);
			level.Bomber rotateroll(-20,0.5);			
			wait(0.5);

			// Tir
			level.Roq1 rotatepitch(12,0.01);
			level.Roq1 show();
			level.Roq1 moveto((-2400,-1020,384),0.5);
			

			level.Bomber moveto((-2400,-1140,1200),1);
			level.Bomber rotatepitch(-27,0.5);
			for(i = 1; i <= 10; i++)
			{
				fx=playfx(level.RoqFlamme,(-4370+197*i,-1020,800-42*i),(197,1020,-42));
				wait(0.05);
			}
			fx=playfx(level.TourExp, (-2400,-1140,384));
			Org playsound("rocket_explode_grass");

			level.Roq1 delete();
			level.Tour2E delete();
			level.Tour2D show();
			
			level.TrigHurtExplo2 useby(Trig);
			level.Mg2 delete();
			

			level.Bomber rotateroll(-10,0.5);
			wait(0.5);

			level.TrigHurtExplo2 useby(Trig);

			level.Bomber moveto((-1100,-910,1500),0.7);
			level.Bomber rotatepitch(-2,0.2);
			level.Bomber rotateyaw(10,0.3);
			wait(0.3);
			level.Bomber rotateroll(-28,0.4);
			wait(0.4);
			level.Bomber moveto((130,-340,1840),0.7);
                        level.Bomber rotateyaw(15,0.3);
                        level.Bomber rotatepitch(-1,0.3);
                        wait(0.3);
                        level.Bomber rotateroll(28,0.4);
                        wait(0.4);
			level.Bomber moveto((720,460,1990),0.5);
			level.Bomber rotatepitch(5,0.3);
			level.Bomber rotateyaw(29,0.3);
			wait(0.3);
			level.Bomber rotateroll(10,0.2);
			wait(0.2);
			level.Bomber moveto((1360,2110,2160),0.9);
			level.Bomber rotatepitch(4,0.3);
			level.Bomber rotateyaw(15,0.3);
			wait(0.3);
			level.Bomber rotateroll(14,0.5);
			wait(0.6);
			level.Bomber moveto((1890,4910,2290),1.4);
			level.Bomber rotatepitch(2,0.3);
			level.Bomber rotateyaw(10,0.5);
			wait(0.5);
			level.Bomber rotateroll(6,0.3);
			wait(0.9);
			level.Bomber moveto((2540,9770,2200),2.5);
			level.Bomber rotatepitch(4,0.3);
			level.Bomber rotateyaw(3,0.5);
			wait(2.5);

			level.Bomber hide();
			level.Bomber rotateto((0,0,0),1);

			
		}
	
}




Porte()
{
trig = getent ("trigmanette","targetname");
manette = getent("objmanette","targetname");

Porte1=getent("porte1","targetname");
Porte2=getent("porte2","targetname");



manette rotatepitch (25,1);
while(1)
{

trig waittill("trigger");
manette rotatepitch (-50,1);

Porte1 movey(288,20);
Porte2 movey(-288,20);

wait(20);

trig waittill("trigger");
manette rotatepitch (50,1);

Porte1 movey(-288,20);
Porte2 movey(288,20);

wait(20);

}


}