local DMG_NOPUSH = 2048 local SPECTATOR_MODE_KILLCAM = 2 local SPECTATOR_MODE_NONE = 0 local TF_TEAM_RED = 2 local TF_TEAM_BLUE = 3 local wavebar = ents.FindByClass("tf_objective_resource") convar.SetValue("tf_mvm_min_players_to_start", 5) ragdollcount = 0 function solotest(_, activator) convar.SetValue("tf_mvm_min_players_to_start", 0) end function toolgun_randomsound(_, activator) activator.m_hActiveWeapon:PlaySound("=95|weapons/airboat/airboat_gun_lastshot" .. math.random(1, 2) .. ".wav") activator.m_hActiveWeapon:PlaySound("=95|weapons/airboat/airboat_gun_lastshot" .. math.random(1, 2) .. ".wav") end -- demo grenade lua pasted in because it conflicts with fall on scouts thing local unmissing_1 = { targetname = "fixgrenadeparticles", effect_name = "asplode_hoodoo_dust", start_active = "1", origin = "0, 0, -500000", } local unmissing_2 = { targetname = "fixgrenadeparticles", -- effect_name = "cinefx_goldrush_flash", effect_name = "asplode_hoodoo_flash", start_active = "1", origin = "0, 0, -500000", } local unmissing_3 = { targetname = "fixgrenadeparticles", effect_name = "asplode_hoodoo_embers", start_active = "1", origin = "0, 0, -500000", } ents.CreateWithKeys("info_particle_system", unmissing_1, true, true) ents.CreateWithKeys("info_particle_system", unmissing_2, true, true) ents.CreateWithKeys("info_particle_system", unmissing_3, true, true) function OnWaveInit() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:SetAttributeValue("dmg taken increased", nil) end end end function grenadetick(_, activator) local origin = activator:GetAbsOrigin() activator:PlaySound("=70|player/cyoa_pda_beep3.wav") if activator.m_iTeamNum == TF_TEAM_RED then util.ParticleEffect("powercore_flash_red", origin, nil, activator) elseif activator.m_iTeamNum ~= TF_TEAM_RED then util.ParticleEffect("powercore_flash_blue", origin, nil, activator) end end function grenadeparticle(_, activator) if activator ~= nil then -- заткнись нахуй паскуда local origin = activator:GetAbsOrigin() util.ParticleEffect("asplode_hoodoo_embers", origin, nil, nil) util.ParticleEffect("asplode_hoodoo_flash", origin, nil, nil) util.ParticleEffect("asplode_hoodoo_dust", origin, nil, nil) end end function damagefunc(player, damageinfo) local inflictor = damageinfo.Inflictor local attacker = damageinfo.Attacker local wep = damageinfo.Weapon if damageinfo.DamageCustom == TF_DMG_CUSTOM_CANNONBALL_PUSH and inflictor ~= nil and inflictor.isgrenade == 1 then damageinfo.DamageCustom = TF_DMG_CUSTOM_THROWABLE damageinfo.Damage = 15 if inflictor.m_bCritical == 1 then damageinfo.DamageType = DMG_BULLET | DMG_NOPUSH | DMG_CRITICAL elseif inflictor.m_bCritical ~= 1 then damageinfo.DamageType = DMG_BULLET | DMG_NOPUSH end damageinfo.DamageForce = Vector(0,0,0) attacker:PlaySoundToSelf("Weapon_LooseCannon.BallImpact") player:PlaySound("Weapon_LooseCannon.BallImpact") player:PlaySoundToSelf("Weapon_LooseCannon.BallImpact") player:SetLocalVelocity(Vector(0, 0, 0)) timer.Simple(0.015, function() player:SetLocalVelocity(Vector(0, 0, 0)) end) if wep:GetAttributeValue("throwable healing") == 1 then if player.m_bIsMiniBoss == 0 then player:StunPlayer(8, 1, TF_STUNFLAG_BONKSTUCK | TF_STUNFLAG_LIMITMOVEMENT | TF_STUNFLAG_SLOWDOWN, damageinfo.Attacker) end end return true end end function pf_flamer_spawn(_, activator) timer.Create(0.015, function() if activator == nil then return false end local primary = activator:GetPlayerItemBySlot(LOADOUT_POSITION_PRIMARY) local BLAST_COST = 30 if primary == nil then return false end if primary:GetAttributeValue("custom weapon id", false) == 13371337 then return false end if not activator:IsAlive() or activator.m_iClass ~= TF_CLASS_PYRO then return false end if activator.m_iAmmo[2] < BLAST_COST or activator.m_hActiveWeapon ~= primary then return end if activator.m_nButtons & IN_ATTACK2 ~= 0 and activator.m_nButtons & IN_ATTACK == 0 then if primary.m_flNextSecondaryAttack <= CurTime() then for _, mimic in pairs(ents.FindAllByClass("tf_point_weapon_mimic")) do if mimic.m_hOwnerEntity:GetHandleIndex() ~= activator:GetHandleIndex() then return end if activator.m_fFlags & FL_DUCKING == 0 then mimic:SetLocalOrigin(Vector(0,0,68)) elseif activator.m_fFlags & FL_DUCKING ~= 0 then mimic:SetLocalOrigin(Vector(0,0,45)) end if activator:InCond(TF_COND_CRITBOOSTED) or activator:InCond(TF_COND_CRITBOOSTED_PUMPKIN) or activator:InCond(TF_COND_CRITBOOSTED_USER_BUFF) or activator:InCond(TF_COND_CRITBOOSTED_CARD_EFFECT) then mimic:AcceptInput("addoutput", "crits 1") mimic:AcceptInput("fireonce") activator:PlaySound("Weapon_Bottle.MissCrit") activator:PlaySound("Weapon_Bottle.MissCrit") activator:PlaySound("Weapon_Bottle.MissCrit") activator:PlaySound("Weapon_Bottle.MissCrit") elseif not activator:InCond(TF_COND_CRITBOOSTED) and not activator:InCond(TF_COND_CRITBOOSTED_PUMPKIN) and not activator:InCond(TF_COND_CRITBOOSTED_USER_BUFF) and not activator:InCond(TF_COND_CRITBOOSTED_CARD_EFFECT) then mimic:AcceptInput("addoutput", "crits 0") mimic:AcceptInput("fireonce") end primary.m_flNextSecondaryAttack = CurTime() + (0.75 * primary:GetAttributeValueByClass("mult_airblast_refire_time", 1)) primary:SetAttributeValue("no_attack", 1) timer.Simple(0.75, function() primary:SetAttributeValue("no_attack", nil) end) local ammo = activator.m_iAmmo[2] activator.m_iAmmo[2] = ammo - BLAST_COST for _, vm in pairs(ents.FindAllByClass("tf_viewmodel")) do if vm.m_hOwner:GetHandleIndex() == activator:GetHandleIndex() then vm:AcceptInput("setcycle", "0") vm:AcceptInput("runscriptcode", "self.SetSequence(13)") vm:AcceptInput("runscriptcode", "self.ResetSequence()") end end activator:PlaySound("Metal_Box.ImpactHard") activator:PlaySound("Metal_Box.ImpactHard") activator:PlaySound("Metal_Box.ImpactHard") activator:PlaySound("Metal_Box.ImpactHard") end end end end, 0, 0) end function removerevolver(_, activator) for _, wep in pairs(ents.FindAllByClass("tf_weapon_revolver")) do if wep.m_hOwner == activator then wep:Remove() end end end function sickintro(_, activator) for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:SetAttributeValue("dmg taken increased", 0.000625) player.m_iObserverMode = SPECTATOR_MODE_KILLCAM player.m_hObserverTarget = activator player:SetHudVisibility(false) end end timer.Simple(4, function() for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then player:SetAttributeValue("dmg taken increased", nil) player.m_iObserverMode = SPECTATOR_MODE_NONE player:SetHudVisibility(true) end end end) end local damagefunc_ent = function(ent, damageinfo) local inflictor = damageinfo.Inflictor local wep = damageinfo.Weapon if damageinfo.DamageCustom == TF_DMG_CUSTOM_CANNONBALL_PUSH and inflictor ~= nil and inflictor.isgrenade == 1 then damageinfo.DamageCustom = TF_DMG_CUSTOM_NONE damageinfo.DamageType = DMG_BULLET | DMG_NOPUSH damageinfo.Damage = 15 damageinfo.DamageForce = Vector(0,0,0) ent:PlaySound("Metal_Box.BulletImpact") damageinfo.Attacker:PlaySoundToSelf("Metal_Box.BulletImpact") return true end end ents.AddCreateCallback("obj*", function(ent) ent:AddCallback(ON_DAMAGE_RECEIVED_PRE, damagefunc_ent) end) ents.AddCreateCallback("tf_ragdoll", function(ent) ragdollcount = ragdollcount + 1 ent:AddCallback(ON_REMOVE, function() ragdollcount = ragdollcount - 1 end) if wavebar.m_nMannVsMachineWaveCount == 2 and ragdollcount > 4 and ent.m_iTeamNum == TF_TEAM_BLUE then ent:Remove() end end) function OnPlayerConnected(player) player:AddCallback(ON_DAMAGE_RECEIVED_PRE, damagefunc) end