4ªU�nutscripts/vscriptsmutation_among_uså34ÿ]°Ÿÿÿmapspawn_addonµ…§EÿWÿÿtxt addoninfoÈ�`ÿÿÿ"AddonInfo" { AddonTitle "Mutation Among Us" AddonVersion "1.0" AddonDescription "One or some of us are hidden threats you never expect among crowd of zombies. Are you prepared to face us, hidden among them?" AddonAuthor "kurochama" AddonAuthorSteamID "" AddonURL0 "" AddonSteamAppID 550 AddonContent_BackgroundMovie 0 AddonContent_BossInfected 0 AddonContent_Campaign 0 AddonContent_CommonInfected 0 AddonContent_Map 0 AddonContent_Music 0 AddonContent_Prefab 0 AddonContent_Prop 0 AddonContent_Script 1 AddonContent_Skin 0 AddonContent_Sound 0 AddonContent_Spray 0 AddonContent_Survivor 0 AddonContent_Weapon 0 AddonContent_WeaponModel 0 }SpawnEntityFromTable("env_soundscape_triggerable", { vscripts = "mutation_among_us" });CounterTimer <- 0 BuffTrigger <- 0 ShotTimer <- 0 CruelBotsMode <- 0 IgnoreDifficultyLevel <- 0 CustomPrimaryAmmo <- 0 BotAutoRetreatCooldown <- 0 AdrenalineCooldown <- 0 ToggleCooldown <- 0 DestructiveShove <- 0 TemporaryGodMode <- 0 TemporaryGodModeTimer <- 0 ExplosionDelay <- 0 TankMutatedSkills <- 0 MaxDistance <- 66666 MaxReviveCount <- Convars.GetFloat("survivor_max_incapacitated_count"); MutationAmongUs <- 0 ZombieMutationType <- 0 ZombieMutationChance <- 1 ZombieMutationRange <- 0 killcount <- 0 ExplosionAmmoToggle <- 0 ExplosionType <- 0 PistolExplosionAmmo <- 0 PistolMagnumExplosionAmmo <- 0 SmgExplosionAmmo <- 0 SmgMp5ExplosionAmmo <- 0 SmgSilencedExplosionAmmo <- 0 PumpshotgunExplosionAmmo <- 0 ShotgunChromeExplosionAmmo <- 0 ShotgunSpasExplosionAmmo <- 0 AutoshotgunExplosionAmmo <- 0 RifleExplosionAmmo <- 0 RifleAk47ExplosionAmmo <- 0 RifleDesertExplosionAmmo <- 0 RifleM60ExplosionAmmo <- 0 RifleSg552ExplosionAmmo <- 0 HuntingRifleExplosionAmmo <- 0 SniperAwpExplosionAmmo <- 0 SniperMilitaryExplosionAmmo <- 0 SniperScoutExplosionAmmo <- 0 GrenadeLauncherExplosionAmmo <- 0 KuroOnly <- 0 PROJECTILE <- Vector(RandomInt(10,30),RandomInt(10,30), 0); ExplosionEntity <- null; FireButton <- 1 JumpButton <- 2 DuckButton <- 4 ForwardButton <- 8 BackButton <- 16 UseButton <- 32 LeftButton <- 512 RightButton <- 1024 ShoveButton <- 2048 ReloadButton <- 8192 ScoreButton <- 65536 ZoomButton <- 524288 function VectorFromQAngle(angles, radius = 1.0) { local function ToRad(angle) { return (angle * PI) / 180; } local yaw = ToRad(angles.Yaw()); local pitch = ToRad(-angles.Pitch()); local x = radius * cos(yaw) * cos(pitch); local y = radius * sin(yaw) * cos(pitch); local z = radius * sin(pitch); return Vector(x, y, z); } function SplashExplosion(kent, targetzom, range) { local entzom = null; while(entzom = Entities.FindInSphere(entzom, targetzom.GetOrigin(), range)) { if(entzom.GetClassname() == "infected" || entzom.GetClassname() == "witch" || IsSpecialInGeneral(entzom)) { if(targetzom != entzom) { NetProps.SetPropEntity(ExplosionEntity, "m_hOwnerEntity", kent); ExplosionEntity.SetOrigin(entzom.GetOrigin()); DoEntFire("!self", "Explode", "" 0, kent, ExplosionEntity); } } } } function DisableButton(kent, keyvalue) { local DisabledButtons = NetProps.GetPropInt(kent, "m_afButtonDisabled"); local IsDisabled = DisabledButtons & keyvalue; if(kent.IsSurvivor()) { return NetProps.SetPropInt(kent, "m_afButtonDisabled", DisabledButtons | keyvalue); } return null; } function EnableDisabledButton2(kent, keyvalue) { local DisabledButtons = NetProps.GetPropInt(kent, "m_afButtonDisabled"); local IsDisabled = DisabledButtons & keyvalue; if(kent.IsSurvivor()) { return NetProps.SetPropInt(kent, "m_afButtonDisabled", DisabledButtons & ~ keyvalue); } return null; } function GetDisabledButton(kent, keyvalue) { local DisabledButtons = NetProps.GetPropInt(kent, "m_afButtonDisabled"); local IsDisabled = DisabledButtons & keyvalue; if(kent.IsSurvivor()) { return IsDisabled; } return null; } function ForcedButton(kent, keyvalue) { local DisabledButtons = NetProps.GetPropInt(kent, "m_afButtonForced"); local IsDisabled = DisabledButtons & keyvalue; if(kent.IsSurvivor()) { return NetProps.SetPropInt(kent, "m_afButtonForced", DisabledButtons | keyvalue); } return null; } function GetForcedButton(kent, keyvalue) { local DisabledButtons = NetProps.GetPropInt(kent, "m_afButtonForced"); local IsDisabled = DisabledButtons & keyvalue; if(kent.IsSurvivor()) { return IsDisabled; } return null; } function ReleaseForcedButton2(kent, keyvalue) { local DisabledButtons = NetProps.GetPropInt(kent, "m_afButtonForced"); local IsDisabled = DisabledButtons & keyvalue; if(kent.IsSurvivor()) { return NetProps.SetPropInt(kent, "m_afButtonForced", DisabledButtons & ~ keyvalue); } return null; } function GetButtonPressed(kent, keyvalue) { if(kent.GetButtonMask() & keyvalue) { return true; } return false; } function GetActiveMainWeapon(player) { local weapon = player.GetActiveWeapon(); if(weapon) return weapon.GetClassname(); return null; } function GetPrimarySlot(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot0" in invTable)) return null; local weapon = invTable.slot0; if(weapon) return weapon.GetClassname(); return null; } function GetPrimaryRemoved(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot0" in invTable)) return null; local weapon = invTable.slot0; if(weapon) return weapon.Kill(); return null; } function GetSecondarySlot(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot1" in invTable)) return null; local weapon = invTable.slot1; if(weapon) return weapon.GetClassname(); return null; } function GetSecondaryRemoved(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot1" in invTable)) return null; local weapon = invTable.slot1; if(weapon) return weapon.Kill(); return null; } function GetThrowableSlot(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot2" in invTable)) return null; local weapon = invTable.slot2; if(weapon) return weapon.GetClassname(); return null; } function GetThrowableRemoved(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot2" in invTable)) return null; local weapon = invTable.slot2; if(weapon) return weapon.Kill(); return null; } function GetMedicSlot(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot3" in invTable)) return null; local weapon = invTable.slot3; if(weapon) return weapon.GetClassname(); return null; } function GetMedicRemoved(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot3" in invTable)) return null; local weapon = invTable.slot3; if(weapon) return weapon.Kill(); return null; } function GetPillSlot(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot4" in invTable)) return null; local weapon = invTable.slot4; if(weapon) return weapon.GetClassname(); return null; } function GetPillRemoved(player) { local invTable = {}; GetInvTable(player, invTable); if(!("slot4" in invTable)) return null; local weapon = invTable.slot4; if(weapon) return weapon.Kill(); return null; } function IsSurvivorInGeneral(kent) { local player = null while(player = Entities.FindByClassname(player, "player")) { if(player.IsSurvivor()) { if(kent == player) { return true; } } } return false; } function IsSpecialInGeneral(kent) { local player = null while(player = Entities.FindByClassname(player, "player")) { if(player.GetZombieType() <= 8) { if(kent == player) { return true; } } } return false; } function IsCommonZombie(kent) { local player = null while(player = Entities.FindByClassname(player, "infected")) { if(kent == player) { return true; } } return false; } function IsWitchZombie(kent) { local player = null while(player = Entities.FindByClassname(player, "witch")) { if(kent == player) { return true; } } return false; } function IsCapturedBySI(player) { local infected = null; while(infected = Entities.FindByClassname(infected, "player")) { if(infected.GetZombieType() != 9) { if(NetProps.GetPropEntity(infected, "m_pummelVictim") == player || NetProps.GetPropEntity(infected, "m_carryVictim") == player || NetProps.GetPropEntity(infected, "m_pounceVictim") == player || NetProps.GetPropEntity(infected, "m_jockeyVictim") == player || NetProps.GetPropEntity(infected, "m_tongueVictim") == player) { return true } } } return false } function MercilessToggleFileCheck(filename) { local files = FileToString(filename); if(!files) { return false; } return true; } function GenerateCvarFile() { local DefaultToggleFile = ""; local CvarToggleFile = [ "sb_melee_approach_victim 1", "nb_head_aim_steady_max_rate 1000", "" ] foreach (line in CvarToggleFile) { DefaultToggleFile = DefaultToggleFile + line + "\n"; } if(!MercilessToggleFileCheck("demolition gunners/demolition gunners cfg/cvar cfg.txt")) { StringToFile("demolition gunners/demolition gunners cfg/cvar cfg.txt", DefaultToggleFile); printl("The 'cvar cfg.txt' file can't be found. Generating a new file..."); } } function LoadCvarcConfigFile(filename) { local trigger = 0; local files = FileToString(filename); if(!files) { return trigger; } local toggles = split(files, "\r\n"); foreach(toggle in toggles) { if(toggle && toggle != "") { toggle = strip(toggle); local idx = toggle.find(" "); if (idx != null) { local togglecommand = toggle.slice(0, idx); local togglevalue = toggle.slice(idx + 1); local togglevalue2 = null; if(togglecommand == togglecommand.tostring()) { Convars.SetValue(togglecommand, togglevalue.tofloat()); } trigger++; } } } return trigger; } function GenerateMiscCfg() { local DefaultToggleFile = ""; local AcidEvasionToggleFile = [ "DestructiveShove 3", ".", ".", "// ====== TOGGLE SETTING INFO ======", "//DestructiveShove = When enabled, shoving zombies can cause explosion. The survivor shoving zombies will be invincible for 0.5 second during shoving, to nullify explosion damage. The value affects which survivors can use this feature.", "0 = Off.", "1 = On, bots only.", "2 = On, players only.", "3 = On, all (bots & players).", ".", ".", "// =================================", "//Notes: To make the changes take effects, save the file & then reload your gun.", "//Notes 2: This cfg contains toggles for simple mechanisms in game.", "//Notes 3: This file is generated automatically when using this mod for the first time. To reset the this toggle back to the default, delete the file & then reload your gun.", "." ] foreach (line in AcidEvasionToggleFile) { DefaultToggleFile = DefaultToggleFile + line + "\n"; } if(!MercilessToggleFileCheck("demolition gunners/demolition gunners cfg/specific cfg/miscellaneous cfg.txt")) { StringToFile("demolition gunners/demolition gunners cfg/specific cfg/miscellaneous cfg.txt", DefaultToggleFile); printl("The 'miscellaneous cfg.txt' file can't be found. Generating a new file..."); } } function GenerateMutationAmongUsFile() { local DefaultToggleFile = ""; local AcidEvasionToggleFile = [ "MutationAmongUs 3", "ZombieMutationChance 10", "ZombieMutationType 9", "ZombieMutationRange 300", ".", ".", "// ====== TOGGLE SETTING INFO ======", "//MutationAmongUs = This toggle controls which type of survivor triggers the mutation among common infected.", "0= Off", "1= On (Bots Only).", "2= On (Players Only).", "3= On (Bots & Players).", ".", "//ZombieMutationChance = This toggle controls the chance of common infected mutated into special infected, tank or witch. Max value is 100 (100% chance)", "0= 1% chance", "1 to 100= Mutation chance is (value * 1)%.", ".", "//ZombieMutationType = This toggle controls which type of mutated zombie the common infected will mutate into.", "0-1= Smoker", "2= Boomer.", "3= Hunter.", "4= Spitter.", "5= Jockey.", "6= Charger.", "7= Witch.", "8= Tank.", "9= Random special infected except tank & witch.", "10= Random special infected including tank & witch.", ".", "//ZombieMutationRange = This toggle controls the range/ distance from survivor where the mutation happens. Max Value is 1000. For example, if you set the value to 0, common infected in front of your face can mutate. If you set to 300, only common infected farther than 4x melee range from survivor can mutate.", "0-1000= Mutation range is based on the value", ".", ".", ".", "// =================================", "//Notes: This file is generated automatically when using this mod for the first time. Save this file & then reload your gun to save changes. To reset the this toggle back to the default, delete the file & then reload your gun.", "." ] foreach (line in AcidEvasionToggleFile) { DefaultToggleFile = DefaultToggleFile + line + "\n"; } if(!MercilessToggleFileCheck("mutation among us/mutation among us.txt")) { StringToFile("mutation among us/mutation among us.txt", DefaultToggleFile); printl("The 'mutation among us.txt' file can't be found. Generating a new 'mutation among us.txt' file..."); } } function LoadSpecificConfigFile(filename) { local trigger = 0; local files = FileToString(filename); if(!files) { return trigger; } local toggles = split(files, "\r\n"); foreach(toggle in toggles) { if(toggle && toggle != "") { toggle = strip(toggle); local idx = toggle.find(" "); if(idx != null) { local togglecommand = toggle.slice(0, idx); local togglevalue = toggle.slice(idx + 1); local togglevalue2 = null; if(RandomInt(0,100) <= 100) { if(togglecommand == "MutationAmongUs") { if(togglevalue == togglevalue.tostring()) { MutationAmongUs = togglevalue.tointeger(); } } if(togglecommand == "ZombieMutationChance") { if(togglevalue == "0") { ZombieMutationChance = 1; } if(togglevalue.tointeger() >= 1) { ZombieMutationChance = togglevalue.tointeger(); } } if(togglecommand == "ZombieMutationRange") { if(togglevalue.tointeger() <= 1000) { ZombieMutationRange = togglevalue.tointeger(); } if(togglevalue.tointeger() > 1000) { ZombieMutationRange = 1000; } } if(togglecommand == "ZombieMutationType") { if(togglevalue == togglevalue.tostring()) { ZombieMutationType = togglevalue.tointeger(); } } else { trigger = 1; } } } } } } function OnGameEvent_infected_hurt(event) { if(MutationAmongUs != 0) { local entDamage = {} local kent = null; if ("attacker" in event) { kent = GetPlayerFromUserID(event.attacker); } local zombie = null; if ("entityid" in event) { zombie = EntIndexToHScript(event.entityid); } local damagetaken = null; if(("amount" in event)) { damagetaken = event["amount"]; } local damagetype = null; if(("type" in event)) { damagetype = event["type"]; } if(MutationAmongUs >= 1) { if(IsCommonZombie(zombie)) { local zombieOrigin = zombie.GetOrigin(); if(IsSurvivorInGeneral(kent)) { if(MutationAmongUs == 1) { if(IsPlayerABot(kent)) { if((kent.GetOrigin() - zombie.GetOrigin()).Length() > ZombieMutationRange) { if(ZombieMutationChance <= 100) { if(RandomInt(0,100) <= ZombieMutationChance) { if(ZombieMutationType != 0) { if(ZombieMutationType != 7) { if(ZombieMutationType != 9) { if(ZombieMutationType != 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = ZombieMutationType, pos = zombieOrigin } ); } } } } } if(ZombieMutationType == 0) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = 1, pos = zombieOrigin } ); } } if(ZombieMutationType == 9) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,6), pos = zombieOrigin } ); } } if(ZombieMutationType == 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,8), pos = zombieOrigin } ); } } if(ZombieMutationType == 7) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = DirectorScript.ZOMBIE_WITCH, pos = zombieOrigin } ); } } } } else if(ZombieMutationChance > 100) { if(RandomInt(0,100) <= 100) { if(ZombieMutationType != 0) { if(ZombieMutationType != 7) { if(ZombieMutationType != 9) { if(ZombieMutationType != 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = ZombieMutationType, pos = zombieOrigin } ); } } } } } if(ZombieMutationType == 0) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = 1, pos = zombieOrigin } ); } } if(ZombieMutationType == 9) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,6), pos = zombieOrigin } ); } } if(ZombieMutationType == 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,8), pos = zombieOrigin } ); } } if(ZombieMutationType == 7) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = DirectorScript.ZOMBIE_WITCH, pos = zombieOrigin } ); } } } } } } } else if(MutationAmongUs == 2) { if(!IsPlayerABot(kent)) { if((kent.GetOrigin() - zombie.GetOrigin()).Length() > ZombieMutationRange) { if(ZombieMutationChance <= 100) { if(RandomInt(0,100) <= ZombieMutationChance) { if(ZombieMutationType != 0) { if(ZombieMutationType != 7) { if(ZombieMutationType != 9) { if(ZombieMutationType != 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = ZombieMutationType, pos = zombieOrigin } ); } } } } } if(ZombieMutationType == 0) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = 1, pos = zombieOrigin } ); } } if(ZombieMutationType == 9) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,6), pos = zombieOrigin } ); } } if(ZombieMutationType == 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,8), pos = zombieOrigin } ); } } if(ZombieMutationType == 7) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = DirectorScript.ZOMBIE_WITCH, pos = zombieOrigin } ); } } } } else if(ZombieMutationChance > 100) { if(RandomInt(0,100) <= 100) { if(ZombieMutationType != 0) { if(ZombieMutationType != 7) { if(ZombieMutationType != 9) { if(ZombieMutationType != 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = ZombieMutationType, pos = zombieOrigin } ); } } } } } if(ZombieMutationType == 0) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = 1, pos = zombieOrigin } ); } } if(ZombieMutationType == 9) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,6), pos = zombieOrigin } ); } } if(ZombieMutationType == 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,8), pos = zombieOrigin } ); } } if(ZombieMutationType == 7) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = DirectorScript.ZOMBIE_WITCH, pos = zombieOrigin } ); } } } } } } } else if(MutationAmongUs >= 3) { if((kent.GetOrigin() - zombie.GetOrigin()).Length() > ZombieMutationRange) { if(ZombieMutationChance <= 100) { if(RandomInt(0,100) <= ZombieMutationChance) { if(ZombieMutationType != 0) { if(ZombieMutationType != 7) { if(ZombieMutationType != 9) { if(ZombieMutationType != 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = ZombieMutationType, pos = zombieOrigin } ); } } } } } if(ZombieMutationType == 0) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = 1, pos = zombieOrigin } ); } } if(ZombieMutationType == 9) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,6), pos = zombieOrigin } ); } } if(ZombieMutationType == 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,8), pos = zombieOrigin } ); } } if(ZombieMutationType == 7) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = DirectorScript.ZOMBIE_WITCH, pos = zombieOrigin } ); } } } } else if(ZombieMutationChance > 100) { if(RandomInt(0,100) <= 100) { if(ZombieMutationType != 0) { if(ZombieMutationType != 7) { if(ZombieMutationType != 9) { if(ZombieMutationType != 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = ZombieMutationType, pos = zombieOrigin } ); } } } } } if(ZombieMutationType == 0) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = 1, pos = zombieOrigin } ); } } if(ZombieMutationType == 9) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,6), pos = zombieOrigin } ); } } if(ZombieMutationType == 10) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = RandomInt(1,8), pos = zombieOrigin } ); } } if(ZombieMutationType == 7) { if(killcount >= 1) { killcount = 0; ZSpawn( { type = DirectorScript.ZOMBIE_WITCH, pos = zombieOrigin } ); } } } } } } } } } } } function OnGameEvent_infected_death(event) { if(MutationAmongUs != 0) { local kent = null; if ("attacker" in event) { kent = GetPlayerFromUserID(event.attacker); } if(IsSurvivorInGeneral(kent)) { killcount++; } } } function OnGameEvent_weapon_reload(event) { local kent = null; if(("userid" in event)) { kent = GetPlayerFromUserID(event.userid); } if(kent.IsSurvivor()) { if(IsPlayerABot(kent)) { if(GetForcedButton(kent, FireButton)) { ReleaseForcedButton2(kent, FireButton); } } if(!IsPlayerABot(kent)) { if(Time() > ToggleCooldown + 1) { ToggleCooldown = Time(); GenerateMutationAmongUsFile(); LoadSpecificConfigFile("mutation among us/mutation among us.txt"); } } } } function OnGameEvent_round_start_post_nav(event) { printl("The 'MUTATED AMONG US' mode is started..."); GenerateMutationAmongUsFile(); LoadSpecificConfigFile("mutation among us/mutation among us.txt"); } function GetPrimaryAmmo(kent) { local primary = GetPrimarySlot(kent); if(primary != null) { local playerweapon = null; while(playerweapon = Entities.FindByClassname(playerweapon, primary)) { if(playerweapon.GetOwnerEntity() == kent) { return NetProps.GetPropIntArray(kent, "m_iAmmo", NetProps.GetPropInt(playerweapon, "m_iPrimaryAmmoType")); } } } return null; } function SetPrimaryAmmo(kent, ammo) { local primary = GetPrimarySlot(kent); if(primary != null) { local playerweapon = null; while(playerweapon = Entities.FindByClassname(playerweapon, primary)) { if(playerweapon.GetOwnerEntity() == kent) { return NetProps.SetPropIntArray(kent, "m_iAmmo", ammo, NetProps.GetPropInt(playerweapon, "m_iPrimaryAmmoType")); } } } return null; } function AdrenalineBots(kent, duration) { local player = null while(player = Entities.FindByClassname(player, "player")) { if(player.IsSurvivor() && IsPlayerABot(player)) { player.UseAdrenaline(duration); } } return null; } function BotAutoRetreatFromMe(kent) { local survteam = null; while(survteam = Entities.FindByClassname(survteam, "player")) { if(survteam.IsSurvivor() && IsPlayerABot(survteam)) { CommandABot( { cmd = DirectorScript.BOT_CMD_RETREAT, target = kent, bot = survteam } ); } } return null; } function BotsAimAtMe(kent) { local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), 66666); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { local survteam = null; while(survteam = Entities.FindByClassname(survteam, "player")) { if(survteam.IsSurvivor()) { if(IsPlayerABot(survteam)) { CommandABot({ cmd = DirectorScript.BOT_CMD_ATTACK, bot = survteam, target = kent }); } } } } } function BotForcedShotB3(kent) { local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), 66666); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { local targetdistance = (kent.GetOrigin() - traceTable.enthit.GetOrigin()).Length(); if(kent.IsSurvivor()) { if(IsPlayerABot(kent)) { if(GetActiveMainWeapon(kent) != "weapon_gascan" && GetActiveMainWeapon(kent) != "weapon_cola_bottles" && GetActiveMainWeapon(kent) != "weapon_first_aid_kit" && GetActiveMainWeapon(kent) != "weapon_defibrillator" && GetActiveMainWeapon(kent) != "weapon_gnome") { if(traceTable.enthit.GetClassname() == "infected") { if(traceTable.enthit.GetHealth() > 0) { ForcedButton(kent, FireButton); if(GetForcedButton(kent, FireButton)) { ReleaseForcedButton2(kent, FireButton); } } } else if(traceTable.enthit.GetClassname() == "player") { if(!traceTable.enthit.IsDead()) { if(!traceTable.enthit.IsDying()) { if(traceTable.enthit.GetZombieType() != 2) { if(traceTable.enthit.GetZombieType() != 9) { ForcedButton(kent, FireButton); if(GetForcedButton(kent, FireButton)) { ReleaseForcedButton2(kent, FireButton); } } } else if(traceTable.enthit.GetZombieType() == 2) { if((kent.GetOrigin() - traceTable.enthit.GetOrigin()).LengthSqr() >= 666) { ForcedButton(kent, FireButton); if(GetForcedButton(kent, FireButton)) { ReleaseForcedButton2(kent, FireButton); } } } else if(traceTable.enthit.GetZombieType() == 9) { if(IsCapturedBySI(traceTable.enthit)) { ForcedButton(kent, FireButton); if(GetForcedButton(kent, FireButton)) { ReleaseForcedButton2(kent, FireButton); } } if(NetProps.GetPropInt(traceTable.enthit, "m_isHangingFromTongue") != 0) { ForcedButton(kent, FireButton); if(GetForcedButton(kent, FireButton)) { ReleaseForcedButton2(kent, FireButton); } } } } } } } } } } } function BotForcedShotB4(kent) { local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), 66666); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { local targetdistance = (kent.GetOrigin() - traceTable.enthit.GetOrigin()).Length(); if(kent.IsSurvivor()) { if(IsPlayerABot(kent)) { if(GetActiveMainWeapon(kent) != "weapon_chainsaw" && GetActiveMainWeapon(kent) != "weapon_melee") { if(traceTable.enthit.GetClassname() == "infected") { if(traceTable.enthit.GetHealth() > 0) { if(GetActiveMainWeapon(kent) == GetPrimarySlot(kent) || GetActiveMainWeapon(kent) == GetSecondarySlot(kent)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 1); if(GetButtonPressed(kent, FireButton)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 0); } } } } else if(traceTable.enthit.GetClassname() == "player") { if(!traceTable.enthit.IsDead()) { if(!traceTable.enthit.IsDying()) { if(traceTable.enthit.GetZombieType() != 2) { if(traceTable.enthit.GetZombieType() != 9) { if(GetActiveMainWeapon(kent) == GetPrimarySlot(kent) || GetActiveMainWeapon(kent) == GetSecondarySlot(kent)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 1); if(GetButtonPressed(kent, FireButton)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 0); } } } } else if(traceTable.enthit.GetZombieType() == 2) { if((kent.GetOrigin() - traceTable.enthit.GetOrigin()).LengthSqr() >= 666) { if(GetActiveMainWeapon(kent) == GetPrimarySlot(kent) || GetActiveMainWeapon(kent) == GetSecondarySlot(kent)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 1); if(GetButtonPressed(kent, FireButton)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 0); } } } } else if(traceTable.enthit.GetZombieType() == 9) { if(IsCapturedBySI(traceTable.enthit)) { if(GetActiveMainWeapon(kent) == GetPrimarySlot(kent) || GetActiveMainWeapon(kent) == GetSecondarySlot(kent)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 1); if(GetButtonPressed(kent, FireButton)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 0); } } } if(NetProps.GetPropInt(traceTable.enthit, "m_isHangingFromTongue") != 0) { if(GetActiveMainWeapon(kent) == GetPrimarySlot(kent) || GetActiveMainWeapon(kent) == GetSecondarySlot(kent)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 1); if(GetButtonPressed(kent, FireButton)) { NetProps.SetPropInt(kent.GetActiveWeapon(), "m_isHoldingFireButton", 0); } } } } } } } } } } } } function BotForcedShotC(kent) { local entDamage = {} local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), 66666); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { local targetdistance = (kent.GetOrigin() - traceTable.enthit.GetOrigin()).Length(); if(kent.IsSurvivor()) { if(IsPlayerABot(kent)) { if(GetActiveMainWeapon(kent) != "weapon_gascan" && GetActiveMainWeapon(kent) != "weapon_cola_bottles" && GetActiveMainWeapon(kent) != "weapon_first_aid_kit" && GetActiveMainWeapon(kent) != "weapon_defibrillator") { if(traceTable.enthit.GetClassname() == "infected") { if(traceTable.enthit.GetHealth() > 0) { ShotTimer = Time(); if(Time() < ShotTimer + 0.5) { Convars.SetValue("sb_open_fire", (1 * 1)); } } } else if(traceTable.enthit.GetClassname() == "player") { if(!traceTable.enthit.IsDead()) { if(traceTable.enthit.GetZombieType() != 2) { if(traceTable.enthit.GetZombieType() != 9) { ShotTimer = Time(); if(Time() < ShotTimer + 0.5) { Convars.SetValue("sb_open_fire", (1 * 1)); } } } else if(traceTable.enthit.GetZombieType() == 2) { if((kent.GetOrigin() - traceTable.enthit.GetOrigin()).LengthSqr() >= 666) { ShotTimer = Time(); if(Time() < ShotTimer + 0.5) { Convars.SetValue("sb_open_fire", (1 * 1)); } } } else if(traceTable.enthit.GetZombieType() == 9) { if(IsCapturedBySI(traceTable.enthit)) { ShotTimer = Time(); if(Time() < ShotTimer + 0.5) { Convars.SetValue("sb_open_fire", (1 * 1)); } if(targetdistance <= (20 * 100)) { kent.SetAngles(QAngle((20 - (targetdistance * 0.01)),0,0)); } } if(NetProps.GetPropInt(traceTable.enthit, "m_isHangingFromTongue") != 0) { ShotTimer = Time(); if(Time() < ShotTimer + 0.5) { Convars.SetValue("sb_open_fire", (1 * 1)); } } } } } } } } } } function ReverseGravity(kent) { local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), 666666); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { local Airwalk = kent.GetOrigin() + Vector(0,0,10); local Airwalk2 = kent.GetVelocity() + Vector(0,0,66666); kent.ApplyAbsVelocityImpulse(Airwalk2); } } function ReverseGravity2(kent) { local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), 666666); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { if(kent.IsSurvivor()) { local Airwalk = kent.GetOrigin() + Vector(0,0,10); local Airwalk2 = kent.GetVelocity() + Vector(0,0,66666); local Airwalk3 = traceTable.enthit.GetVelocity() + Vector(0,0,66666); if(traceTable.enthit.GetClassname() == "player") { traceTable.enthit.ApplyAbsVelocityImpulse(Airwalk2); } } } } function WitchCurseOnHumanSurv(kent, cursehint) { local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), MaxDistance); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { if(!IsPlayerABot(kent)) { ShowSpecialHint3(kent, cursehint, SkullIcon, 0.5, 3, 1) } } } function ShowSpecialHint3(kent, customhint, customicon, delay, duration, hintshakeoption) { local spechint = clone special_hint; local traceEndpoint = kent.EyePosition() + VectorFromQAngle(kent.EyeAngles(), MaxDistance); local traceTable = { start = kent.EyePosition() end = traceEndpoint ignore = kent } TraceLine(traceTable) if("enthit" in traceTable) { if(!kent.IsDead()) { spechint.hint_caption = customhint; spechint.hint_icon_onscreen = customicon; spechint.hint_shakeoption = hintshakeoption; local spechintentity = SpawnEntityFromTable("env_instructor_hint", spechint); DoEntFire("!self", "ShowHint", "!activator", delay, kent, spechintentity); DoEntFire("!self", "kill", "", duration, spechintentity, spechintentity); } } } SkullIcon <- "icon_skull"; ShieldIcon <- "icon_shield"; AlertIconWhite <- "icon_alert"; ForbiddenIcon <- "icon_no"; LampIcon <- "icon_tip"; GiftIcon <- "icon_upgrade"; TankIcon <- "tip_tank"; SurvivorIcon <- "Stat_vs_Most_Damage_Done"; SpecialIcon <- "Stat_Most_Special_Kills"; special_hint <- { classname = "env_instructor_hint" hint_name = "special_hint" hint_caption = "" hint_auto_start = 0 hint_target = "" hint_timeout = 5 hint_static = 1 hint_forcecaption = 1 hint_icon_onscreen = "" hint_instance_type = 2 hint_shakeoption = 0 hint_color = "255 255 255" }