function ThunderHit( damage, activator, caller ) --activator is the one with the weapon, caller is the one that got hit if caller and ( caller:IsValid() ) and ( activator ) and ( activator:IsValid() ) and ( caller:IsPlayer() ) and ( damage >= 85 ) then if activator:IsMidair() then util.ParticleEffect( "drg_cow_explosioncore_charged", caller:GetEyePos(), caller:GetEyePos():FaceVector( activator:GetEyePos() ) ) for _, player in pairs(ents.FindInSphere(activator:GetAbsOrigin(),185)) do if ( player ~= caller ) and ( player:GetTeam() == caller:GetTeam() ) then local dmg_info = { Attacker = activator, Weapon = activator:GetPlayerItemBySlot(2), Damage = 44.4, -- rounds to 75 CritType = 1 } player:TakeDamage( dmg_info ) end end else util.ParticleEffect( "drg_cow_explosioncore_normal", caller:GetEyePos(), caller:GetEyePos():FaceVector( activator:GetEyePos() ) ) for _, player in pairs(ents.FindInSphere(activator:GetAbsOrigin(),148)) do if ( player ~= caller ) and ( player:GetTeam() == caller:GetTeam() ) then local dmg_info = { Attacker = activator, Weapon = activator:GetPlayerItemBySlot(2), Damage = 22, --rounds to 30 CritType = 1 } player:TakeDamage( dmg_info ) end end end end end function ThunderThrow( _, activator, caller ) local ShootOffset = activator:GetEyePos() + Vector(8,4,0) local KV = { TeamNum = 3 } local shooter = ents.CreateWithKeys("tf_point_weapon_mimic", KV, true, true) shooter["$weaponname"] = "Hammer Proj" shooter:AcceptInput("$SetOwner", activator) shooter["$preventshootparent"] = 1 shooter:Teleport( ShootOffset, activator:GetEyeAngles() ) for _, viewmodel in pairs(ents.FindAllByClass("tf_viewmodel")) do if viewmodel.m_hOwner == activator then viewmodel.m_nSequence = 8 timer.Simple(0.015, function() viewmodel.m_nSequence = 11 end) end end shooter:AcceptInput("FireOnce") timer.Simple(1.015, function() shooter:AcceptInput("kill") end) end