InvulnerableCondTable = { TF_COND_INVULNERABLE, TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED, TF_COND_INVULNERABLE_USER_BUFF, TF_COND_INVULNERABLE_CARD_EFFECT, } Wavebar = ents.FindByClass("tf_objective_resource") function IsInvulnerable(player) for _, cond in pairs(InvulnerableCondTable) do if player:InCond(cond) then break return true end end return false end function GetVelocity(entity) return Vector(entity.m_vecVelocity[1], entity.m_vecVelocity[2], entity.m_vecVelocity[3]) end function GetViewModel(player) for _, vm in pairs(ents.FindAllByClass("tf_viewmodel")) do if vm.m_hOwner == player then return vm end end end function GetEyeAngles(player) return Vector(player.m_angEyeAngles[1], player.m_angEyeAngles[2], player.m_angEyeAngles[3]) end function GetViewHeight(player) local result = player.m_vecViewOffset[3] if player.m_fFlags & FL_DUCKING ~= 0 then result = 40 * player.m_flModelScale end return result end function GetCamera(player) local origin = player:GetAbsOrigin() local height = GetViewHeight(player) local result = origin + Vector(0, 0, height) return result end function Delay(seconds) local globaltime = CurTime() local newtime = globaltime + seconds return newtime end ------- SCOUT_EXPLODE_VELOCITY_MULT = 2.25 SCOUT_EXPLODE_FALL_MULT = 5 SCOUT_EXPLODE_ALLOW_QUICKFIX = 1 SCOUT_EXPLODE_EASTEREGG_COOLDOWN = 0.75 SCOUT_EXPLODE_EASTEREGG_MAX_JUMPS = 9 function ScoutExplode(player) if not player:IsAlive() then return false end local vel = GetVelocity(player) player:SetLocalVelocity((vel * SCOUT_EXPLODE_VELOCITY_MULT) * player.m_iAirDash) player:AddCond(TF_COND_BLASTJUMPING) for _, medigun in pairs(ents.FindAllByClass("tf_weapon_medigun")) do local owner = medigun.m_hOwner if medigun.m_hHealingTarget == player and medigun.m_iItemDefinitionIndex == 411 then --quick fix if SCOUT_EXPLODE_ALLOW_QUICKFIX == 1 then owner:SetLocalVelocity(GetVelocity(owner) + GetVelocity(player)) end end end player:PlaySound("NilValue.AirdashExplode") util.ParticleEffect("ExplosionCore_MidAir_Flare", player:GetAbsOrigin(), nil, player) util.ParticleEffect("Explosion_Smoke_1", player:GetAbsOrigin(), nil, player) --die if you explode too much player.iConsecutiveExplosions = player.iConsecutiveExplosions + 1 if player.iConsecutiveExplosions == SCOUT_EXPLODE_EASTEREGG_MAX_JUMPS then ents.FindByName("cmd"):AcceptInput("command", "dsp_player 36", player) util.ParticleEffect("rd_robot_explosion_smoke_linger", player:GetAbsOrigin(), nil, player) tempents.Send("TFBlood", {m_vecOrigin = player:GetAbsOrigin()}, nil) elseif player.iConsecutiveExplosions > SCOUT_EXPLODE_EASTEREGG_MAX_JUMPS then for _, e in pairs(InvulnerableCondTable) do player:RemoveCond(e) end player:TakeDamage({ Attacker = player, Damage = player.m_iHealth * 3000, DamageType = DMG_BLAST, Inflictor = player, }) player:Suicide() --failsafe end player.flExplosionReset = Delay(SCOUT_EXPLODE_EASTEREGG_COOLDOWN) end function FuckingExplode(bot) local mimic = ents.CreateWithKeys("tf_point_weapon_mimic", { ["$weaponname"] = "explo", teamnum = bot.m_iTeamNum, targetname = "boom", }, true, true) local shake = ents.CreateWithKeys("env_shake", { radius = 1000, frequency = 200, amplitude = 150, duration = 1, targetname = "boom", }) util.ParticleEffect("ExplosionCore_MidAir", bot:GetAbsOrigin() + Vector(0,0,50), nil, bot) mimic:SetAbsOrigin(bot:GetAbsOrigin() + Vector(0, 0, 25)) shake:SetAbsOrigin(bot:GetAbsOrigin() + Vector(0, 0, 50)) bot:Suicide() mimic:SetOwner(bot) mimic:FireOnce() shake:StartShake() timer.Simple(0.2, function() mimic:Remove() shake:Remove() end) if bot.m_hRagdoll ~= nil then bot.m_hRagdoll:Remove() end end --------------- function OnWaveSpawnBot(bot) bot:SetAttributeValue("collect currency on kill", 1) if bot.m_iTeamNum == TEAM_RED then bot:Teleport(Vector(-1723, 1027, 808)) bot:AddCond(51, 2.5) else bot:SetAttributeValue("allow friendly fire", 1) end end function OnPlayerConnected(player) player.iAirDashTime = 0 player.iConsecutiveExplosions = 0 player.flExplosionReset = 0 player.iAirDashCount2 = 0 player:AddCallback(ON_DEATH, function() player:SetAttributeValue("no_attack", nil) player.flExplosionReset = 0 player.iConsecutiveExplosions = 0 player.iAirDashCount2 = 0 ents.FindByName("cmd"):AcceptInput("command", "dsp_player 0", player) end) player:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(_, damageinfo) local attacker = damageinfo.Attacker local weapon = damageinfo.Weapon local inflictor = damageinfo.Inflictor local dtype = damageinfo.DamageType if player:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE) ~= nil and player:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE):GetAttributeValueByClass("throwable_healing", 0) == 1 then if dtype & DMG_FALL ~= 0 then if player.m_hGroundEntity:GetClassname() == "player" and player.m_iTeamNum ~= player.m_hGroundEntity.m_iTeamNum and player.m_hGroundEntity:IsAlive() then player.m_hGroundEntity:TakeDamage({ Damage = damageinfo.Damage * 20, DamageCustom = TF_DMG_CUSTOM_BOOTS_STOMP, Attacker = player, }) damageinfo.Damage = 0 player:PlaySound("Weapon_Mantreads.Impact") else damageinfo.Damage = damageinfo.Damage * SCOUT_EXPLODE_FALL_MULT damageinfo.DamageCustom = TF_DMG_CUSTOM_PLASMA_CHARGED player:RunScriptCode("self.ViewPunch(QAngle(5,0,-2))") end end end return true end) end function OnGameTick() for _, player in pairs(ents.GetAllPlayers()) do if player.iAirDashCount2 ~= player.m_iAirDash then if player:IsAlive() and player:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE) and player:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE):GetAttributeValueByClass("throwable_healing", 0) == 1 and player.m_iAirDash > 0 then ScoutExplode(player) end player.iAirDashCount2 = player.m_iAirDash end if Delay(0) >= player.flExplosionReset then player.iConsecutiveExplosions = 0 end if player:InCond(12) and player.m_iClass == TF_CLASS_MEDIC then FuckingExplode(player) player:RemoveCond(12) end end end