Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced "botpopstop" plugin + added Tank anti-rock protect on his spawn #744

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
52 changes: 52 additions & 0 deletions addons/sourcemod/scripting/l4d2_block_bot_pills.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <left4dhooks>
#include <actions>
#include <colors>

bool g_bExtensionActions;

ConVar g_cvDebugModeEnabled;

public Plugin myinfo =
{
name = "[L4D2] Block Bot Pills",
author = "B[R]UTUS",
description = "Prohibits the use of pills to bots",
version = "1.0",
url = "https://steamcommunity.com/id/8ru7u5/"
}

public void OnPluginStart()
{
// ====================
// Validate extensions
// ====================
g_bExtensionActions = LibraryExists("actionslib");

if (!g_bExtensionActions)
SetFailState("\n==========\nMissing required extensions: \"Actions\".\nRead installation instructions again.\n==========");

g_cvDebugModeEnabled = CreateConVar("l4d2_bbp_debug_enabled", "0", "Is debug mode enabled?");
}

// ====================================================================================================
// ACTIONS EXTENSION
// ====================================================================================================
public void OnActionCreated(BehaviorAction action, int actor, const char[] name)
{
/* Hooking take pills action (when bot wants to take pills) */
if (strcmp(name[8], "TakePills") == 0)
action.OnStart = OnSelfActionPills;
}

public Action OnSelfActionPills(BehaviorAction action, int actor, BehaviorAction priorAction, ActionResult result)
{
if (g_cvDebugModeEnabled.BoolValue)
CPrintToChatAll("{green}[{default}Bot Block Pills{green}]{default}: Bot {blue}%N{default} wants to use pain pills. Blocking this action...", actor);

result.type = DONE;
return Plugin_Changed;
}
35 changes: 35 additions & 0 deletions addons/sourcemod/scripting/l4d2_tank_spawn_antirock_protect.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <sourcemod>
#include <left4dhooks>
#include <colors>

float g_fSpawnTime;

ConVar g_cvAntiRockProtectTime;

public Plugin myinfo =
{
name = "[L4D2] Tank Spawn Anti-Rock Protect",
author = "B[R]UTUS",
description = "Protects a Tank player from randomly rock attack at his spawn",
version = "1.0",
url = "https://steamcommunity.com/id/8ru7u5/"
}

public void OnPluginStart()
{
HookEvent("tank_spawn", Event_TankSpawn, EventHookMode_Post);
g_cvAntiRockProtectTime = CreateConVar("l4d2_antirock_protect_time", "1.5", "Protect time from randomly Tank's rock attack after his spawn");
}

public void Event_TankSpawn(Event event, const char[] name, bool dontBroadcast)
{
g_fSpawnTime = GetGameTime();
}

public Action L4D_OnCThrowActivate(int ability)
{
if (GetGameTime() - g_fSpawnTime < g_cvAntiRockProtectTime.FloatValue)
return Plugin_Handled;

return Plugin_Continue;
}
3 changes: 2 additions & 1 deletion cfg/cfgogl/acemodrv/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sm plugins load optional/l4d2_pickup.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
sm plugins load optional/finalefix.smx
Expand Down Expand Up @@ -58,6 +58,7 @@ sm plugins load optional/starting_items.smx
sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d_witch_damage_announce.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

//----------------------
// Equilibrium Plugins
Expand Down
6 changes: 6 additions & 0 deletions cfg/cfgogl/acemodrv/shared_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ confogl_addcvar tank_overhand_only 0
confogl_addcvar vs_tank_pound_damage 36
confogl_addcvar vs_tank_rock_damage 24

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d2_ultra_witch.smx]
confogl_addcvar z_witch_damage 48

Expand Down Expand Up @@ -263,6 +266,9 @@ confogl_addcvar sm2_permament_health_proportion 0.75
confogl_addcvar sm2_pills_hp_factor 6.0
confogl_addcvar sm2_pills_max_bonus 30

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

/////////////////////////////
// [Static shotgun spread] //
/////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/apex/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sm plugins load optional/l4d2_pickup.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
sm plugins load optional/finalefix.smx
Expand Down Expand Up @@ -58,6 +58,7 @@ sm plugins load optional/smart_ai_rock.smx
sm plugins load optional/starting_items.smx
sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

//----------------------
// Equilibrium Plugins
Expand Down
6 changes: 6 additions & 0 deletions cfg/cfgogl/apex/shared_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ confogl_addcvar tank_overhand_only 0
confogl_addcvar vs_tank_pound_damage 36
confogl_addcvar vs_tank_rock_damage 24

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d2_pickup.smx]
confogl_addcvar pickup_switch_flags 2
confogl_addcvar pickup_incap_flags 2
Expand Down Expand Up @@ -232,6 +235,9 @@ confogl_addcvar SM_adrenaline_health_buffer 25
confogl_addcvar SM_mapmulti 1
confogl_addcvar SM_custommaxdistance 1

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

/////////////////////////////
// [Static shotgun spread] //
/////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion cfg/cfgogl/deadman/confogl_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sm plugins load optional/1v1.smx
sm plugins load optional/aitankgank.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/checkpoint-rage-control.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
Expand Down
3 changes: 3 additions & 0 deletions cfg/cfgogl/deadman/deadman.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ confogl_addcvar l4d_tank_props_glow 0
confogl_addcvar sm_uncinfblock_enabled 1
confogl_addcvar sm_uncinfblock_types 127

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

// [l4d2_weaponrules.smx]
l4d2_addweaponrule smg_mp5 smg_silenced
l4d2_addweaponrule rifle smg_silenced
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/eq/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sm plugins load playercommands.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
sm plugins load optional/finalefix.smx
Expand Down Expand Up @@ -61,6 +61,7 @@ sm plugins load optional/starting_items.smx
sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d_witch_damage_announce.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

//----------------------
// Equilibrium Plugins
Expand Down
6 changes: 6 additions & 0 deletions cfg/cfgogl/eq/shared_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ confogl_addcvar tank_overhand_only 0
confogl_addcvar vs_tank_pound_damage 36
confogl_addcvar vs_tank_rock_damage 24

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d2_tank_melee_fury.smx]
confogl_addcvar tank_swing_miss_interval 1.0 // Interval between "compensated" tank punches
// This is a native L4D2 cvar, but it has no effect,
Expand Down Expand Up @@ -245,6 +248,9 @@ confogl_addcvar sm2_permament_health_proportion 0.75
confogl_addcvar sm2_pills_hp_factor 6.0
confogl_addcvar sm2_pills_max_bonus 30

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

// [Static shotgun spread]
// Pump settings
sm_weapon pumpshotgun damage 14
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/neomod/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sm plugins load optional/l4d2_pickup.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
sm plugins load optional/finalefix.smx
Expand Down Expand Up @@ -59,6 +59,7 @@ sm plugins load optional/smart_ai_rock.smx
sm plugins load optional/starting_items.smx
sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

//----------------------
// Equilibrium Plugins
Expand Down
6 changes: 6 additions & 0 deletions cfg/cfgogl/neomod/shared_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ confogl_addcvar tank_overhand_only 0
confogl_addcvar vs_tank_pound_damage 36
confogl_addcvar vs_tank_rock_damage 24

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d2_pickup.smx]
confogl_addcvar pickup_switch_flags 2
confogl_addcvar pickup_incap_flags 2
Expand Down Expand Up @@ -164,6 +167,9 @@ confogl_addcvar l4d_pills_hot_interval 0.1
confogl_addcvar l4d_pills_hot_increment 2
confogl_addcvar l4d_pills_hot_total 50

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

// [l4d2_m2_control.smx]
confogl_addcvar z_max_hunter_pounce_stagger_duration 1
confogl_addcvar l4d2_m2_hunter_penalty 1
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/nextmod/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sm plugins load optional/l4d2_pickup.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/8ball.smx
sm plugins load optional/changelog.smx
Expand Down Expand Up @@ -101,5 +101,6 @@ sm plugins load optional/panel_text.smx
sm plugins load optional/spechud.smx
sm plugins load optional/slots_vote.smx
sm plugins load optional/witch_and_tankifier.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx
sm plugins load confoglcompmod.smx
sm plugins load match_vote.smx
7 changes: 6 additions & 1 deletion cfg/cfgogl/nextmod/shared_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ confogl_addcvar sm_survivor_mvp_brevity 0
confogl_addcvar sm_survivor_mvp_brevity_latest 111
confogl_addcvar sm_stats_autoprint_vs_round 8372


// [l4d2_sounds_blocker.smx]
confogl_addcvar ssb_block_car_alarms 0
confogl_addcvar ssb_block_horde 0
Expand Down Expand Up @@ -124,6 +123,9 @@ confogl_addcvar tank_overhand_only 0
confogl_addcvar vs_tank_pound_damage 36
confogl_addcvar vs_tank_rock_damage 24

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d2_pickup.smx]
confogl_addcvar pickup_switch_flags 2
confogl_addcvar pickup_incap_flags 2
Expand Down Expand Up @@ -169,6 +171,9 @@ confogl_addcvar l4d_pills_hot_interval 0.1
confogl_addcvar l4d_pills_hot_increment 2
confogl_addcvar l4d_pills_hot_total 50

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

// [l4d2_m2_control.smx]
confogl_addcvar z_max_hunter_pounce_stagger_duration 1
confogl_addcvar l4d2_m2_hunter_penalty 4
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/pmelite/confogl_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sm plugins load optional/autopause.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/boomer_horde_equalizer.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/checkpoint-rage-control.smx
sm plugins load optional/coinflip.smx
Expand Down Expand Up @@ -94,6 +94,7 @@ sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d_witch_damage_announce.smx
sm plugins load optional/l4d2_slowdown_control.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

// Static shotgun spread
sm plugins load optional/l4d2_weapon_attributes.smx
Expand Down
8 changes: 7 additions & 1 deletion cfg/cfgogl/pmelite/pmelite.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ confogl_addcvar l4d_no_oxygen 0
// [l4d2_tank_attack_control.smx]
confogl_addcvar l4d2_block_punch_rock 1
confogl_addcvar l4d2_block_jump_rock 0
confogl_addcvar tank_overhand_only 0
confogl_addcvar tank_overhand_only 0

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d_tank_damage_announce.smx]
confogl_addcvar l4d_tankdamage_enabled 1
Expand Down Expand Up @@ -253,6 +256,9 @@ confogl_addcvar l4d_adrenaline_hot_interval 0.2
confogl_addcvar l4d_adrenaline_hot_increment 2
confogl_addcvar l4d_adrenaline_hot_total 25

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

// [lerpmonitor.smx]
confogl_addcvar sm_allowed_lerp_changes 3
confogl_addcvar sm_lerp_change_spec 1
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/zonehunters/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sm plugins load playercommands.smx
sm plugins load optional/l4d2_pickup.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
sm plugins load optional/finalefix.smx
Expand Down Expand Up @@ -52,6 +52,7 @@ sm plugins load optional/smart_ai_rock.smx
sm plugins load optional/starting_items.smx
sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

//----------------------
// Equilibrium Plugins
Expand Down
6 changes: 6 additions & 0 deletions cfg/cfgogl/zonehunters/shared_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ confogl_addcvar l4d2_tank_prop_dissapear_time 10.0
confogl_addcvar l4d2_tankrage_flowpercent 7
confogl_addcvar l4d2_tankrage_freezetime 4.0

// [l4d2_tank_spawn_antirock_protect]
confogl_addcvar l4d2_antirock_protect_time 1.5

// [l4d2_sound_manipulation.smx]
confogl_addcvar sound_flags 7

Expand Down Expand Up @@ -128,6 +131,9 @@ confogl_addcvar l4d_pills_hot_interval 0.1
confogl_addcvar l4d_pills_hot_increment 2
confogl_addcvar l4d_pills_hot_total 50

// [l4d2_block_bot_pills.smx]
confogl_addcvar l4d2_bbp_debug_enabled 0

// [l4d2_m2_control.smx]
confogl_addcvar z_max_hunter_pounce_stagger_duration 1
confogl_addcvar l4d2_m2_hunter_penalty 1
Expand Down
3 changes: 2 additions & 1 deletion cfg/cfgogl/zonemod/shared_plugins.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sm plugins load optional/l4d2_pickup.smx
sm plugins load optional/blockheatseekingchargers.smx
sm plugins load optional/blocktrolls.smx
sm plugins load optional/bossspawningfix.smx
sm plugins load optional/botpopstop.smx
sm plugins load optional/l4d2_block_bot_pills.smx
sm plugins load optional/coinflip.smx
sm plugins load optional/current.smx
sm plugins load optional/finalefix.smx
Expand Down Expand Up @@ -57,6 +57,7 @@ sm plugins load optional/smart_ai_rock.smx
sm plugins load optional/starting_items.smx
sm plugins load optional/teamflip.smx
sm plugins load optional/temphealthfix.smx
sm plugins load optional/l4d2_tank_spawn_antirock_protect.smx

//----------------------
// Equilibrium Plugins
Expand Down
Loading
Loading