L4D2 ONLY
Description
This plugin nerfs the damage that commons take from some weapons, that usually instant kill them even with high HP set (
z_health cvar).
Currently, support the following weapons:
- Rifle M60
- Pistol Magnum
- All Snipers (Hunting, Military, Scout, AWP)
- Chainsaw
- All Melees (custom melees included)
- Explosive Ammo
- Incendiary Ammo
- Shotgun Bullets (stumble effect)
Don't support:
Features- Allow configuring which weapons should do insta-kill to commons.
- Allow configuring which ammo type should do insta-kill to commons.
- Allow configuring the damage factor (Normal/Incendiary/Explosive).
- Allow configuring the damage dropoff.
- Automatically calculates the weapon damage.
Cvars
A configuration file named "
l4d2_nerf_damage_common.cfg" will automatically be created for you upon the first run in the "
\cfg\sourcemod\" folder.
PHP Code:
// Nerf damage for 50cal.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_50cal "1"
// 50cal damage on common infecteds.
// Game default: 50.
// -
// Default: "50"
// Minimum: "0.000000"
l4d2_nerf_damage_common_50cal_damage "50"
// 50cal range modifier on common infecteds.
// Game default: 1.0.
// 1.0 = OFF.
// -
// Default: "0.97"
// Minimum: "0.000000"
l4d2_nerf_damage_common_50cal_rangemodifier "0.97"
// Nerf damage for Chainsaw.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_chainsaw "1"
// Nerf damage incoming from other common infecteds.
// Usually happens when they are brawling or in vomit.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_common "1"
// Damage received from other common infecteds (doesn't scale with damage factor).
// Game default: 4 (brawling) / 10 (vomit).
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_common_damage "1"
// Apply damage dropoff.
// Decreases damage based on distance if RangeModifier < 1.0.
// Formula: Damage * (RangeModifier ^ (Distance/500))
// Source: https://counterstrike.fandom.com/wiki/Damage_dropoff.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_damage_dropoff "1"
// Apply difficulty and damage multiplier on non-headshot hits.
// Formula: damage * z_non_head_damage_factor_<difficulty> * z_non_head_damage_factor_multiplier.
// Check "z_non_head_damage_factor_*" cvars for more info.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_damage_factor "1"
// Enable/Disable the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_enable "1"
// Nerf damage for Explosive Ammo.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
l4d2_nerf_damage_common_explosive_ammo "1"
// Multiplier for explosive ammo/melee flag.
// 1.0 = OFF.
// -
// Default: "2.0"
// Minimum: "0.000000"
l4d2_nerf_damage_common_explosive_ammo_factor "2.0"
// Add the stumble effect to common infecteds when hit by an explosive ammo.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
l4d2_nerf_damage_common_explosive_ammo_stumble "1"
// Nerf damage for Hunting Rifle.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_hunting_rifle "1"
// Ignore headshot damage
// Note: By default, a common zombie instantly dies on a headshot.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_ignore_headshot "1"
// Nerf damage for Incendiary Ammo.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
l4d2_nerf_damage_common_incendiary_ammo "1"
// Multiplier for incendiary ammo/melee flag.
// 1.0 = OFF.
// -
// Default: "1.5"
// Minimum: "0.000000"
l4d2_nerf_damage_common_incendiary_ammo_factor "1.5"
// Chance to insta-kill (any weapon).
// 0 = OFF.
// -
// Default: "2.0"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_nerf_damage_common_insta_kill_chance "2.0"
// Nerf damage for Baseball Bat.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_baseball_bat "1"
// Nerf damage for Cricket Bat.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_cricket_bat "1"
// Nerf damage for Crowbar.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_crowbar "1"
// Nerf damage for Custom Melees.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_custom "1"
// Melee damage on common infecteds.
// Game default: 50.
// -
// Default: "250"
// Minimum: "0.000000"
l4d2_nerf_damage_common_melee_damage "250"
// Nerf damage for Electric Guitar.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_electric_guitar "1"
// Nerf damage for Fire Axe.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_fireaxe "1"
// Nerf damage for Frying Pan.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_frying_pan "1"
// Nerf damage for Golf Club.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_golfclub "1"
// Nerf damage for Katana.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_katana "1"
// Nerf damage for Knife.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_knife "1"
// Nerf damage for Machete.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_machete "1"
// Nerf damage for Pitchfork.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_pitchfork "1"
// Nerf damage for Riot Shield.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_riotshield "1"
// Nerf damage for Shovel.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_shovel "1"
// Safe interval in seconds between melee attacks per client.
// Useful for melees that has DMG_BURN flag, otherwise the attack is registered multiple times by the game.
// 0 = OFF.
// -
// Default: "0.1"
// Minimum: "0.000000"
l4d2_nerf_damage_common_melee_spam_protection "0.1"
// Chance to stumble common infecteds during a melee attack.
// 0 = OFF.
// -
// Default: "15.0"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_nerf_damage_common_melee_stumble_chance "15.0"
// Nerf damage for Tonfa.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_melee_tonfa "1"
// Nerf damage for Minigun.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_minigun "1"
// Minigun damage on common infecteds.
// Game default: 50.
// 0 = OFF, 1 = ON.
// -
// Default: "32"
// Minimum: "0.000000"
l4d2_nerf_damage_common_minigun_damage "32"
// Minigun range modifier on common infecteds.
// Game default: 1.0.
// 1.0 = OFF.
// -
// Default: "0.97"
// Minimum: "0.000000"
l4d2_nerf_damage_common_minigun_rangemodifier "0.97"
// Chance to stumble common infecteds during a non-melee attack.
// Doesn't affect Shotguns.
// 0 = OFF.
// -
// Default: "5.0"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_nerf_damage_common_non_melee_stumble_chance "5.0"
// Nerf damage for Pistol Magnum.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_pistol_magnum "1"
// Nerf damage for Rifle M60.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_rifle_m60 "1"
// Stumble effect from shotgun hits.
// 0 = OFF (uses l4d2_nerf_damage_common_non_melee_stumble_chance cvar), 1 = ON (default game behaviour).
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_shotgun_stumble "0"
// Nerf damage for AWP Sniper.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_sniper_awp "1"
// Nerf damage for Military Sniper.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_sniper_military "1"
// Nerf damage for Scout Sniper.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_sniper_scout "1"
// Set wounds only when the zombie is going to die.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_nerf_damage_common_wound_dead "1"
Related Game Cvars
- z_health => Starting health for commons zombies. (default: 50)
- chainsaw_damage => Chainsaw damage. (default: 100)
- z_non_head_damage_factor_easy => Damage to zombie from non-headshots is multiplied by this factor. (default: 2x)
- z_non_head_damage_factor_normal => Damage to zombie from non-headshots is multiplied by this factor. (default: 1x)
- z_non_head_damage_factor_hard => Damage to zombie from non-headshots is multiplied by this factor. (default: 0.75x)
- z_non_head_damage_factor_expert => Damage to zombie from non-headshots is multiplied by this factor. (default: 0.5x)
- z_non_head_damage_factor_multiplier => Damage to zombie from non-headshots is multiplied by this factor. (default: 1x)
Recommended Game Cvars
- z_brawl_chance => Chance to common infecteds randomly fight eachother. (default: 2 / recommended: 0)
Admin Commands
- sm_print_cvars_l4d2_nerf_damage_common => Print the plugin related cvars and their respective values to the console. (z flag required)
Change Log
Notes
- You can use "!cvar sv_showdamage 2" (game cvar) to check the damage.
- On realism mode the "z_non_head_damage_factor_multiplier" cvar automatically changes its value from 1.0 to 0.5.
- Headshots still does insta-kill.
- L4D1 is not supported cause the weapons doesn't do insta-kill (except headshot).
- The damage and range modifier of some weapons are calculated by weapon scripts. (e.g.: left4dead2/scripts/rifle_m60.txt) - [Check this plugin for more info]
- Chainsaw and Melee have specific cvars for damage.
- Machine Guns have specific cvars for damage and range modifier.
- There is a cvar to enable the vanilla damage calculation. (Formula: damage * difficulty * multiplier)
- There is a cvar to enable the damage dropoff calculation. (Formula: Damage * (RangeModifier ^ (Distance/500)))
- For Incendiary (DMG_BURN) the damage type flag had to be removed, otherwise even changing the damage, the common would still die. In case the zombie is going to die, the flag is restored.
- When DMG_BURN flag is added to a melee, the game register multiples damages on hit, instead of just one. So was added spam protection for melee attacks.
- The stumble effect is achieved by adding the DMG_BUCKSHOT flag.
- Valve bug: When commons die from oxygen tank, sometimes the inflictor will become another common infected.
Known Issues
- Not plugin related - the z_health cvar seems to affect the damage dealt by Machine Guns (50cal and Minigun) commons and SIs. When set with higher values, the damage taken is also increased.
To Do
- Check plugin behaviour in uncommons.
Thank you!
Related Plugins
Post Reply
- Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.
Requirements
Installation
- Put the "l4d2_nerf_damage_common.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.