main()
{
	 precacheFX();
	 ambientFX();
}

precacheFX()
{
      if(level.wwx_ambfirefx)
      {
	level._effect["building_fire_large"]	= loadfx ("fx/fire/building_fire_large.efx");
	level._effect["tank_fire"]	= loadfx ("fx/fire/tank_fire_turret_large.efx");
      }

      if(level.wwx_ambsmokefx)
      {
	level._effect["black_smoke_ball"]	= loadfx ("fx/smoke/damaged_vehicle_smoke.efx");
      level._effect["light_smoke"]	= loadfx ("fx/smoke/thin_light_smoke_L.efx");
      level._effect["tank_smoke"]	= loadfx ("fx/smoke/smoke_panzerfaust.efx");
      }

      if(level.wwx_ambfogbankfx) level._effect["fogbank_small_beltot"]		= loadfx ("fx/misc/fogbank_small_beltot.efx");
         
}

ambientFX()
{
	//fire
      if(level.wwx_ambfirefx)
      {
	maps\mp\_fx::loopfx("building_fire_large", (-5584.0, 5040.0, -2216.0), 2);
      maps\mp\_fx::loopfx("building_fire_large", (4224.0, 6872.0, -2216.0), 2);
      maps\mp\_fx::loopfx("building_fire_large", (4680.0, 6920.0, -2216.0), 2);
      maps\mp\_fx::loopfx("building_fire_large", (5648.0, -632.0, -2240.0), 2);
      maps\mp\_fx::loopfx("tank_fire", (5264.0, 7008.0, -2182.0), 2); //tank 1
      maps\mp\_fx::loopfx("tank_fire", (5880.0, 7104.0, -2176.0), 2); //tank 2
      //Sound FX
	maps\mp\_fx::soundfx("bigfire", (-5584.0,5040.0,-2216.0));
	maps\mp\_fx::soundfx("bigfire", (4224.0,6872.0,-2216.0));
      maps\mp\_fx::soundfx("bigfire", (4680.0,6920.0,-2216.0));
	maps\mp\_fx::soundfx("bigfire", (5648.0,-632.0,-2240.0));
      maps\mp\_fx::soundfx("medfire", (5264.0,7008.0,-2176.0));
	maps\mp\_fx::soundfx("medfire", (5880.0,7104.0,-2176.0));
      }

	//smoke
      if(level.wwx_ambsmokefx)
      {	
	maps\mp\_fx::loopfx("black_smoke_ball", (-5584.0, 5040.0, -2180.0), 0.6);
      maps\mp\_fx::loopfx("black_smoke_ball", (4224.0, 6872.0, -2180.0), 0.6);
      maps\mp\_fx::loopfx("black_smoke_ball", (4680.0, 6920.0, -2180.0), 0.6);
      maps\mp\_fx::loopfx("light_smoke", (5648.0, -632.0, -2240.0), 0.6);
      maps\mp\_fx::loopfx("tank_smoke", (5264.0, 5264.0, -2120.0), 0.6); //tank 1
      maps\mp\_fx::loopfx("tank_smoke", (5264.0, 5264.0, -2120.0), 0.6); //tank 2
      }

}