Raised This Month: $32 Target: $400
 8% 

FF2 [Boss] SCP-173 (My version)


Post New Thread Reply   
 
Thread Tools Display Modes
Maximilian_
Veteran Member
Join Date: Oct 2014
Old 05-17-2019 , 09:01   Re: [Boss] SCP-173 (My version)
Reply With Quote #11

decompiled by Lysis, you should rewrite it

Code:
 public PlVers:__version =
{
	version = 5,
	filevers = "1.8.0.6017",
	date = "06/02/2018",
	time = "18:22:52"
};
new Float:NULL_VECTOR[3];
new String:NULL_STRING[4];
public Extension:__ext_core =
{
	name = "Core",
	file = "core",
	autoload = 0,
	required = 0,
};
new MaxClients;
new TFHoliday:TFHoliday_Birthday;
new TFHoliday:TFHoliday_Halloween;
new TFHoliday:TFHoliday_Christmas;
new TFHoliday:TFHoliday_EndOfTheLine;
new TFHoliday:TFHoliday_CommunityUpdate;
new TFHoliday:TFHoliday_ValentinesDay;
new TFHoliday:TFHoliday_MeetThePyro;
new TFHoliday:TFHoliday_SpyVsEngyWar;
new TFHoliday:TFHoliday_FullMoon;
new TFHoliday:TFHoliday_HalloweenOrFullMoon;
new TFHoliday:TFHoliday_HalloweenOrFullMoonOrValentines;
new TFHoliday:TFHoliday_AprilFools;
public Extension:__ext_tf2 =
{
	name = "TF2 Tools",
	file = "game.tf2.ext",
	autoload = 0,
	required = 1,
};
public Extension:__ext_tf2items =
{
	name = "TF2Items",
	file = "tf2items.ext.2.ep2v",
	autoload = 0,
	required = 1,
};
public Extension:__ext_sdktools =
{
	name = "SDKTools",
	file = "sdktools.ext",
	autoload = 1,
	required = 1,
};
new String:TFResourceNames[18][];
public Extension:__ext_regex =
{
	name = "Regex Extension",
	file = "regex.ext",
	autoload = 1,
	required = 1,
};
new bool:CSkipList[66] =
{
	1634038374, 1868980075, 1701999730, 845116275, 0, 1634038374, 1868980075, 1701999730, 845116275, 2020438830, 0, 2448, 2468, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 845571630, 0, 0, 47, 92, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
new CTeamColors[1][3];
new Handle:CTrie = 1634038374;
public SharedPlugin:__pl_FF2 =
{
	name = "freak_fortress_2",
	file = "freak_fortress_2.smx",
	required = 1,
};
new String:this_plugin_name[80];
new BossTeam = 3;
new SecondsLeft[66];
new BossDamage;
new Handle:hDisableRage[66];
new Handle:hTimerTick[66];
public Plugin:myinfo =
{
	name = "Freak Fortress 2: SCP-173 Special Abilities",
	description = "",
	author = "OriginalNero",
	version = "",
	url = ""
};
public void:__ext_core_SetNTVOptional()
{
	MarkNativeAsOptional("GetFeatureStatus");
	MarkNativeAsOptional("RequireFeature");
	MarkNativeAsOptional("AddCommandListener");
	MarkNativeAsOptional("RemoveCommandListener");
	MarkNativeAsOptional("BfWriteBool");
	MarkNativeAsOptional("BfWriteByte");
	MarkNativeAsOptional("BfWriteChar");
	MarkNativeAsOptional("BfWriteShort");
	MarkNativeAsOptional("BfWriteWord");
	MarkNativeAsOptional("BfWriteNum");
	MarkNativeAsOptional("BfWriteFloat");
	MarkNativeAsOptional("BfWriteString");
	MarkNativeAsOptional("BfWriteEntity");
	MarkNativeAsOptional("BfWriteAngle");
	MarkNativeAsOptional("BfWriteCoord");
	MarkNativeAsOptional("BfWriteVecCoord");
	MarkNativeAsOptional("BfWriteVecNormal");
	MarkNativeAsOptional("BfWriteAngles");
	MarkNativeAsOptional("BfReadBool");
	MarkNativeAsOptional("BfReadByte");
	MarkNativeAsOptional("BfReadChar");
	MarkNativeAsOptional("BfReadShort");
	MarkNativeAsOptional("BfReadWord");
	MarkNativeAsOptional("BfReadNum");
	MarkNativeAsOptional("BfReadFloat");
	MarkNativeAsOptional("BfReadString");
	MarkNativeAsOptional("BfReadEntity");
	MarkNativeAsOptional("BfReadAngle");
	MarkNativeAsOptional("BfReadCoord");
	MarkNativeAsOptional("BfReadVecCoord");
	MarkNativeAsOptional("BfReadVecNormal");
	MarkNativeAsOptional("BfReadAngles");
	MarkNativeAsOptional("BfGetNumBytesLeft");
	MarkNativeAsOptional("BfWrite.WriteBool");
	MarkNativeAsOptional("BfWrite.WriteByte");
	MarkNativeAsOptional("BfWrite.WriteChar");
	MarkNativeAsOptional("BfWrite.WriteShort");
	MarkNativeAsOptional("BfWrite.WriteWord");
	MarkNativeAsOptional("BfWrite.WriteNum");
	MarkNativeAsOptional("BfWrite.WriteFloat");
	MarkNativeAsOptional("BfWrite.WriteString");
	MarkNativeAsOptional("BfWrite.WriteEntity");
	MarkNativeAsOptional("BfWrite.WriteAngle");
	MarkNativeAsOptional("BfWrite.WriteCoord");
	MarkNativeAsOptional("BfWrite.WriteVecCoord");
	MarkNativeAsOptional("BfWrite.WriteVecNormal");
	MarkNativeAsOptional("BfWrite.WriteAngles");
	MarkNativeAsOptional("BfRead.ReadBool");
	MarkNativeAsOptional("BfRead.ReadByte");
	MarkNativeAsOptional("BfRead.ReadChar");
	MarkNativeAsOptional("BfRead.ReadShort");
	MarkNativeAsOptional("BfRead.ReadWord");
	MarkNativeAsOptional("BfRead.ReadNum");
	MarkNativeAsOptional("BfRead.ReadFloat");
	MarkNativeAsOptional("BfRead.ReadString");
	MarkNativeAsOptional("BfRead.ReadEntity");
	MarkNativeAsOptional("BfRead.ReadAngle");
	MarkNativeAsOptional("BfRead.ReadCoord");
	MarkNativeAsOptional("BfRead.ReadVecCoord");
	MarkNativeAsOptional("BfRead.ReadVecNormal");
	MarkNativeAsOptional("BfRead.ReadAngles");
	MarkNativeAsOptional("BfRead.GetNumBytesLeft");
	MarkNativeAsOptional("PbReadInt");
	MarkNativeAsOptional("PbReadFloat");
	MarkNativeAsOptional("PbReadBool");
	MarkNativeAsOptional("PbReadString");
	MarkNativeAsOptional("PbReadColor");
	MarkNativeAsOptional("PbReadAngle");
	MarkNativeAsOptional("PbReadVector");
	MarkNativeAsOptional("PbReadVector2D");
	MarkNativeAsOptional("PbGetRepeatedFieldCount");
	MarkNativeAsOptional("PbSetInt");
	MarkNativeAsOptional("PbSetFloat");
	MarkNativeAsOptional("PbSetBool");
	MarkNativeAsOptional("PbSetString");
	MarkNativeAsOptional("PbSetColor");
	MarkNativeAsOptional("PbSetAngle");
	MarkNativeAsOptional("PbSetVector");
	MarkNativeAsOptional("PbSetVector2D");
	MarkNativeAsOptional("PbAddInt");
	MarkNativeAsOptional("PbAddFloat");
	MarkNativeAsOptional("PbAddBool");
	MarkNativeAsOptional("PbAddString");
	MarkNativeAsOptional("PbAddColor");
	MarkNativeAsOptional("PbAddAngle");
	MarkNativeAsOptional("PbAddVector");
	MarkNativeAsOptional("PbAddVector2D");
	MarkNativeAsOptional("PbRemoveRepeatedFieldValue");
	MarkNativeAsOptional("PbReadMessage");
	MarkNativeAsOptional("PbReadRepeatedMessage");
	MarkNativeAsOptional("PbAddMessage");
	MarkNativeAsOptional("Protobuf.ReadInt");
	MarkNativeAsOptional("Protobuf.ReadFloat");
	MarkNativeAsOptional("Protobuf.ReadBool");
	MarkNativeAsOptional("Protobuf.ReadString");
	MarkNativeAsOptional("Protobuf.ReadColor");
	MarkNativeAsOptional("Protobuf.ReadAngle");
	MarkNativeAsOptional("Protobuf.ReadVector");
	MarkNativeAsOptional("Protobuf.ReadVector2D");
	MarkNativeAsOptional("Protobuf.GetRepeatedFieldCount");
	MarkNativeAsOptional("Protobuf.SetInt");
	MarkNativeAsOptional("Protobuf.SetFloat");
	MarkNativeAsOptional("Protobuf.SetBool");
	MarkNativeAsOptional("Protobuf.SetString");
	MarkNativeAsOptional("Protobuf.SetColor");
	MarkNativeAsOptional("Protobuf.SetAngle");
	MarkNativeAsOptional("Protobuf.SetVector");
	MarkNativeAsOptional("Protobuf.SetVector2D");
	MarkNativeAsOptional("Protobuf.AddInt");
	MarkNativeAsOptional("Protobuf.AddFloat");
	MarkNativeAsOptional("Protobuf.AddBool");
	MarkNativeAsOptional("Protobuf.AddString");
	MarkNativeAsOptional("Protobuf.AddColor");
	MarkNativeAsOptional("Protobuf.AddAngle");
	MarkNativeAsOptional("Protobuf.AddVector");
	MarkNativeAsOptional("Protobuf.AddVector2D");
	MarkNativeAsOptional("Protobuf.RemoveRepeatedFieldValue");
	MarkNativeAsOptional("Protobuf.ReadMessage");
	MarkNativeAsOptional("Protobuf.ReadRepeatedMessage");
	MarkNativeAsOptional("Protobuf.AddMessage");
	VerifyCoreVersion();
	return void:0;
}

GetThisPluginName()
{
	decl String:pluginName[80];
	GetPluginFilename(Handle:0, pluginName, 80);
	ReplaceString(pluginName, 80, ".ff2", "", false);
	new forwardSlash = -1;
	new backwardSlash = -1;
	new finalPluginName = -1;
	do {
		forwardSlash = StrContains(pluginName[finalPluginName + 1], "/", true);
		backwardSlash = StrContains(pluginName[finalPluginName + 1], "\", true);
		new var1;
		if ((backwardSlash < forwardSlash && backwardSlash != -1) || forwardSlash == -1)
		{
			if (!(backwardSlash == -1))
			{
				finalPluginName = backwardSlash;
			}
		}
		else
		{
			new var3;
			if ((forwardSlash < backwardSlash && forwardSlash != -1) || backwardSlash == -1)
			{
				if (!(forwardSlash == -1))
				{
					finalPluginName = forwardSlash;
				}
			}
		}
		strcopy(this_plugin_name, 80, pluginName[finalPluginName + 1]);
		return 0;
	} while (true);
}

public void:OnPluginStart()
{
	OnPluginStart2();
	GetThisPluginName();
	return void:0;
}

public Action:FF2_OnAbility(client, String:plugin_name[], String:ability_name[], status)
{
	if (plugin_name[0])
	{
		if (strcmp(this_plugin_name, plugin_name, true))
		{
			return Action:0;
		}
	}
	FF2_OnAbility2(client, plugin_name, ability_name, status);
	return Action:0;
}

public OnPluginStart2()
{
	HookEvent("teamplay_round_win", OnRoundEnd, EventHookMode:1);
	HookEvent("teamplay_round_start", OnRoundStart, EventHookMode:1);
	return 0;
}

public Action:OnRoundEnd(Handle:event, String:name[], bool:dontBroadcast)
{
	TurnOnLights();
	ResetHandles();
	return Action:0;
}

public Action:OnRoundStart(Handle:event, String:name[], bool:dontBroadcast)
{
	TurnOnLights();
	ResetHandles();
	return Action:0;
}

public Action:FF2_OnAbility2(boss, String:plugin_name[], String:ability_name[], status)
{
	if (!strcmp(ability_name, "ff2_scp", true))
	{
		new client = GetClientOfUserId(FF2_GetBossUserId(boss));
		new Float:position[3] = 0.0;
		new bool:otherTeamIsAlive;
		new target = 1;
		while (target <= MaxClients)
		{
			new var1;
			if (IsClientInGame(target) && IsPlayerAlive(target) && client != target && !FF2_GetFF2flags(target) & 128)
			{
				otherTeamIsAlive = true;
				if (!otherTeamIsAlive)
				{
					return Action:0;
				}
				new target;
				new tries;
				tries++;
				target = GetRandomInt(1, MaxClients);
				while (tries == 100)
				{
					new var2;
					if (!(!IsValidEdict(target) || client != target || FF2_GetFF2flags(target) & 128 || !IsPlayerAlive(target)))
					{
						GetEntPropVector(target, PropType:1, "m_vecOrigin", position, 0);
						TeleportEntity(client, position, NULL_VECTOR, NULL_VECTOR);
						TF2_AddCondition(client, TFCond:6, FF2_GetAbilityArgumentFloat(boss, this_plugin_name, ability_name, 1, 5.0), 0);
						FF2_SetBossCharge(boss, 0, 0.0);
						SecondsLeft[client] = RoundToNearest(FF2_GetAbilityArgumentFloat(boss, this_plugin_name, ability_name, 1, 5.0)) + -1;
						BossDamage = FF2_GetBossRageDamage(boss);
						FF2_SetBossRageDamage(boss, 1000000);
						hDisableRage[client] = CreateTimer(0.1, DisableRage, boss, 1);
						hTimerTick[client] = CreateTimer(1.0, TimerTick, boss, 1);
						CreateTimer(FF2_GetAbilityArgumentFloat(boss, this_plugin_name, ability_name, 1, 5.0), DeleteTimer, boss, 0);
					}
				}
				return Action:0;
			}
			target++;
		}
		if (!otherTeamIsAlive)
		{
			return Action:0;
		}
		new target;
		new tries;
		tries++;
		target = GetRandomInt(1, MaxClients);
		while (tries == 100)
		{
			new var2;
			if (!(!IsValidEdict(target) || client != target || FF2_GetFF2flags(target) & 128 || !IsPlayerAlive(target)))
			{
				GetEntPropVector(target, PropType:1, "m_vecOrigin", position, 0);
				TeleportEntity(client, position, NULL_VECTOR, NULL_VECTOR);
				TF2_AddCondition(client, TFCond:6, FF2_GetAbilityArgumentFloat(boss, this_plugin_name, ability_name, 1, 5.0), 0);
				FF2_SetBossCharge(boss, 0, 0.0);
				SecondsLeft[client] = RoundToNearest(FF2_GetAbilityArgumentFloat(boss, this_plugin_name, ability_name, 1, 5.0)) + -1;
				BossDamage = FF2_GetBossRageDamage(boss);
				FF2_SetBossRageDamage(boss, 1000000);
				hDisableRage[client] = CreateTimer(0.1, DisableRage, boss, 1);
				hTimerTick[client] = CreateTimer(1.0, TimerTick, boss, 1);
				CreateTimer(FF2_GetAbilityArgumentFloat(boss, this_plugin_name, ability_name, 1, 5.0), DeleteTimer, boss, 0);
			}
		}
		return Action:0;
	}
	return Action:0;
}

public void:TF2_OnConditionAdded(player, TFCond:condition)
{
	new client = 1;
	while (client <= MaxClients)
	{
		if (FF2_GetBossIndex(client) != -1)
		{
			new boss = FF2_GetBossIndex(client);
			if (FF2_HasAbility(boss, this_plugin_name, "ff2_scp"))
			{
				new var1;
				if (condition == TFCond:6 && client == player)
				{
					TF2_RemoveCondition(client, TFCond:87);
				}
				new var2;
				if (condition == TFCond:87 && client == player)
				{
					TurnOnLights();
				}
			}
		}
		client++;
	}
	return void:0;
}

public void:TF2_OnConditionRemoved(player, TFCond:condition)
{
	new client = 1;
	while (client <= MaxClients)
	{
		if (FF2_GetBossIndex(client) != -1)
		{
			new boss = FF2_GetBossIndex(client);
			if (FF2_HasAbility(boss, this_plugin_name, "ff2_scp"))
			{
				new Float:pos[3] = 0.0;
				new Float:vec[3] = 0.0;
				new var1;
				if (condition == TFCond:6 && client == player)
				{
					GetEntPropVector(client, PropType:1, "m_vecOrigin", pos, 0);
					GetEntPropVector(client, PropType:1, "m_vecVelocity", vec, 0);
					TF2_AddCondition(client, TFCond:87, -1.0, 0);
					TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, 3604);
					vec[2] = 0.0;
				}
				new var2;
				if (condition == TFCond:87 && client == player)
				{
					new target = 1;
					while (target <= MaxClients)
					{
						if (IsValidClient(target, false))
						{
							new var3;
							if (BossTeam != GetClientTeam(target) && player != target)
							{
								TurnOffLights(GetClientUserId(target));
							}
						}
						target++;
					}
				}
			}
		}
		client++;
	}
	return void:0;
}

public Action:DeleteTimer(Handle:timer, any:boss)
{
	new client = GetClientOfUserId(FF2_GetBossUserId(boss));
	if (IsValidClient(client, false))
	{
		FF2_SetBossCharge(boss, 0, 0.0);
		FF2_SetBossRageDamage(boss, BossDamage);
		SecondsLeft[client] = 0;
		if (hDisableRage[client])
		{
			KillTimer(hDisableRage[client], false);
			hDisableRage[client] = 0;
		}
		if (hTimerTick[client])
		{
			KillTimer(hTimerTick[client], false);
			hTimerTick[client] = 0;
		}
	}
	return Action:0;
}

public Action:DisableRage(Handle:timer, any:boss)
{
	new client = GetClientOfUserId(FF2_GetBossUserId(boss));
	new var1;
	if (boss == any:-1 || !IsClientInGame(client) || SecondsLeft[client])
	{
		return Action:4;
	}
	FF2_SetBossCharge(boss, 0, 0.0);
	return Action:0;
}

public Action:TimerTick(Handle:timer, any:boss)
{
	new client = GetClientOfUserId(FF2_GetBossUserId(boss));
	new var1;
	if (boss == any:-1 || !IsClientInGame(client) || SecondsLeft[client])
	{
		return Action:4;
	}
	SecondsLeft[client] += -1;
	return Action:0;
}

void:TurnOnLights()
{
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & -16385);
	new target = 1;
	while (target <= MaxClients)
	{
		if (IsValidClient(target, false))
		{
			ClientCommand(target, "r_screenoverlay \"\"");
		}
		target++;
	}
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & 16384);
	return void:0;
}

void:TurnOffLights(userid)
{
	new client = GetClientOfUserId(userid);
	new flags = GetCommandFlags("r_screenoverlay") & -16385;
	SetCommandFlags("r_screenoverlay", flags);
	ClientCommand(client, "r_screenoverlay \"%s\"", "Effects/tp_eyefx/tp_black");
	SetCommandFlags("r_screenoverlay", GetCommandFlags("r_screenoverlay") & 16384);
	return void:0;
}

void:ResetHandles()
{
	new player;
	while (player <= MaxClients)
	{
		if (IsValidClient(player, false))
		{
			if (hDisableRage[player])
			{
				KillTimer(hDisableRage[player], false);
				hDisableRage[player] = 0;
			}
			if (hTimerTick[player])
			{
				KillTimer(hTimerTick[player], false);
				hTimerTick[player] = 0;
			}
		}
		player++;
	}
	return void:0;
}

bool:IsValidClient(client, bool:isAlive)
{
	new var1;
	if (!client || client > MaxClients)
	{
		return false;
	}
	if (isAlive)
	{
		new var2;
		return IsClientInGame(client) && IsPlayerAlive(client);
	}
	return IsClientInGame(client);
}

Last edited by Maximilian_; 05-17-2019 at 09:01.
Maximilian_ is offline
Batfoxkid
Senior Member
Join Date: Nov 2018
Location: ''On the map''
Old 05-17-2019 , 11:39   Re: [Boss] SCP-173 (My version)
Reply With Quote #12

Quote:
Originally Posted by Maximilian_ View Post
decompiled by Lysis, you should rewrite it
Here's a somewhat rewrite, I can't test compile/run right now but I'm sure it's fixable now.

EDIT: Not idea what this means
Code:
int target;
int tries;
tries++;
target = GetRandomInt(1, MaxClients);
while (tries == 100)
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <tf2_stocks>
#include <sdktools>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin>

#pragma newdecls required

int BossTeam 3;
int SecondsLeft[MAXPLAYERS+1];
int BossDamage;
Handle hDisableRage[MAXPLAYERS+1];
Handle hTimerTick[MAXPLAYERS+1];

public 
Plugin myinfo =
{
    
name "Freak Fortress 2: SCP-173 Special Abilities",
    
description "",
    
author "OriginalNero",
    
version "",
    
url ""
};

public 
void OnPluginStart2()
{
    
HookEvent("teamplay_round_win"OnRoundEndEventHookMode_Pre);
    
HookEvent("teamplay_round_start"OnRoundStartEventHookMode_Pre);
}

public 
Action OnRoundEnd(Handle eventchar[] namebool dontBroadcast)
{
    
TurnOnLights();
    
ResetHandles();
    return 
Plugin_Continue;
}

public 
Action OnRoundStart(Handle eventchar[] namebool dontBroadcast)
{
    
TurnOnLights();
    
ResetHandles();
    return 
Plugin_Continue;
}

public 
Action FF2_OnAbility2(int bosschar[] plugin_namechar[] ability_nameint status)
{
    if (!
strcmp(ability_name"ff2_scp"true))
    {
        
int client GetClientOfUserId(FF2_GetBossUserId(boss));
        
float position[3] = 0.0;
        
bool otherTeamIsAlive;
        for(
target=1target<=MaxClientstarget++)
        {
            if (
IsClientInGame(target) && IsPlayerAlive(target) && client != target && !FF2_GetFF2flags(target) & FF2FLAG_USEBOSSTIMER)
            {
                
otherTeamIsAlive true;
                if (!
otherTeamIsAlive)
                {
                    return 
Plugin_Continue;
                }
                
int target;
                
int tries;
                
tries++;
                
target GetRandomInt(1MaxClients);    // Wat
                
while (tries == 100)
                {
                    if (!(!
IsValidEdict(target) || client != target || FF2_GetFF2flags(target) & FF2FLAG_USEBOSSTIMER || !IsPlayerAlive(target)))
                    {
                        
GetEntPropVector(targetProp_Send"m_vecOrigin"position0);
                        
TeleportEntity(clientpositionNULL_VECTORNULL_VECTOR);
                        
TF2_AddCondition(clientTFCond_TeleportedGlowFF2_GetAbilityArgumentFloat(bossthis_plugin_nameability_name15.0), 0);
                        
FF2_SetBossCharge(boss00.0);
                        
SecondsLeft[client] = RoundToNearest(FF2_GetAbilityArgumentFloat(bossthis_plugin_nameability_name15.0)) + -1;
                        
BossDamage FF2_GetBossRageDamage(boss);
                        
FF2_SetBossRageDamage(boss1000000);
                        
hDisableRage[client] = CreateTimer(0.1DisableRageboss1);
                        
hTimerTick[client] = CreateTimer(1.0TimerTickboss1);
                        
CreateTimer(FF2_GetAbilityArgumentFloat(bossthis_plugin_nameability_name15.0), DeleteTimerboss0);
                    }
                }
                return 
Plugin_Continue;
            }
        }
        if (!
otherTeamIsAlive)
        {
            return 
Plugin_Continue;
        }
        
int target;
        
int tries;
        
tries++;
        
target GetRandomInt(1MaxClients);
        while (
tries == 100)    // Someone try to understand this please
        
{
            if (!(!
IsValidEdict(target) || client != target || FF2_GetFF2flags(target) & FF2FLAG_USEBOSSTIMER || !IsPlayerAlive(target)))
            {
                
GetEntPropVector(targetProp_Send"m_vecOrigin"position0);
                
TeleportEntity(clientpositionNULL_VECTORNULL_VECTOR);
                
TF2_AddCondition(clientTFCond_TeleportedGlowFF2_GetAbilityArgumentFloat(bossthis_plugin_nameability_name15.0), 0);
                
FF2_SetBossCharge(boss00.0);
                
SecondsLeft[client] = RoundToNearest(FF2_GetAbilityArgumentFloat(bossthis_plugin_nameability_name15.0)) + -1;
                
BossDamage FF2_GetBossRageDamage(boss);
                
FF2_SetBossRageDamage(boss1000000);
                
hDisableRage[client] = CreateTimer(0.1DisableRageboss1);
                
hTimerTick[client] = CreateTimer(1.0TimerTickboss1);
                
CreateTimer(FF2_GetAbilityArgumentFloat(bossthis_plugin_nameability_name15.0), DeleteTimerboss0);
            }
        }
        return 
Plugin_Continue;
    }
    return 
Plugin_Continue;
}

public 
void TF2_OnConditionAdded(int playerTFCond condition)
{
    for (
int client=1client<=MaxClientsclient++)
    {
        if (
FF2_GetBossIndex(client) != -1)
        {
            
int boss FF2_GetBossIndex(client);
            if (
FF2_HasAbility(bossthis_plugin_name"ff2_scp"))
            {
                if (
condition == TFCond_TeleportedGlow && client == player)
                {
                    
TF2_RemoveCondition(clientTFCond_HalloweenKartNoTurn);
                }
                if (
condition == TFCond_HalloweenKartNoTurn && client == player)
                {
                    
TurnOnLights();
                }
            }
        }
    }
}

public 
void TF2_OnConditionRemoved(int playerTFCond condition)
{
    for (
int client=1client<=MaxClientsclient++)
    {
        if (
FF2_GetBossIndex(client) != -1)
        {
            
int boss FF2_GetBossIndex(client);
            if (
FF2_HasAbility(bossthis_plugin_name"ff2_scp"))
            {
                
float pos[3] = 0.0;
                
float vec[3] = 0.0;
                if (
condition == TFCond_TeleportedGlow && client == player)
                {
                    
GetEntPropVector(clientProp_Send"m_vecOrigin"pos0);
                    
GetEntPropVector(clientProp_Send"m_vecVelocity"vec0);
                    
TF2_AddCondition(clientTFCond_HalloweenKartNoTurn, -1.00);
                    
TeleportEntity(clientNULL_VECTORNULL_VECTOR3604);
                    
vec[2] = 0.0;
                }
                if (
condition == TFCond_HalloweenKartNoTurn && client == player)
                {
                    for (
int target=1target<=MaxClientstarget++)
                    {
                        if (
IsValidClient(targetfalse))
                        {
                            if (
BossTeam != GetClientTeam(target) && player != target)
                            {
                                
TurnOffLights(GetClientUserId(target));
                            }
                        }
                    }
                }
            }
        }
    }
}

public 
Action DeleteTimer(Handle timerany boss)
{
    
int client GetClientOfUserId(FF2_GetBossUserId(boss));
    if (
IsValidClient(clientfalse))
    {
        
FF2_SetBossCharge(boss00.0);
        
FF2_SetBossRageDamage(bossBossDamage);
        
SecondsLeft[client] = 0;
        if (
hDisableRage[client])
        {
            
KillTimer(hDisableRage[client], false);
            
hDisableRage[client] = 0;
        }
        if (
hTimerTick[client])
        {
            
KillTimer(hTimerTick[client], false);
            
hTimerTick[client] = 0;
        }
    }
    return 
Plugin_Continue;
}

public 
Action DisableRage(Handle timerany boss)
{
    
int client GetClientOfUserId(FF2_GetBossUserId(boss));
    if (
boss == -|| !IsClientInGame(client) || SecondsLeft[client])
    {
        return 
Plugin_Stop;
    }
    
FF2_SetBossCharge(boss00.0);
    return 
Plugin_Continue;
}

public 
Action TimerTick(Handle timerany boss)
{
    
int client GetClientOfUserId(FF2_GetBossUserId(boss));
    if (
boss == -|| !IsClientInGame(client) || SecondsLeft[client])
    {
        return 
Plugin_Stop;
    }
    
SecondsLeft[client] += -1;
    return 
Plugin_Continue;
}

void TurnOnLights()
{
    
SetCommandFlags("r_screenoverlay"GetCommandFlags("r_screenoverlay") & -FCVAR_CHEAT);
    for (
int target=1target<=MaxClientstarget++)
    {
        if (
IsValidClient(targetfalse))
        {
            
ClientCommand(target"r_screenoverlay \"\"");
        }
    }
    
SetCommandFlags("r_screenoverlay"GetCommandFlags("r_screenoverlay") & FCVAR_CHEAT);
}

void TurnOffLights(any userid)
{
    
int client GetClientOfUserId(userid);
    
int flags GetCommandFlags("r_screenoverlay") & -FCVAR_CHEAT;
    
SetCommandFlags("r_screenoverlay"flags);
    
ClientCommand(client"r_screenoverlay \"%s\"""Effects/tp_eyefx/tp_black");
    
SetCommandFlags("r_screenoverlay"GetCommandFlags("r_screenoverlay") & FCVAR_CHEAT);
}

void ResetHandles()
{
    for (
int playerplayer<=MaxClientsplayer++)
    {
        if (
IsValidClient(playerfalse))
        {
            if (
hDisableRage[player])
            {
                
KillTimer(hDisableRage[player], false);
                
hDisableRage[player] = 0;
            }
            if (
hTimerTick[player])
            {
                
KillTimer(hTimerTick[player], false);
                
hTimerTick[player] = 0;
            }
        }
    }
}

bool IsValidClient(int clientbool isAlive)
{
    if (!
client || client MaxClients)
    {
        return 
false;
    }
    if (
isAlive)
    {
        return 
IsClientInGame(client) && IsPlayerAlive(client);
    }
    return 
IsClientInGame(client);

__________________

Last edited by Batfoxkid; 05-17-2019 at 13:22. Reason: Forgot the int in the for loop
Batfoxkid is offline
Cpt.Haxray
Member
Join Date: Mar 2016
Location: Canada
Old 05-17-2019 , 13:12   Re: [Boss] SCP-173 (My version)
Reply With Quote #13

Wow you guys are awesome.
Cpt.Haxray is offline
Batfoxkid
Senior Member
Join Date: Nov 2018
Location: ''On the map''
Old 05-18-2019 , 00:58   Re: [Boss] SCP-173 (My version)
Reply With Quote #14

Welp, I decided to redo how the plugin works. Alot simpler now.
(Also I messed with the config a bit.)
Attached Files
File Type: cfg scp_173.cfg (6.9 KB, 161 views)
File Type: sp Get Plugin or Get Source (ff2_scp173.sp - 113 views - 4.8 KB)
File Type: smx ff2_scp173.smx (7.7 KB, 107 views)
__________________
Batfoxkid is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode