Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
|
11-09-2016
, 02:50
[L4D2] New Ammo Packs
|
#1
|
Description:
This adds ammo packs with various effects to produce some spice into the game. In this rewritten version, those effects can now be extended when the ammo pack with the same effect is deployed.
However, some of these effects can be an advantage or disadvantage to: - Yourself as the deployer
- Your team
- Infected team
- Both teams
So be really careful when deploying them.
Also, there are some specific effects that will disable other effects for the stabilization of both the plugin and the server to lessen the chance of getting a crash mid-game. Few of the added effects eat up more CPU even if its code is optimized.
Lastly, this plugin is recommended for servers with greater number of players.
ConVars:
- "nap-l4d2_version" - "3.2" (Version of this plugin)
- "nap-l4d2_on" - "1" (Enable/Disable plugin)
- "nap-l4d2_freeze_duration" - "15.0" (Duration of Freeze effect)
- "nap-l4d2_freeze_radius" - "400.0" (Radius covered by Freeze effect)
- "nap-l4d2_matrix_duration" - "15.0" (Duration of Matrix effect)
- "nap-l4d2_matrix_glow" - "3" (Who glows during Matrix effect? 1 = Only deployer, 2 = Survivors, 3 = Infected, 4 = All)
- "nap-l4d2_speed_duration" - "17.5" (Duration of Speed effect)
- "nap-l4d2_speed_increase" - "1.5" (Increases deployer's speed to this value)
- "nap-l4d2_immune_duration" - "20.0" (Duration of Immune effect)
- "nap-l4d2_immune_type" - "1" (Immune Box blocks: 0 = Damages taken by deployer, 1 = Same as 0 but include boomer vomits)
- "nap-l4d2_heal_type" - "3" (Heal Box must give: 1 = A static amount of HP to the deployer, 2 = Maximum HP to the deployer, 3 = Full treatment for the deployer)
- "nap-l4d2_heal_amount" - "50" (Amount of HP to heal, works only if above convar is set to 1)
- "nap-l4d2_gravity_duration" - "22.5" (Duration of Gravity effect)
- "nap-l4d2_gravity_amount" - "0.3" (Gravity changes to this value)
- "nap-l4d2_gravity_type" - "0" (Gravity Box applies to: 0 = Deployer only, 1 = Whole Team)
- "nap-l4d2_invisible_duration" - "12.5" (Duration of Invisible effect)
- "nap-l4d2_invisible_type" - "1" (Invisible Box hides: 0 = Deployer's model only, 1 = Complete trace of the deployer)
- "nap-l4d2_invisible_dummy" - "1" (Enable/Disable dummy during Invisible effect)
- "nap-l4d2_invisible_dummy_glow" - "1" (Enable/Disable glow on dummy)
- "nap-l4d2_jingle_duration" - "1" (Enable/Disable glow on dummy)
- "nap-l4d2_jingle_burn_contact" - "1" (Enable/Disable burn on contact during Jingle effect)
- "nap-l4d2_jingle_kill_contact" - "1" (Enable/Disable kill on tact during Jingle effect)
- "nap-l4d2_bile_radius" - "450.0" (Radius covered by bile)
- "nap-l4d2_bile_special" - "1" (Include/Exclude special infected from being biled)
- "nap-l4d2_bile_common" - "1" (Include/Exclude common infected from being biled)
- "nap-l4d2_bile_witch" - "1" (Include/Exclude witches from being biled)
- "nap-l4d2_mob_count" - "2" (Amount of mobs to spawn)
- "nap-l4d2_realism_duration" - "25.0" (Duration of Realism effect)
- "nap-l4d2_realism_damage_multiplier" - "1.3" (Multiplier applied to all damages taken)
- "nap-l4d2_meteor_fall_duration" - "10.0" (Duration of Meteor Fall effect)
- "nap-l4d2_meteor_fall_damage" - "15.0" (Damage dealt by meteors)
- "nap-l4d2_fireworks_duration" - "30.0" (Duration of Fireworks effect)
- "nap-l4d2_fireworks_burn_contact" - "1" (Enable/Disable burn on contact with fireworks)
- "nap-l4d2_pet_protect_range" - "400.0" (Range covered by pet's protection)
- "nap-l4d2_pet_height" - "60.0" (Height added to pet - DO NOT CHANGE THIS)
- "nap-l4d2_pet_duration" - "90.0" (Duration of Pet effect)
- "nap-l4d2_armor_duration" - "90.0" (Duration of Armor effect)
- "nap-l4d2_shout_damage" - "10.0" (Damage caused by shouts)
- "nap-l4d2_shout_duration" - "40.0" (Duration of Shout effect)
- "nap-l4d2_shout_range" - "350.0" (Range covered by shouts)
- "nap-l4d2_blind_duration" - "20.0" (Duration of Blind effect)
- "nap-l4d2_blur_duration" - "17.5" (Duration of Blur effect)
- "nap-l4d2_snow_duration" - "22.5" (Duration of Snow effect)
- "nap-l4d2_snow_freeze_chance" - "25" (Chance of freezing during Snow effect)
- "nap-l4d2_warp_frequency" - "2.5" (Frequency of Warp effect)
- "nap-l4d2_warp_duration" - "17.5" (Duration of Warp effect)
- "nap-l4d2_distortion_duration" - "25.0" (Duration of Distortion effect)
- "nap-l4d2_distortion_type" - "4" (Type of distortion: 1=View colors, 2=View angles, 3=Game sounds, 4=All)
- "nap-l4d2_flash_duration" - "15.0" (Duration of Flash effect)
- "nap-l4d2_infected_spawn_type" - "1" (Spawn method: 0=SourceMod, 1=Left 4 Downtown 2)
- "nap-l4d2_notification" - "1" (Enable/Disable notifications)
- "nap-l4d2_upgrade_ammo_multiplied" - "1" (Apply multiplier to upgrade ammo when using normal ammo packs)
Natives and Forwards:
PHP Code:
/**
* Fires when the plugin is (un)loaded.
*
* @param iState Initialization state.
* @noreturn
*/
forward void NAP_OnInit(int iState);
/**
* Fires before a Heal Box's effect is applied to the deployer.
* @remarks This forward only runs when nap-l4d2_heal_type is
* set to 3.
*
* @param client Given client index
* @noreturn
*/
forward void NAP_OnHBPre(int client);
/**
* Fires during the effect of a Heal Box being applied to the deployer.
* @remarks This forward only runs when nap-l4d2_heal_type is set to 3.
*
* @param client Given client index
* @noreturn
*/
forward void NAP_OnHB(int client);
/**
* Fires after a Heal Box's effect is applied to the deployer.
* @remarks This forward only occurs when nap-l4d2_heal_type
* is set to 3.
*
* @param client Given client index
* @noreturn
*/
forward void NAP_OnHBPost(int client);
/**
* Fires when an airstrike bomb explodes at a position.
*
* @param fHitX X axis of the bombed position
* @param fHitY Y axis of the bombed position
* @param fHitZ Z axis of the bombed position
*
* @noreturn
*/
forward void NAP_OnAirstikeHit(float fHitX, float fHitY, float fHitZ);
/**
* Checks to see if a client still feels effects from deployed ammo packs.
*
* @param client Client index
* @param effectIndex Index of ammo pack with effect.
*
* @error Invalid client or incorrect index
* @return true if it is still there, false otherwise
*/
native bool HasEffect(int client, int effectIndex);
/**
* Returns the time left an ammo pack effect has.
*
* @param client Client index
* @param effectIndex Index of ammo pack with effect
*
* @error Invalid client or incorrect index
* @return time left on success, 0.0 on failure
*/
native float GetEffectTime(int client, int effectIndex);
/**
* Gets the index of a deployer's ammo pack.
*
* @param client Client index
* @param effectIndex Index of ammo pack with effect
*
* @error Invalid client
* @return deployer's ammo pack index, else 0
*/
native int GetAPIndex(int client);
/**
* Sets the index of a deployer's ammo pack.
*
* @param client Client index
* @param APIndex Chosen index of ammo pack.
*
* @error Invalid client or incorrect index
* @noreturn
*/
native void SetAPIndex(int client, int APIndex);
/**
* Gets the name of the ammo pack being deployed.
*
* @param client Client index
* @param sBuffer String used to store the name
* @param iBufferSize Size of the string
*
* @error Invalid client or incorrect buffer size
* @return Number of bytes written
*/
native int GetAPName(int client, char[] sBuffer, int iBufferSize);
/**
* Sets the name of the ammo pack being deployed.
*
* @param client Client index
* @param sBuffer String used to change the name
*
* @error Invalid client
* @noreturn
*/
native void SetAPName(int client, char[] sBuffer);
Notes:
- If you are experiencing crashes with this plugin, probable cause would be the unprecached models used so it's best to download my [L4D2] Game Files Precacher.
- There must be no, not even a single, trace of the old and buggy version. You could use that for back-up though.
- If re-compiling, you must have the necessary includes used by this plugin.
- Left 4 Downtown 2 is now optional when compiling so it is not necessary to have the extension installed.
- If you're having trouble re-compiling (mainly due to Scene Processor, and the conflicting L4D Stocks and Glow includes), I suggest:
- For sceneprocessor.inc, please manually edit the file,
find the line(s) that is/are producing the error(s), and add (a) missing semicolon(s).
- For conflicting includes, kindly edit the l4d_stocks include, and remove the conflicting line(s).
Changelog:
06-29-2017: First release.
: A whole rewrite of the old and messy one.
: The duration of the effects can now be extended.
07-03-2017: Huge update.
: Few boxes were re-added.
: Gamedata updated.
08-02-2017: Pet Box, Armor Box, and Shout Box added.
: Fixed three bugs.
: New natives.
: 6 of the previous boxes are re-added.
08-30-2017: Warp, Distortion, Blur, Party, and Snow Boxes added.
: Re-added forward for Airstrikes.
: 3 previous boxes re-added.
: Some bugs fixed.
: Another huge update.
08-31-2017: A small update. ( Thanks to Farmoza for reporting! )
10-04-2017: Flash Box added.
: Bugs have been fixed.
Last edited by cravenge; 01-28-2018 at 16:45.
|
|