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

main()
{
    level._effect["vfx_sunflare_dart"] = loadfx( "vfx/ambient/atmospheric/vfx_sunflare_dart" );
    level._effect["vfx_wolf_mouth_spritz"] = loadfx( "vfx/moments/nml/vfx_wolf_mouth_spritz" );
    level._effect["vfx_wolf_fight_dust_med"] = loadfx( "vfx/moments/nml/vfx_wolf_fight_dust_med" );
    level._effect["vfx_wolf_attack_spit"] = loadfx( "vfx/moments/nml/vfx_wolf_attack_spit" );
    level._effect["sniper_muzzleflash"] = loadfx( "vfx/gameplay/muzzle_flashes/snp/vfx_muz_snp_w" );
    level._effect["vfx_nml_carfire"] = loadfx( "vfx/moments/nml/vfx_nml_carfire" );
    level._effect["vfx_cityscape_hanging_clouds"] = loadfx( "vfx/ambient/weather/clouds/vfx_cityscape_hanging_clouds" );
    level._effect["vfx_crater_hanging_clouds_near"] = loadfx( "vfx/ambient/weather/clouds/vfx_crater_hanging_clouds_near" );
    level._effect["vfx_crater_hanging_clouds_rim"] = loadfx( "vfx/ambient/weather/clouds/vfx_crater_hanging_clouds_rim" );
    level._effect["vfx_crater_hanging_clouds"] = loadfx( "vfx/ambient/weather/clouds/vfx_crater_hanging_clouds" );
    level._effect["vfx_dog_attack_blood_child_spurt"] = loadfx( "vfx/gameplay/dog/vfx_dog_attack_blood_child_spurt" );
    level._effect["vfx_pipe_drip"] = loadfx( "vfx/ambient/water/vfx_pipe_drip" );
    level._effect["vfx_particulates_thin"] = loadfx( "vfx/moments/nml/vfx_particulates_thin" );
    level._effect["vfx_warm_light_nodlight"] = loadfx( "vfx/ambient/lights/vfx_warm_light_nodlight" );
    level._effect["light_glow_white_bulb"] = loadfx( "fx/misc/light_glow_white_bulb" );
    level._effect["debris_smolder_large"] = loadfx( "vfx/ambient/fire/debris_smolder_large" );
    level._effect["transformer_spark_runner_loop"] = loadfx( "fx/explosions/transformer_spark_runner_loop" );
    level._effect["vfx_brown_moth_bulb"] = loadfx( "vfx/ambient/animals/vfx_brown_moth_bulb" );
    level._effect["brown_moths"] = loadfx( "vfx/ambient/animals/brown_moths" );
    level._effect["vfx_gnat_swarm"] = loadfx( "vfx/ambient/animals/vfx_gnat_swarm" );
    level._effect["vfx_falling_dust"] = loadfx( "vfx/ambient/dust/vfx_falling_dust" );
    level._effect["vfx_smk_plume_black_med"] = loadfx( "vfx/_requests/nml/smk_plume_black_med" );
    level._effect["vfx_window_break"] = loadfx( "vfx/moments/nml/vfx_window_break" );
    level._effect["vfx_window_break_mini"] = loadfx( "vfx/moments/nml/vfx_window_break_mini" );
    level._effect["vfx_door_breach"] = loadfx( "vfx/moments/nml/vfx_door_breach" );
    level._effect["vfx_door_breach_firstdust"] = loadfx( "vfx/moments/nml/vfx_door_breach_firstdust" );
    level._effect["vfx_nml_doorwayflare"] = loadfx( "vfx/ambient/lights/vfx_nml_doorwayflare" );
    level._effect["vfx_birds_flock_right_runner"] = loadfx( "vfx/moments/nml/vfx_birds_flock_right_runner" );
    level._effect["vfx_birds_flock_right"] = loadfx( "vfx/moments/nml/vfx_birds_flock_right" );
    level._effect["vfx_leafs_fall_main"] = loadfx( "vfx/moments/nml/vfx_leafs_fall_main" );
    level._effect["vfx_particulates_main"] = loadfx( "vfx/moments/nml/vfx_particulates_main" );
    level._effect["vfx_mist_slow_main_lessdense"] = loadfx( "vfx/moments/nml/vfx_mist_slow_main_lessdense" );
    level._effect["vfx_mist_slow_indoors_drift"] = loadfx( "vfx/moments/nml/vfx_mist_slow_indoors_drift" );
    level._effect["vfx_mist_slow_indoors"] = loadfx( "vfx/moments/nml/vfx_mist_slow_indoors" );
    level._effect["vfx_relic_liquid_flow_fan_out"] = loadfx( "vfx/moments/nml/vfx_relic_liquid_flow_fan_out" );
    level._effect["vfx_relic_liquid_leak_splash"] = loadfx( "vfx/moments/nml/vfx_relic_liquid_leak_splash" );
    level._effect["vfx_relic_liquid_flow_straight"] = loadfx( "vfx/moments/nml/vfx_relic_liquid_flow_straight" );
    level._effect["vfx_relic_liquid_leak"] = loadfx( "vfx/moments/nml/vfx_relic_liquid_leak" );
    level._effect["vfx_mist_fall_in_crater"] = loadfx( "vfx/moments/nml/vfx_mist_fall_in_crater" );
    level._effect["vfx_mist_insidecrater"] = loadfx( "vfx/moments/nml/vfx_mist_insidecrater" );
    level._effect["vfx_mist_slow_defined"] = loadfx( "vfx/moments/nml/vfx_mist_slow_defined" );
    level._effect["vfx_mist_slow_main_still"] = loadfx( "vfx/moments/nml/vfx_mist_slow_main_still" );
    level._effect["vfx_mist_slow_ground_dark"] = loadfx( "vfx/moments/nml/vfx_mist_slow_ground_dark" );
    level._effect["vfx_mist_slow_ground"] = loadfx( "vfx/moments/nml/vfx_mist_slow_ground" );
    level._effect["vfx_godray_anim"] = loadfx( "vfx/moments/nml/vfx_godray_anim" );
    level._effect["vfx_particulates_wind_thick"] = loadfx( "vfx/moments/nml/vfx_particulates_wind_thick" );
    level._effect["vfx_throughhouse_particulates"] = loadfx( "vfx/moments/nml/vfx_throughhouse_particulates" );
    level._effect["vfx_mist_slow_main"] = loadfx( "vfx/moments/nml/vfx_mist_slow_main" );
    level._effect["vfx_particulates_wind_main"] = loadfx( "vfx/moments/nml/vfx_particulates_wind_main" );
    level._effect["vfx_church_collapse_debris"] = loadfx( "vfx/moments/nml/vfx_church_collapse_debris" );

    if ( !getdvarint( "r_reflectionProbeGenerate" ) )
    {
        maps\createfx\nml_fx::main();
        maps\createfx\nml_sound::main();
    }

    level._effect["crater_chunk_dust"] = loadfx( "vfx/_requests/nml/crater_chunk_dust_runner" );
    level._effect["screen_glitch"] = loadfx( "vfx/moments/nml/vfx_distort_screen_glitch" );
    level._effect["breach_door"] = loadfx( "fx/explosions/breach_door" );
    level._effect["window_break"] = loadfx( "vfx/moments/nml/vfx_window_break" );
    level._effect["flesh_hit_head_fatal_exit_exaggerated"] = loadfx( "fx/impacts/flesh_hit_head_fatal_exit_exaggerated" );
    level._effect["pipe_dust"] = loadfx( "fx/_requests/nml/pipe_dust" );
    level._effect["cave_dust"] = loadfx( "fx/dust/ceiling_dust_default" );
    level._effect["rain_10_lite"] = loadfx( "fx/weather/rain_10_lite" );
    level._effect["leaves_fall_gentlewind_paris"] = loadfx( "fx/misc/leaves_fall_gentlewind_paris" );
    level._effect["bird_flock_large_right"] = loadfx( "fx/animals/bird_flock_large_right" );
    level._effect["smoke_plume_grey_02"] = loadfx( "fx/smoke/smoke_plume_grey_02" );
    level._effect["ash_hamburg"] = loadfx( "fx/weather/ash_hamburg" );
    level._effect["amb_ash"] = loadfx( "fx/smoke/amb_ash" );
    level._effect["light_glow_walllight_white"] = loadfx( "fx/misc/light_glow_walllight_white" );
    level._effect["flashlight"] = loadfx( "fx/misc/flashlight" );
    level._effect["castle_low_fog_lt"] = loadfx( "fx/maps/castle/castle_low_fog_lt" );
    level._effect["godray_forest"] = loadfx( "fx/lights/godray_forest" );
    level._effect["godray_forest_thin"] = loadfx( "fx/lights/godray_forest_thin" );
    level._effect["sniper_glint"] = loadfx( "fx/misc/scope_glint" );
    level._effect["btr_light"] = loadfx( "fx/_requests/nml/dlight_white" );
    level._effect["btr_light_fadein"] = loadfx( "fx/_requests/nml/dlight_white_fadein" );
    level._effect["bird"] = loadfx( "fx/misc/bird" );
    level._effect["bird_takeoff"] = loadfx( "fx/misc/bird_takeoff" );
    level._effect["vfx_birds_flock_large_takeoff"] = loadfx( "vfx/ambient/animals/vfx_birds_flock_large_takeoff" );
    level._effect["vfx_church_collapse_smoke"] = loadfx( "vfx/moments/nml/vfx_church_collapse_smoke" );
    level._effect["vfx_church_collapse_impact"] = loadfx( "vfx/moments/nml/vfx_church_collapse_impact" );
    level._effect["cliffside_near_shakeoff"] = loadfx( "fx/_requests/nml/cliffside_near_shakeoff" );
    level._effect["cliffside_rockslide_nml"] = loadfx( "fx/_requests/nml/cliffside_rockslide_nml" );
    level._effect["cliffside_ledge_fall"] = loadfx( "fx/_requests/nml/cliffside_ledge_fall" );
    level._effect["vfx_wolf_screendrool"] = loadfx( "vfx/moments/nml/vfx_wolf_attack_spit" );
    level._effect["vfx_wolf_droolfoam"] = loadfx( "vfx/moments/nml/vfx_wolf_mouth_spritz" );
    level._effect["vfx_dog_screenblood"] = loadfx( "vfx/gameplay/dog/vfx_dog_screenblood" );
    level._effect["vfx_dog_droolfoam"] = loadfx( "vfx/gameplay/dog/vfx_dog_droolfoam" );
    level._effect["vfx_dog_attack_blood"] = loadfx( "vfx/gameplay/dog/vfx_dog_attack_blood" );
    level._effect["vfx_dog_attack_throatrip"] = loadfx( "vfx/gameplay/dog/vfx_dog_attack_throatrip" );
    level._effect["vfx_dog_attack_blooddrip"] = loadfx( "vfx/gameplay/dog/vfx_dog_attack_blooddrip" );
    level._effect["vfx_scrnfx_dogcam"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_dogcam" );
    maps\_ash_falling::ash_init();
    thread random_earthquakes();
    thread rotating_turbines();
}

rotating_turbines()
{
    wait 0.1;
    var_0 = common_scripts\utility::array_combine( getentarray( "rotating_turbine_2", "targetname" ), getentarray( "rotating_turbine_3", "targetname" ) );
    common_scripts\utility::array_thread( var_0, ::rotate_turbine );
}

rotate_turbine()
{
    var_0 = randomfloatrange( 3, 6 );
    self.org = common_scripts\utility::get_linked_ent();
    self linkto( self.org );

    for (;;)
    {
        self.org rotateroll( 90, var_0 );
        wait( var_0 * 0.8 );
    }
}

random_earthquakes()
{
    common_scripts\utility::waitframe();

    if ( !common_scripts\utility::flag_exist( "start_earthquakes" ) )
        return;

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

    for (;;)
    {
        var_0 = level.player.origin + common_scripts\utility::randomvector( 100 );

        if ( !isdefined( level.next_earthquake ) )
            level.next_earthquake = "weak_4s";

        if ( common_scripts\utility::cointoss() || level.force_next_earthquake )
        {
            level notify( "earthquaking", 3 );
            common_scripts\utility::do_earthquake( level.next_earthquake, var_0 );
        }

        level.next_earthquake = undefined;

        if ( !isdefined( level.next_quake_sound ) )
            var_1 = "elm_nml_quake_sm";
        else
            var_1 = level.next_quake_sound;

        thread common_scripts\utility::play_sound_in_space( var_1, var_0 );
        level.next_quake_sound = undefined;
        level common_scripts\utility::waittill_notify_or_timeout( "trigger_earthquake", randomfloatrange( 25, 45 ) );
        common_scripts\utility::flag_wait( "start_earthquakes" );
    }
}
