// IW6 GSC SOURCE
// Generated by https://github.com/xensik/gsc-tool

main()
{
    level._effect["factory_het_cab_headlight_full"] = loadfx( "vfx/moments/factory/factory_het_cab_headlight_full" );
    level._effect["factory_ambush_smoke_post"] = loadfx( "vfx/moments/factory/factory_ambush_smoke_post" );
    level._effect["door_open_dust_short_01"] = loadfx( "fx/dust/door_open_dust_short_01" );
    level._effect["factory_fog_cover"] = loadfx( "fx/smoke/factory_fog_cover" );
    level._effect["factory_fog_ground_400"] = loadfx( "fx/smoke/factory_fog_ground_400" );
    level._effect["factory_fog_patch"] = loadfx( "fx/smoke/factory_fog_patch" );
    level._effect["101ton_bomb"] = loadfx( "vfx/gameplay/explosions/101ton_bomb" );
    level._effect["101ton_bomb_nocometflash"] = loadfx( "vfx/gameplay/explosions/101ton_bomb_nocometflash" );
    level._effect["101ton_bomb_slow"] = loadfx( "vfx/gameplay/explosions/101ton_bomb_slow" );
    level._effect["101ton_bomb_cg_light"] = loadfx( "vfx/gameplay/explosions/101ton_bomb_cg_light" );
    level._effect["afterburner_contrail"] = loadfx( "vfx/gameplay/vehicles/afterburner_contrail" );
    level._effect["afterburner_contrail_faint"] = loadfx( "vfx/gameplay/vehicles/afterburner_contrail_faint" );
    level._effect["amber_light_100_blinker_nolight"] = loadfx( "vfx/ambient/lights/amber_light_100_blinker_nolight" );
    level._effect["amber_light_45_beacon_glow"] = loadfx( "vfx/ambient/lights/amber_light_45_beacon_glow" );
    level._effect["amber_light_45_beacon_nglight_glow"] = loadfx( "vfx/ambient/lights/amber_light_45_beacon_nglight_glow" );
    level._effect["amber_light_45_beacon_nolight_beam"] = loadfx( "vfx/ambient/lights/amber_light_45_beacon_nolight_beam" );
    level._effect["amber_light_45_beacon_nolight_glow"] = loadfx( "vfx/ambient/lights/amber_light_45_beacon_nolight_glow" );
    level._effect["amber_light_running_3_nolight"] = loadfx( "vfx/ambient/lights/amber_light_running_3_nolight" );
    level._effect["amber_light_running_4_nolight"] = loadfx( "vfx/ambient/lights/amber_light_running_4_nolight" );
    level._effect["amber_light_running_4_orient"] = loadfx( "vfx/ambient/lights/amber_light_running_4_orient" );
    level._effect["amber_light_running_8_nolight"] = loadfx( "vfx/ambient/lights/amber_light_running_8_nolight" );
    level._effect["drip_50x5"] = loadfx( "vfx/ambient/water/drip_50x5" );
    level._effect["drip_5x5"] = loadfx( "vfx/ambient/water/drip_5x5" );
    level._effect["dropped_flashlight_spotlight_runner"] = loadfx( "vfx/ambient/lights/dropped_flashlight_spotlight_runner" );
    level._effect["dust_motes_100"] = loadfx( "vfx/ambient/dust/particulates/dust_motes_100" );
    level._effect["dust_puff_light_fast_16"] = loadfx( "vfx/ambient/dust/dust_puff_light_fast_16" );
    level._effect["electrical_sparks"] = loadfx( "vfx/ambient/sparks/electrical_sparks" );
    level._effect["electrical_sparks_20_funner"] = loadfx( "vfx/ambient/sparks/electrical_sparks_20_funner" );
    level._effect["electrical_sparks_fuller"] = loadfx( "vfx/ambient/sparks/electrical_sparks_fuller" );
    level._effect["electrical_sparks_small_funner"] = loadfx( "vfx/ambient/sparks/electrical_sparks_small_funner" );
    level._effect["explosion_150"] = loadfx( "vfx/gameplay/explosions/explosion_150" );
    level._effect["factory_amber_flare"] = loadfx( "vfx/moments/factory/factory_amber_flare" );
    level._effect["factory_ambush_assembly_smoke"] = loadfx( "vfx/moments/factory/factory_ambush_assembly_smoke" );
    level._effect["factory_ambush_assembly_smoke_flir2"] = loadfx( "vfx/moments/factory/factory_ambush_assembly_smoke_flir2" );
    level._effect["factory_ambush_chest_blood"] = loadfx( "vfx/moments/factory/factory_ambush_chest_blood" );
    level._effect["factory_ambush_godray"] = loadfx( "vfx/moments/factory/factory_ambush_godray" );
    level._effect["factory_ambush_grenade_trail_runner"] = loadfx( "vfx/moments/factory/factory_ambush_grenade_trail_runner" );
    level._effect["factory_ambush_monitor"] = loadfx( "vfx/moments/factory/factory_ambush_monitor" );
    level._effect["factory_ambush_monitor_error"] = loadfx( "vfx/moments/factory/factory_ambush_monitor_error" );
    level._effect["factory_ambush_smoke"] = loadfx( "vfx/moments/factory/factory_ambush_smoke" );
    level._effect["factory_ambush_smoke_grenade"] = loadfx( "vfx/moments/factory/factory_ambush_smoke_grenade" );
    level._effect["factory_ambush_smoke_grenade_hand"] = loadfx( "vfx/moments/factory/factory_ambush_smoke_grenade_hand" );
    level._effect["grenade_flash_flir2"] = loadfx( "vfx/gameplay/explosions/grenade_flash_flir2" );
    level._effect["factory_box_scanner"] = loadfx( "vfx/moments/factory/factory_box_scanner" );
    level._effect["factory_box_scanner_godray"] = loadfx( "vfx/moments/factory/factory_box_scanner_godray" );
    level._effect["factory_breach_edge_sparks"] = loadfx( "vfx/moments/factory/factory_breach_edge_sparks" );
    level._effect["factory_breach_monitor_sparks_01"] = loadfx( "vfx/moments/factory/factory_breach_monitor_sparks_01" );
    level._effect["factory_breach_runner"] = loadfx( "vfx/moments/factory/factory_breach_runner" );
    level._effect["factory_car_fire_runner"] = loadfx( "vfx/moments/factory/factory_car_fire_runner" );
    level._effect["factory_chase_awning_dust"] = loadfx( "vfx/moments/factory/factory_chase_awning_dust" );
    level._effect["factory_chase_box_smoke"] = loadfx( "vfx/moments/factory/factory_chase_box_smoke" );
    level._effect["factory_chase_corner_dust"] = loadfx( "vfx/moments/factory/factory_chase_corner_dust" );
    level._effect["factory_chase_het_tire_smoke_runner"] = loadfx( "vfx/moments/factory/factory_chase_het_tire_smoke_runner" );
    level._effect["factory_chase_jeep_exp_fire_runner"] = loadfx( "vfx/moments/factory/factory_chase_jeep_exp_fire_runner" );
    level._effect["factory_chase_jeep_explosion "] = loadfx( "vfx/moments/factory/factory_chase_jeep_explosion" );
    level._effect["factory_chase_jeep_fire"] = loadfx( "vfx/moments/factory/factory_chase_jeep_fire" );
    level._effect["factory_chase_jeep_fire_small"] = loadfx( "vfx/moments/factory/factory_chase_jeep_fire_small" );
    level._effect["factory_chase_lamp_dust"] = loadfx( "vfx/moments/factory/factory_chase_lamp_dust" );
    level._effect["factory_chase_smoke_column"] = loadfx( "vfx/moments/factory/factory_chase_smoke_column" );
    level._effect["factory_chase_smoke_column_small"] = loadfx( "vfx/moments/factory/factory_chase_smoke_column_small" );
    level._effect["factory_chase_stack_big_dust"] = loadfx( "vfx/moments/factory/factory_chase_stack_big_dust" );
    level._effect["factory_chase_stack_big_dust_linger"] = loadfx( "vfx/moments/factory/factory_chase_stack_big_dust_linger" );
    level._effect["factory_chase_stack_break"] = loadfx( "vfx/moments/factory/factory_chase_stack_break" );
    level._effect["factory_chase_stack_glow_runner"] = loadfx( "vfx/moments/factory/factory_chase_stack_glow_runner" );
    level._effect["factory_chase_stack_pieces_impact_dust"] = loadfx( "vfx/moments/factory/factory_chase_stack_pieces_impact_dust" );
    level._effect["factory_chase_stack_pieces_trail_runner"] = loadfx( "vfx/moments/factory/factory_chase_stack_pieces_trail_runner" );
    level._effect["factory_chase_stack_pipe_explosion"] = loadfx( "vfx/moments/factory/factory_chase_stack_pipe_explosion" );
    level._effect["factory_chase_stack_small_dust"] = loadfx( "vfx/moments/factory/factory_chase_stack_small_dust" );
    level._effect["factory_chase_stack_small_roof_dust"] = loadfx( "vfx/moments/factory/factory_chase_stack_small_roof_dust" );
    level._effect["factory_chase_stack_walkway_dust"] = loadfx( "vfx/moments/factory/factory_chase_stack_walkway_dust" );
    level._effect["factory_explosion_1200"] = loadfx( "vfx/moments/factory/factory_explosion_1200" );
    level._effect["factory_explosion_600"] = loadfx( "vfx/moments/factory/factory_explosion_600" );
    level._effect["factory_floodlight"] = loadfx( "vfx/moments/factory/factory_floodlight" );
    level._effect["factory_floodlight_big"] = loadfx( "vfx/moments/factory/factory_floodlight_big" );
    level._effect["factory_floodlight_flare"] = loadfx( "vfx/moments/factory/factory_floodlight_flare" );
    level._effect["factory_floodlight_flare_far"] = loadfx( "vfx/moments/factory/factory_floodlight_flare_far" );
    level._effect["factory_floodlight_rain"] = loadfx( "vfx/moments/factory/factory_floodlight_rain" );
    level._effect["factory_godray_spread_200"] = loadfx( "vfx/moments/factory/factory_godray_spread_200" );
    level._effect["factory_godray_spread_240"] = loadfx( "vfx/moments/factory/factory_godray_spread_240" );
    level._effect["factory_het_cab_headlight_beam"] = loadfx( "vfx/moments/factory/factory_het_cab_headlight_beam" );
    level._effect["factory_het_cab_headlight_lens"] = loadfx( "vfx/moments/factory/factory_het_cab_headlight_lens" );
    level._effect["factory_intro_helicopter_rain"] = loadfx( "vfx/moments/factory/factory_intro_helicopter_rain" );
    level._effect["factory_intro_helicopter_raindrops"] = loadfx( "vfx/moments/factory/factory_intro_helicopter_raindrops" );
    level._effect["factory_intro_hero_rain"] = loadfx( "vfx/moments/factory/factory_intro_hero_rain" );
    level._effect["factory_intro_stab_blood_ally"] = loadfx( "vfx/moments/factory/factory_intro_stab_blood_ally" );
    level._effect["factory_intro_stab_blood_knife"] = loadfx( "vfx/moments/factory/factory_intro_stab_blood_knife" );
    level._effect["factory_intro_stab_blood_player"] = loadfx( "vfx/moments/factory/factory_intro_stab_blood_player" );
    level._effect["factory_intro_white_light_1200"] = loadfx( "vfx/moments/factory/factory_intro_white_light_1200" );
    level._effect["factory_moving_piece_light"] = loadfx( "vfx/moments/factory/factory_moving_piece_light" );
    level._effect["factory_presat_brake_light"] = loadfx( "vfx/moments/factory/factory_presat_brake_light" );
    level._effect["factory_presat_stadium_light"] = loadfx( "vfx/moments/factory/factory_presat_stadium_light" );
    level._effect["factory_red_flare"] = loadfx( "vfx/moments/factory/factory_red_flare" );
    level._effect["factory_red_flare_dir"] = loadfx( "vfx/moments/factory/factory_red_flare_dir" );
    level._effect["factory_sat_floor_steam"] = loadfx( "vfx/moments/factory/factory_sat_floor_steam" );
    level._effect["factory_sat_studio_light"] = loadfx( "vfx/moments/factory/factory_sat_studio_light" );
    level._effect["factory_sat_tunnel_steam_runner"] = loadfx( "vfx/moments/factory/factory_sat_tunnel_steam_runner" );
    level._effect["factory_single_drip"] = loadfx( "vfx/moments/factory/factory_single_drip" );
    level._effect["factory_single_splash"] = loadfx( "vfx/moments/factory/factory_single_splash" );
    level._effect["factory_spotlight_nomodel"] = loadfx( "vfx/moments/factory/factory_spotlight_nomodel" );
    level._effect["factory_studio_light_green"] = loadfx( "vfx/moments/factory/factory_studio_light_green" );
    level._effect["factory_warm_flare"] = loadfx( "vfx/moments/factory/factory_warm_flare" );
    level._effect["factory_warm_flare_dir"] = loadfx( "vfx/moments/factory/factory_warm_flare_dir" );
    level._effect["factory_water_splash_runner"] = loadfx( "vfx/moments/factory/factory_water_splash_runner" );
    level._effect["factory_water_splash_wave"] = loadfx( "vfx/moments/factory/factory_water_splash_wave" );
    level._effect["factory_water_splash_wave_bright"] = loadfx( "vfx/moments/factory/factory_water_splash_wave_bright" );
    level._effect["factory_water_spray_01"] = loadfx( "vfx/moments/factory/factory_water_spray_01" );
    level._effect["factory_white_flare"] = loadfx( "vfx/moments/factory/factory_white_flare" );
    level._effect["factory_white_flare_dir"] = loadfx( "vfx/moments/factory/factory_white_flare_dir" );
    level._effect["flashlight_spotlight"] = loadfx( "vfx/ambient/lights/flashlight_spotlight" );
    level._effect["flashlight_spotlight_flare"] = loadfx( "vfx/ambient/lights/flashlight_spotlight_flare" );
    level._effect["flashlight_spotlight_rain"] = loadfx( "vfx/ambient/lights/flashlight_spotlight_rain" );
    level._effect["glow_green_light_30_nolight"] = loadfx( "vfx/ambient/lights/vfx_glow_green_light_30_nolight" );
    level._effect["glow_green_light_15_nolight"] = loadfx( "vfx/ambient/lights/vfx_glow_green_light_15_nolight" );
    level._effect["glow_red_light_100_blinker"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_100_blinker" );
    level._effect["glow_red_light_100_blinker_nolight"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_100_blinker_nolight" );
    level._effect["glow_red_light_100_nolight"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_100_nolight" );
    level._effect["glow_red_light_15_nolight"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_15_nolight" );
    level._effect["glow_red_light_30_blinker_nolight"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_30_blinker_nolight" );
    level._effect["glow_red_light_400_strobe"] = loadfx( "vfx/ambient/lights/vfx_glow_red_light_400_strobe" );
    level._effect["no_effect"] = loadfx( "vfx/ambient/misc/no_effect" );
    level._effect["leaf_green_light_wind_blue"] = loadfx( "vfx/ambient/trees/leaf_green_light_wind_blue" );
    level._effect["leaf_green_strong_wind_blue"] = loadfx( "vfx/ambient/trees/leaf_green_strong_wind_blue" );
    level._effect["leaf_palm_light_wind_blue"] = loadfx( "vfx/ambient/trees/leaf_palm_light_wind_blue" );
    level._effect["leaf_palm_strong_wind_blue"] = loadfx( "vfx/ambient/trees/leaf_palm_strong_wind_blue" );
    level._effect["lights_stadium_drizzle"] = loadfx( "vfx/ambient/weather/rain/lights_stadium_drizzle" );
    level._effect["parking_lot_double_light"] = loadfx( "vfx/ambient/lights/parking_lot_double_light" );
    level._effect["parking_lot_double_light_rain"] = loadfx( "vfx/ambient/lights/parking_lot_double_light_rain" );
    level._effect["rain_ground_100_runner"] = loadfx( "vfx/ambient/weather/rain/rain_ground_100_runner" );
    level._effect["rain_horizontal_150"] = loadfx( "vfx/ambient/weather/rain/rain_horizontal_150" );
    level._effect["rain_splash_100x100"] = loadfx( "vfx/ambient/weather/rain/rain_splash_100x100" );
    level._effect["rain_splash_200x200"] = loadfx( "vfx/ambient/weather/rain/rain_splash_200x200" );
    level._effect["rain_splash_20x20"] = loadfx( "vfx/ambient/weather/rain/rain_splash_20x20" );
    level._effect["rain_splash_puddle_50x50_runner"] = loadfx( "vfx/ambient/weather/rain/rain_splash_puddle_50x50_runner" );
    level._effect["raindrops_screen_3_0"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_3_0" );
    level._effect["raindrops_screen_3_1"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_3_1" );
    level._effect["raindrops_screen_3_2"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_3_2" );
    level._effect["raindrops_screen_3_3"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_3_3" );
    level._effect["raindrops_screen_3_4"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_3_4" );
    level._effect["raindrops_screen_5_0"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_5_0" );
    level._effect["raindrops_screen_5_1"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_5_1" );
    level._effect["raindrops_screen_5_2"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_5_2" );
    level._effect["raindrops_screen_5_3"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_5_3" );
    level._effect["raindrops_screen_5_4"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_5_4" );
    level._effect["raindrops_screen_10_0"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_10_0" );
    level._effect["raindrops_screen_10_1"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_10_1" );
    level._effect["raindrops_screen_10_2"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_10_2" );
    level._effect["raindrops_screen_10_3"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_10_3" );
    level._effect["raindrops_screen_10_4"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_10_4" );
    level._effect["raindrops_screen_20_0"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_20_0" );
    level._effect["raindrops_screen_20_1"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_20_1" );
    level._effect["raindrops_screen_20_2"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_20_2" );
    level._effect["raindrops_screen_20_3"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_20_3" );
    level._effect["raindrops_screen_20_4"] = loadfx( "vfx/gameplay/screen_effects/raindrops_screen_20_4" );
    level._effect["rect_glow_120"] = loadfx( "vfx/ambient/lights/rect_glow_120" );
    level._effect["rect_glow_120_godray"] = loadfx( "vfx/ambient/lights/rect_glow_120_godray" );
    level._effect["rect_glow_300"] = loadfx( "vfx/ambient/lights/rect_glow_300" );
    level._effect["red_light_15_rain"] = loadfx( "vfx/ambient/lights/red_light_15_rain" );
    level._effect["red_light_15_rain_nolight"] = loadfx( "vfx/ambient/lights/red_light_15_rain_nolight" );
    level._effect["red_light_30_rain_oriented"] = loadfx( "vfx/ambient/lights/red_light_30_rain_oriented" );
    level._effect["red_light_30_rain_side_nolight"] = loadfx( "vfx/ambient/lights/red_light_30_rain_side_nolight" );
    level._effect["red_light_1200_strobe"] = loadfx( "vfx/ambient/lights/red_light_1200_strobe" );
    level._effect["smk_wispy_small_blue"] = loadfx( "vfx/ambient/smoke/smk_wispy_small_blue" );
    level._effect["smokestack_blue"] = loadfx( "vfx/ambient/smoke/smokestack_blue" );
    level._effect["smokestack_small_blue"] = loadfx( "vfx/ambient/smoke/smokestack_small_blue" );
    level._effect["smoky_fluorescent_light"] = loadfx( "vfx/ambient/lights/smoky_fluorescent_light" );
    level._effect["smoky_fluorescent_light_200_soft"] = loadfx( "vfx/ambient/lights/smoky_fluorescent_light_200_soft" );
    level._effect["smoky_fluorescent_light_soft"] = loadfx( "vfx/ambient/lights/smoky_fluorescent_light_soft" );
    level._effect["smoky_fluorescent_light_soft_faint"] = loadfx( "vfx/ambient/lights/smoky_fluorescent_light_soft_faint" );
    level._effect["smoky_fluorescent_light_wall_soft"] = loadfx( "vfx/ambient/lights/smoky_fluorescent_light_wall_soft" );
    level._effect["steam_low"] = loadfx( "vfx/ambient/steam/steam_low" );
    level._effect["steam_low_small"] = loadfx( "vfx/ambient/steam/steam_low_small" );
    level._effect["steam_floor_vent_low"] = loadfx( "vfx/ambient/steam/steam_floor_vent_low" );
    level._effect["steam_jet_small"] = loadfx( "vfx/ambient/steam/steam_jet_small" );
    level._effect["steam_lazy_60"] = loadfx( "vfx/ambient/steam/steam_lazy_60" );
    level._effect["steam_wall_vent"] = loadfx( "vfx/ambient/steam/steam_wall_vent" );
    level._effect["splash_body_shallow"] = loadfx( "vfx/ambient/water/splash_body_shallow" );
    level._effect["splash_body_shallow_bigger"] = loadfx( "vfx/ambient/water/splash_body_shallow_bigger" );
    level._effect["warm_ceiling_light_cone"] = loadfx( "vfx/ambient/lights/warm_ceiling_light_cone" );
    level._effect["warm_glow_60"] = loadfx( "vfx/ambient/lights/warm_glow_60" );
    level._effect["welding_sparks_funner"] = loadfx( "vfx/ambient/sparks/welding_sparks_funner" );
    level._effect["white_light_100_nolight"] = loadfx( "vfx/ambient/lights/white_light_100_nolight" );
    level._effect["white_light_60_beam_nolight"] = loadfx( "vfx/ambient/lights/white_light_60_beam_nolight" );
    level._effect["white_light_60_soft_nolight"] = loadfx( "vfx/ambient/lights/white_light_60_soft_nolight" );
    level._effect["iveco_headlight_l_night"] = loadfx( "vfx/gameplay/vehicles/iveco_headlight_l_night" );
    level._effect["iveco_headlight_r_night"] = loadfx( "vfx/gameplay/vehicles/iveco_headlight_r_night" );
    level._effect["car_taillight_btr80_eye"] = loadfx( "fx/misc/car_taillight_btr80_eye" );
    level._effect["real_spot"] = loadfx( "fx/lights/lights_spotlight_modern_so_spotlight_castle" );
    level._effect["cheap_spot"] = loadfx( "fx/lights/lights_spotlight_long_castle" );
    level._effect["flashlight"] = loadfx( "fx/misc/flashlight" );
    level._effect["office_muzzle_flash"] = loadfx( "fx/misc/factory_muzzle_light_big" );
    level._effect["lights_console_blue"] = loadfx( "fx/lights/fxlight_blue" );
    level._effect["spotlight_model_factory"] = loadfx( "fx/misc/spotlight_model_factory" );
    level._effect["silencer_flash"] = loadfx( "fx/misc/factory_muzzle_light_big" );
    level._effect["airstrip_explosion"] = loadfx( "fx/explosions/airstrip_explosion" );
    level._effect["factory_rooftop_wind_gust"] = loadfx( "vfx/moments/factory/factory_rooftop_wind_gust" );
    level._effect["factory_rooftop_wind_gust_ground"] = loadfx( "vfx/moments/factory/factory_rooftop_wind_gust_ground" );
    level._effect["water_pipe_spray_small"] = loadfx( "fx/water/water_pipe_spray_small" );
    level._effect["water_pipe_spray_wide"] = loadfx( "fx/water/water_pipe_spray_wide" );
    level._effect["heavy_drip_splash_floor"] = loadfx( "fx/water/heavy_drip_splash_floor" );
    level._effect["rain_splash_puddles_md"] = loadfx( "fx/weather/rain_splash_puddles_md" );
    level._effect["light_blink_forklift"] = loadfx( "fx/misc/light_blink_forklift" );
    level._effect["factory_single_splash_plr"] = loadfx( "vfx/moments/factory/factory_single_splash_plr" );
    level._effect["lightning"] = loadfx( "fx/weather/lightning" );
    level._effect["lightning_bolt"] = loadfx( "fx/weather/lightning_bolt" );
    level._effect["lightning_bolt_lrg"] = loadfx( "fx/weather/lightning_bolt_lrg" );
    maps\_weather::addlightningexploder( 10 );
    maps\_weather::addlightningexploder( 11 );
    maps\_weather::addlightningexploder( 12 );
    level.nextlightning = gettime() + 1;
    level._effect["rain_0"] = loadfx( "vfx/ambient/misc/no_effect" );
    level._effect["rain_1"] = loadfx( "vfx/moments/factory/rain_light" );
    level._effect["rain_2"] = loadfx( "vfx/moments/factory/rain_light" );
    level._effect["rain_3"] = loadfx( "vfx/moments/factory/rain_light" );
    level._effect["rain_4"] = loadfx( "vfx/moments/factory/rain_med1" );
    level._effect["rain_5"] = loadfx( "vfx/moments/factory/rain_med1" );
    level._effect["rain_6"] = loadfx( "vfx/moments/factory/rain_med1" );
    level._effect["rain_7"] = loadfx( "vfx/moments/factory/rain_med2" );
    level._effect["rain_8"] = loadfx( "vfx/moments/factory/rain_med2" );
    level._effect["rain_9"] = loadfx( "vfx/moments/factory/rain_heavy" );
    level._effect["rain_10"] = loadfx( "vfx/moments/factory/rain_heavy" );
    thread maps\_weather::raininit( "none" );
    thread factory_playerweather();

    if ( !getdvarint( "r_reflectionProbeGenerate" ) )
    {
        maps\createfx\factory_fx::main();
        maps\createfx\factory_sound::main();
    }
}

fx_init()
{
    maps\_global_fx_code::global_fx( "fx_stack_big_red_light", "vfx/ambient/lights/red_light_30_nolight", -2, "fx_stack_big_red_light" );
    maps\_global_fx_code::global_fx( "fx_stack_big_smoke", "vfx/ambient/smoke/smokestack_big_blue", -2, "fx_stack_big_smoke" );
    maps\_global_fx_code::global_fx( "fx_stack_small_red_light", "vfx/ambient/lights/red_light_30_nolight", -2, "fx_stack_small_red_light" );
    maps\_global_fx_code::global_fx( "fx_stack_small_smoke", "vfx/ambient/smoke/smokestack_big_blue", -2, "fx_stack_small_smoke" );
    maps\_global_fx_code::global_fx( "blue_light_60_nolight_FX_origin", "vfx/ambient/lights/blue_light_60_nolight", -2 );
    maps\_global_fx_code::global_fx( "red_light_15_rain_nolight_FX_origin", "vfx/ambient/lights/red_light_30_nolight", -2 );
    common_scripts\utility::flag_init( "fx_moving_pieces" );
    common_scripts\utility::flag_init( "fx_player_watersheeting" );
    common_scripts\utility::flag_init( "fx_screen_raindrops" );
    common_scripts\utility::flag_init( "fx_thermal_glitch" );
    common_scripts\utility::flag_init( "factory_rooftop_wind_gust" );
    common_scripts\utility::flag_init( "factory_rooftop_wind_gust_moment" );
    animscripts\utility::setfootstepeffect( "grass", loadfx( "vfx/moments/factory/factory_footstep_water" ) );
    animscripts\utility::setfootstepeffectsmall( "grass", loadfx( "vfx/moments/factory/factory_footstep_water" ) );
    animscripts\utility::setfootstepeffect( "gravel", loadfx( "vfx/moments/factory/factory_footstep_water" ) );
    animscripts\utility::setfootstepeffectsmall( "gravel", loadfx( "vfx/moments/factory/factory_footstep_water" ) );
    animscripts\utility::setfootstepeffect( "mud", loadfx( "vfx/moments/factory/factory_footstep_water" ) );
    animscripts\utility::setfootstepeffectsmall( "mud", loadfx( "vfx/moments/factory/factory_footstep_water" ) );
    fx_enable_ssao();
    level.friendly_thermal_reflector_effect = level._effect["no_effect"];
    level.assemblysmoke = undefined;
    level.assemblysmokeflir2 = undefined;
    level.assemblysmokepos = ( 5434.46, -1387.37, 279.125 );
    level.smokeintensity = 0;
    level.smokevolume = getent( "ambush_smoke_volume", "targetname" );
    maps\_utility::setsaveddvar_cg_ng( "fx_alphathreshold", 9, 2 );
    maps\_utility::setsaveddvar_cg_ng( "r_thermalColorOffset", 0, 0.23 );
    maps\_utility::setsaveddvar_cg_ng( "r_thermalDetailScale", 0.375, 0.1 );
    setsaveddvar( "r_thermalFadeControl", 1 );
    setsaveddvar( "r_thermalFadeColor", "0.19 0.43 0.19 1.0" );
    setsaveddvar( "r_thermalFadeMin", 1300 );
    setsaveddvar( "r_thermalFadeMax", 1301 );
    level.defaultreactivewind = [];
    level.defaultreactivewind["strength"] = 1.0;
    level.defaultreactivewind["amplitudeScale"] = 1.2;
    level.defaultreactivewind["frequencyScale"] = 0.7;
    setsaveddvar( "r_reactiveMotionWindStrength", level.defaultreactivewind["strength"] );
    setsaveddvar( "r_reactiveMotionWindAmplitudeScale", level.defaultreactivewind["amplitudeScale"] );
    setsaveddvar( "r_reactiveMotionWindFrequencyScale", level.defaultreactivewind["frequencyScale"] );
    maps\_utility::add_earthquake( "chase_quake_giant", 0.8, 1.6, 12000 );
    maps\_utility::add_earthquake( "chase_quake_big", 0.6, 1.6, 5500 );
    maps\_utility::add_earthquake( "chase_quake_medium", 0.5, 1.0, 4000 );
    maps\_utility::add_earthquake( "chase_quake_small", 0.4, 0.6, 3200 );
    level thread fx_ambient_setup();
    level thread fx_screen_raindrops();
}

fx_assembly_setup()
{
    common_scripts\utility::exploder( "assembly_ambient" );
    common_scripts\utility::exploder( "assembly_ambient_off_in_smoke" );
    var_0 = getentarray( "factory_welding_base_01", "script_noteworthy" );

    foreach ( var_2 in var_0 )
        playfxontag( level._effect["glow_green_light_30_nolight"], var_2, "tag_light_green" );
}

lgt_intro_train_light()
{

}

lgt_assembly_flicker_anim( var_0 )
{
    var_1 = var_0 getlightintensity();
    var_0 setlightintensity( 0.01 );
    wait( randomfloatrange( 2.0, 4.0 ) );
    var_0 thread maps\_lights::generic_flickering();
    wait( randomfloatrange( 6.0, 10.0 ) );
    var_0 notify( "stop_dynamic_light_behavior" );
    var_0 setlightintensity( var_1 );
}

lgt_ambush_begin()
{
    var_0 = getentarray( "ambush", "targetname" );
    var_1 = getentarray( "ambush_tv", "targetname" );
    var_2 = getentarray( "ambush_assembly_lights", "script_noteworthy" );

    foreach ( var_4 in var_0 )
        var_4 setlightintensity( 1.75 );

    foreach ( var_4 in var_1 )
        var_4 setlightintensity( 3.0 );

    var_8 = getentarray( "ambush_console", "targetname" );

    foreach ( var_4 in var_8 )
        var_4 = playfx( level._effect["lights_console_blue"], var_4.origin );

    level waittill( "ambush_triggered" );
    wait 16.75;

    foreach ( var_4 in var_0 )
        var_4 setlightintensity( 0.01 );

    foreach ( var_4 in var_1 )
        var_4 setlightintensity( 0.01 );

    wait 0.75;

    foreach ( var_4 in var_2 )
    {
        if ( maps\_lights::is_light_entity( var_4 ) )
            thread lgt_assembly_flicker_anim( var_4 );
    }

    common_scripts\utility::flag_set( "lgt_factory_ambush_breach" );
}

lgt_vision_fog_init()
{
    common_scripts\utility::flag_init( "lgt_factory_ambush_breach" );
    common_scripts\utility::flag_init( "lgt_exit_weapon_room" );
    setsaveddvar( "r_sky_fog_intensity", 0.75 );
    thread trigger_vf_sunsamplesize();
    thread trigger_vf_intro();
    thread trigger_vf_factory_reveal();
    thread trigger_vf_powerstealth();
    thread trigger_vf_presat();
    thread trigger_vf_weapon_reveal();
    thread trigger_vf_ambush();
    thread trigger_vf_ambush_breach();
    thread trigger_vf_chase();
}

trigger_vf_sunsamplesize()
{
    if ( level.ps3 == 1 )
        setsaveddvar( "sm_sunsamplesizenear", 0.1 );
    else
        setsaveddvar( "sm_sunsamplesizenear", 0.25 );

    common_scripts\utility::flag_wait( "lgt_factory_reveal" );

    if ( level.ps3 == 1 )
        maps\_utility::lerp_saveddvar( "sm_sunsamplesizenear", 0.1, 2 );
    else
        maps\_utility::lerp_saveddvar( "sm_sunsamplesizenear", 0.65, 2 );

    common_scripts\utility::flag_wait( "lgt_factory_ingress" );

    if ( level.ps3 == 1 )
        maps\_utility::lerp_saveddvar( "sm_sunsamplesizenear", 0.3, 1 );
    else
        maps\_utility::lerp_saveddvar( "sm_sunsamplesizenear", 0.65, 2 );
}

trigger_vf_intro()
{
    if ( maps\_utility::is_gen4() )
    {
        common_scripts\utility::flag_wait( "lgt_playerkill_done" );
        maps\_art::dof_enable_script( 6.87, 52.83, 5, 1000, 7000, 0.15, 0.6 );
        common_scripts\utility::flag_wait( "player_starts_moving" );
        maps\_art::dof_disable_script( 2.5 );
    }
}

trigger_vf_factory_reveal()
{
    var_0 = getent( "lgt_main_hall_door", "script_noteworthy" );
    var_1 = getentarray( "lgt_main_hall_flr", "script_noteworthy" );
    var_2 = var_0 getlightradius();
    var_0 setlightradius( var_2 / 10.0 );

    foreach ( var_4 in var_1 )
    {
        var_2 = var_4 getlightradius();
        var_4 setlightradius( var_2 / 10.0 );
    }

    common_scripts\utility::flag_wait_any( "entered_factory_1", "card_swiped" );
    wait 0.5;
    var_2 = var_0 getlightradius();
    var_0 setlightradius( var_2 * 10 );
    wait 1;

    foreach ( var_4 in var_1 )
    {
        var_2 = var_4 getlightradius();
        var_4 setlightradius( var_2 * 10.0 );
    }
}

trigger_vf_powerstealth()
{
    var_0 = getentarray( "lgt_powerstealth_racks", "script_noteworthy" );

    foreach ( var_2 in var_0 )
        var_2 setlightradius( 20 );

    common_scripts\utility::flag_wait_any( "entered_factory_1", "card_swiped" );

    foreach ( var_2 in var_0 )
        var_2 setlightradius( 700 );

    var_6 = 0;
    common_scripts\utility::flag_wait( "lgt_flag_powerstealth" );
    wait 0.1;
    var_7 = 20;

    if ( var_6 == 1 )
        var_7 = 800;

    var_6 = !var_6;

    foreach ( var_2 in var_0 )
        var_2 setlightradius( var_7 );
}

trigger_vf_presat()
{
    common_scripts\utility::flag_wait( "presat_entrance" );
    var_0 = getent( "lgt_presat_revolving_door", "script_noteworthy" );

    if ( isdefined( var_0 ) )
        var_0 setlightintensity( 2.5 );

    var_1 = getent( "lgt_presat_warning", "script_noteworthy" );

    if ( isdefined( var_1 ) )
    {
        var_2 = randomintrange( 5, 7 ) * 8;
        var_1 setlightintensity( 1.25 );

        for ( var_3 = 0; var_3 < var_2; var_3++ )
            var_1 rotateyaw( 45, 1 );

        var_1 setlightintensity( 0.1 );
    }
}

alphabetizeentarray( var_0 )
{
    if ( var_0.size <= 1 )
        return var_0;

    var_1 = [ var_0.size ];

    for ( var_2 = 0; var_2 < var_0.size; var_2++ )
    {
        var_3 = var_0[var_2];

        if ( isdefined( var_3.targetname ) )
        {
            var_1[var_2] = var_3.targetname;
            continue;
        }

        var_1[var_2] = "";
    }

    for ( var_4 = var_1.size - 1; var_4 >= 1; var_4-- )
    {
        var_5 = var_1[var_4];
        var_6 = var_0[var_4];
        var_7 = var_4;

        for ( var_2 = 0; var_2 < var_4; var_2++ )
        {
            var_8 = var_1[var_2];

            if ( stricmp( var_8, var_5 ) > 0 )
            {
                var_5 = var_8;
                var_6 = var_0[var_2];
                var_7 = var_2;
            }
        }

        if ( var_7 != var_4 )
        {
            var_1[var_7] = var_1[var_4];
            var_0[var_7] = var_0[var_4];
            var_1[var_4] = var_5;
            var_0[var_4] = var_6;
        }
    }

    return var_0;
}

changelightintensityovertime( var_0, var_1 )
{
    var_2 = self getlightintensity();
    var_3 = int( var_1 / 0.05 );
    var_4 = ( var_0 - var_2 ) / var_3;
    var_5 = var_2;

    for ( var_6 = 0; var_6 < var_3; var_6++ )
    {
        var_5 = var_5 + var_4;
        self setlightintensity( var_5 );
        wait 0.05;
    }

    self setlightintensity( var_0 );
}

trigger_vf_weapon_reveal()
{
    setsaveddvar( "r_fastModelPrimaryLightCheck", "1" );

    if ( maps\_utility::is_gen4() )
        lgt_weapon_reveal_sequence_ng();
    else
    {
        var_0 = getent( "satellite_room_vert_pieces", "targetname" );
        var_1 = getent( "satellite_ROG_01", "targetname" );
        var_2 = getent( "satellite_ROG_02", "targetname" );
        var_3 = getent( "satellite_ROG_03", "targetname" );
        var_4 = getent( "satellite_ROG_04", "targetname" );
        var_5 = getent( "satellite_ROG_05", "targetname" );
        var_6 = getent( "satellite_ROG_06", "targetname" );
        var_7 = getent( "satellite_room_rack_system", "targetname" );
        var_8 = getent( "satellite_room_rog_holder", "targetname" );
        var_9 = spawn( "script_model", ( 7202, -984, 324 ) );
        var_9 setmodel( "tag_origin" );
        var_0 retargetscriptmodellighting( var_9 );
        var_1 retargetscriptmodellighting( var_9 );
        var_2 retargetscriptmodellighting( var_9 );
        var_3 retargetscriptmodellighting( var_9 );
        var_4 retargetscriptmodellighting( var_9 );
        var_5 retargetscriptmodellighting( var_9 );
        var_6 retargetscriptmodellighting( var_9 );
        var_7 retargetscriptmodellighting( var_9 );
        var_8 retargetscriptmodellighting( var_9 );
        lgt_weapon_reveal_sequence();
    }
}

lgt_weapon_rim_dim( var_0, var_1 )
{
    foreach ( var_3 in var_0 )
        var_3 thread changelightintensityovertime( 0.2, 2.0 );

    foreach ( var_3 in var_1 )
        var_3 thread changelightintensityovertime( 0.1, 2.0 );

    wait 2.0;

    foreach ( var_3 in var_0 )
        var_3 setlightradius( 13 );
}

lgt_weapon_reveal_sequence()
{
    var_0 = getentarray( "lgt_sat_room_amber", "script_noteworthy" );
    var_1 = getentarray( "lgt_sat_room_rim", "script_noteworthy" );
    var_2 = getentarray( "lgt_sat_room_rim_keep", "script_noteworthy" );

    foreach ( var_4 in var_1 )
        var_4 setlightintensity( 0.3 );

    foreach ( var_4 in var_2 )
        var_4 setlightintensity( 0.3 );

    common_scripts\utility::flag_wait( "lgt_weapon_room_jump" );
    wait 4.5;

    foreach ( var_4 in var_0 )
        var_4 thread changelightintensityovertime( 1, 0.75 );

    common_scripts\utility::flag_wait( "lgt_weapon_sequencing" );
    wait 1;
    level.player thread maps\factory_audio::sfx_sat_room_lights( "scn_factory_satroom_lights_01" );
    thread lgt_weapon_rim_dim( var_1, var_2 );
    var_10 = getentarray( "lgt_weapon_room_01", "script_noteworthy" );

    foreach ( var_4 in var_10 )
    {
        var_12 = var_4 getlightintensity() * 20;
        var_4 setlightintensity( 1.25 );
    }

    wait 1;
    level.player thread maps\factory_audio::sfx_sat_room_lights( "scn_factory_satroom_lights_02" );
    var_10 = getentarray( "lgt_weapon_room_03", "script_noteworthy" );

    foreach ( var_4 in var_10 )
    {
        var_4 thread changelightintensityovertime( 2.0, 0.1 );
        var_12 = var_4 getlightintensity() * 40;
    }

    wait 1;
    level.player thread maps\factory_audio::sfx_sat_room_lights( "scn_factory_satroom_lights_03" );
    var_10 = getentarray( "lgt_weapon_room_04", "script_noteworthy" );

    foreach ( var_4 in var_10 )
    {
        var_12 = var_4 getlightintensity() * 20;
        var_4 setlightintensity( 2 );
    }
}

lgt_weapon_reveal_sequence_ng()
{
    var_0 = getentarray( "lgt_sat_room_amber", "script_noteworthy" );
    var_1 = getentarray( "lgt_sat_room_rim", "script_noteworthy" );
    var_2 = getentarray( "lgt_sat_room_rim_keep", "script_noteworthy" );

    foreach ( var_4 in var_1 )
        var_4 setlightintensity( 0.85 );

    foreach ( var_4 in var_2 )
        var_4 setlightintensity( 0.85 );

    common_scripts\utility::flag_wait( "lgt_weapon_room_jump" );
    wait 4.5;

    foreach ( var_4 in var_0 )
        var_4 thread changelightintensityovertime( 1.0, 0.75 );

    common_scripts\utility::flag_wait( "lgt_weapon_sequencing" );
    wait 1;
    level.player thread maps\factory_audio::sfx_sat_room_lights( "scn_factory_satroom_lights_01" );
    thread lgt_weapon_rim_dim( var_1, var_2 );
    var_10 = getentarray( "lgt_weapon_room_01", "script_noteworthy" );

    foreach ( var_4 in var_10 )
    {
        var_12 = var_4 getlightintensity() * 20;
        var_4 setlightintensity( 2.0 );
    }

    wait 2;
    level.player thread maps\factory_audio::sfx_sat_room_lights( "scn_factory_satroom_lights_02" );
    var_10 = getentarray( "lgt_weapon_room_03", "script_noteworthy" );

    foreach ( var_4 in var_10 )
        var_4 thread changelightintensityovertime( 3.25, 0.1 );

    wait 1;
    level.player thread maps\factory_audio::sfx_sat_room_lights( "scn_factory_satroom_lights_03" );
    var_10 = getentarray( "lgt_weapon_room_04", "script_noteworthy" );

    foreach ( var_4 in var_10 )
        var_4 setlightintensity( 3 );
}

trigger_vf_ambush()
{
    common_scripts\utility::flag_wait_any( "lgt_factory_ambush", "lgt_ambush_jump" );
    maps\_utility::vision_set_fog_changes( "factory_ambush", 1 );
    thread lgt_ambush_begin();
}

trigger_vf_ambush_breach()
{
    common_scripts\utility::flag_wait( "lgt_factory_ambush_breach" );
    maps\_utility::vision_set_fog_changes( "", 1 );
}

trigger_vf_chase()
{

}

fx_track_thermal()
{
    level thread fx_thermal_glitch_flashbang_spotlight();
    var_0 = 0;

    for (;;)
    {
        if ( level.player.thermal )
        {
            if ( !var_0 )
            {
                var_0 = 1;
                setexpfog( 0, 110, 0.4, 0.4, 0.4, 0, 0 );
                setsaveddvar( "r_cc_mode", "clut" );
                maps\_utility::stop_exploder( "assembly_ambient_off_in_thermal" );
            }
        }
        else if ( var_0 )
        {
            var_0 = 0;

            if ( isdefined( level.smokevolume ) && level.player istouching( level.smokevolume ) )
                setexpfog( 0, 110, 0.4, 0.4, 0.4, level.smokeintensity, 0 );

            setsaveddvar( "r_cc_mode", "off" );
            common_scripts\utility::exploder( "assembly_ambient_off_in_thermal" );
        }

        wait 0.05;
    }
}

fx_thermal_glitch_transition( var_0, var_1, var_2, var_3 )
{
    self endon( "fx_thermal_glitch" );
    var_4 = getdvarvector( "r_cc_toneBias1" );
    var_5 = getdvarvector( "r_cc_toneBias2" );
    var_6 = getdvarint( "r_cc_lerp1" );
    var_7 = getdvarint( "r_cc_lerp2" );
    var_8 = 0.1 * int( 10.0 * abs( var_5[0] - var_1[0] ) );

    while ( var_8 >= 0.05 )
    {
        var_8 = var_8 - 0.05;
        var_9 = 1.0 - var_8;
        setsaveddvar( "r_cc_toneBias1", vectorlerp( var_4, var_0, var_9 ) );
        setsaveddvar( "r_cc_toneBias2", vectorlerp( var_5, var_1, var_9 ) );
        setsaveddvar( "r_cc_lerp1", var_6 + var_9 * ( var_6 - var_2 ) );
        setsaveddvar( "r_cc_lerp2", var_7 + var_9 * ( var_6 - var_3 ) );
        wait 0.05;
    }

    setsaveddvar( "r_cc_toneBias1", var_0 );
    setsaveddvar( "r_cc_toneBias2", var_1 );
    setsaveddvar( "r_cc_lerp1", var_2 );
    setsaveddvar( "r_cc_lerp2", var_3 );
}

fx_thermal_glitch_flashbang_spotlight()
{
    level endon( "stop_thermal_glitch" );
    level.player endon( "end_thermal" );
    var_0 = 8;
    var_1 = 4;
    var_2 = var_0;
    level.player.thermal_blind_status = "";

    for (;;)
    {
        var_3 = level.player common_scripts\utility::waittill_any_return( "flashed", "spotlight_blind" );

        if ( level.player.thermal && isalive( level.player ) )
        {
            if ( var_3 == "flashed" )
                var_2 = var_0;
            else if ( var_3 == "spotlight_blind" )
                var_2 = var_1;

            if ( level.player.thermal_blind_status != "blind" )
            {
                common_scripts\utility::flag_set( "fx_thermal_glitch" );
                wait 0.01;
                level.player visionsetthermalforplayer( "factory_thermal_blowout_1", 0.0 );
                common_scripts\utility::flag_clear( "fx_thermal_glitch" );
                level thread fx_thermal_glitch_transition( ( 0.5, 0.5, 0.5 ), ( 1, 1, 1 ), 0, 5000 );
                level.player thread fx_thermal_glitch_timer( var_2 );
                level.player.thermal_blind_status = "blind";
            }
            else if ( level.player.thermal_blind_status == "blind" )
            {
                level.player notify( "reset_blind_timer" );
                level.player thread fx_thermal_glitch_timer( var_2 );
            }
        }

        wait 0.1;
    }
}

fx_thermal_glitch_timer( var_0 )
{
    self endon( "reset_blind_timer" );
    wait( var_0 );
    common_scripts\utility::flag_set( "fx_thermal_glitch" );
    wait 0.01;
    level.player visionsetthermalforplayer( "factory_flir2", 0.0 );
    common_scripts\utility::flag_clear( "fx_thermal_glitch" );
    level thread fx_thermal_glitch_transition( ( 0, 0, 0 ), ( 0, 0, 0 ), 0, 500 );
    level.player.thermal_blind_status = "normal";
}

fx_ambush_spawn_assembly_smoke()
{
    var_0 = getentarray( "gas_node", "targetname" );

    foreach ( var_2 in var_0 )
        playfx( level._effect["factory_ambush_smoke_grenade"], var_2.origin, ( 0, 0, 1 ), ( 1, 0, 0 ) );

    common_scripts\utility::waitframe();
    level.assemblysmoke = spawn( "script_model", level.player.origin );
    level.assemblysmoke setmodel( "tag_origin" );
    level.assemblysmoke addpitch( 270 );
    level.assemblysmoke linkto( level.player );
    playfxontag( level._effect["factory_ambush_assembly_smoke"], level.assemblysmoke, "tag_origin" );
    thread maps\factory_audio::ambush_smoke_grenade_explo_sfx();
    level.assemblysmokeflir2 = spawn( "script_model", level.assemblysmokepos );
    level.assemblysmokeflir2 setmodel( "tag_origin" );
    level.assemblysmokeflir2 addpitch( 270 );
    playfxontag( level._effect["factory_ambush_assembly_smoke_flir2"], level.assemblysmokeflir2, "tag_origin" );
    level.smokeintensity = 0.6;
    level thread fx_ambush_smoke_killer();
    setexpfog( 0, 110, 0.4, 0.4, 0.4, 0, 0.05 );
    wait 0.05;
    setexpfog( 0, 110, 0.4, 0.4, 0.4, level.smokeintensity, 8 );
    wait 3;
    fx_disable_ssao();
    maps\_utility::stop_exploder( "ambush_door_exploder_strobe" );
    maps\_utility::stop_exploder( "ambush_door_exploder_strobe_ng" );
    maps\_utility::stop_exploder( "assembly_ambient_off_in_smoke" );
}

fx_ambush_smoke_killer()
{
    common_scripts\utility::flag_wait( "ambush_stop_smoke" );
    fx_enable_ssao();

    if ( isdefined( level.assemblysmoke ) )
    {
        stopfxontag( level._effect["factory_ambush_assembly_smoke"], level.assemblysmoke, "tag_origin" );
        level.assemblysmoke delete();
    }

    if ( isdefined( level.assemblysmokeflir2 ) )
    {
        stopfxontag( level._effect["factory_ambush_assembly_smoke_flir2"], level.assemblysmokeflir2, "tag_origin" );
        level.assemblysmokeflir2 delete();
    }

    if ( isdefined( level.smokevolume ) && level.player istouching( level.smokevolume ) )
    {
        while ( level.smokeintensity >= 0.05 )
        {
            level.smokeintensity = level.smokeintensity - 0.05;

            if ( !level.player.thermal )
                setexpfog( 0, 110, 0.4, 0.4, 0.4, level.smokeintensity, 0.1 );

            wait 0.1;
        }
    }

    level.smokeintensity = 0;
    common_scripts\utility::exploder( "assembly_ambient_off_in_smoke" );
    maps\_utility::vision_set_fog_changes( "", 2 );
}

fx_ambush_welding_start( var_0 )
{
    if ( !isdefined( level.flag[var_0.animname] ) )
        common_scripts\utility::flag_init( var_0.animname );

    if ( !common_scripts\utility::flag( "factory_assembly_line_resume_speed_front" ) && !common_scripts\utility::flag( "factory_assembly_line_resume_speed_back" ) )
        return;

    common_scripts\utility::flag_clear( var_0.animname );
    var_1 = 0;

    while ( isdefined( var_0 ) && !common_scripts\utility::flag( var_0.animname ) )
    {
        if ( common_scripts\utility::flag( "factory_assembly_line_resume_speed_front" ) && common_scripts\utility::flag( "factory_assembly_line_resume_speed_back" ) && common_scripts\utility::flag( "fx_moving_pieces" ) )
            playfxontag( level._effect["welding_sparks_funner"], var_0, "tag_fx_01" );

        wait 0.5;
    }

    if ( isdefined( var_0 ) )
        killfxontag( level._effect["welding_sparks_funner"], var_0, "tag_fx_01" );
}

fx_ambush_welding_stop( var_0 )
{
    common_scripts\utility::flag_set( var_0.animname );
    stopfxontag( level._effect["welding_sparks_funner"], var_0, "tag_fx_01" );
}

fx_ambush_piece_start( var_0 )
{
    var_1 = "piece" + var_0.mover_prefab_id;

    if ( !isdefined( level.flag[var_1] ) )
        common_scripts\utility::flag_init( var_1 );

    if ( !common_scripts\utility::flag( "factory_assembly_line_resume_speed_front" ) || !common_scripts\utility::flag( "factory_assembly_line_resume_speed_back" ) )
        return;

    common_scripts\utility::flag_clear( var_1 );

    while ( !common_scripts\utility::flag( var_1 ) )
    {
        if ( common_scripts\utility::flag( "fx_moving_pieces" ) )
            playfxontag( level._effect["factory_moving_piece_light"], var_0, "j_anim_jnt_main_piston_arm_btm" );

        wait 0.5;
    }
}

fx_ambush_piece_stop( var_0 )
{
    common_scripts\utility::flag_set( "piece" + var_0.mover_prefab_id );
    stopfxontag( level._effect["factory_moving_piece_light"], var_0, "j_anim_jnt_main_piston_arm_btm" );
}

fx_ambush_chest_blood( var_0 )
{
    var_1 = common_scripts\utility::spawn_tag_origin();
    var_0.allowdeath = 0;
    var_1 linkto( var_0, "j_pectoral_le", ( 0, -5, 0 ), ( 0, 270, 0 ) );
    playfxontag( level._effect["factory_ambush_chest_blood"], var_1, "tag_origin" );
    wait 20;
    var_1 delete();
}

fx_assembly_cardreader_unlock( var_0 )
{
    maps\_utility::stop_exploder( "assembly_cardreader_lock" );
    common_scripts\utility::exploder( "assembly_cardreader_unlock" );
    fx_show_hide( "assembly_cardreader_unlock", "assembly_cardreader_lock" );
}

fx_ambient_setup()
{
    level.fx_outdoor_triggers = [];
    common_scripts\utility::array_thread( getentarray( "fx_intro_ambient", "targetname" ), ::fx_intro_ambient );
    common_scripts\utility::array_thread( getentarray( "fx_entrance_ambient", "targetname" ), ::fx_entrance_ambient );
    common_scripts\utility::array_thread( getentarray( "fx_powerstealth_ambient", "targetname" ), ::fx_powerstealth_ambient );
    common_scripts\utility::array_thread( getentarray( "fx_presat_ambient", "targetname" ), ::fx_presat_ambient );
    common_scripts\utility::array_thread( getentarray( "fx_sat_ambient", "targetname" ), ::fx_sat_ambient );
    common_scripts\utility::array_thread( getentarray( "fx_roof_ambient", "targetname" ), ::fx_roof_ambient );
    common_scripts\utility::array_thread( getentarray( "fx_chase_ambient", "targetname" ), ::fx_chase_ambient );
    level thread fx_outdoor_ambient();
}

fx_intro_ambient()
{
    level.fx_outdoor_triggers[level.fx_outdoor_triggers.size] = self;

    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "intro_ambient" );

        if ( maps\_utility::is_gen4() )
            common_scripts\utility::exploder( "intro_ambient_ng" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "intro_ambient" );
        maps\_utility::stop_exploder( "intro_ambient_ng" );
    }
}

fx_entrance_ambient()
{
    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "entrance_ambient" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "entrance_ambient" );
    }
}

fx_powerstealth_ambient()
{
    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "powerstealth_ambient" );

        if ( maps\_utility::is_gen4() )
            common_scripts\utility::exploder( "powerstealth_ambient_ng" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "powerstealth_ambient" );
        maps\_utility::stop_exploder( "powerstealth_ambient_ng" );
    }
}

fx_presat_ambient()
{
    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "presat_ambient" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "presat_ambient" );
    }
}

fx_sat_ambient()
{
    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "sat_ambient" );

        if ( maps\_utility::is_gen4() )
            common_scripts\utility::exploder( "sat_ambient_ng" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "sat_ambient" );
        maps\_utility::stop_exploder( "sat_ambient_ng" );
    }
}

fx_roof_ambient()
{
    level.fx_outdoor_triggers[level.fx_outdoor_triggers.size] = self;

    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "roof_ambient" );

        if ( maps\_utility::is_gen4() )
            common_scripts\utility::exploder( "roof_ambient_ng" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "roof_ambient" );
        maps\_utility::stop_exploder( "roof_ambient_ng" );
    }
}

fx_chase_ambient()
{
    level.fx_outdoor_triggers[level.fx_outdoor_triggers.size] = self;

    for (;;)
    {
        self waittill( "trigger" );
        common_scripts\utility::exploder( "chase_ambient" );

        while ( level.player istouching( self ) )
            wait 0.1;

        maps\_utility::stop_exploder( "chase_ambient" );
    }
}

fx_outdoor_ambient()
{
    var_0 = 0;

    for (;;)
    {
        var_1 = 0;

        foreach ( var_3 in level.fx_outdoor_triggers )
            var_1 = var_1 || level.player istouching( var_3 );

        if ( var_1 != var_0 )
        {
            if ( var_1 )
            {
                common_scripts\utility::exploder( "chase_intro_lamp_on" );
                common_scripts\utility::exploder( "outdoor_ambient" );
                common_scripts\utility::exploder( "smokestacks" );

                if ( maps\_utility::is_gen4() )
                    common_scripts\utility::exploder( "outdoor_ambient_ng" );
            }
            else
            {
                maps\_utility::stop_exploder( "chase_intro_lamp_on" );
                maps\_utility::stop_exploder( "outdoor_ambient" );
                maps\_utility::stop_exploder( "smokestacks" );
                maps\_utility::stop_exploder( "outdoor_ambient_ng" );
            }

            var_0 = var_1;
        }

        wait 0.1;
    }
}

fx_intro_rain()
{
    common_scripts\utility::exploder( "lights_rain_cards" );
    common_scripts\utility::flag_wait( "entered_conveyor" );
    maps\_utility::stop_exploder( "lights_rain_cards" );
}

fx_intro_cardreader_unlock()
{
    maps\_utility::stop_exploder( "intro_cardreader_lock" );
    common_scripts\utility::exploder( "intro_cardreader_unlock" );
    fx_show_hide( "intro_cardreader_unlock", "intro_cardreader_lock" );
}

fx_set_wind( var_0, var_1, var_2, var_3 )
{
    thread maps\_utility::lerp_saveddvar( "r_reactiveMotionWindStrength", var_0, var_3 );
    thread maps\_utility::lerp_saveddvar( "r_reactiveMotionWindAmplitudeScale", var_1, var_3 );
    thread maps\_utility::lerp_saveddvar( "r_reactiveMotionWindFrequencyScale", var_2, var_3 );
}

fx_show_hide( var_0, var_1 )
{
    if ( isdefined( var_0 ) )
    {
        var_2 = getentarray( var_0, "targetname" );

        foreach ( var_4 in var_2 )
            var_4 show();
    }

    if ( isdefined( var_1 ) )
    {
        var_2 = getentarray( var_1, "targetname" );

        foreach ( var_4 in var_2 )
            var_4 hide();
    }
}

fx_show_delete( var_0, var_1 )
{
    if ( isdefined( var_0 ) )
    {
        var_2 = getentarray( var_0, "targetname" );

        foreach ( var_4 in var_2 )
            var_4 show();
    }

    if ( isdefined( var_1 ) )
    {
        var_2 = getentarray( var_1, "targetname" );

        foreach ( var_4 in var_2 )
            var_4 delete();
    }
}

lightning_flash( var_0, var_1, var_2 )
{
    level notify( "emp_lighting_flash" );
    level endon( "emp_lighting_flash" );

    if ( level.createfx_enabled )
        return;

    var_1 = 1;

    if ( !isdefined( level.old_type ) )
        level.old_type = 9;

    if ( !isdefined( var_0 ) )
        var_0 = ( -20, 60, 0 );

    if ( !isdefined( var_2 ) )
    {
        var_2 = randomint( 10 );

        if ( var_2 == level.old_type )
            return;
    }

    level.old_type = var_2;

    if ( maps\_utility::is_gen4() )
    {
        var_3 = 4.0;

        switch ( var_2 )
        {
            case 0:
                lightning_single_flash( 1.5 * var_3, 1.5 * var_3, 1.8 * var_3, 0.8, 3 );
                lightning_single_flash( 1.7 * var_3, 1.7 * var_3, 2.1 * var_3, 1.0, 3 );
                lightning_single_flash( 1.5 * var_3, 1.5 * var_3, 1.8 * var_3, 0.8, 9 );
                lightning_single_flash( 3.2, 3.2, 3.6, 1.0, 3 );
                lightning_normal();
                wait( randomfloatrange( 1, 5 ) );
                break;
            case 1:
                lightning_single_flash( 1.7 * var_3, 1.7 * var_3, 2.1 * var_3, 1.0, 6 );
                lightning_single_flash( 1.0 * var_3, 1.0 * var_3, 1.3 * var_3, 0.8, 9 );
                lightning_single_flash( 1.9 * var_3, 1.9 * var_3, 2.4 * var_3, 0.8, 6 );
                lightning_single_flash( 1.0 * var_3, 1.0 * var_3, 1.3 * var_3, 1.0, 3 );
                lightning_normal();
                wait( randomfloatrange( 1, 4 ) );
                break;
            case 2:
                lightning_single_flash( 1.5 * var_3, 1.5 * var_3, 1.8 * var_3, 1.0, 6 );
                lightning_normal();
                wait( randomfloatrange( 0.1, 2 ) );
                break;
            case 3:
                lightning_single_flash( 1.7 * var_3, 1.7 * var_3, 2.1 * var_3, 1.0, 6 );
                lightning_normal();
                wait( randomfloatrange( 0.3, 2 ) );
                break;
            case 4:
                lightning_single_flash( 1.9 * var_3, 1.9 * var_3, 2.3 * var_3, 1.0, 6 );
                lightning_normal();
                wait( randomfloatrange( 0.3, 2 ) );
                break;
            case 5:
                lightning_single_flash( 1.0 * var_3, 1.0 * var_3, 1.3 * var_3, 0.8, 3 );
                lightning_single_flash( 1.0 * var_3, 1.0 * var_3, 1.3 * var_3, 0.8, 3 );
                lightning_normal();
                wait( randomfloatrange( 0.4, 4 ) );
                break;
            case 9:
            case 8:
            case 7:
            case 6:
                var_1 = randomintrange( 1, 3 );

                for ( var_4 = 0; var_4 < var_1; var_4++ )
                    lightning_single_flash( 0.7 * var_3, 0.7 * var_3, 0.9 * var_3, 1.0, randomfloatrange( 2, 9 ) );

                lightning_normal();
                wait( randomfloatrange( 0.1, 2 ) );
                break;
        }
    }
    else
    {
        switch ( var_2 )
        {
            case 0:
                lightning_single_flash( 0.5, 0.5, 0.8, 0.8, 3 );
                lightning_single_flash( 0.5, 0.6, 0.8, 1.0, 3 );
                lightning_single_flash( 0.5, 0.6, 0.8, 0.8, 9 );
                lightning_single_flash( 1.7, 1.7, 1.9, 1.0, 3 );
                lightning_normal();
                wait( randomfloatrange( 1, 5 ) );
                break;
            case 1:
                lightning_single_flash( 1.7, 1.7, 1.9, 1.0, 6 );
                lightning_single_flash( 0.5, 0.5, 0.8, 0.8, 9 );
                lightning_single_flash( 1.7, 1.7, 1.9, 0.8, 6 );
                lightning_single_flash( 0.8, 0.9, 1.2, 1.0, 3 );
                lightning_normal();
                wait( randomfloatrange( 1, 4 ) );
                break;
            case 2:
                lightning_single_flash( 0.5, 0.5, 0.8, 1.0, 6 );
                lightning_normal();
                wait( randomfloatrange( 0.1, 2 ) );
                break;
            case 3:
                lightning_single_flash( 1.0, 1.0, 1.5, 1.0, 6 );
                lightning_normal();
                wait( randomfloatrange( 0.3, 2 ) );
                break;
            case 4:
                lightning_single_flash( 1.2, 1.2, 1.5, 1.0, 6 );
                lightning_normal();
                wait( randomfloatrange( 0.3, 2 ) );
                break;
            case 5:
                lightning_single_flash( 0.8, 0.8, 1.2, 0.8, 3 );
                lightning_single_flash( 0.8, 0.8, 1.2, 0.8, 3 );
                lightning_normal();
                wait( randomfloatrange( 0.4, 4 ) );
                break;
            case 9:
            case 8:
            case 7:
            case 6:
                var_1 = randomintrange( 1, 3 );

                for ( var_4 = 0; var_4 < var_1; var_4++ )
                    lightning_single_flash( 0.7, 0.7, 0.9, 1.0, randomfloatrange( 2, 12 ) );

                lightning_normal();
                wait( randomfloatrange( 0.1, 2 ) );
                break;
        }
    }

    wait( randomfloatrange( 0.05, 0.061 ) );
    lightning_normal();
}

lightning_single_flash( var_0, var_1, var_2, var_3, var_4 )
{
    level.defaultsunlight = getmapsunlight();
    var_5 = level.defaultsunlight[0];
    var_6 = level.defaultsunlight[1];
    var_7 = level.defaultsunlight[2];
    var_8 = ( var_0 - var_5 ) / var_4;
    var_9 = ( var_1 - var_6 ) / var_4;

    for ( var_10 = ( var_2 - var_7 ) / var_4; var_4 * var_3 > 0; var_2 = var_2 - var_10 )
    {
        setsunlight( var_0, var_1, var_2 );
        wait 0.05;
        var_4 = var_4 - 1;
        var_0 = var_0 - var_8;
        var_1 = var_1 - var_9;
    }
}

lightning_flash_primary( var_0, var_1 )
{
    if ( isdefined( var_0 ) )
    {
        var_0 setlightintensity( 3.2 );

        if ( !isdefined( var_1 ) )
            var_1 = randomintrange( 1, 4 );

        for ( var_2 = 0; var_2 < var_1; var_2++ )
        {
            var_3 = randomint( 3 );

            switch ( var_3 )
            {
                case 0:
                    wait 0.05;
                    var_0 setlightintensity( 2.6 );
                    wait 0.05;
                    var_0 setlightintensity( 1.75 );
                    break;
                case 1:
                    wait 0.05;
                    var_0 setlightintensity( 2.2 );
                    wait 0.05;
                    var_0 setlightintensity( 3.15 );
                    wait 0.05;
                    var_0 setlightintensity( 1.7 );
                    break;
                case 2:
                    wait 0.05;
                    var_0 setlightintensity( 1.2 );
                    wait 0.05;
                    var_0 setlightintensity( 2.0 );
                    wait 0.05;
                    var_0 setlightintensity( 3.2 );
                    wait 0.05;
                    var_0 setlightintensity( 2.2 );
                    break;
            }

            wait( randomfloatrange( 0.05, 0.65 ) );
            var_0 setlightintensity( 0.1 );
        }

        var_0 setlightintensity( 0.1 );
    }
}

lightning_normal()
{
    resetsunlight();
    resetsundirection();
}

factory_playerweather()
{
    for (;;)
    {
        playfx( level._effect["rain_drops"], level.player.origin + ( 0, 0, 300 ), ( 0, 0, -1 ), ( 1, 0, 0 ) );
        wait 0.3;
    }
}

factory_chase_playerweather()
{
    maps\_weather::rainnone( 1 );

    for (;;)
    {
        playfx( level._effect["rain_drops"], level.player.origin + ( 0, 0, 300 ), ( -1, 0, 0 ) );
        wait 0.3;
    }
}

fx_assembly_monitor_bink_init()
{
    fx_show_hide( "ambush_breach_ally_monitor_1_bink", "ambush_breach_ally_monitor_1_desktop" );
    fx_show_hide( "ambush_breach_ally_monitor_2_bink", "ambush_breach_ally_monitor_2_desktop" );
    fx_show_hide( undefined, "ambush_breach_ally_monitor_1_dim" );
    fx_show_hide( undefined, "ambush_breach_ally_monitor_2_dim" );
    setsaveddvar( "cg_cinematicFullScreen", "0" );
    cinematicingameloopresident( "factory_computer_screensaver", 1 );
    thread ambush_screensaver_loop();
}

ambush_screensaver_loop()
{
    level endon( "stop_screensaver_bink" );
    thread fx_assembly_monitor_bink_load_and_play();

    for (;;)
    {
        cinematicingameloopresident( "factory_computer_screensaver", 1 );
        wait 1;

        while ( iscinematicplaying() )
            wait 0.5;
    }
}

fx_assembly_monitor_bink_load_and_play()
{
    common_scripts\utility::flag_wait( "ambush_triggered" );
    level notify( "stop_screensaver_bink" );
    cinematicingame( "factory_computer_pda" );
    pausecinematicingame( 1 );
    level waittill( "start_ambush_bink" );
    level notify( "stop_screensaver_bink" );
    pausecinematicingame( 0 );
}

fx_assembly_monitor_bink_start( var_0 )
{
    level notify( "start_ambush_bink" );
    fx_show_delete( "ambush_breach_ally_monitor_1_dim", "ambush_breach_ally_monitor_1_desktop" );
    fx_show_delete( "ambush_breach_ally_monitor_2_dim", "ambush_breach_ally_monitor_2_desktop" );
}

fx_enable_ssao()
{
    if ( maps\_utility::is_gen4() )
    {
        setsaveddvar( "r_ssaoStrength", 3.0 );
        setsaveddvar( "r_ssaoPower", 1.2 );
    }
}

fx_disable_ssao()
{
    if ( maps\_utility::is_gen4() )
    {
        setsaveddvar( "r_ssaoStrength", 0.5 );
        setsaveddvar( "r_ssaoPower", 0.5 );
    }
}

fx_assembly_ally_monitor_swap_1( var_0 )
{
    wait 0.5;
    fx_show_delete( "ambush_breach_ally_monitor_1_desktop", "ambush_breach_ally_monitor_1_bink" );
    wait 1.5;
    fx_show_delete( "ambush_breach_ally_monitor_1_dim", "ambush_breach_ally_monitor_1_desktop" );
    wait 0.1;
    common_scripts\utility::exploder( "ambush_ally_monitor_1_search" );
}

fx_assembly_ally_monitor_swap_2( var_0 )
{
    wait 0.5;
    fx_show_delete( "ambush_breach_ally_monitor_2_desktop", "ambush_breach_ally_monitor_2_bink" );
    wait 1.2;
    fx_show_delete( "ambush_breach_ally_monitor_2_dim", "ambush_breach_ally_monitor_2_desktop" );
    wait 0.1;
    common_scripts\utility::exploder( "ambush_ally_monitor_2_search" );
}

fx_assembly_ally_monitor_error( var_0 )
{
    maps\_utility::stop_exploder( "ambush_ally_monitor_1_search" );
    maps\_utility::stop_exploder( "ambush_ally_monitor_2_search" );
    wait 0.5;
    common_scripts\utility::exploder( "ambush_ally_monitor_error" );
    wait 10.7;
    maps\_utility::stop_exploder( "ambush_ally_monitor_error" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_1_dim" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_2_dim" );
    maps\_utility::stop_exploder( "ambush_ally_monitor_1_search" );
    maps\_utility::stop_exploder( "ambush_ally_monitor_2_search" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_1_bink" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_2_bink" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_1_desktop" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_2_desktop" );
}

fx_assembly_ally_monitor_delete()
{
    fx_show_delete( "ambush_breach_ally_monitor_1_desktop", "ambush_breach_ally_monitor_1_bink" );
    fx_show_delete( "ambush_breach_ally_monitor_2_desktop", "ambush_breach_ally_monitor_2_bink" );
    wait 12;
    maps\_utility::stop_exploder( "ambush_ally_monitor_1_search" );
    maps\_utility::stop_exploder( "ambush_ally_monitor_2_search" );
    wait 7.5;
    fx_show_delete( undefined, "ambush_breach_ally_monitor_1_desktop" );
    fx_show_delete( undefined, "ambush_breach_ally_monitor_2_desktop" );
}

fx_assembly_ceiling_cables( var_0 )
{
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_01"], "tag_fx_001" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_02"], "tag_fx_001" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_03"], "tag_fx_001" );
    wait 0.05;
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_01"], "tag_fx_002" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_02"], "tag_fx_002" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_03"], "tag_fx_002" );
    wait 0.05;
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_01"], "tag_fx_003" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_02"], "tag_fx_003" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_03"], "tag_fx_003" );
    wait 0.05;
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_01"], "tag_fx_004" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_02"], "tag_fx_004" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_03"], "tag_fx_004" );
    wait 0.05;
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_01"], "tag_fx_005" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_02"], "tag_fx_005" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_03"], "tag_fx_005" );
    wait 0.05;
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_01"], "tag_fx_006" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_02"], "tag_fx_006" );
    playfxontag( level._effect["electrical_sparks_small_funner"], level.assembly_ceiling_cables["factory_ambush_ceiling_cables_03"], "tag_fx_006" );
}

fx_screen_raindrops()
{
    level.screenrain = spawn( "script_model", ( 0, 0, 0 ) );
    level.screenrain setmodel( "tag_origin" );
    level.screenrain.origin = level.player.origin;
    level.screenrain linktoplayerview( level.player, "tag_origin", ( 0, 0, 0 ), ( 0, 0, 0 ), 1 );
    var_0 = 0;

    for (;;)
    {
        if ( common_scripts\utility::flag( "fx_screen_raindrops" ) || common_scripts\utility::flag( "fx_player_watersheeting" ) )
        {
            var_1 = 0;
            var_2 = level.player getplayerangles();

            if ( common_scripts\utility::flag( "fx_player_watersheeting" ) && var_2[0] < 25 )
            {
                level.player setwatersheeting( 1, 1.0 );
                var_1 = 1;
            }

            if ( common_scripts\utility::flag( "fx_screen_raindrops" ) )
            {
                if ( !var_1 && var_2[0] < -55 && randomint( 100 ) < 20 )
                    level.player setwatersheeting( 1, 1.0 );

                var_0 = var_0 + 1;

                if ( var_0 > 4 )
                    var_0 = 0;

                if ( var_2[0] < -40 )
                    playfxontag( level._effect["raindrops_screen_20_" + var_0], level.screenrain, "tag_origin" );
                else if ( var_2[0] < -25 )
                    playfxontag( level._effect["raindrops_screen_10_" + var_0], level.screenrain, "tag_origin" );
                else if ( var_2[0] < 25 )
                    playfxontag( level._effect["raindrops_screen_5_" + var_0], level.screenrain, "tag_origin" );
                else if ( var_2[0] < 40 )
                    playfxontag( level._effect["raindrops_screen_3_" + var_0], level.screenrain, "tag_origin" );
            }
        }

        wait 0.5;
    }
}

splash_on_player( var_0 )
{
    level endon( var_0 );
    level.splash_tag = "tag_flash";
    level.splash_x = randomfloatrange( -25, -5 );
    level.splash_y = randomfloatrange( -1, 1 );
    level.splash_z = randomfloatrange( 1, 2 );
    level.splash_angles = ( 0, 0, 0 );
    var_1 = spawn( "script_model", ( 0, 0, 20 ) );
    var_2 = spawn( "script_model", ( 0, 0, 20 ) );

    for (;;)
    {
        if ( common_scripts\utility::flag( "fx_player_watersheeting" ) )
        {
            var_3 = randomint( 3 );

            switch ( var_3 )
            {
                case 0:
                    level.splash_fx = "splash_body_shallow";
                    break;
                case 2:
                case 1:
                    level.splash_fx = "factory_single_splash_plr";
                    break;
            }
        }
        else
            level.splash_fx = "factory_single_splash_plr";

        if ( !level.player issprinting() && !level.player isreloading() )
        {
            var_1 delete();
            var_1 = spawn( "script_model", ( 0, 0, 0 ) );
            var_1 setmodel( "tag_origin" );
            thread splash_on_player_choose_location();
            var_1 linktoplayerview( self, level.splash_tag, ( level.splash_x, level.splash_y, level.splash_z ), level.splash_angles, 1 );
            playfx( common_scripts\utility::getfx( level.splash_fx ), var_1 gettagorigin( "tag_origin" ) );
            wait( randomfloatrange( 0.06, 0.3 ) );
            var_2 delete();
            var_2 = spawn( "script_model", ( 0, 0, 0 ) );
            var_2 setmodel( "tag_origin" );
            thread splash_on_player_choose_location();
            var_2 linktoplayerview( self, level.splash_tag, ( level.splash_x, level.splash_y, level.splash_z ), level.splash_angles, 1 );
            playfxontag( common_scripts\utility::getfx( level.splash_fx ), var_2, "tag_origin" );
        }

        wait( randomfloatrange( 0.06, 0.3 ) );
    }
}

splash_on_player_choose_location()
{
    var_0 = randomint( 2 );

    switch ( var_0 )
    {
        case 0:
            if ( level.player getcurrentweapon() == "p226_tactical+silencerpistol_sp+tactical_sp" )
            {
                level.splash_tag = "tag_flash";
                level.splash_x = randomfloatrange( -10, -1 );
                level.splash_y = randomfloatrange( -0.5, 0.5 );
                level.splash_z = randomfloatrange( 0.0, 0.5 );
                level.splash_angles = ( 0, 0, 0 );
                break;
            }

            if ( level.player getcurrentweapon() == "factory_knife" )
            {
                var_1 = getnumparts( level.player getviewmodel() );
                level.splash_tag = getpartname( level.player getviewmodel(), randomintrange( 0, var_1 ) );
                level.splash_x = 0;
                level.splash_y = 0;
                level.splash_z = 0;
                level.splash_angles = ( 90, 0, 0 );
                break;
            }

            level.splash_tag = "tag_flash";
            level.splash_x = randomfloatrange( 0, 20 );
            level.splash_y = randomfloatrange( 0, 2 );
            level.splash_z = randomfloatrange( -3, 0 );
            level.splash_angles = ( 0, 0, 0 );
            break;
        case 1:
            var_1 = getnumparts( level.player getviewmodel() );
            level.splash_tag = getpartname( level.player getviewmodel(), randomintrange( 0, var_1 ) );
            level.splash_x = 0;
            level.splash_y = 0;
            level.splash_z = 0;
            level.splash_angles = ( 90, 0, 0 );
            break;
    }
}

splash_on_actor( var_0, var_1, var_2 )
{
    while ( !common_scripts\utility::flag( var_1 ) )
    {
        if ( common_scripts\utility::flag( "factory_rooftop_wind_gust" ) )
        {
            var_3 = randomintrange( 0, 3 );

            switch ( var_3 )
            {
                case 4:
                case 2:
                case 1:
                case 0:
                    playfx( common_scripts\utility::getfx( "factory_rooftop_wind_gust_ground" ), var_0.origin + ( 30, 0, randomfloatrange( 0, 40 ) ), ( 0, -1, 0 ), ( 0, 0, 1 ) );
                    break;
            }
        }

        wait 0.25;
    }
}

rooftop_wind_gusts()
{

}

rain_on_actor( var_0, var_1, var_2, var_3 )
{
    level endon( var_1 );
    var_4 = common_scripts\utility::spawn_tag_origin();
    var_5 = common_scripts\utility::spawn_tag_origin();
    var_6 = common_scripts\utility::spawn_tag_origin();
    var_7 = var_0.origin;

    for (;;)
    {
        if ( common_scripts\utility::flag( var_1 ) )
            break;

        if ( !isalive( var_0 ) )
            break;

        var_8 = var_0.origin - ( 1, 1, 1 );
        var_9 = var_0.origin + ( 1, 1, 1 );

        if ( var_7[0] > var_8[0] && var_7[0] < var_9[0] && var_7[1] > var_8[1] && var_7[1] < var_9[1] )
        {
            var_5.origin = var_0 gettagorigin( "J_Neck" );
            var_5.origin = var_5.origin + ( randomfloatrange( -4, 4 ), randomfloatrange( -10, 2 ), randomfloatrange( 2, 4 ) );
            playfxontag( level._effect["factory_single_drip"], var_5, "tag_origin" );
            var_6.origin = var_0 gettagorigin( "J_Neck" );
            var_6.origin = var_6.origin + ( randomfloatrange( -11, 11 ), randomfloatrange( 0, 9 ), randomfloatrange( -1, 1 ) );
            playfxontag( level._effect["factory_single_drip"], var_6, "tag_origin" );
        }
        else
        {
            var_5.origin = var_0 gettagorigin( "J_Neck" );
            var_5.origin = var_5.origin + ( randomfloatrange( -11, 11 ), randomfloatrange( 0, 9 ), randomfloatrange( -45, -25 ) );
            playfxontag( level._effect["factory_single_drip"], var_6, "tag_origin" );
            var_6.origin = var_0 gettagorigin( "J_Neck" );
            var_6.origin = var_6.origin + ( randomfloatrange( -11, 11 ), randomfloatrange( 0, 9 ), randomfloatrange( -45, -25 ) );
            playfxontag( level._effect["factory_single_drip"], var_6, "tag_origin" );
        }

        common_scripts\utility::waitframe();

        if ( !isalive( var_0 ) )
            break;

        if ( !isdefined( var_3 ) )
        {
            var_8 = var_0.origin - ( 3, 3, 3 );
            var_9 = var_0.origin + ( 3, 3, 3 );

            if ( var_7[0] > var_8[0] && var_7[0] < var_9[0] && var_7[1] > var_8[1] && var_7[1] < var_9[1] )
            {
                var_10 = randomintrange( 0, 9 );

                if ( var_10 < 6 )
                {
                    var_4.origin = var_0 gettagorigin( "J_Neck" );
                    var_4.origin = var_4.origin + ( randomfloatrange( -11, 11 ), randomfloatrange( 0, 9 ), randomfloatrange( -1, 1 ) );
                    playfxontag( level._effect["factory_single_splash"], var_4, "tag_origin" );
                    playfxontag( level._effect["factory_single_drip"], var_4, "tag_origin" );
                }
                else if ( var_10 == 6 )
                {
                    var_4.origin = var_0 gettagorigin( "J_Neck" );
                    var_4.origin = var_4.origin + ( randomfloatrange( -3, 3 ), randomfloatrange( -10, -1 ), randomfloatrange( 7, 8 ) );
                    playfxontag( level._effect["factory_single_splash"], var_4, "tag_origin" );
                    playfxontag( level._effect["factory_single_drip"], var_4, "tag_origin" );
                }
                else if ( var_10 == 7 )
                {
                    var_4.origin = var_0 gettagorigin( "J_Neck" );
                    playfxontag( level._effect["factory_single_splash"], var_4, "tag_origin" );
                    playfxontag( level._effect["factory_single_drip"], var_4, "tag_origin" );
                }
                else if ( var_10 == 8 )
                {
                    var_4.origin = var_0 gettagorigin( "J_Wrist_RI" );
                    playfxontag( level._effect["factory_single_splash"], var_4, "tag_origin" );
                    playfxontag( level._effect["factory_single_drip"], var_4, "tag_origin" );
                }
                else if ( var_10 == 9 )
                {
                    var_4.origin = var_0 gettagorigin( "tag_inhand" );
                    playfxontag( level._effect["factory_single_splash"], var_4, "tag_origin" );
                    playfxontag( level._effect["factory_single_drip"], var_4, "tag_origin" );
                }
            }
            else
            {
                var_4.origin = var_0 gettagorigin( "J_Neck" );
                var_4.origin = var_4.origin + ( randomfloatrange( -11, 11 ), randomfloatrange( -5, 5 ), randomfloatrange( -6, 1 ) );
                playfxontag( level._effect["factory_single_splash"], var_4, "tag_origin" );
                var_8 = var_0.origin - ( 6, 6, 6 );
                var_9 = var_0.origin + ( 6, 6, 6 );
            }

            if ( isalive( var_0 ) )
                var_7 = var_0.origin;

            wait( var_2 );
        }
    }

    var_4 delete();
    var_5 delete();
    var_6 delete();
}

fx_sat_revolving_door_light_setup()
{
    fx_show_hide( "fx_sat_revolving_door_light_on", "fx_sat_revolving_door_light_off" );
    common_scripts\utility::array_thread( getentarray( "fx_sat_revolving_door_light_on", "targetname" ), ::fx_sat_revolving_door_light );
    common_scripts\utility::exploder( "presat_door_light" );
    common_scripts\utility::flag_wait( "presat_revolving_door_closed" );
    common_scripts\utility::array_thread( getentarray( "fx_sat_revolving_door_light_off", "targetname" ), ::fx_show_hide, "fx_sat_revolving_door_light_off" );
    maps\_utility::stop_exploder( "presat_door_light" );
}

fx_sat_revolving_door_light()
{
    var_0 = common_scripts\utility::spawn_tag_origin();
    var_0.origin = self.origin - ( 0, 0, 5 );
    var_0.angles = self.angles - ( 0, 90, 0 );
    var_0 linkto( self );
    playfxontag( level._effect["amber_light_45_beacon_nolight_beam"], var_0, "tag_origin" );
    var_1 = common_scripts\utility::spawn_tag_origin();
    var_1.origin = self.origin - ( 0, 0, 5 );
    var_1.angles = self.angles;
    var_1 linkto( self );
    playfxontag( level._effect["amber_light_45_beacon_nglight_glow"], var_1, "tag_origin" );
    thread fx_sat_revolving_door_light_rotate();
    common_scripts\utility::flag_wait( "presat_revolving_door_closed" );
    var_0 delete();
    var_1 delete();
    self hide();
}

fx_sat_revolving_door_light_rotate()
{
    self endon( "death" );

    while ( !common_scripts\utility::flag( "presat_revolving_door_closed" ) )
    {
        self rotateyaw( 360, 1.5 );
        wait 1.5;
    }
}

fx_intro_kill_ally_stab( var_0 )
{
    var_1 = common_scripts\utility::spawn_tag_origin();
    var_1 linkto( var_0, "j_neck", ( 3, -2, 6 ), ( 270, 0, 0 ) );
    playfxontag( level._effect["factory_ambush_chest_blood"], var_1, "tag_origin" );
    wait 20.0;
    var_1 delete();
}

fx_intro_kill_player_stab( var_0 )
{
    var_1 = common_scripts\utility::spawn_tag_origin();
    var_1 linkto( var_0, "j_spineupper", ( 12, -14, 0 ), ( 0, 275, 0 ) );
    playfxontag( level._effect["factory_intro_stab_blood_player"], var_1, "tag_origin" );
    wait 20.0;
    var_1 delete();
}

fx_intro_kill_player_jump_stab( var_0 )
{
    var_1 = common_scripts\utility::spawn_tag_origin();
    var_1 linkto( var_0, "j_pectoral_le", ( 0, -5, 0 ), ( 0, 270, 0 ) );
    playfxontag( level._effect["factory_ambush_chest_blood"], var_1, "tag_origin" );
    wait 20.0;
    var_1 delete();
}

fx_chase_het_tire_smoke( var_0 )
{
    playfxontag( level._effect["factory_chase_het_tire_smoke_runner"], var_0, "tag_wheel_back_left" );
    playfxontag( level._effect["factory_chase_het_tire_smoke_runner"], var_0, "tag_wheel_back_right" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_het_tire_smoke_runner"], var_0, "tag_wheel_middle_left" );
    playfxontag( level._effect["factory_chase_het_tire_smoke_runner"], var_0, "tag_wheel_middle_right" );
}

fx_chase_stack_small_break( var_0 )
{
    foreach ( var_2 in level.createfxent )
    {
        if ( var_2.v["fxid"] == "fx_stack_small_red_light" )
            var_2 common_scripts\_createfx::stop_fx_looper();
    }

    foreach ( var_2 in level.createfxent )
    {
        if ( var_2.v["fxid"] == "fx_stack_small_smoke" )
            var_2 common_scripts\_createfx::stop_fx_looper();
    }

    playfxontag( level._effect["factory_chase_stack_glow_runner"], var_0, "tag_fx_stack_top" );
    common_scripts\utility::exploder( "chase_stack_small_break" );
    wait 1.5;
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_00" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_01" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_02" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_03" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_04" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_05" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_06" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_07" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_08" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_09" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_10" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_11" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_12" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_13" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_14" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_15" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_16" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_17" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_18" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_19" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_20" );
    wait 1.2;
    stopfxontag( level._effect["factory_chase_stack_glow_runner"], var_0, "tag_fx_stack_top" );
}

fx_chase_first_explosion( var_0 )
{
    maps\_utility::vision_set_fog_changes( "factory_chase_explosion", 0.1 );
    common_scripts\utility::exploder( "chase_000" );
    level.player playrumbleonentity( "artillery_rumble" );
    level.third_opfor_car thread fx_chase_first_explosion_jeep();
    wait 2.0;
    maps\_utility::vision_set_fog_changes( "", 1.0 );
    common_scripts\utility::exploder( "chase_000_smoke_column" );
}

fx_chase_first_explosion_jeep()
{
    playfxontag( level._effect["factory_chase_jeep_exp_fire_runner"], self, "tag_origin" );
    wait 6.0;
    stopfxontag( level._effect["factory_chase_jeep_exp_fire_runner"], self, "tag_origin" );
}

fx_chase_box_explosions_start( var_0 )
{
    maps\_utility::vision_set_fog_changes( "factory_chase_explosion", 0.25 );
    wait 0.75;
    maps\_utility::vision_set_fog_changes( "", 0.5 );
}

fx_chase_warehouse_explosion( var_0 )
{
    maps\_utility::vision_set_fog_changes( "factory_chase_explosion", 0.1 );
    common_scripts\utility::exploder( "chase_warehouse_missile_explosion" );
    wait 0.4;
    common_scripts\utility::exploder( "chase_warehouse_door_explosion" );
    wait 0.3;
    common_scripts\utility::exploder( "chase_warehouse_explosion" );
    common_scripts\utility::exploder( "building_crash_01_exploder" );
    wait 2.0;
    common_scripts\utility::exploder( "chase_stack_base_explosion" );
    wait 0.5;
    maps\_utility::vision_set_fog_changes( "", 1.5 );
}

fx_chase_stack_break_01( var_0 )
{
    foreach ( var_2 in level.createfxent )
    {
        if ( var_2.v["fxid"] == "fx_stack_big_red_light" )
            var_2 common_scripts\_createfx::stop_fx_looper();
    }

    foreach ( var_2 in level.createfxent )
    {
        if ( var_2.v["fxid"] == "fx_stack_big_smoke" )
            var_2 common_scripts\_createfx::stop_fx_looper();
    }

    playfxontag( level._effect["factory_chase_stack_glow_runner"], var_0, "tag_fx_stack_top" );
    common_scripts\utility::exploder( "chase_stack_break_01" );
    wait 1.5;
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_21" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_22" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_23" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_24" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_25" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_26" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_27" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_28" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_29" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_30" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_31" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_32" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_33" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_34" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_35" );
    wait 4.5;
    stopfxontag( level._effect["factory_chase_stack_glow_runner"], var_0, "tag_fx_stack_top" );
}

fx_chase_stack_break_02( var_0 )
{
    common_scripts\utility::exploder( "chase_stack_break_02" );
    wait 1.5;
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_00" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_01" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_02" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_03" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_04" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_05" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_06" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_07" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_08" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_09" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_10" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_11" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_12" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_13" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_14" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_15" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_16" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_17" );
    common_scripts\utility::waitframe();
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_18" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_19" );
    playfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, "tag_fx_falling_chunks_20" );
}

fx_chase_stack_piece( var_0, var_1 )
{
    stopfxontag( level._effect["factory_chase_stack_pieces_trail_runner"], var_0, var_1 );
    var_2 = var_0 gettagorigin( var_1 );
    playfx( level._effect["factory_chase_stack_pieces_impact_dust"], var_2, ( 0, 0, 1 ), ( 1, 0, 0 ) );
}

fx_chase_stack_piece_027( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_23" );
}

fx_chase_stack_piece_037( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_33" );
}

fx_chase_stack_piece_039( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_31" );
}

fx_chase_stack_piece_042( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_35" );
}

fx_chase_stack_piece_007( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_20" );
}

fx_chase_stack_piece_008( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_15" );
}

fx_chase_stack_piece_017( var_0 )
{
    fx_chase_stack_piece( var_0, "tag_fx_falling_chunks_00" );
}

fx_chase_turn_explosion( var_0 )
{
    maps\_utility::vision_set_fog_changes( "factory_chase_explosion", 0.1 );
    common_scripts\utility::exploder( "chase_turn_dust" );
    maps\_utility::stop_exploder( "chase_stack_ground_collision_01" );
    wait 1.0;
    maps\_utility::vision_set_fog_changes( "factory_chase_outro", 1.0 );
}

fx_chase_helicopter_explosion( var_0 )
{
    maps\_utility::vision_set_fog_changes( "factory_chase_explosion", 0.1 );
    common_scripts\utility::exploder( "chase_helicopter_explosion" );
    wait 1.0;
    maps\_utility::vision_set_fog_changes( "factory_chase_outro", 0.5 );
    wait 1.0;
    common_scripts\utility::exploder( "chase_final_explosion" );
    thread maps\factory_audio::sfx_final_explosions();
}

fx_roof_heli_spotlight()
{
    playfxontag( level._effect["factory_spotlight_nomodel"], self, "tag_flash" );
    common_scripts\utility::flag_wait( "rooftop_door_open" );
    wait 7;

    if ( !common_scripts\utility::flag( "spotlight_off" ) )
    {
        killfxontag( level._effect["factory_spotlight_nomodel"], self, "tag_flash" );
        common_scripts\utility::waitframe();
        playfxontag( level._effect["spotlight_model_factory"], self, "tag_flash" );
        thread maps\factory_rooftop::thermal_disables_spotlight( self );
    }
}
