main()
{
level thread precacheFX();
level thread spawnWorldFX();
level.rasta_cod2_rain = loadfx ("fx/misc/rain_heavy_cloudtype.efx");
}

precacheFX()
{

if(level.wwx_ambfirefx) level._effect["building_fire_small"] = loadfx ("fx/fire/building_fire_small.efx");

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

level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");

}

spawnWorldFX()
{
//fire
if(level.wwx_ambfirefx)
{
maps\MP\_fx::loopfx("building_fire_small", (-1039.0, 1830.0, 20.0), 2);
maps\MP\_fx::loopfx("building_fire_small", (-72.0, 696.0, 104.0), 2);
}

//smoke
if(level.wwx_ambsmokefx)
{ 
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-3560.0, 448.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-2848.0, 464.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-2120.0, 456.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-1416.0, 456.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-664.0, 440.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (128.0, 480.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (568.0, -1136.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-920.0, -2584.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-2168.0, -2576.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-3592.0, -2184.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-3024.0, -1616.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-3552.0, -616.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-2824.0, -552.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-2064.0, -576.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-1344.0, -576.0, -100.0), 0.6);
maps\MP\_fx::loopfx("battlefield_smokebank_S", (-1880.0, -1248.0, -100.0), 0.6);
maps\MP\_fx::loopfx("damaged_vehicle_smoke", (376.0, 1344.0, 24.0), 0.6);
maps\MP\_fx::loopfx("smoke_plumeBG", (-4456.0, 1304.0, 72.0), 0.6);
}

//lightning
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (1808, -2200, 2352), 25.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-2008, 1888, 2352), 15.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-1736, -448, 2352), 5.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-2296, -424, 2352), 15.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-4680, -2736, 2352), 30.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (1000, 1900, 2352), 23.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-5200, -2000, 2352), 7.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-1664, 1950, 2352), 10.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-4624, -2952, 2352), 27.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-3520, -856, 2352), 17.0);
level._effect["lightning"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("lightning", (-4904, 1792, 2352), 13.0);
level._effect["flash2flak"] = loadfx ("fx/misc/lightning.efx");
maps\mp\_fx::loopfx("flash2flak", (-2200, -3000, 2352), 20.0);

}
