diff --git a/plugins/l4d2_feedthetrolls.smx b/plugins/l4d2_feedthetrolls.smx index 70ebe8d..588f7cd 100644 Binary files a/plugins/l4d2_feedthetrolls.smx and b/plugins/l4d2_feedthetrolls.smx differ diff --git a/scripting/include/feedthetrolls/base.inc b/scripting/include/feedthetrolls/base.inc index 4e4dc25..b6df8d4 100644 --- a/scripting/include/feedthetrolls/base.inc +++ b/scripting/include/feedthetrolls/base.inc @@ -469,7 +469,7 @@ public int Native_ApplyTroll(Handle plugin, int numParams) { int index = GetTrollID(name); if(index > 0) { - Trolls[index].Activate(victim, activator, modifier, flags, GetNativeCell(7)); + Trolls[index].Activate(victim, activator, modifier, flags, GetNativeCell(6)); } else { ThrowNativeError(SP_ERROR_NATIVE, "Could not find troll with name \"%s\"", name); } diff --git a/scripting/include/feedthetrolls/events.inc b/scripting/include/feedthetrolls/events.inc index fe0c9c3..f67af88 100644 --- a/scripting/include/feedthetrolls/events.inc +++ b/scripting/include/feedthetrolls/events.inc @@ -984,10 +984,10 @@ public bool TraceEntityFilterPlayer(int entity, int mask, any data) { // TODO: Increase the frequency of spawns the longer they are in antirush. Possibly increase int and decrease over time public Action OnAntiRush(int client, int &type, float distance) { - if(client && client > 0 && client <= MaxClients && type == 3 && IsPlayerAlive(client) && !IsPlayerIncapped(client)) { - if(GetGameTime() - fLastAntiRushEvent[client] > ANTI_RUSH_DEFAULT_FREQUENCY - fAntiRushFrequencyCounter[client]) { - if(fAntiRushFrequencyCounter[client] < ANTI_RUSH_DEFAULT_FREQUENCY) { - fAntiRushFrequencyCounter[client] += ANTI_RUSH_FREQ_INC; + if(client && client > 0 && client <= MaxClients && type == 3 && !IsFakeClient(client) && IsPlayerAlive(client) && !IsPlayerIncapped(client)) { + if(GetGameTime() - fLastAntiRushEvent[client] > hAntirushBaseFreq.FloatValue - fAntiRushFrequencyCounter[client]) { + if(fAntiRushFrequencyCounter[client] < hAntirushBaseFreq.FloatValue) { + fAntiRushFrequencyCounter[client] += hAntirushIncFreq.FloatValue; } SpecialType special = view_as(GetRandomInt(1,6)); fLastAntiRushEvent[client] = GetGameTime(); diff --git a/scripting/include/feedthetrolls/misc.inc b/scripting/include/feedthetrolls/misc.inc index c903676..c5660e9 100644 --- a/scripting/include/feedthetrolls/misc.inc +++ b/scripting/include/feedthetrolls/misc.inc @@ -130,12 +130,12 @@ void LoadPhrases() { PrintToServer("[FTT] Could not load phrase list from data/ftt_phrases.cfg"); return; } - static char word[32]; + char word[32]; char phrase[MAX_PHRASE_LENGTH]; // Go through all the words: kv.GotoFirstSubKey(); int i = 0; - static char buffer[4]; + char buffer[4]; do { kv.GetSectionName(word, sizeof(word)); StringToLower(word); diff --git a/scripting/include/feedthetrolls/trolls.inc b/scripting/include/feedthetrolls/trolls.inc index 2315896..d31a5ca 100644 --- a/scripting/include/feedthetrolls/trolls.inc +++ b/scripting/include/feedthetrolls/trolls.inc @@ -466,8 +466,4 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod #endif } return true; -} - -bool Filter_IgnorePlayer(int entity, int contentsMask, any data) { - return entity != data; } \ No newline at end of file diff --git a/scripting/include/ftt.inc b/scripting/include/ftt.inc index ed8bb6e..3770cce 100644 --- a/scripting/include/ftt.inc +++ b/scripting/include/ftt.inc @@ -27,6 +27,8 @@ ConVar hBadThrowHitSelf; ConVar hBotReverseFFDefend; ConVar hSbFriendlyFire; ConVar hBotDefendChance; +ConVar hAntirushBaseFreq; +ConVar hAntirushIncFreq ConVar hSbFixEnabled; bool wasSbFixEnabled; diff --git a/scripting/l4d2_feedthetrolls.sp b/scripting/l4d2_feedthetrolls.sp index 149affc..9f003e4 100644 --- a/scripting/l4d2_feedthetrolls.sp +++ b/scripting/l4d2_feedthetrolls.sp @@ -5,8 +5,8 @@ #define MAIN_TIMER_INTERVAL_S 5.0 #define PLUGIN_VERSION "1.0" -#define ANTI_RUSH_DEFAULT_FREQUENCY 30.0 -#define ANTI_RUSH_FREQ_INC 0.5 +#define ANTI_RUSH_DEFAULT_FREQUENCY 20.0 +#define ANTI_RUSH_FREQ_INC 0.75 #include #include @@ -76,6 +76,8 @@ public void OnPluginStart() { hShoveFailChance = CreateConVar("sm_ftt_shove_fail_chance", "0.65", "The % chance that a shove fails", FCVAR_NONE, true, 0.0, true, 1.0); hBadThrowHitSelf = CreateConVar("sm_ftt_badthrow_fail_chance", "1", "The % chance that on a throw, they will instead hit themselves. 0 to disable", FCVAR_NONE, true, 0.0, true, 1.0); hBotReverseFFDefend = CreateConVar("sm_ftt_bot_defend", "0", "Should bots defend themselves?\n0 = OFF\n1 = Will retaliate against non-admins\n2 = Anyone", FCVAR_NONE, true, 0.0, true, 2.0); + hAntirushBaseFreq = CreateConVar("sm_ftt_antirush_freq_base", "24", "The base frequency of anti-rush", FCVAR_NONE, true, 0.0); + hAntirushIncFreq = CreateConVar("sm_ftt_antirush_freq_inc", "1", "The incremental frequency of anti-rush", FCVAR_NONE, true, 0.0); hBotDefendChance = CreateConVar("sm_ftt_bot_defend_chance", "0.75", "% Chance bots will defend themselves.", FCVAR_NONE, true, 0.0, true, 1.0); hSbFriendlyFire = FindConVar("sb_friendlyfire");