local function weaponMimic(properties) local mimic = ents.CreateWithKeys("tf_point_weapon_mimic", properties) return mimic end local reverts = false local custom_itemsets = false convar.SetValue("tf_mvm_respec_enabled", 0) function OldExplosiveHeadshot( damage, activator, caller ) --activator is the one with the weapon, caller is the one that got hit if activator and caller then if not caller:IsPlayer() then return end local upgrade_lvl = activator:GetPlayerItemBySlot(0):GetAttributeValue( "wrench index", false ) or 0 local check_dmg = 150 if activator:GetPlayerItemBySlot(0):GetItemName() == "The Sydney Sleeper" then check_dmg = 67 end if caller:InCond( TF_COND_DEFENSEBUFF_NO_CRIT_BLOCK ) then check_dmg = check_dmg * 0.65 end if caller:IsAlive() and ( IsValid( caller.m_hActiveWeapon ) ) and( caller.m_hActiveWeapon:GetItemName() == "Fists of Steel" ) then check_dmg = check_dmg * 0.6 end if caller:InCond( TF_COND_DEFENSEBUFF ) then check_dmg = 69420 end check_dmg = check_dmg - 1 -- just in case local base_damage = check_dmg * activator:GetPlayerItemBySlot(0):GetAttributeValueByClass( "mult_dmg", 1 ) local damage_percent = damage / base_damage local base_radius = 150 --best I can find from Sigsegv local radius_increase = 30 local radius = base_radius + ( radius_increase * ( upgrade_lvl - 1 ) ) local bleed_duration = 1 + ( 2 * ( upgrade_lvl - 1 ) ) local weapon = "EH_Bleed_" .. tostring(upgrade_lvl) print( weapon, upgrade_lvl, damage_percent, base_damage, damage ) if ( upgrade_lvl > 0 ) and ( damage_percent >= 1 ) then --if caller:GetTeam() ~= activator:GetTeam() then local mimic = weaponMimic({ TeamNum = activator.m_iTeamNum, Damage = 10, Crits = 0, SplashRadius = radius, SpeedMax = 0, SpeedMin = 0, ["$dmgtype"] = DMG_NEVERGIB, ["$killicon"] = "bleed_kill", ["$preventshootparent"] = 1, ["$weaponnosound"] = 1, ["$weaponname"] = weapon, origin = caller:GetAbsOrigin()[1] .. " " .. caller:GetAbsOrigin()[2] .. " " .. (caller:GetAbsOrigin()[3] + 16), angles = tostring(Vector(0, 0, 0)), }) mimic:Teleport( caller:GetAbsOrigin() + Vector( 0, 0 , 16 ) ) mimic["$SetOwner"](mimic, activator) if mimic:IsValid() then mimic:FireOnce() timer.Simple(bleed_duration + 0.1, function() mimic:Remove() end) end --end for _, bot in pairs( ents.FindInSphere( caller:GetAbsOrigin(), radius ) ) do if bot:IsValid() and ( bot:IsPlayer() ) and ( bot ~= caller ) and ( bot:GetTeam() ~= activator:GetTeam() ) and ( bot:IsAlive() ) then if activator:GetPlayerItemBySlot(0):GetItemName() == "The Sydney Sleeper" then bot:AddCond( TF_COND_URINE, 8 ) end local particle = ents.CreateWithKeys( "info_particle_system", { ["effect_name"] = "arm_muzzleflash_zap", ["start_active"] = 1, ["origin"] = caller:GetEyePos()[1] .. " " .. caller:GetEyePos()[2] .. " " .. (caller:GetEyePos()[3] + 10), ["cpoint1"] = bot }, true, true) particle.m_hControlPointEnts[1] = bot timer.Simple( 0.1, function() --feedback particle:Remove() end) end end end end end --Reverts function EnableReverts() reverts = true end function EnableCustomItemSets() custom_itemsets = true end local ItemSet_Table = { { Name = "The Gas Jockey's Gear", Desc = "\x05+10% Move speed, -10% Bullet vuln", Items = { "The Degreaser", nil, "The Powerjack" }, Attributes = { { "CARD: move speed bonus", 1.1 }, { "dmg taken from bullets increased", 1.1 } } }, { Name = "Special Delivery", Desc = "\x05+25 Max health", Items = { "The Shortstop", "Mad Milk", "The Holy Mackerel" }, Attributes = { { "max health additive bonus", 25 } } }, { Name = "Tank Buster", Desc = "\x05+20% Sentry resistance", Items = { "The Black Box", "The Battalion's Backup", nil }, Attributes = { { "dmg from sentry reduced", 0.8 } } }, { Name = "Expert's Ordnance", Desc = "\x05+10% Fire resistance", Items = { "The Loch-n-Load", nil, "The Ullapool Caber" }, Attributes = { { "dmg taken from fire reduced on active", 0.9 } } }, { Name = "Hibernating Bear", Desc = "\x05+5% Crit resistance", Items = { "The Brass Beast", "The Buffalo Steak Sandvich", "Warrior's Spirit" }, Attributes = { { "dmg taken from crit increased", 0.95 } } }, { Name = "Medieval Medic", Desc = "\x05+1 Health regen", Items = { "The Crusader's Crossbow", nil, "The Amputator" }, Attributes = { { "active health regen", 1 } } }, { Name = "Croc-o-Style Kit", Desc = "\x05+10% Crit resistance (survive headshots)", Items = { "The Sydney Sleeper", "Darwin's Danger Shield", "The Bushwacka" }, Attributes = { { "dmg taken from crit increased", 0.9 } } }, { Name = "Saharan Spy", Desc = "\x05+Reduced decloak sound -0.5 sec longer Cloak blink time", Items = { nil, "L'Etranger", "Your Eternal Reward" }, Attributes = { { "quiet unstealth", 1 }, { "cloak blink time penalty", 0.5 } } } } local Custom_ItemSet_Table = { { Name = "Clinical Trial", Desc = "\x05+2 Seconds of uber", Items = { "The Overdose", "The Quick-Fix", "The Solemn Vow" }, Attributes = { { "uber duration bonus", 2 } } }, { Name = "General's Formals", Desc = "\x05+10% Faster move speed, -33% Fire vuln", Items = { nil, "The Mantreads", "The Disciplinary Action" }, Attributes = { { "CARD: move speed bonus", 1.1 }, { "dmg taken from fire increased", 1.33 } } }, { Name = "Dr. Grordbort's Victory Pack", Desc = "\x05Deal +10% Damage for each target you damage each shot.", Items = { "The Cow Mangler 5000", "The Righteous Bison", nil }, Attributes = { { "add damage per target", 0.1 }, { "penetration damage penalty", 1.1 } } }, { Name = "Airborne Armaments", Desc = "\x05+20% push force (self included), +35% Deploy speed while rocket jumping", Items = { "The Liberty Launcher", "The Reserve Shooter", "The Market Gardener" }, Attributes = { { "self dmg push force increased", 1.2 }, { "mult rocketjump deploy time", 0.65 }, { "damage blast push", 1.2 } } }, { Name = "#1 Fan", Desc = "\x05+20% Accuracy while midair, +10% Damage while midair", Items = { "The Soda Popper", "The Winger", "The Atomizer" }, Attributes = { { "self dmg push force increased", 1.2 }, { "midair accuracy mult", 0.8 }, { "mult dmg while midair", 1.1 } } }, { Name = "Public Enemy", Desc = "\x05+Heal up to 10 health each hit", Items = { "Baby Face's Blaster", "Pretty Boy's Pocket Pistol", nil }, Attributes = { { "heal on hit for slowfire", 10 } } }, { Name = "Dr. Grordbort's Moonman Pack", Desc = "\x05+15% Bullet resistance", Items = { "The Phlogistinator", "The Manmelter", "The Third Degree" }, Attributes = { { "CARD: dmg taken from bullets reduced", 0.85 } } }, { Name = "One Thousand and One Demoknights", Desc = "\x05+Mini-crits become crits, +10 Max health", Items = { "Ali Baba's Wee Booties", "The Splendid Screen", "The Persian Persuader" }, Attributes = { { "minicrits become crits", 1 }, { "max health additive bonus", 10 } } }, { Name = "Black Market Business", Desc = "\x05+20% Move speed while spun up", Items = { "Tomislav", "The Family Business", "The Eviction Notice" }, Attributes = { { "aiming movespeed increased", 1.2 } } }, { Name = "Dr. Grordbort's Brainiac Pack", Desc = "\x05+Reveal Cloak and or Disguised spies on hit", Items = { "The Pomson 6000", nil, "The Eureka Effect" }, Attributes = { { "reveal cloaked victim on hit", 1 }, { "reveal disguised victim on hit", 1 } } }, { Name = "Urban Professional", Desc = "\x05+35% Move speed while scoped", Items = { "The Hitman's Heatmaker", "The Cleaner's Carbine", nil }, Attributes = { { "aiming movespeed increased", 1.35 } } }, { Name = "Lawrence of Australia", Desc = "\x05+40% Reserve ammo", Items = { "The Bazaar Bargain", nil, "The Shahanshah" }, Attributes = { { "maxammo primary increased", 1.4 }, { "maxammo secondary increased", 1.4 } } }, { Name = "Man of Honor", Desc = "\x05+35 Max health, +Crit vs disguised spies", Items = { nil, "The Enforcer", "The Big Earner" }, Attributes = { { "max health additive bonus", 35 }, { "crit vs disguised players", 1 }, { "crit on cond", 3 } } }, } function EquipItemSets( player, activator ) player = player or activator for i = 1, #ItemSet_Table do local has_items = true for slot, item in pairs( ItemSet_Table[i].Items ) do if item ~= nil then if IsValid( player:GetPlayerItemBySlot( slot-1 ) ) and player:GetPlayerItemBySlot( slot-1 ):GetItemName() ~= item then has_items = false end end end if has_items == true then for _, attr in pairs( ItemSet_Table[i].Attributes ) do player:SetAttributeValue( attr[1], attr[2] ) end util.PrintToChat( player, "You have equiped the \x05" .. ItemSet_Table[i].Name .. "\x01 item set." ) util.PrintToChat( player, ItemSet_Table[i].Desc ) end end if custom_itemsets == false then return end for i = 1, #Custom_ItemSet_Table do local has_items = true for slot, item in pairs( Custom_ItemSet_Table[i].Items ) do if item ~= nil then if IsValid( player:GetPlayerItemBySlot( slot-1 ) ) and player:GetPlayerItemBySlot( slot-1 ):GetItemName() ~= item then has_items = false end end end if has_items == true then for _, attr in pairs( Custom_ItemSet_Table[i].Attributes ) do player:SetAttributeValue( attr[1], attr[2] ) end util.PrintToChat( player, "You have equiped the \x05" .. Custom_ItemSet_Table[i].Name .. "\x01 item set (custom)." ) util.PrintToChat( player, Custom_ItemSet_Table[i].Desc ) end end end function OnPlayerConnected( player ) if player:IsPlayer() then player.midair_jumps = 0 player:AddCallback( ON_KEY_PRESSED, function(entity, key) if reverts then if key == IN_JUMP then if IsValid( player:GetPlayerItemBySlot(2) ) and ( player:GetPlayerItemBySlot(2):GetItemName() == "The Atomizer" ) then player.midair_jumps = player.midair_jumps + 1 if player.midair_jumps == 3 then player:TakeDamage({ Attacker = player, Damage = 10 }) end end if IsValid( player:GetPlayerItemBySlot(0) ) and ( player:GetPlayerItemBySlot(0):GetItemName() == "Baby Face's Blaster" ) then player.m_flHypeMeter = 0 end end end end) player:AddCallback( ON_SPAWN, function( ply ) timer.Simple( 0.2, function() if reverts then if IsValid( ply:GetPlayerItemBySlot( 0 ) ) and ( ply:GetPlayerItemBySlot(0):GetItemName() == "The Shortstop" ) then ply:GetPlayerItemBySlot(0).m_iPrimaryAmmoType = 2 end EquipItemSets( ply, nil ) end end) end) player:AddCallback( ON_DAMAGE_RECEIVED_PRE ,function( ent, dmginfo ) if ( IsValidAlivePlayer( player ) ) and reverts then if ( player:InCond( TF_COND_MEDIGUN_UBER_BULLET_RESIST ) ) then local provider = player:GetConditionProvider( TF_COND_MEDIGUN_UBER_BULLET_RESIST ) if ( provider:IsValid() ) and ( player ~= provider ) and ( IsValid( provider:GetPlayerItemBySlot(1) ) ) and ( provider:GetPlayerItemBySlot(1):GetItemName() == "The Vaccinator" ) then provider:AddHealth( dmginfo.Damage * 0.25, false ) end end if ( player:InCond( TF_COND_MEDIGUN_UBER_BLAST_RESIST ) ) then local provider = player:GetConditionProvider( TF_COND_MEDIGUN_UBER_BLAST_RESIST ) if ( provider:IsValid() ) and ( player ~= provider ) and ( IsValid( provider:GetPlayerItemBySlot(1) ) ) and ( provider:GetPlayerItemBySlot(1):GetItemName() == "The Vaccinator" ) then provider:AddHealth( dmginfo.Damage * 0.25, false ) end end if ( player:InCond( TF_COND_MEDIGUN_UBER_FIRE_RESIST ) ) then local provider = player:GetConditionProvider( TF_COND_MEDIGUN_UBER_FIRE_RESIST ) if ( provider:IsValid() ) and ( player ~= provider ) and ( IsValid( provider:GetPlayerItemBySlot(1) ) ) and ( provider:GetPlayerItemBySlot(1):GetItemName() == "The Vaccinator" ) then provider:AddHealth( dmginfo.Damage * 0.25, false ) end end end end) end end function OnGameTick() if reverts then for _, player in pairs( ents.GetAllPlayers() ) do if player:IsValid() and player:IsPlayer() and player:IsAlive() and ( player.m_iTeamNum ~= 1 ) then if not player:IsMidair() then player.midair_jumps = 0 end if IsValid( player:GetPlayerItemBySlot(2) ) and ( player:GetPlayerItemBySlot(2):GetItemName() == "The Atomizer" ) then Revert_Atomizer( player ) end if IsValid( player:GetPlayerItemBySlot(0) ) and ( player:GetPlayerItemBySlot(0):GetItemName() == "The Brass Beast" ) then Revert_Brass( player ) end if IsValid( player:GetPlayerItemBySlot(0) ) and ( player:GetPlayerItemBySlot(0):GetItemName() == "Baby Face's Blaster" ) then Revert_BabyFace( player ) end if ( IsValidAlivePlayer( player ) ) and ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( player:GetPlayerItemBySlot(1):GetItemName() == "The Vaccinator" ) and reverts then player:SetAttributeValue("uber duration bonus", -0.5) elseif ( player:GetPlayerItemBySlot(1):GetItemName() ~= "The Quick-Fix" ) then player:SetAttributeValue("uber duration bonus", nil) end end end for _,building in pairs(ents.FindAllByClass("obj_sentrygun")) do if IsValid( building.m_hBuilder ) then local owner = building.m_hBuilder if IsValid( owner:GetPlayerItemBySlot(5) ) then local pda = owner:GetPlayerItemBySlot(LOADOUT_POSITION_PDA) local melee = owner:GetPlayerItemBySlot(LOADOUT_POSITION_MELEE) if ( melee:GetItemName() == "The Gunslinger" ) and ( building.m_iState == 0 ) then building.m_iMaxHealth = 100 * ( owner:GetPlayerItemBySlot(LOADOUT_POSITION_PDA):GetAttributeValue("engy building health bonus" ) or 1 ) if ( building.m_iState == 0 ) then building.HealthFix = true building:AcceptInput("SetHealth", building.m_iMaxHealth ) end end end end end end end function Revert_Atomizer( player ) if player.midair_jumps < 3 then player.m_iAirDash = 0 end end function Revert_BabyFace( player ) local boost = player.m_flHypeMeter player:SetAttributeValue("CARD: move speed bonus", lerp( 1, 1.4, boost / 99) ) end function Revert_Brass( player ) if player:InCond( TF_COND_AIMING ) then player:SetAttributeValue( "dmg taken increased", 0.8 ) else player:SetAttributeValue( "dmg taken increased", nil ) end end function Revert_Phlog( taunt, player ) if player.m_flRageMeter == 100 then player:SetHealth( player.m_iMaxHealth ) player:AddCond( 45, 3 ) player:AddCond( 28, 3 ) timer.Create( 0.1, function() player:RemoveCond( 57 ) player:RemoveCond( 5 ) player:RemoveCond( 8 ) player:RemoveCond( 52 ) player:RemoveCond( 51 ) end, 16 ) end end