Raised This Month: $209 Target: $400
 52% 

[L4D2] Nerf Damage To Commons [v1.0.8 | 03-March-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
7471
Plugin Version:
1.0.8
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
1 
Plugin Description:
Nerfs some insta-kill damages dealt to commons
Old 01-19-2021 , 20:17   [L4D2] Nerf Damage To Commons [v1.0.8 | 03-March-2021]
Reply With Quote #1

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)

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: "5.0"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_nerf_damage_common_insta_kill_chance "5.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

Spoiler


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.

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.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_nerf_damage_common.sp - 14 views - 64.9 KB)
__________________

Last edited by Marttt; 07-11-2021 at 10:50.
Marttt is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: TW
Old 01-20-2021 , 02:28   Re: [L4D2] Nerf Damage To Commons [v1.0.0 | 19-January-2021]
Reply With Quote #2

Nice, nerf M60
__________________
HarryPotter is offline
Maur0
Member
Join Date: Aug 2020
Old 01-20-2021 , 13:17   Re: [L4D2] Nerf Damage To Commons [v1.0.0 | 19-January-2021]
Reply With Quote #3

Yeah! At last! This was what was needed. Since I get tired of us easily killing the commons with only melee, magnum, snipers and m60, and even with fires and explosives.

One only problem. Since this plugin requires the "Left 4 DHooks Direct" and that prevents me from downloading the plugin because it failed to compile. And that I just tried to compile it with the sp and I threw the error of error in compiling:

/home/groups/sourcemod/upload_tmp/phpDSxujr.sp(3 : fatal error 183: cannot read from file: "left4dhooks"

Compilation aborted.
1 Error.

If you can make the download separate in order to download this excellent plugin, I appreciate it. You are a genius Marttt!
Maur0 is offline
Crasher_3637
Veteran Member
Join Date: May 2012
Old 01-20-2021 , 13:35   Re: [L4D2] Nerf Damage To Commons [v1.0.0 | 19-January-2021]
Reply With Quote #4

Quote:
Originally Posted by Maur0 View Post
Yeah! At last! This was what was needed. Since I get tired of us easily killing the commons with only melee, magnum, snipers and m60, and even with fires and explosives.

One only problem. Since this plugin requires the "Left 4 DHooks Direct" and that prevents me from downloading the plugin because it failed to compile. And that I just tried to compile it with the sp and I threw the error of error in compiling:

/home/groups/sourcemod/upload_tmp/phpDSxujr.sp(38) : fatal error 183: cannot read from file: "left4dhooks"

Compilation aborted.
1 Error.

If you can make the download separate in order to download this excellent plugin, I appreciate it. You are a genius Marttt!
Just install Left 4 DHooks. Make sure you copy "left4dhooks.inc" into your "include" folder so that you can compile the plugin with the L4DH library.
__________________
AFK like JFK
Crasher_3637 is offline
Maur0
Member
Join Date: Aug 2020
Old 01-20-2021 , 14:45   Re: [L4D2] Nerf Damage To Commons [v1.0.0 | 19-January-2021]
Reply With Quote #5

Quote:
Originally Posted by Crasher_3637 View Post
Just install Left 4 DHooks. Make sure you copy "left4dhooks.inc" into your "include" folder so that you can compile the plugin with the L4DH library.
I just had the Left 4 DHooks installed and it still won't let me compile

And I don't even know how to make it work with the L4DH library, which I have never done :/
Maur0 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-20-2021 , 15:28   Re: [L4D2] Nerf Damage To Commons [v1.0.0 | 19-January-2021]
Reply With Quote #6

Is my first plugin with 3rd party dependency, so I may have forgotten some points about scripting or instructions.

@Maur0, I added the smx file now compiled by Spider in the main post. You can download and test.

So here are the steps in case you need to do that someday.
  • Download Left 4 DHooks plugin
  • Unpack the zip file and get the .inc file inside the scripting folder (sourcemod\scripting\include\left4dhooks.inc)
  • Go to the Spider Compiler website
  • Drop the .inc file at the "Drop .inc files here" area
  • Paste the l4d2_nerf_damage_common.sp sourcecode in the left area
  • Click Compile then Download

OR
  • Windows Only (Not Sure)
  • Download Left 4 DHooks plugin
  • Unpack the zip file and get the .inc file inside the scripting folder (sourcemod\scripting\include\left4dhooks.inc)
  • Paste the left4dhooks.inc in your SM sourcemod\scripting\include folder
  • Paste the l4d2_nerf_damage_common.sp file in your SM sourcemod\scripting folder
  • Drag the l4d2_nerf_damage_common.sp file to the spcomp.exe file, located in the same folder
  • Get the file generated (l4d2_nerf_damage_common.smx)

There are some tutorials around the forum about how to compile plugins,

I use one great from Dragokas that let me compile any .sp file just by double click on Windows.
__________________

Last edited by Marttt; 01-20-2021 at 15:46.
Marttt is offline
Maur0
Member
Join Date: Aug 2020
Old 01-20-2021 , 19:02   Re: [L4D2] Nerf Damage To Commons [v1.0.0 | 19-January-2021]
Reply With Quote #7

@Marttt - Many thanks! And thanks Crasher_3637 for explaining to me.

I have just tried it and I really liked it that now they don't usually die from a blow with the weapons that usually kill them easily. Although there I notice several things:
  1. When I kill ICs with the 50.cal machine gun and the M60 they always get burned to death. I don't know if this is normal. But it is somewhat annoying and it is similar when you have incendiary bullets (which I am not wearing) and it bothers the vision.
  2. The melee damage is more or less difficult for me to understand how to configure to prevent them from dying in a single hit, even if it is for two or three. The uncommon are those that have more health factor compared to the normal ones and instead of Jimmy and Fallen who have 1000 there is not much problem. The thing that I have disabled the instant kill damage and lowered the melee damage to 50 (250 by default) and it is difficult for me to calculate how much it is owed depending on its health and damage factor in each difficulty.

Overall: I really loved this plugin. You always make great plugins like these. Hopefully you can do a nerf melee damage to the special infected to avoid not killing them in one hit.
Maur0 is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-20-2021 , 21:26   Re: [L4D2] Nerf Damage To Commons [v1.0.1 | 20-January-2021]
Reply With Quote #8

Quote:
Originally Posted by Maur0 View Post
When I kill ICs with the 50.cal machine gun and the M60 they always get burned to death.
Thanks for reporting Maur0, fixed on 1.0.1.

Quote:
Originally Posted by Maur0 View Post
The thing that I have disabled the instant kill damage and lowered the melee damage to 50 (250 by default) and it is difficult for me to calculate how much it is owed depending on its health and damage factor in each difficulty.[/list]
You can check better how melees work setting the melee_show_swing cvar to 1.
It will enable some yellow tracer every time you swing (attack) with a melee.
Some tracers will be red when you hit a target.
__________________

Last edited by Marttt; 01-21-2021 at 09:19.
Marttt is offline
Maur0
Member
Join Date: Aug 2020
Old 01-20-2021 , 21:50   Re: [L4D2] Nerf Damage To Commons [v1.0.1 | 20-January-2021]
Reply With Quote #9

ahhh perfect. Thank you very much Marttt. If there are times I think melee weapons are ridiculously too OP on a hit basis. I would have liked it to be a style similar to TF2 where if you hit the zombies with melee weapons, you damage them and push a bit.

But hey, it's been several years and Valve gave that mechanic a little ridiculous but fun. Thanks for this good plugin, the rest of the weapons are perfect and more for the Magnum that will make it more challenging.
Maur0 is offline
Frost Sovereign Goddess
Senior Member
Join Date: Sep 2010
Old 01-21-2021 , 00:22   Re: [L4D2] Nerf Damage To Commons [v1.0.1 | 20-January-2021]
Reply With Quote #10

Any chance in an update u can have an M60 damage cvar that controls how much damage the m60 does per shot like any other assault rifle or sub machine gun in the game like how it is in this plugin?

basically the m60 script doesnt have a damage cvar only this:
"clip_size" "150"
"ReloadDuration" "2.0"
"CycleTime" "0.11"
your plugin covers the insta kill problem for m60 it just needs a damage cvar for m60 like how it has for the miniguns, 50cals etc. like how there are damage cvars for most weapons in the script file in the link below

The damage of some weapons are calculated by weapon scripts. (e.g.: left4dead2/scripts/rifle_m60.txt) - [Check this plugin for more info] https://forums.alliedmods.net/showthread.php?t=310586

Thanks! Good work so far!
__________________

Last edited by Frost Sovereign Goddess; 01-21-2021 at 00:25.
Frost Sovereign Goddess is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:37.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode