[TF2]Domination Taunt Frenzy 0.1

Posted on October 18, 2013

Highlights a domination by making EVERYONE on the server taunt and granting  (mini)crits for 15 seconds.

Triggers on !sm_domtaunt, or on domination/revenge kill.

CVAR: sm_domtaunt_enable (0/1)

Simply insert into sourcemod/plugins directory. Don’t forget to enable using the above cvar.

Compiled

Source:

 /* Plugin Template generated by Pawn Studio */

 /*
 * Licensed under the GPLv3
 * Modified version of TF2 Mandatory Taunt Mode v0.3 (7/31) by chundo
 * Changes to original:
 * -Everybody taunts
 * -Triggered upon domination
 * -Gives everyone (mini)crits for 15 seconds after the beginning of taunting
 */

#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <adt_array>

#define TAUNT_PLUGIN_VERSION "0.1"

new Handle:g_cvarTauntEnable = INVALID_HANDLE;

public Plugin:myinfo = 
{
    name = "Domination Taunt Frenzy",
    author = "Ohmnivore",
    description = "Makes everyone taunt upon domination/revenge and grants (mini)crits to everyone for 15 seconds. Highlight someone's ownage with celebration and crits!",
    version = "1.0",
    url = "ohmnivore.elementfx.com"
}

public OnPluginStart()
{
    CreateConVar("sm_domtaunt_version", TAUNT_PLUGIN_VERSION, "Domination Taunt Frenzy version.", FCVAR_PLUGIN|FCVAR_NOTIFY);
    g_cvarTauntEnable = CreateConVar("sm_domtaunt_enable", "0", "Force everybody to taunt and gain (mini)crits for 15secs after a domination/revenge kill", FCVAR_PLUGIN);
    HookEvent("player_death", EverybodyTauntNow, EventHookMode_Post);
    HookConVarChange(g_cvarTauntEnable, TauntEnableChanged);
    RegAdminCmd("sm_domtaunt", Command_Taunt, ADMFLAG_SLAY, "Force everybody to taunt and gain (mini)crits for 15secs");
    AutoExecConfig(false);
}

public Action:EverybodyTauntNow(Handle:event, const String:name[], bool:dontBroadcast) {
    if (GetConVarBool(g_cvarTauntEnable)) 
    {
        new flags = GetEventInt(event,"death_flags");
        if (flags == 1 || flags == 4)
        {
            LogAction(0, -1, "[SM] Domination taunt frenzy triggered!");
            PrintToChatAll("Domination taunt frenzy triggered!");

            new players[MAXPLAYERS], counter=0;
            new maxplayers = GetMaxClients();
            for (new x = 1; x <= maxplayers ; x++)
            {
              if (IsClientInGame(x))
              {
                players[counter] = x;
                counter++;
              }
            }

            CreateTimer(15.0, ResetCrits);
            for (new i = 0; i < maxplayers; i++)
            {
                PerformTaunt(players[i]);
                TF2_AddCondition(players[i], TFCond_Buffed, 15.0, 0);
            }
        }
    }

}

public TauntEnableChanged(Handle:cvar, const String:oldval[], const String:newval[]) {
    if (strcmp(oldval, newval) != 0) {
        if (strcmp(newval, "1") == 0) {
            PrintToChatAll("%c[SM] %c%t %c%t!", 0x01, 0x04, "Domination taunt frenzy", 0x01, "enabled");
        } else {
            PrintToChatAll("%c[SM] %c%t %c%t!", 0x01, 0x04, "Domination taunt frenzy", 0x01, "disabled");
        }
    }
}

public PerformTaunt(target) {
    FakeClientCommand(target, "taunt");
}

public Action:ResetCrits(Handle:timer)
{
    LogAction(0, -1, "[SM] Domination taunt frenzy ended!");
    PrintToChatAll("Domination taunt frenzy ended!");
}

public Action:Command_Taunt(client, args) 
{
    LogAction(0, -1, "[SM] Domination taunt frenzy triggered!");
    PrintToChatAll("Domination taunt frenzy triggered!");
    new players[MAXPLAYERS], counter=0;
    new maxplayers = GetMaxClients();
    for (new x = 1; x <= maxplayers ; x++)
    {
      if (IsClientInGame(x))
      {
        players[counter] = x;
        counter++;
      }
    }

    CreateTimer(15.0, ResetCrits);
    for (new i = 0; i < maxplayers; i++)
    {
        PerformTaunt(players[i]);
        TF2_AddCondition(players[i], TFCond_Buffed, 15.0, 0);
    }
    return Plugin_Handled;
}