View Single Post
Author Message
Mortiegama
Senior Member
Join Date: Feb 2010
Old 03-21-2010 , 01:31   [L4D2] HP Regeneration V-1.63 (1/26/11)
Reply With Quote #1

General

This plugin requires Sourcemod 1.3 or higher


Description

This plugin will allow you to set custom values for HP Regeneration of either Survivors or the Infected team. They're set with default values but can be changed by editing the plugin.L4D2.HPRegen.cfg in the CFG\Sourcemod folder.

Credits

Credit for the original framework of this plugin goes to Bl4nk. He created a basic version of the plugin which I've modified to better serve the infected team in L4D2.

<*>http://forums.alliedmods.net/showthread.php?t=66154

Special thanks to Graveeater for helping clean up some of the code.

Cvars

<*>To change these values edit the plugin.L4D2.HPRegen.cfg in the CFG\Sourcemod folder.
<*>NOTE: Setting sm_hpregeneration_XX has three values, 0 will regenerate to a percent of the in-game cvar, 1 will go based upon what you set for a value in the CFG, 2 will regenerate based upon in-game cvar. (Survivors and Tanks do not have an option 2, they have no in-game cvars).
  • sm_hpregeneration_mortversion
  • sm_hpregeneration_enable (Enabled 1, Disabled 0), Allows the survivors and infected to regenerate HP.
  • sm_hpregeneration_enablesurvivor (Enabled 1, Disabled 0), Enables regeneration for the Survivor team.
  • sm_hpregeneration_enablebwhealing (Enabled 1, Disabled 0), Enables regeneration when the Survivor is Black and White.
  • sm_hpregeneration_enableinfected (Enabled 1, Disabled 0), Enables regeneration for the Infected team (this includes Tank).
  • sm_hpregeneration_enabletank (Enabled 1, Disabled 0), Enables regeneration for the Tank (this is disabled by default).
  • sm_hpregeneration_delayenable (Enabled 1, Disabled 0), Enables a delay in regeneration due to damage.
  • sm_hpregeneration_delaydamage (Default 2), How long after damage stops that regeneration begins.
  • sm_hpregeneration_tickrate1 (Default 3), Rate at which the survivors will regenerate their HP.
  • sm_hpregeneration_survivor (0 - Regenerate by %, 1 - Regenerate by Cvar), Sets Regeneration Mode.
  • sm_hpregeneration_survivorhealth (Default 100), Amount of health to regenerate to for survivors.
  • sm_hpregeneration_survivoramount (Default 1), Amount of health the survivors will receive each tickrate.
  • sm_hpregeneration_survivorpercent (Default 1.0), Percent of health to regenerate (1.0 = 100%).
  • sm_hpregeneration_tickrate2 (Default 1), Rate at which the infected team will regenerate their HP.
  • sm_hpregeneration_boomer (0 - Regenerate by %, 1 - Regenerate by plugin Cvar, 2 - Regenerate by In-game Health), Sets Regeneration Mode.
  • sm_hpregeneration_boomerhealth (Default 50), Amount of health to regenerate to for a Boomer.
  • sm_hpregeneration_boomerpercent (Default 1.0), Percent of health to regenerate to for a Boomer (1.0 = 100%).
  • sm_hpregeneration_boomeramount (Default 5), Amount of health the Boomer will receive each tickrate.
  • sm_hpregeneration_charger (0 - Regenerate by %, 1 - Regenerate by plugin Cvar, 2 - Regenerate by In-game Health), Sets Regeneration Mode.
  • sm_hpregeneration_chargerhealth (Default 600), Amount of health to regenerate to for a Charger.
  • sm_hpregeneration_chargerpercent (Default 1.0), Percent of health to regenerate to for a Charger (1.0 = 100%).
  • sm_hpregeneration_chargeramount (Default 5), Amount of health the Charger will receive each tickrate.
  • sm_hpregeneration_hunter (0 - Regenerate by %, 1 - Regenerate by plugin Cvar, 2 - Regenerate by In-game Health), Sets Regeneration Mode.
  • sm_hpregeneration_hunterhealth (Default 250), Amount of health to regenerate to for a Hunter.
  • sm_hpregeneration_hunterpercent (Default 1.0), Percent of health to regenerate to for a Hunter (1.0 = 100%).
  • sm_hpregeneration_hunteramount (Default 5), Amount of health the Hunter will receive each tickrate.
  • sm_hpregeneration_jockey (0 - Regenerate by %, 1 - Regenerate by plugin Cvar, 2 - Regenerate by In-game Health), Sets Regeneration Mode
  • sm_hpregeneration_jockeyhealth (Default 325), Amount of health to regenerate to for a Jockey.
  • sm_hpregeneration_jockeypercent (Default 1.0), Percent of health to regenerate to for a Jockey (1.0 = 100%).
  • sm_hpregeneration_jockeyamount (Default 5), Amount of health the Jockey will receive each tickrate.
  • sm_hpregeneration_smoker (0 - Regenerate by %, 1 - Regenerate by plugin Cvar, 2 - Regenerate by In-game Health), Sets Regeneration Mode.
  • sm_hpregeneration_smokerhealth (Default 250), Amount of health to regenerate to for a Smoker.
  • sm_hpregeneration_smokerhealth (Default 100), Amount of health to regenerate to for a Smoker.
  • sm_hpregeneration_smokerpercent (Default 1.0), Percent of health to regenerate to for a Smoker (1.0 = 100%).
  • sm_hpregeneration_spitter (0 - Regenerate by %, 1 - Regenerate by plugin Cvar, 2 - Regenerate by In-game Health), Sets Regeneration Mode.
  • sm_hpregeneration_spitterhealth (Default 100), Amount of health to regenerate to for a Spitter.
  • sm_hpregeneration_spitterpercent (Default 1.0), Percent of health to regenerate to for a Spitter (1.0 = 100%).
  • sm_hpregeneration_spitteramount (Default 5), Amount of health the Spitter will receive each tickrate.
  • sm_hpregeneration_tank (0 - Regenerate by %, 1 - Regenerate by plugin Cvar), Sets Regeneration Mode.
  • sm_hpregeneration_tankhealth (Default 6000), Amount of health to regenerate to for a Tank.
  • sm_hpregeneration_tankpercent (Default 0.0), Percent of health to regenerate to for a Tank (1.0 = 100%).
  • sm_hpregeneration_tankamount (Default 0), Amount of health the Tank will receive each tickrate.

Admin Commands
  • sm_hpsurvivor - Toggles HP Regeneration for the Survivors
  • sm_hpinfected - Toggles HP Regeneration for the Infected
  • sm_hptank - Toggles HP Regeneration for the Tank
  • sm_hpdelay - Toggles a delay in regeneration due to damage
Installation
  • Download and copy [L4D2] HP Regeneration.smx to Addons/Sourcemod/Plugins folder.
  • Delete the plugin.L4D2.HPRegen.cfg in the CFG/Sourcemod folder.
  • If you have Version 1.12 or earlier HP.Regeneration.cfg in the CFG/Sourcemod folder.

Version History

Version 1.63 - (1/26/11)
<*>Changed the name of the public cvar
Version 1.62 - (5/31/10) - 1236 Views
<*>Major cut down on code thanks to - Dirka Dirka's input
<*>Changed the way the Timers are closed
Version 1.61 - (5/26/10) - 42 Views
<*>Added new Cvar sm_regeneration_enablebwhealing
<*>Set a check to see if Survivor is B&W, now they will stop healing 1 point less than their max health
<*>Cleaned up some of the code calling the Max Infected HP
Version 1.6 - (5/18/10) - 97 Views
<*>Added Regeneration based upon percentage of HP
<*>Added Regeneration based upon in-game Cvar set Health (not Survivor or Tank)
<*>Improved the client detection for Valid Clients
<*>Changed some Cvar names so the CFG is more organized
Version 1.53 - (4/24/10) - 203 Views
<*>Very minor bug, made sure to ignore client if it is Client 0
Version 1.52 - (4/16/10) - 143 Views
<*>Set the call to check IfPlayerIsOnFire in the correct place to prevent errors
<*>Set a call to check if a player is InCapped, will now stop regen
Version 1.51 - (4/11/10) - 66 Views
<*>Fixed a minor bug when checking IfPlayerIsOnFire
Version 1.5 - (4/10/10) - 27 Views
<*>Added in-game Admin commands to toggle Enable commands
<*>Set a check if player is on fire so that regeneration is disabled if the Delay is enabled
<*>Cleaned up possible bugs in the coding for Infected
<*>Added a timer close if player disconnects
Version 1.4 - (4/6/10) - 87 Views
<*>Plugin can now disable/enable regeneration for Survivors/Infected/Tank
<*>Added Cvar sm_hpregeneration_enablesurvivor
<*>Added Cvar sm_hpregeneration_enableinfected
<*>Added Cvar sm_hpregeneration_enabletank
<*>Updated the HP check for the Infected team
<*>Cleaned up code to run plugin faster
Version 1.31 - (4/3/10) - 36 Views
<*>Cleaned up some of the code for the plugin (Credit to Graveeater)
Version 1.3 - (4/2/10) - 37 Views
<*>Added a check to verify how much temporary HP a survivor has before regenerating
<*>Added regeneration support for the Tank, default for the Tank is 0 so it won't be enabled unless the Cvar is changed
<*>Changed the names of the Infected Cvar to InfectedNameHealth for their health Cvars
<*>Changed the names of the Survivor Cvar to use Survivor instead of 1 for Health and Amount
<*>Added Cvar sm_hpregeneration_amountboomer
<*>Added Cvar sm_hpregeneration_amountcharger
<*>Added Cvar sm_hpregeneration_amountjockey
<*>Added Cvar sm_hpregeneration_amounthunter
<*>Added Cvar sm_hpregeneration_amountsmoker
<*>Added Cvar sm_hpregeneration_amountspitter
<*>Added Cvar sm_hpregeneration_amounttank
Version 1.2 - (3/25/10) - 102 Views
<*>Changed plugin to delay regeneration until the Cvar time period has passed
<*>Added Cvar sm_hpregeneration_delayenable
<*>Added Cvar sm_hpregeneration_damagedelay
<*>Added PlayerDeath and PlayerTeam events to kill the client timer
<*>Changed CFG file created to plugin.L4D2.HPRegen.cfg
Version 1.12 - (3/21/10) - 93 Views
<*>Changed the call for Survivor regeneration
<*>Minor bug fixes
Version 1.11 - (3/21/10) - 21 Views
<*>Fixed the plugin spamming the server with error messages
Version 1.1 - (3/21/10) - 1 View
<*>Fixed it so that when incapped your health does not reduce to the health1 cvar amount
<*>Changed it so that the bots will also regenerate HP
Version 1.0 - (3/20/10) - 23 Views
<*>Original launch of the plugin


Known Issues
<*>None
Attached Files
File Type: sp Get Plugin or Get Source (L4D2 HP Regeneration.sp - 10157 views - 23.9 KB)

Last edited by Mortiegama; 01-14-2014 at 23:47. Reason: You forgot to add to set the public cvar in the thread.. again!
Mortiegama is offline