View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-05-2019 , 14:01   [L4D2] Spitter Acid Damage (1.13) [20-Sep-2022]
Reply With Quote #1

About:
  • Unlocks the Spitter Acid to detonate various explosives.
  • Unlocks the Spitter Acid to damage common and special infected.
  • The games default behaviour alternates between 0.2 and 0.3 seconds to damage entities.
  • The game scales damage over the duration of effect: 0 at the start, 6 in the middle and 4 when it ends.
  • This plugin can scale that damage where 1.0 is default, or set a full value to damage each time (this plugins default for common and special infected).
  • Also included in the source for developers a demonstration on "inferno" entities and getting their flame positions.



Thanks:
  • Iizuka07 - For the idea and request.
  • Lux - For scripting advice.



CVars:

Saved to l4d2_spitter_acid_damage.cfg in your servers \cfg\sourcemod\ folder.

PHP Code:
l4d2_spitter_acid_allow "1"             // 0=Plugin off, 1=Plugin on.
l4d2_spitter_acid_damage "13"           // Omitted values scale the damage the game inflicts. Or: Apply full damage value from dmg_* cvars. on: 1=Common. 2=Survivors (default). 4=Special. 8=Self. 15=All. Add numbers together.
l4d2_spitter_acid_dmg_common "5.0"      // Damage dealt to common infected. Can use a ratio instead by changing l4d2_spitter_acid_damage.
l4d2_spitter_acid_dmg_self "0.0"        // Damage dealt to self owner of acid. Can use a ratio instead by changing l4d2_spitter_acid_damage.
l4d2_spitter_acid_dmg_special "8.0"     // Damage dealt to special infected. Can use a ratio instead by changing l4d2_spitter_acid_damage.
l4d2_spitter_acid_dmg_survivor "1.0"    // Damage dealt to survivors (games default is 1.0 with l4d2_spitter_acid_damage omitting a value of 2).
l4d2_spitter_acid_dmg_bots "1.0"        // Damage dealt to survivor bots (games default is 1.0 with l4d2_spitter_acid_damage omitting a value of 2).
l4d2_spitter_acid_effects "5"           // Displays a particle when hurting. 0=Off, 1=Common Infected, 2=Survivors, 4=Special Infected, 8=Self. 15=All.
l4d2_spitter_acid_explode "0"           // Which explosives should explode, otherwise they will ignite first: 0=All ignite, 1=Firework Crates, 2=Oxygen Tank, 4=Propane Tank, 7=All explode. Add numbers together.
l4d2_spitter_acid_explosives "3"        // Allow acid to ignite explosives: 0=Off, 1=GasCans, 2=Firework Crates, 4=Oxygen Tank, 8=Propane Tank, 15=All. Add numbers together.
l4d2_spitter_acid_grace "1.0"           // How long after Spitter acid detonates until it can cause damage.
l4d2_spitter_acid_modes ""              // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
l4d2_spitter_acid_modes_off ""          // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
l4d2_spitter_acid_modes_tog "0"         // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
l4d2_spitter_acid_version               // Spitter Acid Damage plugin version 


Changes:
Code:
1.13 (20-Sep-2022)
    - Changed the way "l4d2_spitter_acid_grace" prevents damage, to also prevent the sound and movement slowdown.

1.12 (25-May-2022)
    - Changed the description of "l4d2_spitter_acid_damage" cvar and some default values due to the logic being inverted from the previous description. Thanks to "VYRNACH_GAMING" for reporting.

1.11 (14-Dec-2021)
    - Fixed infected hurt sounds when "l4d2_spitter_acid_dmg_special" or "l4d2_spitter_acid_dmg_self" was set to "0.0". Thanks to "KoMiKoZa" for reporting.

1.10a (19-Oct-2021)
    - Wildcarded the .txt GameData signature for compatibility with "Left4DHooks" plugin version 1.64+.

1.10 (26-Aug-2021)
    - Added cvar "l4d2_spitter_acid_grace" to prevent damaging enemies when spit acid detonates until after the grace period. Requested by "Lukey1028".
    - Potentially fixed hearing pain vocalizations when damage should be blocked. Thanks to "KoMiKoZa" for reporting.

1.9 (25-Jul-2021)
    - Fixed affecting Special Infected ghosts. Thanks to "ddd123" for reporting.

1.8 (24-Apr-2021)
    - Fixed invalid edict error. Thanks to "Krufftys Killers" for reporting.

1.7 (23-Feb-2021)
    - Added cvar "l4d2_spitter_acid_dmg_bots" to set the damage for survivor bots. Requested by "Gobi".

1.6 (09-Oct-2020)
    - Added cvar "l4d2_spitter_acid_explode" to control which explosives should ignite or explode (gascans can only ignite).
    - Fixed map spawn gascans not being affected and igniting. Thanks to "KoMiKoZa" for reporting.
    - Fixed not detecting Scavenge mode if the "_tog" cvar was not being used.

1.5 (04-Jun-2020)
    - Added cvar "l4d2_spitter_acid_explosives" to allow Spitter Acid to ignite/explode explosives.

1.4 (10-May-2020)
    - Added better error log message when gamedata file is missing.
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    - Various changes to tidy up code.

1.3 (01-Apr-2020)
    - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.

1.2 (18-Mar-2020)
    - Fixed crashing in Linux. GameData changed.
    - Fixed cvar "l4d2_spitter_acid_damage" not actually being used.
    - Added cvar "l4d2_spitter_acid_dmg_self" to control Spitter damage from their own spit.

1.1 (05-Nov-2019)
    - Optimized to unhook OnTakeDamage when no longer used.

1.0 (05-Nov-2019)
    - Initial release.


Requirements:
  • SourceMod 1.11 or newer.


Installation:
  1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
  2. Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.

Updating from 1.9 or older:
  • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_spitter_acid_damage.sp - 879 views - 26.9 KB)
File Type: txt l4d2_spitter_acid_damage.txt (920 Bytes, 847 views)
__________________

Last edited by Silvers; 10-01-2023 at 08:47.
Silvers is offline