main() 
{ 
	ambientFX(); 

	precacheFX();

	level.scr_sound["flak88_explode"] = "flak88_explode";
} 

precacheFX() 
{ 
	level._effect["flak_explosion"] = loadfx ("fx/explosions/flak88_explosion.efx");
	level._effect["tombefeuille"] = loadfx ("fx/impacts/feuilletombe.efx");
      level._effect["lantern_light"]       = loadfx ("fx/props/glow_latern.efx"); 

      if(level.wwx_ambfirefx)
      {
	level._effect["building_fire_med"]	= loadfx ("fx/fire/building_fire_med.efx");
	level._effect["med_oil_fire"]	= loadfx ("fx/fire/med_oil_fire.efx");
      }

      if(level.wwx_ambsmokefx)
      {
	level._effect["battlefield_smokebank_S"]	= loadfx ("fx/smoke/battlefield_smokebank_S.efx");
	level._effect["thin_light_smoke_M"]	= loadfx ("fx/smoke/thin_light_smoke_M.efx");
	level._effect["thin_light_smoke_S"]	= loadfx ("fx/smoke/thin_light_smoke_S.efx");
	level._effect["thin_light_smoke_L"]	= loadfx ("fx/smoke/thin_light_smoke_L.efx");
	level._effect["damaged_vehicle_smoke"]	= loadfx ("fx/smoke/damaged_vehicle_smoke.efx"); 
	level._effect["smoke_plumeBG"]	= loadfx ("fx/smoke/smoke_plumeBG.efx"); 
      }
} 

ambientFX() 
{ 

//Lanterns FX 
//Fire
      if(level.wwx_ambfirefx)
      {
	maps\mp\_fx::loopfx("building_fire_med", (4216, 1480, 168), 2);
	maps\mp\_fx::loopfx("med_oil_fire", (6335,-1699, 63), 2);
      }

	maps\mp\_fx::loopfx("lantern_light", (3948, 136, 32), 0.5); 
	maps\mp\_fx::loopfx("lantern_light", (2376, 120, 320), 0.5); 
	maps\mp\_fx::loopfx("lantern_light", (6232, -4228, 150), 0.5); 
	maps\mp\_fx::loopfx("lantern_light", (2132, 1096, 183), 0.5); 

//Smoke bank
//smoke
      if(level.wwx_ambsmokefx)
      {
	maps\mp\_fx::loopfx("thin_light_smoke_M", (3296, 1000, 60), 1);  
	maps\mp\_fx::loopfx("thin_light_smoke_S", (6104, 456, -24), 1);  
	maps\mp\_fx::loopfx("thin_light_smoke_S", (5367, -2010, -40), 1);  
	maps\mp\_fx::loopfx("thin_light_smoke_S", (3296, -3584, -40), 1);  
	maps\mp\_fx::loopfx("damaged_vehicle_smoke", (2832,-1136, 24), 1);  
	maps\mp\_fx::loopfx("smoke_plumeBG", (650,400, 0), 1); 
	maps\mp\_fx::loopfx("thin_light_smoke_L", (4240, -2432, -72), 1);
	maps\mp\_fx::loopfx("damaged_vehicle_smoke", (4758,-3684, 158), 1);
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (3664, -1176, -160), 1);
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (5736, -1480, -40), 1);  
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (3696, 440, 0), 1);  
	maps\mp\_fx::loopfx("battlefield_smokebank_S", (2168, -2744, 32), 1); 
      }
} 
