IncludeScript("alternatewaves", getroottable()) IncludeScript("tankextensions_main", getroottable()) IncludeScript("tankextensions/teletank", getroottable()) IncludeScript("tankextensions/targetank", getroottable()) TankExt.SetValueOverrides ({ TARGETANK_COLOR1 = "255 255 0" TARGETANK_COLOR2 = "255 0 0" TARGETANK_SND_IMPACT = "DemoCharge.HitFlesh" TARGETANK_RECHARGE_DURATION = 18.5 }) TankExt.CreatePaths({ path_left = [ Vector(1016, -2488, -56) Vector(1008, -2056, -56) Vector(1016, -1216, -32) Vector(344, -1232, 16) Vector(40, -1256, 80) Vector(-184, -1112, 104) Vector(-312, -888, 104) Vector(-424, -640, 96) Vector(-424, 136, 104) Vector(80, 168, 104) Vector(152, 384, 104) Vector(144, 960, 120) Vector(-72, 1112, 112) Vector(-224, 1384, 104) Vector(-208, 1816, 72) Vector(232, 1816, 48) Vector(592, 1888, 8) Vector(592, 2328, 0) Vector(592, 2736, -120) Vector(432, 2904, -120) Vector(200, 2888, -120) Vector(120, 2992, -120) Vector(104, 3448, -120) Vector(208, 3552, -120) Vector(472, 3552, -120) ] path_farleft = [ Vector(1016, -2488, -56) Vector(1016, -2056, -56) Vector(1016, -1216, -32) Vector(984, -616, 40) Vector(992, -8, 40) Vector(560, 152, 48) Vector(320, 208, 88) Vector(152, 232, 96) Vector(144, 768, 120) Vector(-48, 1056, 112) Vector(-288, 1576, 88) Vector(-544, 2040, 72) Vector(-544, 2632, 80) Vector(-512, 3408, 104) Vector(-192, 3432, 96) Vector(168, 3504, -128) Vector(472, 3544, -120) ] }) AlternateWaves.bTrackIcons = false local defUberTime = Convars.GetFloat("tf_mvm_engineer_teleporter_uber_duration") if("UnendingBloodlust" in ROOT) { UnendingBloodlust.CleanUp() // delete ::UnendingBloodlust } ::UnendingBloodlust <- { NotifiedPlayers = [] WaveInProgress = false BlockedAreas = [Vector(1294.0, 2346.0, 230.0), Vector(-550.0, 2177.0, 40.0)] BlockedAreaRadius = 400.0 function CleanUp() { local gamerules = FindByClassname(null, "tf_gamerules"); local scope = gamerules.GetScriptScope(); if (scope != null) { gamerules.TerminateScriptScope(); NetProps.SetPropString(gamerules, "m_iszScriptThinkFunction", ""); AddThinkToEnt(gamerules, null); } local waveStart = Entities.FindByName(null, "wave_start_relay"); RemoveWaveScope(waveStart); local navAreas = {}; foreach (pos in BlockedAreas) { NavMesh.GetNavAreasInRadius(pos, BlockedAreaRadius, navAreas); foreach (area in navAreas) { area.UnblockArea(); } } delete ::UnendingBloodlust; } function ReblockAreas() { local navAreas = {}; foreach (pos in BlockedAreas) { NavMesh.GetNavAreasInRadius(pos, BlockedAreaRadius, navAreas); foreach (area in navAreas) { //area.MarkAsBlocked(Constants.ETFTeam.TF_TEAM_BLUE); } } } function RemoveWaveScope(waveStart) { local scope = waveStart.GetScriptScope(); if (scope != null) { waveStart.TerminateScriptScope(); NetProps.SetPropString(waveStart, "m_iszScriptThinkFunction", ""); AddThinkToEnt(waveStart, null); } } function OnGameEvent_post_inventory_application(params) { local player = GetPlayerFromUserID(params.userid) ModifyWeapons(player); } function ModifyWeapons(player) { if (player.GetTeam() == 2) { for (local i = 0; i < NetProps.GetPropArraySize(player, "m_hMyWeapons"); i++) { local weapon = NetProps.GetPropEntityArray(player, "m_hMyWeapons", i) if (weapon == null) { continue; } if (weapon.GetClassname() == "tf_weapon_minigun") { weapon.RemoveAttribute("damage bonus HIDDEN"); weapon.AddAttribute("damage bonus HIDDEN", 0.8, 0) } } } } function OnGameEvent_recalculate_holidays(params) { CleanUp(); } function OnGameEvent_mvm_wave_complete(params) { CleanUp(); } function OnGameEvent_player_disconnect(params) { local index = NotifiedPlayers.find(params.userid) if (index == null) { return } NotifiedPlayers.remove(index) } function OnGameEvent_mvm_wave_complete(params) { WaveInProgress = false } function OnGameEvent_mvm_wave_failed(params) { WaveInProgress = false } function OnGameEvent_mvm_begin_wave(params) { WaveInProgress = true; local waveStart = Entities.FindByName(null, "wave_start_relay"); RemoveWaveScope(waveStart); AddScope(waveStart); ReblockAreas(); for (local avoid; avoid = Entities.FindByClassname(avoid, "func_nav_avoid");) { avoid.KeyValueFromString("tags", "common bomb_carrier"); avoid.SetTeam(Constants.ETFTeam.TF_TEAM_BLUE); avoid.DispatchSpawn(); break; } } function OnGameEvent_player_spawn(params) { local player = GetPlayerFromUserID(params.userid); if (player == null || !player.IsValid() || !player.IsBotOfType(TF_BOT_TYPE)) { return; } player.TerminateScriptScope(); NetProps.SetPropString(player, "m_iszScriptThinkFunction", ""); AddThinkToEnt(player, null); EntFireByHandle(player, "RunScriptCode", "UnendingBloodlust.TagCheck(self)", -1, null, null); } function TagCheck(player) { if (player.HasBotTag("crit_fix")) { player.ValidateScriptScope(); local scope = player.GetScriptScope(); scope.Healer <- null; scope.HealerFound <- false; scope.Think <- function() { if (self.GetTeam() != 3 || !self.IsAlive()) { self.TerminateScriptScope(); NetProps.SetPropString(self, "m_iszScriptThinkFunction", ""); AddThinkToEnt(self, null); return 0; } if (scope.Healer == null) { for (local i = 1, otherPlayer; i <= MaxClients().tointeger(); i++) { if ((otherPlayer = PlayerInstanceFromIndex(i)) != null && otherPlayer.GetHealTarget() == self) { scope.Healer = otherPlayer; } } } else { if (scope.Healer.GetHealTarget() == null) { scope.Healer = null; } } if (self.InCond(11) && scope.Healer != null && scope.Healer.IsValid()) { self.AddBotAttribute(512); } else { self.RemoveBotAttribute(512); self.RemoveCond(11); self.RemoveCond(34); } return 0; } AddThinkToEnt(player, "Think"); } } function OnGameEvent_mvm_reset_stats(params) { WaveInProgress = true } function HasScope(waveStart) { local scope = waveStart.GetScriptScope(); return ("IsFading" in scope); } function StartFadeOutTrack(trackA, trackB) { local waveStart = Entities.FindByName(null, "wave_start_relay"); if (HasScope(waveStart)) { local scope = waveStart.GetScriptScope(); scope.StartFade(trackA, trackB); return; } } AddScope = function(waveStart) { waveStart.ValidateScriptScope(); if (HasScope(waveStart)) { return; } local scope = waveStart.GetScriptScope(); scope.VolumeA <- 1.0; scope.VolumeB <- 0.0; scope.IsFading <- false; scope.TrackA <- ""; scope.TrackB <- ""; scope.StartFade <- function(trackA, trackB) { scope.IsFading = true; scope.VolumeA = 1.0; scope.VolumeB = 0.0; scope.TrackA = trackA; scope.TrackB = trackB; } scope.MusicThink <- function() { if (!scope.IsFading) { return 0; } scope.VolumeA -= FrameTime(); scope.VolumeB += FrameTime(); if (scope.VolumeA <= 0.0) { scope.VolumeA = 0.0; scope.IsFading = false; } if (scope.VolumeB >= 1.0) { scope.VolumeB = 1.0; scope.IsFading = false; } for (local i = 1, player; i <= MaxClients().tointeger(); i++) { if ((player = PlayerInstanceFromIndex(i)) != null && !IsPlayerABot(player)) { EmitSoundEx({ sound_name = scope.TrackA entity = player filter_type = 4 flags = 1 volume = scope.VolumeA }) EmitSoundEx({ sound_name = scope.TrackB entity = player filter_type = 4 flags = 1 volume = scope.VolumeB }) } } return 0; } AddThinkToEnt(waveStart, "MusicThink"); } function SetUberTeleportTime(value) { Convars.SetValue("tf_mvm_engineer_teleporter_uber_duration", value); } function ResetUberTeleportTime() { Convars.SetValue("tf_mvm_engineer_teleporter_uber_duration", defUberTime); } function StopWaveSpawn(wave) { local populator = FindByClassname(null, "point_populator_interface"); populator.AcceptInput("$PauseWaveSpawn", wave, null, null); for (local i = 1; i <= MAX_CLIENTS; i++) { local otherPlayer = PlayerInstanceFromIndex(i); if (otherPlayer == null || otherPlayer.GetTeam() != 3 || !otherPlayer.IsAlive()) { continue; } otherPlayer.SetHealth(0); otherPlayer.TakeDamageCustom(otherPlayer, otherPlayer, null, Vector(0, 0, 0), otherPlayer.GetCenter(), otherPlayer.GetHealth().tofloat() + 10.0, 0, 6); } for (local building; building = Entities.FindByClassname(building, "obj_*");) { if (building == null || building.GetTeam() != 3) { continue; } building.TakeDamage(building.GetHealth().tofloat() + 10.0, 64, Entities.First()); } } function SetWaveBar(wave) { local isWave0 = (wave == 0) EntFire("tf_objective_resource", "$SetClientProp$m_nMvMEventPopfileType", isWave0 ? "1" : "0", -1) EntFire("tf_objective_resource", "$SetClientProp$m_nMannVsMachineWaveCount", isWave0 ? "1" : wave.tostring(), -1) if (wave == 9) { EntFire("tf_objective_resource", "$SetClientProp$m_nMannVsMachineMaxWaveCount", isWave0 ? "0" : "9", -1) } else { EntFire("tf_objective_resource", "$SetClientProp$m_nMannVsMachineMaxWaveCount", isWave0 ? "0" : "8", -1) } AlternateWaves.ClearWaveIcons() if (!isWave0) { AlternateWaves.SetWaveCount(wave, 8) } switch (wave) { case 1: AlternateWaves.AddWaveIcons([ [ "demo_clusterbomb_delay", 1, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_kritz_giant", 1, MVM_CLASS_FLAG_MINIBOSS ], [ "scout_giant_fast", 4, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_spammer", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "scout_bonk_stun", 30, MVM_CLASS_FLAG_NORMAL ], [ "heavy_steelfist_nys_pusher", 8, MVM_CLASS_FLAG_NORMAL ], [ "heavy_deflector", 20, MVM_CLASS_FLAG_NORMAL ], [ "spy", 2, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], ]) break case 2: AlternateWaves.AddWaveIcons([ [ "soldier_burstfire", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_pop", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "scout_sunstick_swordstone", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_blackbox_conch_lite", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "pyro_flare", 20, MVM_CLASS_FLAG_NORMAL ], [ "heavy_gru", 10, MVM_CLASS_FLAG_NORMAL ], [ "medic", 10, MVM_CLASS_FLAG_NORMAL ], [ "demo", 20, MVM_CLASS_FLAG_NORMAL ], [ "pyro_flare_armored_yoovy", 12, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "sniper_bow_multi", 4, MVM_CLASS_FLAG_NORMAL ], [ "sniper", 2, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], ]) break case 3: AlternateWaves.AddWaveIcons([ [ "tank_tele", 1, MVM_CLASS_FLAG_MINIBOSS ], [ "scout_stun_giant_armored", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_crossbow_penetration", 4, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_crit_spammer", 3, MVM_CLASS_FLAG_MINIBOSS | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "heavy_steelfist_nys_giant", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_kritz_armored", 4, MVM_CLASS_FLAG_NORMAL ], [ "demoknight_persian_nys", 20, MVM_CLASS_FLAG_NORMAL ], [ "demo", 25, MVM_CLASS_FLAG_NORMAL ], [ "scout", 20, MVM_CLASS_FLAG_NORMAL ], [ "soldier", 16, MVM_CLASS_FLAG_NORMAL ], ]) break case 4: AlternateWaves.AddWaveIcons([ [ "pyro_dragonfury_giant", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_banner_trio_spammer_lite", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "demo_spammer_giant", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "heavy_accurate_lite", 15, MVM_CLASS_FLAG_NORMAL ], [ "demoknight", 20, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "scout_bonk", 20, MVM_CLASS_FLAG_NORMAL ], [ "medic_kritz_armored", 3, MVM_CLASS_FLAG_NORMAL ], [ "scout_bonk_stun", 20, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "heavy_shotgun", 25, MVM_CLASS_FLAG_NORMAL ], [ "engineer", 1, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "medic_uber_quick", 1, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], ]) break case 5: AlternateWaves.AddWaveIcons([ [ "heavy_hyper", 1, MVM_CLASS_FLAG_MINIBOSS ], [ "tank_targe", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "pyro_dragon_fury_swordstone", 24, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "demo", 32, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "sniper_bow_multi_ignite_fix", 12, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "spy", 3, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], ]) break case 6: AlternateWaves.AddWaveIcons([ [ "soldier_bison_spammer_hyper_mentrillum", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "tank", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "demo_spammer_giant", 12, MVM_CLASS_FLAG_MINIBOSS ], [ "scout_giant_fast", 50, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "demo_spammer", 10, MVM_CLASS_FLAG_NORMAL ], [ "pyro_reflect", 30, MVM_CLASS_FLAG_NORMAL ], [ "soldier_directhit_buff_lite", 20, MVM_CLASS_FLAG_NORMAL ], [ "sniper_sydneysleeper", 2, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], ]) break case 7: AlternateWaves.AddWaveIcons([ [ "scout_bat_nys", 3, MVM_CLASS_FLAG_MINIBOSS | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "soldier_libertylauncher_giant", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "shotgun_reserve_spammer", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_pop", 3, MVM_CLASS_FLAG_NORMAL ], [ "sniper_bow_penetrate", 18, MVM_CLASS_FLAG_NORMAL ], [ "heavy_steelfist_nys", 12, MVM_CLASS_FLAG_NORMAL ], [ "engineer_ranger_nys", 6, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT | MVM_CLASS_FLAG_SUPPORT ], [ "soldier_bazooka", 6, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "soldier_mangler", 2, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ] ]) break case 8: AlternateWaves.AddWaveIcons([ [ "heavy_shotgun_burst_lite", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "heavy_steelfist_nys_giant", 6, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_burstfire", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_crossbow_penetration", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_uber_armored", 3, MVM_CLASS_FLAG_NORMAL ], [ "medic_vacc_trio_armored_lite", 3, MVM_CLASS_FLAG_NORMAL ], [ "heavy_accurate_lite", 20, MVM_CLASS_FLAG_NORMAL ], [ "soldier_bison_a", 12, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "pyro", 6, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "soldier_bison_spammer_fix", 4, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ] ]) break case 9: AlternateWaves.AddWaveIcons([ [ "demo_burst_giant", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_burstfire", 3, MVM_CLASS_FLAG_MINIBOSS ], [ "pyro_dragon_fury_swordstone_spammer", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_kritz_giant", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_crossbow_penetration", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_shield_lite_giant", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "soldier_bison_a", 2, MVM_CLASS_FLAG_MINIBOSS | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "heavy_steelfist_nys_pusher_giant", 2, MVM_CLASS_FLAG_MINIBOSS | MVM_CLASS_FLAG_ALWAYSCRIT ], [ "soldier_bison_spammer_hyper_mentrillum", 2, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_bullet_giant", 1, MVM_CLASS_FLAG_MINIBOSS ], [ "medic_blast_giant", 1, MVM_CLASS_FLAG_MINIBOSS ], [ "scout_bat_nys", 10, MVM_CLASS_FLAG_MINIBOSS ], [ "heavy_mittens", 4, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT | MVM_CLASS_FLAG_SUPPORT], [ "sniper_headshot_crit_mission", 1, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_ALWAYSCRIT | MVM_CLASS_FLAG_SUPPORT ], [ "scout", 6, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "pyro", 3, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ] ]) break default: AlternateWaves.AddWaveIcons([ [ "random_lite_giant", 666, MVM_CLASS_FLAG_MINIBOSS ], [ "random_lite", 666, MVM_CLASS_FLAG_NORMAL ], [ "sniper", 0, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "spy", 0, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], [ "engineer", 0, MVM_CLASS_FLAG_NORMAL | MVM_CLASS_FLAG_SUPPORT ], ]) break } } function ChangeBombPath(right = false) { EntFire("bombpath_choose_relay", "Disable"); EntFire("bombpath_clearall_relay", "Trigger", null, 0.1); EntFire("bombpath_holograms_clear_relay", "Trigger", null, 0.1); if (right) { EntFire("bombpath_right_relay", "Trigger", null, 0.5); } else { EntFire("bombpath_left_relay", "Trigger", null, 0.5); } if (WaveInProgress) { EntFire("bombpath_holograms_clear_relay", "Trigger", null, 15.0); local bomb = Entities.FindByName(null, "intel"); bomb.AcceptInput("ForceReset", "!activator", null, null); EntFireByHandle(bomb, "CallScriptFunction", "EvaluateNavBrushes", 0.4, null, null); SendGlobalGameEvent("show_annotation", { text = format("The bomb path has changed to the %s path.", right ? "right" : "left") lifetime = 15.0 worldPosX = 1000.0 worldPosY = -1250.0 worldPosZ = -20.0 id = -1 play_sound = "misc/null.wav" show_distance = false show_effect = true visibilityBitfield = 0 }) } ReblockAreas(); } function HopBombBack() { local bomb = Entities.FindByName(null, "intel"); bomb.GetScriptScope().Hop(); ReblockAreas(); } function change() { // NetProps.SetPropString(Entities.FindByClassname(null, `tf_objective_resource`), `m_iszMvMPopfileName`, `Here you die. . .`) local ent = Entities.FindByClassname(null, "tf_objective_resource") //This makes the mission name change properly for potato, while preserving its functionality on other servers. local IsSigmod = Convars.GetInt("sig_etc_misc") != null if (IsSigmod) { ent.AcceptInput("$SetClientProp$m_iszMvMPopfileName", "Here you die. . .", null, null) } else { NetProps.SetPropString(ent, "m_iszMvMPopfileName", "Here you die. . .") } } function AttachTankThink(name) { local timer = Entities.CreateByClassname("logic_relay"); timer.ValidateScriptScope(); local scope = timer.GetScriptScope(); local tank = Entities.FindByNameNearest(name, Vector(1016, -2488, -56), 200.0); PrecacheSound(")ambient/materials/cartrap_explode_impact2.wav"); scope.Tank <- tank; scope.OldState <- false; scope.State <- false; scope.Wait <- 0.25 scope.Initialize <- 0.5 scope.Think <- function() { scope.Initialize -= FrameTime(); if (scope.Initialize > 0.0) { return -1; } if (scope.Tank == null) { self.Kill(); return -1; } else if ( !scope.Tank.IsValid() ) { self.Kill(); return -1; } scope.State = (tank.GetFlags() & 1) != 0; if (!scope.State) { scope.Wait -= FrameTime(); } if (scope.Wait <= 0.0 && scope.State && !scope.OldState) { EmitSoundEx({sound_name = ")ambient/materials/cartrap_explode_impact2.wav" entity = scope.Tank sound_level = 90 }); EmitSoundEx({sound_name = ")ambient/materials/cartrap_explode_impact2.wav" entity = scope.Tank sound_level = 90 }); DispatchParticleEffect("hammer_impact_button", scope.Tank.GetOrigin(), scope.Tank.GetAngles()); ScreenShake(scope.Tank.GetOrigin(), 16.0, 9.0, 3.0, 1000.0, 0, true); for (local otherPlayer; otherPlayer = Entities.FindByClassnameWithin(otherPlayer, "player", scope.Tank.GetOrigin(), 200.0);) { if (otherPlayer == null || !otherPlayer.IsValid() || !otherPlayer.IsAlive() || IsPlayerABot(otherPlayer) || otherPlayer.GetTeam() != 2) { continue; } otherPlayer.TakeDamageEx(scope.Tank, scope.Tank, null, Vector(0.0, 0.0, 0.0), scope.Tank.GetOrigin(), 2000.0, 1048640); } scope.Tank = null; } scope.OldState = scope.State; return -1; } AddThinkToEnt(timer, "Think"); } GameRules = FindByClassname(null, "tf_gamerules") } __CollectGameEventCallbacks(UnendingBloodlust) local nextBarChange = 0.0 local waveBarIndex = 0 local gamerules = FindByClassname(null, "tf_gamerules") gamerules.ValidateScriptScope() gamerules.GetScriptScope().WaveBarChanger <- function() { if (UnendingBloodlust.WaveInProgress) { return } if ("fun" in ROOT) { if ( fun.bViewing ) return } if (nextBarChange <= Time()) { waveBarIndex++ if (waveBarIndex > 8) { waveBarIndex = 1 } nextBarChange = Time() + 2.0 UnendingBloodlust.SetWaveBar(waveBarIndex) } } for (local i = 1, player; i <= MaxClients().tointeger(); i++) { if ((player = PlayerInstanceFromIndex(i)) != null) { UnendingBloodlust.ModifyWeapons(player); } } AddThinkToEnt(gamerules, "WaveBarChanger")