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

init()
{
    level._effect["sentry_overheat_mp"] = loadfx( "vfx/gameplay/mp/killstreaks/vfx_sg_overheat_smoke" );
    level._effect["sentry_explode_mp"] = loadfx( "vfx/gameplay/mp/killstreaks/vfx_ims_explosion" );
    level._effect["sentry_smoke_mp"] = loadfx( "vfx/gameplay/mp/killstreaks/vfx_sg_damage_blacksmoke" );
    level.sentrysettings = [];
    level.sentrysettings["alien_sentry"] = spawnstruct();
    level.sentrysettings["alien_sentry"].health = 999999;
    level.sentrysettings["alien_sentry"].maxhealth = 300;
    level.sentrysettings["alien_sentry"].burstmin = 5;
    level.sentrysettings["alien_sentry"].burstmax = 40;
    level.sentrysettings["alien_sentry"].pausemin = 0.15;
    level.sentrysettings["alien_sentry"].pausemax = 0.35;
    level.sentrysettings["alien_sentry"].sentrymodeon = "sentry";
    level.sentrysettings["alien_sentry"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["alien_sentry"].timeout = 600.0;
    level.sentrysettings["alien_sentry"].spinuptime = 1.0;
    level.sentrysettings["alien_sentry"].overheattime = 5.0;
    level.sentrysettings["alien_sentry"].cooldowntime = 0.1;
    level.sentrysettings["alien_sentry"].fxtime = 0.3;
    level.sentrysettings["alien_sentry"].streakname = "sentry";
    level.sentrysettings["alien_sentry"].weaponinfo = "alien_sentry_minigun_1_mp";
    level.sentrysettings["alien_sentry"].modelbase = "weapon_sentry_chaingun";
    level.sentrysettings["alien_sentry"].modelplacement = "weapon_sentry_chaingun_obj";
    level.sentrysettings["alien_sentry"].modelplacementfailed = "weapon_sentry_chaingun_obj_red";
    level.sentrysettings["alien_sentry"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["alien_sentry"].hintstring = &"SENTRY_PICKUP";
    level.sentrysettings["alien_sentry"].headicon = 1;
    level.sentrysettings["alien_sentry"].teamsplash = "used_sentry";
    level.sentrysettings["alien_sentry"].shouldsplash = 0;
    level.sentrysettings["alien_sentry"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["alien_sentry"].issentient = 1;
    level.sentrysettings["alien_sentry_1"] = spawnstruct();
    level.sentrysettings["alien_sentry_1"].health = 999999;
    level.sentrysettings["alien_sentry_1"].maxhealth = 300;
    level.sentrysettings["alien_sentry_1"].burstmin = 5;
    level.sentrysettings["alien_sentry_1"].burstmax = 40;
    level.sentrysettings["alien_sentry_1"].pausemin = 0.15;
    level.sentrysettings["alien_sentry_1"].pausemax = 0.35;
    level.sentrysettings["alien_sentry_1"].sentrymodeon = "sentry";
    level.sentrysettings["alien_sentry_1"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["alien_sentry_1"].timeout = 600.0;
    level.sentrysettings["alien_sentry_1"].spinuptime = 1.0;
    level.sentrysettings["alien_sentry_1"].overheattime = 5.0;
    level.sentrysettings["alien_sentry_1"].cooldowntime = 0.1;
    level.sentrysettings["alien_sentry_1"].fxtime = 0.3;
    level.sentrysettings["alien_sentry_1"].streakname = "sentry";
    level.sentrysettings["alien_sentry_1"].weaponinfo = "alien_sentry_minigun_2_mp";
    level.sentrysettings["alien_sentry_1"].modelbase = "weapon_sentry_chaingun";
    level.sentrysettings["alien_sentry_1"].modelplacement = "weapon_sentry_chaingun_obj";
    level.sentrysettings["alien_sentry_1"].modelplacementfailed = "weapon_sentry_chaingun_obj_red";
    level.sentrysettings["alien_sentry_1"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["alien_sentry_1"].hintstring = &"SENTRY_PICKUP";
    level.sentrysettings["alien_sentry_1"].headicon = 1;
    level.sentrysettings["alien_sentry_1"].teamsplash = "used_sentry";
    level.sentrysettings["alien_sentry_1"].shouldsplash = 0;
    level.sentrysettings["alien_sentry_1"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["alien_sentry_1"].issentient = 1;
    level.sentrysettings["alien_sentry_2"] = spawnstruct();
    level.sentrysettings["alien_sentry_2"].health = 999999;
    level.sentrysettings["alien_sentry_2"].maxhealth = 300;
    level.sentrysettings["alien_sentry_2"].burstmin = 10;
    level.sentrysettings["alien_sentry_2"].burstmax = 80;
    level.sentrysettings["alien_sentry_2"].pausemin = 0.15;
    level.sentrysettings["alien_sentry_2"].pausemax = 0.25;
    level.sentrysettings["alien_sentry_2"].sentrymodeon = "sentry";
    level.sentrysettings["alien_sentry_2"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["alien_sentry_2"].timeout = 600.0;
    level.sentrysettings["alien_sentry_2"].spinuptime = 1.0;
    level.sentrysettings["alien_sentry_2"].overheattime = 5.0;
    level.sentrysettings["alien_sentry_2"].cooldowntime = 0.2;
    level.sentrysettings["alien_sentry_2"].fxtime = 0.3;
    level.sentrysettings["alien_sentry_2"].streakname = "sentry";
    level.sentrysettings["alien_sentry_2"].weaponinfo = "alien_sentry_minigun_3_mp";
    level.sentrysettings["alien_sentry_2"].modelbase = "weapon_sentry_chaingun";
    level.sentrysettings["alien_sentry_2"].modelplacement = "weapon_sentry_chaingun_obj";
    level.sentrysettings["alien_sentry_2"].modelplacementfailed = "weapon_sentry_chaingun_obj_red";
    level.sentrysettings["alien_sentry_2"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["alien_sentry_2"].hintstring = &"SENTRY_PICKUP";
    level.sentrysettings["alien_sentry_2"].headicon = 1;
    level.sentrysettings["alien_sentry_2"].teamsplash = "used_sentry";
    level.sentrysettings["alien_sentry_2"].shouldsplash = 0;
    level.sentrysettings["alien_sentry_2"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["alien_sentry_2"].issentient = 1;
    level.sentrysettings["alien_sentry_3"] = spawnstruct();
    level.sentrysettings["alien_sentry_3"].health = 999999;
    level.sentrysettings["alien_sentry_3"].maxhealth = 300;
    level.sentrysettings["alien_sentry_3"].burstmin = 10;
    level.sentrysettings["alien_sentry_3"].burstmax = 80;
    level.sentrysettings["alien_sentry_3"].pausemin = 0.15;
    level.sentrysettings["alien_sentry_3"].pausemax = 0.25;
    level.sentrysettings["alien_sentry_3"].sentrymodeon = "sentry";
    level.sentrysettings["alien_sentry_3"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["alien_sentry_3"].timeout = 600.0;
    level.sentrysettings["alien_sentry_3"].spinuptime = 1.0;
    level.sentrysettings["alien_sentry_3"].overheattime = 5.0;
    level.sentrysettings["alien_sentry_3"].cooldowntime = 0.2;
    level.sentrysettings["alien_sentry_3"].fxtime = 0.3;
    level.sentrysettings["alien_sentry_3"].streakname = "sentry";
    level.sentrysettings["alien_sentry_3"].weaponinfo = "alien_sentry_minigun_4_mp";
    level.sentrysettings["alien_sentry_3"].modelbase = "weapon_sentry_chaingun";
    level.sentrysettings["alien_sentry_3"].modelplacement = "weapon_sentry_chaingun_obj";
    level.sentrysettings["alien_sentry_3"].modelplacementfailed = "weapon_sentry_chaingun_obj_red";
    level.sentrysettings["alien_sentry_3"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["alien_sentry_3"].hintstring = &"SENTRY_PICKUP";
    level.sentrysettings["alien_sentry_3"].headicon = 1;
    level.sentrysettings["alien_sentry_3"].teamsplash = "used_sentry";
    level.sentrysettings["alien_sentry_3"].shouldsplash = 0;
    level.sentrysettings["alien_sentry_3"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["alien_sentry_3"].issentient = 1;
    level.sentrysettings["alien_sentry_4"] = spawnstruct();
    level.sentrysettings["alien_sentry_4"].health = 999999;
    level.sentrysettings["alien_sentry_4"].maxhealth = 300;
    level.sentrysettings["alien_sentry_4"].burstmin = 10;
    level.sentrysettings["alien_sentry_4"].burstmax = 80;
    level.sentrysettings["alien_sentry_4"].pausemin = 0.15;
    level.sentrysettings["alien_sentry_4"].pausemax = 0.25;
    level.sentrysettings["alien_sentry_4"].sentrymodeon = "sentry";
    level.sentrysettings["alien_sentry_4"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["alien_sentry_4"].timeout = 600.0;
    level.sentrysettings["alien_sentry_4"].spinuptime = 1.0;
    level.sentrysettings["alien_sentry_4"].overheattime = 6.0;
    level.sentrysettings["alien_sentry_4"].cooldowntime = 0.2;
    level.sentrysettings["alien_sentry_4"].fxtime = 0.3;
    level.sentrysettings["alien_sentry_4"].streakname = "sentry";
    level.sentrysettings["alien_sentry_4"].weaponinfo = "alien_sentry_minigun_4_mp";
    level.sentrysettings["alien_sentry_4"].modelbase = "weapon_sentry_chaingun";
    level.sentrysettings["alien_sentry_4"].modelplacement = "weapon_sentry_chaingun_obj";
    level.sentrysettings["alien_sentry_4"].modelplacementfailed = "weapon_sentry_chaingun_obj_red";
    level.sentrysettings["alien_sentry_4"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["alien_sentry_4"].hintstring = &"SENTRY_PICKUP";
    level.sentrysettings["alien_sentry_4"].headicon = 1;
    level.sentrysettings["alien_sentry_4"].teamsplash = "used_sentry";
    level.sentrysettings["alien_sentry_4"].shouldsplash = 0;
    level.sentrysettings["alien_sentry_4"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["alien_sentry_4"].issentient = 1;
    level.sentrysettings["gl_turret"] = spawnstruct();
    level.sentrysettings["gl_turret"].health = 999999;
    level.sentrysettings["gl_turret"].maxhealth = 650;
    level.sentrysettings["gl_turret"].burstmin = 20;
    level.sentrysettings["gl_turret"].burstmax = 130;
    level.sentrysettings["gl_turret"].pausemin = 0.15;
    level.sentrysettings["gl_turret"].pausemax = 0.35;
    level.sentrysettings["gl_turret"].sentrymodeon = "manual";
    level.sentrysettings["gl_turret"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["gl_turret"].timeout = 600.0;
    level.sentrysettings["gl_turret"].spinuptime = 0.05;
    level.sentrysettings["gl_turret"].overheattime = 2.5;
    level.sentrysettings["gl_turret"].cooldowntime = 0.5;
    level.sentrysettings["gl_turret"].fxtime = 0.3;
    level.sentrysettings["gl_turret"].streakname = "grenade";
    level.sentrysettings["gl_turret"].weaponinfo = "alien_manned_gl_turret_mp";
    level.sentrysettings["gl_turret"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["gl_turret"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["gl_turret"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["gl_turret"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["gl_turret"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["gl_turret"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["gl_turret"].headicon = 0;
    level.sentrysettings["gl_turret"].teamsplash = "used_gl_turret";
    level.sentrysettings["gl_turret"].shouldsplash = 1;
    level.sentrysettings["gl_turret"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["gl_turret"].issentient = 0;
    level.sentrysettings["gl_turret_1"] = spawnstruct();
    level.sentrysettings["gl_turret_1"].health = 999999;
    level.sentrysettings["gl_turret_1"].maxhealth = 650;
    level.sentrysettings["gl_turret_1"].burstmin = 20;
    level.sentrysettings["gl_turret_1"].burstmax = 130;
    level.sentrysettings["gl_turret_1"].pausemin = 0.15;
    level.sentrysettings["gl_turret_1"].pausemax = 0.35;
    level.sentrysettings["gl_turret_1"].sentrymodeon = "manual";
    level.sentrysettings["gl_turret_1"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["gl_turret_1"].timeout = 600.0;
    level.sentrysettings["gl_turret_1"].spinuptime = 0.05;
    level.sentrysettings["gl_turret_1"].overheattime = 2.5;
    level.sentrysettings["gl_turret_1"].cooldowntime = 0.5;
    level.sentrysettings["gl_turret_1"].fxtime = 0.3;
    level.sentrysettings["gl_turret_1"].streakname = "grenade";
    level.sentrysettings["gl_turret_1"].weaponinfo = "alien_manned_gl_turret1_mp";
    level.sentrysettings["gl_turret_1"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["gl_turret_1"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["gl_turret_1"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["gl_turret_1"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["gl_turret_1"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["gl_turret_1"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["gl_turret_1"].headicon = 0;
    level.sentrysettings["gl_turret_1"].teamsplash = "used_gl_turret";
    level.sentrysettings["gl_turret_1"].shouldsplash = 1;
    level.sentrysettings["gl_turret_1"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["gl_turret_1"].issentient = 0;
    level.sentrysettings["gl_turret_2"] = spawnstruct();
    level.sentrysettings["gl_turret_2"].health = 999999;
    level.sentrysettings["gl_turret_2"].maxhealth = 650;
    level.sentrysettings["gl_turret_2"].burstmin = 20;
    level.sentrysettings["gl_turret_2"].burstmax = 130;
    level.sentrysettings["gl_turret_2"].pausemin = 0.15;
    level.sentrysettings["gl_turret_2"].pausemax = 0.35;
    level.sentrysettings["gl_turret_2"].sentrymodeon = "manual";
    level.sentrysettings["gl_turret_2"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["gl_turret_2"].timeout = 600.0;
    level.sentrysettings["gl_turret_2"].spinuptime = 0.05;
    level.sentrysettings["gl_turret_2"].overheattime = 2.5;
    level.sentrysettings["gl_turret_2"].cooldowntime = 0.5;
    level.sentrysettings["gl_turret_2"].fxtime = 0.3;
    level.sentrysettings["gl_turret_2"].streakname = "grenade";
    level.sentrysettings["gl_turret_2"].weaponinfo = "alien_manned_gl_turret2_mp";
    level.sentrysettings["gl_turret_2"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["gl_turret_2"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["gl_turret_2"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["gl_turret_2"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["gl_turret_2"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["gl_turret_2"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["gl_turret_2"].headicon = 0;
    level.sentrysettings["gl_turret_2"].teamsplash = "used_gl_turret";
    level.sentrysettings["gl_turret_2"].shouldsplash = 1;
    level.sentrysettings["gl_turret_2"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["gl_turret_2"].issentient = 0;
    level.sentrysettings["gl_turret_3"] = spawnstruct();
    level.sentrysettings["gl_turret_3"].health = 999999;
    level.sentrysettings["gl_turret_3"].maxhealth = 650;
    level.sentrysettings["gl_turret_3"].burstmin = 20;
    level.sentrysettings["gl_turret_3"].burstmax = 130;
    level.sentrysettings["gl_turret_3"].pausemin = 0.15;
    level.sentrysettings["gl_turret_3"].pausemax = 0.35;
    level.sentrysettings["gl_turret_3"].sentrymodeon = "manual";
    level.sentrysettings["gl_turret_3"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["gl_turret_3"].timeout = 600.0;
    level.sentrysettings["gl_turret_3"].spinuptime = 0.05;
    level.sentrysettings["gl_turret_3"].overheattime = 2.5;
    level.sentrysettings["gl_turret_3"].cooldowntime = 0.5;
    level.sentrysettings["gl_turret_3"].fxtime = 0.3;
    level.sentrysettings["gl_turret_3"].streakname = "grenade";
    level.sentrysettings["gl_turret_3"].weaponinfo = "alien_manned_gl_turret3_mp";
    level.sentrysettings["gl_turret_3"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["gl_turret_3"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["gl_turret_3"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["gl_turret_3"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["gl_turret_3"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["gl_turret_3"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["gl_turret_3"].headicon = 0;
    level.sentrysettings["gl_turret_3"].teamsplash = "used_gl_turret";
    level.sentrysettings["gl_turret_3"].shouldsplash = 1;
    level.sentrysettings["gl_turret_3"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["gl_turret_3"].issentient = 0;
    level.sentrysettings["gl_turret_4"] = spawnstruct();
    level.sentrysettings["gl_turret_4"].health = 999999;
    level.sentrysettings["gl_turret_4"].maxhealth = 650;
    level.sentrysettings["gl_turret_4"].burstmin = 20;
    level.sentrysettings["gl_turret_4"].burstmax = 130;
    level.sentrysettings["gl_turret_4"].pausemin = 0.15;
    level.sentrysettings["gl_turret_4"].pausemax = 0.35;
    level.sentrysettings["gl_turret_4"].sentrymodeon = "manual";
    level.sentrysettings["gl_turret_4"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["gl_turret_4"].timeout = 600.0;
    level.sentrysettings["gl_turret_4"].spinuptime = 0.05;
    level.sentrysettings["gl_turret_4"].overheattime = 2.5;
    level.sentrysettings["gl_turret_4"].cooldowntime = 0.5;
    level.sentrysettings["gl_turret_4"].fxtime = 0.3;
    level.sentrysettings["gl_turret_4"].streakname = "grenade";
    level.sentrysettings["gl_turret_4"].weaponinfo = "alien_manned_gl_turret4_mp";
    level.sentrysettings["gl_turret_4"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["gl_turret_4"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["gl_turret_4"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["gl_turret_4"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["gl_turret_4"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["gl_turret_4"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["gl_turret_4"].headicon = 0;
    level.sentrysettings["gl_turret_4"].teamsplash = "used_gl_turret";
    level.sentrysettings["gl_turret_4"].shouldsplash = 1;
    level.sentrysettings["gl_turret_4"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["gl_turret_4"].issentient = 0;
    level.sentrysettings["minigun_turret"] = spawnstruct();
    level.sentrysettings["minigun_turret"].health = 999999;
    level.sentrysettings["minigun_turret"].maxhealth = 650;
    level.sentrysettings["minigun_turret"].burstmin = 20;
    level.sentrysettings["minigun_turret"].burstmax = 130;
    level.sentrysettings["minigun_turret"].pausemin = 0.15;
    level.sentrysettings["minigun_turret"].pausemax = 0.35;
    level.sentrysettings["minigun_turret"].sentrymodeon = "manual";
    level.sentrysettings["minigun_turret"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["minigun_turret"].timeout = 600.0;
    level.sentrysettings["minigun_turret"].spinuptime = 0.5;
    level.sentrysettings["minigun_turret"].overheattime = 4.0;
    level.sentrysettings["minigun_turret"].cooldowntime = 0.5;
    level.sentrysettings["minigun_turret"].fxtime = 0.3;
    level.sentrysettings["minigun_turret"].streakname = "minigun";
    level.sentrysettings["minigun_turret"].weaponinfo = "alien_manned_minigun_turret_mp";
    level.sentrysettings["minigun_turret"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["minigun_turret"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["minigun_turret"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["minigun_turret"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["minigun_turret"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["minigun_turret"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["minigun_turret"].headicon = 0;
    level.sentrysettings["minigun_turret"].teamsplash = "used_minigun_turret";
    level.sentrysettings["minigun_turret"].shouldsplash = 1;
    level.sentrysettings["minigun_turret"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["minigun_turret"].issentient = 0;
    level.sentrysettings["minigun_turret_1"] = spawnstruct();
    level.sentrysettings["minigun_turret_1"].health = 999999;
    level.sentrysettings["minigun_turret_1"].maxhealth = 650;
    level.sentrysettings["minigun_turret_1"].burstmin = 20;
    level.sentrysettings["minigun_turret_1"].burstmax = 130;
    level.sentrysettings["minigun_turret_1"].pausemin = 0.15;
    level.sentrysettings["minigun_turret_1"].pausemax = 0.35;
    level.sentrysettings["minigun_turret_1"].sentrymodeon = "manual";
    level.sentrysettings["minigun_turret_1"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["minigun_turret_1"].timeout = 600.0;
    level.sentrysettings["minigun_turret_1"].spinuptime = 0.05;
    level.sentrysettings["minigun_turret_1"].overheattime = 4.0;
    level.sentrysettings["minigun_turret_1"].cooldowntime = 0.5;
    level.sentrysettings["minigun_turret_1"].fxtime = 0.3;
    level.sentrysettings["minigun_turret_1"].streakname = "minigun";
    level.sentrysettings["minigun_turret_1"].weaponinfo = "alien_manned_minigun_turret1_mp";
    level.sentrysettings["minigun_turret_1"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["minigun_turret_1"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["minigun_turret_1"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["minigun_turret_1"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["minigun_turret_1"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["minigun_turret_1"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["minigun_turret_1"].headicon = 0;
    level.sentrysettings["minigun_turret_1"].teamsplash = "used_minigun_turret";
    level.sentrysettings["minigun_turret_1"].shouldsplash = 1;
    level.sentrysettings["minigun_turret_1"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["minigun_turret_1"].issentient = 0;
    level.sentrysettings["minigun_turret_2"] = spawnstruct();
    level.sentrysettings["minigun_turret_2"].health = 999999;
    level.sentrysettings["minigun_turret_2"].maxhealth = 650;
    level.sentrysettings["minigun_turret_2"].burstmin = 20;
    level.sentrysettings["minigun_turret_2"].burstmax = 130;
    level.sentrysettings["minigun_turret_2"].pausemin = 0.15;
    level.sentrysettings["minigun_turret_2"].pausemax = 0.35;
    level.sentrysettings["minigun_turret_2"].sentrymodeon = "manual";
    level.sentrysettings["minigun_turret_2"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["minigun_turret_2"].timeout = 600.0;
    level.sentrysettings["minigun_turret_2"].spinuptime = 0.05;
    level.sentrysettings["minigun_turret_2"].overheattime = 4.0;
    level.sentrysettings["minigun_turret_2"].cooldowntime = 0.5;
    level.sentrysettings["minigun_turret_2"].fxtime = 0.3;
    level.sentrysettings["minigun_turret_2"].streakname = "minigun";
    level.sentrysettings["minigun_turret_2"].weaponinfo = "alien_manned_minigun_turret2_mp";
    level.sentrysettings["minigun_turret_2"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["minigun_turret_2"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["minigun_turret_2"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["minigun_turret_2"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["minigun_turret_2"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["minigun_turret_2"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["minigun_turret_2"].headicon = 0;
    level.sentrysettings["minigun_turret_2"].teamsplash = "used_minigun_turret";
    level.sentrysettings["minigun_turret_2"].shouldsplash = 1;
    level.sentrysettings["minigun_turret_2"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["minigun_turret_2"].issentient = 0;
    level.sentrysettings["minigun_turret_3"] = spawnstruct();
    level.sentrysettings["minigun_turret_3"].health = 999999;
    level.sentrysettings["minigun_turret_3"].maxhealth = 650;
    level.sentrysettings["minigun_turret_3"].burstmin = 20;
    level.sentrysettings["minigun_turret_3"].burstmax = 130;
    level.sentrysettings["minigun_turret_3"].pausemin = 0.15;
    level.sentrysettings["minigun_turret_3"].pausemax = 0.35;
    level.sentrysettings["minigun_turret_3"].sentrymodeon = "manual";
    level.sentrysettings["minigun_turret_3"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["minigun_turret_3"].timeout = 600.0;
    level.sentrysettings["minigun_turret_3"].spinuptime = 0.05;
    level.sentrysettings["minigun_turret_3"].overheattime = 4.0;
    level.sentrysettings["minigun_turret_3"].cooldowntime = 0.5;
    level.sentrysettings["minigun_turret_3"].fxtime = 0.3;
    level.sentrysettings["minigun_turret_3"].streakname = "minigun";
    level.sentrysettings["minigun_turret_3"].weaponinfo = "alien_manned_minigun_turret3_mp";
    level.sentrysettings["minigun_turret_3"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["minigun_turret_3"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["minigun_turret_3"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["minigun_turret_3"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["minigun_turret_3"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["minigun_turret_3"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["minigun_turret_3"].headicon = 0;
    level.sentrysettings["minigun_turret_3"].teamsplash = "used_minigun_turret";
    level.sentrysettings["minigun_turret_3"].shouldsplash = 1;
    level.sentrysettings["minigun_turret_3"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["minigun_turret_3"].issentient = 0;
    level.sentrysettings["minigun_turret_4"] = spawnstruct();
    level.sentrysettings["minigun_turret_4"].health = 999999;
    level.sentrysettings["minigun_turret_4"].maxhealth = 650;
    level.sentrysettings["minigun_turret_4"].burstmin = 20;
    level.sentrysettings["minigun_turret_4"].burstmax = 130;
    level.sentrysettings["minigun_turret_4"].pausemin = 0.15;
    level.sentrysettings["minigun_turret_4"].pausemax = 0.35;
    level.sentrysettings["minigun_turret_4"].sentrymodeon = "manual";
    level.sentrysettings["minigun_turret_4"].sentrymodeoff = "sentry_offline";
    level.sentrysettings["minigun_turret_4"].timeout = 600.0;
    level.sentrysettings["minigun_turret_4"].spinuptime = 0.05;
    level.sentrysettings["minigun_turret_4"].overheattime = 6.0;
    level.sentrysettings["minigun_turret_4"].cooldowntime = 0.5;
    level.sentrysettings["minigun_turret_4"].fxtime = 0.3;
    level.sentrysettings["minigun_turret_4"].streakname = "minigun";
    level.sentrysettings["minigun_turret_4"].weaponinfo = "alien_manned_minigun_turret4_mp";
    level.sentrysettings["minigun_turret_4"].modelbase = "weapon_standing_turret_grenade_launcher";
    level.sentrysettings["minigun_turret_4"].modelplacement = "weapon_standing_turret_grenade_launcher_obj";
    level.sentrysettings["minigun_turret_4"].modelplacementfailed = "weapon_standing_turret_grenade_launcher_obj_red";
    level.sentrysettings["minigun_turret_4"].modeldestroyed = "weapon_sentry_chaingun_destroyed";
    level.sentrysettings["minigun_turret_4"].hintstring = &"ALIEN_COLLECTIBLES_USE_TURRET";
    level.sentrysettings["minigun_turret_4"].ownerhintstring = &"ALIEN_COLLECTIBLES_DOUBLE_TAP_TO_CARRY";
    level.sentrysettings["minigun_turret_4"].headicon = 0;
    level.sentrysettings["minigun_turret_4"].teamsplash = "used_minigun_turret";
    level.sentrysettings["minigun_turret_4"].shouldsplash = 1;
    level.sentrysettings["minigun_turret_4"].vodestroyed = "sentry_destroyed";
    level.sentrysettings["minigun_turret_4"].issentient = 0;
}

givesentry( var_0 )
{
    self.last_sentry = var_0;
    var_1 = createsentryforplayer( var_0, self );
    removeperks();
    self.carriedsentry = var_1;
    var_2 = setcarryingsentry( var_1, 1 );
    self.carriedsentry = undefined;
    thread waitrestoreperks();
    self.iscarrying = 0;

    if ( isdefined( var_1 ) )
        return 1;
    else
        return 0;
}

setcarryingsentry( var_0, var_1 )
{
    self endon( "death" );
    self endon( "disconnect" );
    var_0 sentry_setcarried( self );
    common_scripts\utility::_disableweapon();
    self notifyonplayercommand( "place_sentry", "+attack" );
    self notifyonplayercommand( "place_sentry", "+attack_akimbo_accessible" );
    self notifyonplayercommand( "cancel_sentry", "+actionslot 4" );

    if ( !level.console )
    {
        self notifyonplayercommand( "cancel_sentry", "+actionslot 5" );
        self notifyonplayercommand( "cancel_sentry", "+actionslot 6" );
        self notifyonplayercommand( "cancel_sentry", "+actionslot 7" );
    }

    for (;;)
    {
        var_2 = common_scripts\utility::waittill_any_return( "place_sentry", "cancel_sentry", "force_cancel_placement" );

        if ( !isdefined( var_0 ) )
        {
            common_scripts\utility::_enableweapon();
            return 1;
        }

        if ( var_2 == "cancel_sentry" || var_2 == "force_cancel_placement" )
        {
            if ( !var_1 && var_2 == "cancel_sentry" )
                continue;

            if ( level.console )
            {
                var_3 = maps\mp\_utility::getkillstreakweapon( level.sentrysettings[var_0.sentrytype].streakname );

                if ( isdefined( self.killstreakindexweapon ) && var_3 == maps\mp\_utility::getkillstreakweapon( self.pers["killstreaks"][self.killstreakindexweapon].streakname ) && !self getweaponslistitems().size )
                {
                    maps\mp\_utility::_giveweapon( var_3, 0 );
                    maps\mp\_utility::_setactionslot( 4, "weapon", var_3 );
                }
            }

            var_0 sentry_setcancelled();
            common_scripts\utility::_enableweapon();
            return 0;
        }

        if ( !var_0.canbeplaced )
            continue;

        var_0 sentry_setplaced();
        common_scripts\utility::_enableweapon();
        return 1;
    }
}

removeweapons()
{
    if ( self.hasriotshield )
    {
        var_0 = maps\mp\alien\_utility::riotshieldname();
        self.restoreweapon = var_0;
        self.riotshieldammo = self getammocount( var_0 );
        self takeweapon( var_0 );
    }
}

removeperks()
{
    if ( maps\mp\_utility::_hasperk( "specialty_explosivebullets" ) )
    {
        self.restoreperk = "specialty_explosivebullets";
        maps\mp\_utility::_unsetperk( "specialty_explosivebullets" );
    }
}

restoreweapons()
{
    if ( isdefined( self.restoreweapon ) )
    {
        maps\mp\_utility::_giveweapon( self.restoreweapon );

        if ( self.hasriotshield )
        {
            var_0 = maps\mp\alien\_utility::riotshieldname();
            self setweaponammoclip( var_0, self.riotshieldammo );
        }
    }

    self.restoreweapon = undefined;
}

restoreperks()
{
    if ( isdefined( self.restoreperk ) )
    {
        maps\mp\_utility::giveperk( self.restoreperk, 0 );
        self.restoreperk = undefined;
    }
}

waitrestoreperks()
{
    self endon( "death" );
    self endon( "disconnect" );
    level endon( "game_ended" );
    wait 0.05;
    restoreperks();
}

createsentryforplayer( var_0, var_1 )
{
    var_2 = spawnturret( "misc_turret", var_1.origin, level.sentrysettings[var_0].weaponinfo );
    var_2.angles = var_1.angles;
    var_2 sentry_initsentry( var_0, var_1 );
    return var_2;
}

sentry_initsentry( var_0, var_1 )
{
    self.sentrytype = var_0;
    self.canbeplaced = 1;
    self setmodel( level.sentrysettings[self.sentrytype].modelbase );
    self.shouldsplash = 1;
    self setcandamage( 1 );

    switch ( var_0 )
    {
        case "gl_turret_4":
        case "gl_turret_3":
        case "gl_turret_2":
        case "gl_turret_1":
        case "minigun_turret_4":
        case "minigun_turret_3":
        case "minigun_turret_2":
        case "minigun_turret_1":
        case "gl_turret":
        case "minigun_turret":
            self setleftarc( 65 );
            self setrightarc( 65 );
            self settoparc( 50 );
            self setbottomarc( 30 );
            self setdefaultdroppitch( 0.0 );
            self.originalowner = var_1;
            break;
        default:
            self maketurretinoperable();
            self setdefaultdroppitch( -89.0 );
            break;
    }

    self setturretmodechangewait( 1 );
    sentry_setinactive();
    sentry_setowner( var_1 );
    thread sentry_handledamage();
    thread sentry_handledeath();
    thread sentry_timeout();

    switch ( var_0 )
    {
        case "minigun_turret_4":
        case "minigun_turret_3":
        case "minigun_turret_2":
        case "minigun_turret_1":
        case "minigun_turret":
            self.momentum = 0;
            self.heatlevel = 0;
            self.overheated = 0;
            thread sentry_heatmonitor();
            break;
        case "gl_turret_4":
        case "gl_turret_3":
        case "gl_turret_2":
        case "gl_turret_1":
        case "gl_turret":
            self.momentum = 0;
            self.heatlevel = 0;
            self.cooldownwaittime = 0;
            self.overheated = 0;
            thread turret_heatmonitor();
            thread turret_coolmonitor();
            break;
        default:
            set_sentry_attack_setup();
            thread sentry_handleuse();
            thread sentry_attacktargets();
            thread sentry_beepsounds();
            break;
    }
}

sentry_handledamage()
{
    self endon( "death" );
    level endon( "game_ended" );
    self.health = level.sentrysettings[self.sentrytype].health;
    self.maxhealth = level.sentrysettings[self.sentrytype].maxhealth;
    self.damagetaken = 0;

    for (;;)
    {
        self waittill( "damage", var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7, var_8, var_9 );

        if ( !maps\mp\gametypes\_weapons::friendlyfirecheck( self.owner, var_1, 0 ) )
            continue;

        if ( isdefined( var_8 ) && var_8 & level.idflags_penetration )
            self.wasdamagedfrombulletpenetration = 1;

        if ( var_4 == "MOD_MELEE" )
            self.damagetaken = self.damagetaken + self.maxhealth;

        var_10 = var_0;

        if ( isplayer( var_1 ) )
        {
            var_1 maps\mp\gametypes\_damagefeedback::updatedamagefeedback( "sentry" );

            if ( var_1 maps\mp\_utility::_hasperk( "specialty_armorpiercing" ) )
                var_10 = var_0 * level.armorpiercingmod;
        }

        if ( isdefined( var_1.owner ) && isplayer( var_1.owner ) )
            var_1.owner maps\mp\gametypes\_damagefeedback::updatedamagefeedback( "sentry" );

        self.damagetaken = self.damagetaken + var_10;

        if ( self.damagetaken >= self.maxhealth )
        {
            thread maps\mp\gametypes\_missions::vehiclekilled( self.owner, self, undefined, var_1, var_0, var_4, var_9 );

            if ( isplayer( var_1 ) && ( !isdefined( self.owner ) || var_1 != self.owner ) )
            {
                var_1 thread maps\mp\gametypes\_rank::giverankxp( "kill", 100, var_9, var_4 );
                var_1 notify( "destroyed_killstreak" );

                if ( isdefined( self.uavremotemarkedby ) && self.uavremotemarkedby != var_1 )
                    self.uavremotemarkedby thread maps\mp\killstreaks\_remoteuav::remoteuav_processtaggedassist();
            }

            if ( isdefined( self.owner ) )
                self.owner thread maps\mp\_utility::leaderdialogonplayer( level.sentrysettings[self.sentrytype].vodestroyed, undefined, undefined, self.origin );

            self notify( "death" );
            return;
        }
    }
}

sentry_watchdisabled()
{
    self endon( "carried" );
    self endon( "death" );
    level endon( "game_ended" );

    for (;;)
    {
        self waittill( "emp_damage", var_0, var_1 );
        playfxontag( common_scripts\utility::getfx( "sentry_explode_mp" ), self, "tag_aim" );
        self setdefaultdroppitch( 40 );
        self setmode( level.sentrysettings[self.sentrytype].sentrymodeoff );
        wait( var_1 );
        self setdefaultdroppitch( -89.0 );
        self setmode( level.sentrysettings[self.sentrytype].sentrymodeon );
    }
}

sentry_handledeath()
{
    self waittill( "death" );

    if ( !isdefined( self ) )
        return;

    self freeentitysentient();
    self setmodel( level.sentrysettings[self.sentrytype].modeldestroyed );
    sentry_setinactive();
    self setdefaultdroppitch( 40 );

    if ( isdefined( self.carriedby ) )
        self setsentrycarrier( undefined );

    self setsentryowner( undefined );
    self setturretminimapvisible( 0 );

    if ( isdefined( self.ownertrigger ) )
        self.ownertrigger delete();

    self playsound( "sentry_explode" );

    switch ( self.sentrytype )
    {
        case "gl_turret":
        case "minigun_turret":
            self.forcedisable = 1;
            self turretfiredisable();
            break;
        default:
            break;
    }

    if ( isdefined( self ) )
        thread sentry_deleteturret();
}

sentry_deleteturret()
{
    self notify( "sentry_delete_turret" );
    self endon( "sentry_delete_turret" );

    if ( isdefined( self.inuseby ) )
    {
        playfxontag( common_scripts\utility::getfx( "sentry_explode_mp" ), self, "tag_origin" );
        playfxontag( common_scripts\utility::getfx( "sentry_smoke_mp" ), self, "tag_aim" );
        self.inuseby setclientomnvar( "ui_alien_turret_overheat", -1 );
        self.inuseby restoreperks();
        self.inuseby restoreweapons();
        self notify( "deleting" );
        self useby( self.inuseby );
        wait 1.0;
    }
    else
    {
        wait 1.5;
        playfxontag( common_scripts\utility::getfx( "sentry_explode_mp" ), self, "tag_aim" );
        playfxontag( common_scripts\utility::getfx( "sentry_smoke_mp" ), self, "tag_aim" );
        self playsound( "sentry_explode_smoke" );
        wait 0.1;
        self notify( "deleting" );
    }

    if ( isdefined( self.killcament ) )
        self.killcament delete();

    if ( isdefined( self ) )
        self delete();
}

sentry_handleuse()
{
    self endon( "death" );
    level endon( "game_ended" );

    for (;;)
    {
        self waittill( "trigger", var_0 );

        if ( !maps\mp\_utility::isreallyalive( var_0 ) )
            continue;

        var_0 setcarryingsentry( self, 0 );
    }
}

turret_handlepickup( var_0 )
{
    self endon( "disconnect" );
    level endon( "game_ended" );
    var_0 endon( "death" );
    var_0 endon( "sentry_delete_turret" );

    if ( !isdefined( var_0.ownertrigger ) )
        return;

    var_1 = 0;

    for (;;)
    {
        if ( isalive( self ) && self istouching( var_0.ownertrigger ) && !isdefined( var_0.inuseby ) && !isdefined( var_0.carriedby ) && self isonground() && !isdefined( var_0.deleting ) )
        {
            if ( self usebuttonpressed() )
            {
                var_1 = 0;

                while ( self usebuttonpressed() )
                {
                    var_1 = var_1 + 0.05;
                    wait 0.05;
                }

                if ( var_1 >= 0.25 )
                    continue;

                var_1 = 0;

                while ( !self usebuttonpressed() && var_1 < 0.25 )
                {
                    var_1 = var_1 + 0.05;
                    wait 0.05;
                }

                if ( var_1 >= 0.25 )
                    continue;

                if ( !can_pickup_sentry( var_0 ) )
                    continue;

                var_0 setmode( level.sentrysettings[var_0.sentrytype].sentrymodeoff );
                thread setcarryingsentry( var_0, 0 );
                var_0.ownertrigger delete();
                return;
            }
        }

        wait 0.05;
    }
}

turret_handlepickup_pc( var_0 )
{
    self endon( "disconnect" );
    level endon( "game_ended" );
    var_0 endon( "death" );
    var_0 endon( "sentry_delete_turret" );

    if ( !isdefined( var_0.ownertrigger ) )
        return;

    var_1 = 0;

    for (;;)
    {
        if ( isalive( self ) && self istouching( var_0.ownertrigger ) && !isdefined( var_0.inuseby ) && !isdefined( var_0.carriedby ) && self isonground() && !isdefined( var_0.deleting ) )
        {
            if ( self meleebuttonpressed() )
            {
                var_1 = 0;

                while ( self meleebuttonpressed() )
                {
                    var_1 = var_1 + 0.05;
                    wait 0.05;
                }

                if ( var_1 >= 0.5 )
                    continue;

                var_1 = 0;

                while ( !self meleebuttonpressed() && var_1 < 0.5 )
                {
                    var_1 = var_1 + 0.05;
                    wait 0.05;
                }

                if ( var_1 >= 0.5 )
                    continue;

                if ( !can_pickup_sentry( var_0 ) )
                    continue;

                var_0 setmode( level.sentrysettings[var_0.sentrytype].sentrymodeoff );
                thread setcarryingsentry( var_0, 0 );
                var_0.ownertrigger delete();
                return;
            }
        }

        wait 0.05;
    }
}

can_pickup_sentry( var_0 )
{
    if ( !maps\mp\_utility::isreallyalive( self ) )
        return 0;

    if ( isdefined( self.using_remote_turret ) && self.using_remote_turret )
        return 0;

    if ( self isusingturret() || isdefined( var_0.deleting ) )
        return 0;

    if ( maps\mp\alien\_utility::is_holding_deployable() )
        return 0;

    if ( maps\mp\alien\_utility::is_true( self.iscarrying ) )
        return 0;

    if ( isdefined( var_0.inuseby ) )
        return 0;

    if ( isdefined( level.drill_carrier ) && level.drill_carrier == self )
        return 0;

    if ( isdefined( self.remoteuav ) )
        return 0;

    return 1;
}

turret_handleuse()
{
    self notify( "turret_handluse" );
    self endon( "turret_handleuse" );
    self endon( "deleting" );
    level endon( "game_ended" );
    self.forcedisable = 0;
    var_0 = ( 1, 0.9, 0.7 );
    var_1 = ( 1, 0.65, 0 );
    var_2 = ( 1, 0.25, 0 );

    for (;;)
    {
        self waittill( "trigger", var_3 );

        if ( isdefined( self.carriedby ) )
            continue;

        if ( isdefined( self.inuseby ) )
            continue;

        if ( !maps\mp\_utility::isreallyalive( var_3 ) )
            continue;

        if ( var_3 maps\mp\alien\_utility::is_holding_deployable() )
            continue;

        if ( isdefined( level.drill_carrier ) && var_3 == level.drill_carrier )
            continue;

        var_3 removeperks();
        var_3 notify( "weapon_change", "none" );
        self.inuseby = var_3;
        self setmode( level.sentrysettings[self.sentrytype].sentrymodeoff );
        sentry_setowner( var_3 );
        self setmode( level.sentrysettings[self.sentrytype].sentrymodeon );
        var_3 thread turret_shotmonitor( self );
        var_3 setclientomnvar( "ui_alien_turret_overheat", 0 );
        var_4 = 0;
        var_5 = 0;
        var_3 maps\mp\_utility::setlowermessage( "disengage_turret", &"ALIEN_COLLECTIBLES_DISENGAGE_TURRET", 4 );

        for (;;)
        {
            if ( !maps\mp\_utility::isreallyalive( var_3 ) )
            {
                self.inuseby = undefined;
                var_3 setclientomnvar( "ui_alien_turret_overheat", -1 );
                var_3 maps\mp\_utility::clearlowermessage( "disengage_turret" );
                break;
            }

            if ( !var_3 isusingturret() )
            {
                self notify( "player_dismount" );
                self.inuseby = undefined;
                var_3 restoreperks();
                var_3 restoreweapons();
                self sethintstring( level.sentrysettings[self.sentrytype].hintstring );
                self setmode( level.sentrysettings[self.sentrytype].sentrymodeoff );
                sentry_setowner( self.originalowner );
                self setmode( level.sentrysettings[self.sentrytype].sentrymodeon );
                var_3 setclientomnvar( "ui_alien_turret_overheat", -1 );
                var_3 maps\mp\_utility::clearlowermessage( "disengage_turret" );
                break;
            }

            if ( self.heatlevel >= level.sentrysettings[self.sentrytype].overheattime )
                var_6 = 1;
            else
                var_6 = self.heatlevel / level.sentrysettings[self.sentrytype].overheattime;

            var_7 = 5;
            var_8 = int( var_6 * 100 );

            if ( var_5 != var_8 )
            {
                if ( var_8 <= var_7 || abs( abs( var_5 ) - abs( var_8 ) ) > var_7 )
                {
                    var_3 setclientomnvar( "ui_alien_turret_overheat", var_8 );
                    var_5 = var_8;
                }
            }

            if ( common_scripts\utility::string_starts_with( self.sentrytype, "minigun_turret" ) )
                var_9 = "minigun_turret";

            if ( self.forcedisable || self.overheated )
            {
                self turretfiredisable();
                var_4 = 0;
            }
            else
            {
                self turretfireenable();
                var_4 = 0;
                self notify( "not_overheated" );
            }

            wait 0.05;
        }

        var_3 maps\mp\_utility::clearlowermessage( "disengage_turret" );
        self setdefaultdroppitch( 0.0 );
        var_3 setclientomnvar( "ui_alien_turret_overheat", -1 );
    }
}

sentry_handleownerdisconnect()
{
    self endon( "death" );
    level endon( "game_ended" );
    self notify( "sentry_handleOwner" );
    self endon( "sentry_handleOwner" );
    self.owner waittill( "killstreak_disowned" );
    self notify( "death" );
}

sentry_setowner( var_0 )
{
    var_0.current_sentry = self;
    self.owner = var_0;
    self setsentryowner( self.owner );
    self setturretminimapvisible( 1, self.sentrytype );

    if ( level.teambased )
    {
        self.team = self.owner.team;
        self setturretteam( self.team );
    }

    thread sentry_handleownerdisconnect();
}

sentry_setplaced()
{
    self setmodel( level.sentrysettings[self.sentrytype].modelbase );

    if ( self getmode() == "manual" )
        self setmode( level.sentrysettings[self.sentrytype].sentrymodeoff );

    self setsentrycarrier( undefined );
    self setcandamage( 1 );

    switch ( self.sentrytype )
    {
        case "gl_turret_4":
        case "gl_turret_3":
        case "gl_turret_2":
        case "gl_turret_1":
        case "minigun_turret_4":
        case "minigun_turret_3":
        case "minigun_turret_2":
        case "minigun_turret_1":
        case "gl_turret":
        case "minigun_turret":
            self.angles = self.carriedby.angles;

            if ( isalive( self.originalowner ) )
            {
                if ( level.console || self.originalowner usinggamepad() )
                    self.originalowner maps\mp\_utility::setlowermessage( "pickup_hint", level.sentrysettings[self.sentrytype].ownerhintstring, 3.0, undefined, undefined, undefined, undefined, undefined, 1 );
                else
                    self.originalowner maps\mp\_utility::setlowermessage( "pickup_hint", &"ALIENS_PATCH_PRESS_TO_CARRY", 3.0, undefined, undefined, undefined, undefined, undefined, 1 );
            }

            self.ownertrigger = spawn( "trigger_radius", self.origin + ( 0, 0, 1 ), 0, 105, 64 );

            if ( level.console || self.originalowner usinggamepad() )
                self.originalowner thread turret_handlepickup( self );
            else
                self.originalowner thread turret_handlepickup_pc( self );

            thread turret_handleuse();
            break;
        default:
            break;
    }

    sentry_makesolid();
    self.carriedby forceusehintoff();
    self.carriedby = undefined;
    self.in_world_area = maps\mp\alien\_utility::get_in_world_area();

    if ( isdefined( self.owner ) )
    {
        self.owner.iscarrying = 0;

        if ( level.sentrysettings[self.sentrytype].issentient )
            common_scripts\utility::make_entity_sentient_mp( self.owner.team );

        self.owner notify( "new_sentry", self );
    }

    sentry_setactive();
    self playsound( "sentry_gun_plant" );
    self notify( "placed" );
}

sentry_setcancelled()
{
    self.carriedby forceusehintoff();

    if ( isdefined( self.owner ) )
        self.owner.iscarrying = 0;

    self delete();
}

sentry_setcarried( var_0 )
{
    if ( isdefined( self.originalowner ) )
    {

    }
    else
    {

    }

    self setmodel( level.sentrysettings[self.sentrytype].modelplacement );
    self setsentrycarrier( var_0 );
    self setcandamage( 0 );
    sentry_makenotsolid();
    self.carriedby = var_0;
    var_0.iscarrying = 1;
    var_0 thread updatesentryplacement( self );
    thread sentry_oncarrierdeath( var_0 );
    thread sentry_oncarrierdisconnect( var_0 );
    thread sentry_oncarrierchangedteam( var_0 );
    thread sentry_ongameended();
    self freeentitysentient();
    self setdefaultdroppitch( -89.0 );
    sentry_setinactive();
    self notify( "carried" );
}

updatesentryplacement( var_0 )
{
    self endon( "death" );
    self endon( "disconnect" );
    level endon( "game_ended" );
    var_0 endon( "placed" );
    var_0 endon( "death" );
    var_0.canbeplaced = 1;
    var_1 = -1;

    for (;;)
    {
        var_0.canbeplaced = can_place_sentry( var_0 );

        if ( var_0.canbeplaced != var_1 )
        {
            if ( var_0.canbeplaced )
            {
                var_0 setmodel( level.sentrysettings[var_0.sentrytype].modelplacement );
                self forceusehinton( &"SENTRY_PLACE" );
            }
            else
            {
                var_0 setmodel( level.sentrysettings[var_0.sentrytype].modelplacementfailed );
                self forceusehinton( &"SENTRY_CANNOT_PLACE" );
            }
        }

        var_1 = var_0.canbeplaced;
        wait 0.05;
    }
}

can_place_sentry( var_0 )
{
    var_1 = self canplayerplacesentry();
    var_0.origin = var_1["origin"];
    var_0.angles = var_1["angles"];
    return self isonground() && var_1["result"] && abs( var_0.origin[2] - self.origin[2] ) < 10;
}

sentry_oncarrierdeath( var_0 )
{
    self endon( "placed" );
    self endon( "death" );
    var_0 waittill( "death" );

    if ( self.canbeplaced )
        sentry_setplaced();
    else
        self delete();
}

sentry_oncarrierdisconnect( var_0 )
{
    self endon( "placed" );
    self endon( "death" );
    var_0 waittill( "disconnect" );
    self delete();
}

sentry_oncarrierchangedteam( var_0 )
{
    self endon( "placed" );
    self endon( "death" );
    var_0 common_scripts\utility::waittill_any( "joined_team", "joined_spectators" );
    self delete();
}

sentry_ongameended( var_0 )
{
    self endon( "placed" );
    self endon( "death" );
    level waittill( "game_ended" );
    self delete();
}

sentry_setactive()
{
    self setmode( level.sentrysettings[self.sentrytype].sentrymodeon );
    self setcursorhint( "HINT_NOICON" );
    self sethintstring( level.sentrysettings[self.sentrytype].hintstring );
    self makeusable();

    foreach ( var_1 in level.players )
    {
        switch ( self.sentrytype )
        {
            case "gl_turret_4":
            case "gl_turret_3":
            case "gl_turret_2":
            case "gl_turret_1":
            case "minigun_turret_4":
            case "minigun_turret_3":
            case "minigun_turret_2":
            case "minigun_turret_1":
            case "gl_turret":
            case "minigun_turret":
                self enableplayeruse( var_1 );

                if ( maps\mp\_utility::is_aliens() )
                {
                    var_2 = self getentitynumber();
                    addtoturretlist( var_2 );
                }

                break;
            default:
                var_2 = self getentitynumber();
                addtoturretlist( var_2 );

                if ( var_1 == self.owner )
                    self enableplayeruse( var_1 );
                else
                    self disableplayeruse( var_1 );

                break;
        }
    }

    if ( self.shouldsplash && !maps\mp\alien\_utility::isplayingsolo() )
    {
        level thread maps\mp\_utility::teamplayercardsplash( level.sentrysettings[self.sentrytype].teamsplash, self.owner, self.owner.team );
        self.shouldsplash = 0;
    }

    thread sentry_watchdisabled();
}

sentry_setinactive()
{
    self setmode( level.sentrysettings[self.sentrytype].sentrymodeoff );
    self makeunusable();
    var_0 = self getentitynumber();

    switch ( self.sentrytype )
    {
        case "gl_turret":
            break;
        default:
            removefromturretlist( var_0 );
            break;
    }

    if ( level.teambased )
        maps\mp\_entityheadicons::setteamheadicon( "none", ( 0, 0, 0 ) );
    else if ( isdefined( self.owner ) )
        maps\mp\_entityheadicons::setplayerheadicon( undefined, ( 0, 0, 0 ) );
}

sentry_makesolid()
{
    self maketurretsolid();
}

sentry_makenotsolid()
{
    self setcontents( 0 );
}

isfriendlytosentry( var_0 )
{
    if ( level.teambased && self.team == var_0.team )
        return 1;

    return 0;
}

addtoturretlist( var_0 )
{
    level.turrets[var_0] = self;
}

removefromturretlist( var_0 )
{
    level.turrets[var_0] = undefined;
}

sentry_attacktargets()
{
    self endon( "death" );
    level endon( "game_ended" );
    self.momentum = 0;
    self.heatlevel = 0;
    self.overheated = 0;
    thread sentry_heatmonitor();

    for (;;)
    {
        common_scripts\utility::waittill_either( "turretstatechange", "cooled" );

        if ( self isfiringturret() )
        {
            thread sentry_burstfirestart();
            continue;
        }

        sentry_spindown();
        thread sentry_burstfirestop();
    }
}

sentry_timeout()
{
    self endon( "death" );
    level endon( "game_ended" );
    var_0 = level.sentrysettings[self.sentrytype].timeout;

    while ( var_0 )
    {
        wait 1.0;
        maps\mp\gametypes\_hostmigration::waittillhostmigrationdone();

        if ( !isdefined( self.carriedby ) )
            var_0 = max( 0, var_0 - 1.0 );
    }

    while ( isdefined( self ) && isdefined( self.inuseby ) )
        wait 0.05;

    self notify( "death" );
}

sentry_targetlocksound()
{
    self endon( "death" );
    self playsound( "sentry_gun_beep" );
    wait 0.1;
    self playsound( "sentry_gun_beep" );
    wait 0.1;
    self playsound( "sentry_gun_beep" );
}

sentry_spinup()
{
    thread sentry_targetlocksound();

    while ( self.momentum < level.sentrysettings[self.sentrytype].spinuptime )
    {
        self.momentum = self.momentum + 0.1;
        wait 0.1;
    }
}

sentry_spindown()
{
    self.momentum = 0;
}

sentry_burstfirestart()
{
    self endon( "death" );
    self endon( "stop_shooting" );
    level endon( "game_ended" );
    sentry_spinup();
    var_0 = weaponfiretime( level.sentrysettings[self.sentrytype].weaponinfo );
    var_1 = level.sentrysettings[self.sentrytype].burstmin;
    var_2 = level.sentrysettings[self.sentrytype].burstmax;
    var_3 = level.sentrysettings[self.sentrytype].pausemin;
    var_4 = level.sentrysettings[self.sentrytype].pausemax;

    for (;;)
    {
        var_5 = randomintrange( var_1, var_2 + 1 );

        for ( var_6 = 0; var_6 < var_5 && !self.overheated; var_6++ )
        {
            self shootturret();
            self notify( "bullet_fired" );
            self.heatlevel = self.heatlevel + var_0;
            wait( var_0 );
        }

        wait( randomfloatrange( var_3, var_4 ) );
    }
}

sentry_burstfirestop()
{
    self notify( "stop_shooting" );
}

turret_shotmonitor( var_0 )
{
    self endon( "death" );
    self endon( "disconnect" );
    level endon( "game_ended" );
    var_0 endon( "death" );
    var_0 endon( "player_dismount" );
    var_1 = weaponfiretime( level.sentrysettings[var_0.sentrytype].weaponinfo );

    for (;;)
    {
        var_0 waittill( "turret_fire" );
        var_0 getturretowner() notify( "turret_fire" );
        var_0.heatlevel = var_0.heatlevel + var_1;
        var_0.cooldownwaittime = var_1;
    }
}

sentry_heatmonitor()
{
    self endon( "death" );
    var_0 = weaponfiretime( level.sentrysettings[self.sentrytype].weaponinfo );
    var_1 = 0;
    var_2 = 0;
    var_3 = level.sentrysettings[self.sentrytype].overheattime;
    var_4 = level.sentrysettings[self.sentrytype].cooldowntime;

    for (;;)
    {
        if ( self.heatlevel != var_1 )
            wait( var_0 );
        else
            self.heatlevel = max( 0, self.heatlevel - 0.05 );

        if ( self.heatlevel > var_3 )
        {
            self.overheated = 1;
            thread playheatfx();

            switch ( self.sentrytype )
            {
                case "minigun_turret_4":
                case "minigun_turret_3":
                case "minigun_turret_2":
                case "minigun_turret_1":
                case "minigun_turret":
                    playfxontag( common_scripts\utility::getfx( "sentry_smoke_mp" ), self, "tag_aim" );
                    break;
                default:
                    break;
            }

            while ( self.heatlevel )
            {
                self.heatlevel = max( 0, self.heatlevel - 0.1 );
                wait 0.1;
            }

            self.overheated = 0;
            self notify( "not_overheated" );
        }

        var_1 = self.heatlevel;
        wait 0.05;
    }
}

turret_heatmonitor()
{
    self endon( "death" );
    var_0 = level.sentrysettings[self.sentrytype].overheattime;

    for (;;)
    {
        if ( self.heatlevel > var_0 )
        {
            self.overheated = 1;
            thread playheatfx();

            switch ( self.sentrytype )
            {
                case "gl_turret":
                    playfxontag( common_scripts\utility::getfx( "sentry_smoke_mp" ), self, "tag_aim" );
                    break;
                default:
                    break;
            }

            while ( self.heatlevel )
                wait 0.1;

            self.overheated = 0;
            self notify( "not_overheated" );
        }

        wait 0.05;
    }
}

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

    for (;;)
    {
        if ( self.heatlevel > 0 )
        {
            if ( self.cooldownwaittime <= 0 )
                self.heatlevel = max( 0, self.heatlevel - 0.05 );
            else
                self.cooldownwaittime = max( 0, self.cooldownwaittime - 0.05 );
        }

        wait 0.05;
    }
}

playheatfx()
{
    self endon( "death" );
    self endon( "not_overheated" );
    level endon( "game_ended" );
    self notify( "playing_heat_fx" );
    self endon( "playing_heat_fx" );

    for (;;)
    {
        playfxontag( common_scripts\utility::getfx( "sentry_overheat_mp" ), self, "tag_flash" );
        wait( level.sentrysettings[self.sentrytype].fxtime );
    }
}

playsmokefx()
{
    self endon( "death" );
    self endon( "not_overheated" );
    level endon( "game_ended" );

    for (;;)
    {
        playfxontag( common_scripts\utility::getfx( "sentry_smoke_mp" ), self, "tag_aim" );
        wait 0.4;
    }
}

sentry_beepsounds()
{
    self endon( "death" );
    level endon( "game_ended" );

    for (;;)
    {
        wait 3.0;

        if ( !isdefined( self.carriedby ) )
            self playsound( "sentry_gun_beep" );
    }
}

set_sentry_attack_setup()
{
    var_0 = [];
    var_0["brute"][0] = maps\mp\alien\_utility::set_attack_sync_direction( ( 1, 0, 0 ), "alien_sentry_attack_sentry_front_enter", "alien_sentry_attack_sentry_front_loop", "alien_sentry_attack_sentry_front_exit", "attack_sentry_front", "attack_sentry" );
    var_0["brute"][1] = maps\mp\alien\_utility::set_attack_sync_direction( ( 0, 1, 0 ), "alien_sentry_attack_sentry_side_l_enter", "alien_sentry_attack_sentry_side_l_loop", "alien_sentry_attack_sentry_side_l_exit", "attack_sentry_left", "attack_sentry" );
    var_0["brute"][2] = maps\mp\alien\_utility::set_attack_sync_direction( ( 0, -1, 0 ), "alien_sentry_attack_sentry_side_r_enter", "alien_sentry_attack_sentry_side_r_loop", "alien_sentry_attack_sentry_side_r_exit", "attack_sentry_right", "attack_sentry" );
    var_0["goon"][0] = maps\mp\alien\_utility::set_attack_sync_direction( ( 1, 0, 0 ), "alien_goon_sentry_attack_sentry_F_enter", "alien_goon_sentry_attack_sentry_F_loop", "alien_goon_sentry_attack_sentry_F_exit", "attack_sentry_front", "attack_sentry" );
    var_0["goon"][1] = maps\mp\alien\_utility::set_attack_sync_direction( ( 0, 1, 0 ), "alien_goon_sentry_attack_sentry_L_enter", "alien_goon_sentry_attack_sentry_L_loop", "alien_goon_sentry_attack_sentry_L_exit", "attack_sentry_left", "attack_sentry" );
    var_0["goon"][2] = maps\mp\alien\_utility::set_attack_sync_direction( ( 0, -1, 0 ), "alien_goon_sentry_attack_sentry_R_enter", "alien_goon_sentry_attack_sentry_R_loop", "alien_goon_sentry_attack_sentry_R_exit", "attack_sentry_right", "attack_sentry" );
    var_1[0] = "death";
    var_1[1] = "destroyed";
    var_1[2] = "carried";
    maps\mp\alien\_utility::set_synch_attack_setup( var_0, 1, var_1, ::sentry_can_synch_attack, ::sentry_synch_attack_begin, ::sentry_synch_attack_loop, ::sentry_synch_attack_end, "sentry gun" );
}

sentry_can_synch_attack()
{
    return !isdefined( self.synched_turret );
}

sentry_synch_attack_begin( var_0 )
{
    self hide();
    self.synched_turret = spawn( "script_model", self.origin );
    self.synched_turret setmodel( level.sentrysettings[self.sentrytype].modelbase );
    self.synched_turret.angles = self.angles;
    self turretfiredisable();
    self.synched_turret scriptmodelplayanim( var_0 );
}

sentry_synch_attack_loop( var_0 )
{
    self.synched_turret scriptmodelclearanim();
    self.synched_turret scriptmodelplayanim( var_0 );
}

sentry_synch_attack_end( var_0, var_1 )
{
    if ( isdefined( var_0 ) )
    {
        self.synched_turret scriptmodelclearanim();
        self.synched_turret scriptmodelplayanim( var_0 );
        wait( var_1 );
    }

    if ( !isdefined( self ) )
        return;

    self.synched_turret delete();
    self show();

    if ( isalive( self ) )
        self turretfireenable();
}
