local function applyAttributesOverExisting(target, newAttributes) -- entirely by crilly local checkItemDefinition = true if target:IsPlayer() == true then checkItemDefinition = false end for name, value in pairs(newAttributes) do if target:GetAttributeValue(name, checkItemDefinition) ~= nil then target:SetAttributeValue(name, (value + target:GetAttributeValue(name, checkItemDefinition))) else target:SetAttributeValue(name, value) end end end local decay_attrs = { ["hud overlay"] = "effects/jarate_overlay", ["major move speed bonus"] = 0.6, ["damage bonus HIDDEN"] = 0.6, } function spawn_mimic(origin) local explode = ents.CreateWithKeys("tf_generic_bomb", { ["damage"] = "100", ["radius"] = "450", ["friendlyfire"] = 0, --["explode_particle"] = "fireSmokeExplosion3", ["sound"] = "npc/env_headcrabcanister/explosion.wav" }) explode:SetAbsOrigin(origin) explode:AcceptInput("Detonate") end function particles_charge(origin) local charge_particle = ents.CreateWithKeys("info_particle_system",{ ["start_active"] = "1", ["flag_as_weather"] = "0", ["effect_name"] = "charge_up", ["origin"] = origin, ["angles"] = "0 0 0", }) charge_particle:SetAbsOrigin(origin + Vector(0, 0, 60)) timer.Simple(3, function() charge_particle:AcceptInput("Stop") charge_particle:Remove() end) end function combustorDeath(damage, activator, caller) local activatorOrigin = activator:GetAbsOrigin() print(activator:GetAbsOrigin()) local activatorAngles = "0 " .. activator["m_angEyeAngles[1]"] .. " 0" activator:Remove() local prop = ents.CreateWithKeys("prop_dynamic", { ["origin"] = activatorOrigin, ["angles"] = activatorAngles, ["model"] = "models/kirillian/infected/hoomer_v4.mdl", ["modelscale"] = "1.5", ["defaultanim"] = "Flinch_01", ["disablebonefollowers"] = "1", ["onanimationbegun"] = "!self,setplaybackrate,0.25,0,-1", ["rendermode"] = "1", ["solid"] = "6", --["sequence"] = currentAnims }) prop:SetAbsOrigin(activatorOrigin) prop:AcceptInput("SetAnimation", "taunt_laugh", activator, activator) particles_charge(activatorOrigin) timer.Simple(3.375, function() prop:AcceptInput("SetAnimation", "deathpose_crouch_back", activator, activator) local shake = ents.CreateWithKeys("env_shake", { ["spawnflags"] = "1", ["amplitude"] = "5", ["duration"] = "0.5", ["frequency"] = "9" }) local explode_particle = ents.CreateWithKeys("info_particle_system",{ ["start_active"] = "1", ["flag_as_weather"] = "0", ["effect_name"] = "fluidSmokeExpl_ring_mvm", ["origin"] = activatorOrigin, ["angles"] = "0 0 -90", }) explode_particle:SetAbsOrigin(activatorOrigin + Vector(0, 0, 60)) timer.Simple(3, function() explode_particle:AcceptInput("Stop") explode_particle:Remove() end) shake:AcceptInput("StartShake") spawn_mimic(activatorOrigin) timer.Simple(0.5, function() prop:Remove() end) local sphereResults = ents.FindInSphere(activatorOrigin, 250) if sphereResults then for _, entity in pairs(sphereResults) do if entity:IsPlayer() and entity:IsAlive() and entity.m_iTeamNum ~= 2 then local timeLeft = 33 local logicLoop applyAttributesOverExisting(entity, decay_attrs) entity:AddCond(15,10,activator) entity:AddCond(25,10,activator) entity:AddCond(123,10,activator) timer.Simple(7, function () for name, value in pairs(decay_attrs) do entity:SetAttributeValue(name, nil) end end) entity:AddOutput("BaseVelocity 0 0 400") logicLoop = timer.Create(0.33, function() timeLeft = timeLeft - 1 entity:TakeDamage({ Attacker = nil, -- Attacker Inflictor = nil, -- Direct cause of damage, usually a projectile Weapon = nil, Damage = 50, DamageType = DMG_GENERIC, -- Damage type, see DMG_* globals. Can be combined with | operator DamageCustom = TF_DMG_CUSTOM_NONE, -- Custom damage type, see TF_DMG_* globals CritType = 0, -- Crit type, 0 = no crit, 1 = mini crit, 2 = normal crit DamagePosition = Vector(0,0,0), -- Where the target was hit at DamageForce = Vector(0,0,0), -- Knockback force of the attack ReportedPosition = Vector(0,0,0) -- Where the attacker attacked from }) entity:AcceptInput("RunScriptCode","DispatchParticleEffect(`blood_impact_backscatter`,self.GetOrigin()+Vector(0,0,60),Vector(0,0,0))") if entity:IsAlive() == false or timeLeft <= 0 then timer.Stop(logicLoop) return end end, 33) end end end end) end