Initial commit

This commit is contained in:
2025-04-15 22:27:20 -04:00
parent 5b7b68f81f
commit 771d8fe8e8
597 changed files with 149544 additions and 0 deletions

View File

@@ -0,0 +1,522 @@
// Fartsy's Boss Handler v1.0.0
enum struct BOSSHANDLER {
int bossID;
bool bTargetInRange[MAXPLAYERS+1];
bool bDoTankBuster;
bool isAlive;
bool shouldTick;
bool shouldTickBGM;
bool tickBuster;
float fAng[3];
float fPos[3];
int bustTarget;
int iBossEnt;
int iBossEntHealth;
int iBossEntMaxHealth;
int iBossEntTarget;
int iBossPhase;
int iBossPhaseTmp;
void EmitSpawnSound(int boss){
switch(boss){
//Onslaughter
case 0:{
//Onslaughter has no spawn sound for now.... maybe when brute justice happens c:
}
//Sephiroth (wip)
case 1:{
}
//Metallizer (wip) To Do: Only change to Inferno if we're in boss attack range. Use a trigger_multiple for this. To Do, delay this by like 1 second so the DJMM sound can play properly.
case 2:{
sudo(1001);
AudioManager.Stop();
AudioManager.indexBGM = 20;
CustomSoundEmitter(SFXArray[106].realPath, 65, false, 0, 1.0, 100); //DJMM SFX
CreateTimer(1.5, DelayedMetalFace);
}
}
}
//For tracking model and skipping player ready check if boss is alive
void Tick(){
//PrintToServer("Boss %i, hp %i/%i", this.bossID, this.iBossEntHealth, this.iBossEntMaxHealth);
if (this.shouldTickBGM) (this.TickBGM());
if(this.isAlive && !core.isWave){
PrintToChatAll("PLACEHOLDER -- FORCE PLAYERS TO BE READY IF NOT IN WAVE.");
}
if(this.tickBuster) this.TickBuster();
switch(this.bossID){
case 0:{
}
case 1:{
}
case 2:{
this.iBossEnt = FindEntityByTargetname("FB.MetalBase", "base_boss");
if (!IsValidEntity(this.iBossEnt)) this.iBossPhase = 4;
else {
this.iBossEntHealth = GetEntProp(this.iBossEnt, Prop_Data, "m_iHealth");
this.iBossEntMaxHealth = GetEntProp(this.iBossEnt, Prop_Data, "m_iMaxHealth");
this.iBossEntTarget = FindEntityByTargetname("FB.MetalFace.Train", "func_tracktrain");
GetEntPropVector(this.iBossEntTarget, Prop_Send, "m_vecOrigin", this.fPos);
GetEntPropVector(this.iBossEntTarget, Prop_Data, "m_angRotation", this.fAng);
float vel[3];
float newPos[3];
vel[0] = 0.0;
vel[1] = 0.0;
vel[2] = 0.0;
newPos[0] = this.fPos[0];
newPos[1] = this.fPos[1];
newPos[2] = this.fPos[2] - 50.0;
TeleportEntity(this.iBossEnt, newPos, this.fAng, vel);
}
//Also need to set entity angles to its target... we can use this.bustTarget for the index of the client to get the angles...
//Do phase changes
switch(RoundToFloor((this.iBossEntHealth * 1.0/this.iBossEntMaxHealth * 1.0) * 10.0)){
case 10:{
this.iBossPhase = 1;
}
case 7:{
this.iBossPhase = 2;
}
case 4:{
this.iBossPhase = 3;
}
case 1:{
this.iBossPhase = 4;
}
}
if(this.iBossPhase != this.iBossPhaseTmp){
PrintToChatAll("PHASE CHANGED, %i to %i", this.iBossPhaseTmp, this.iBossPhase);
this.iBossPhaseTmp = this.iBossPhase;
if(this.iBossPhase > 1){
FastFire2("mfTelefect", "Start", "", 0.0, false);
FastFire2("FB.MetalFace.ReturnSND", "PlaySound", "", 0.0, false);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFTHOME", 0.25, false);
FastFire2("FB.MetalFace.Invuln", "Enable", "", 3.0, false);
}
//Phase changing, these only ever happen once per phase.
switch(this.iBossPhase){
case 0:{
PrintToChatAll("Phase 0 happened, boss must must be dead /shrug");
}
case 1:{
//PrintToChatAll("Recognized 0 -> 1, the boss must have just spawned!");
FastFire2("FB.MetalBase", "SetHealth", "320000", 0.0, false);
FastFire2("FB.MetalBase", "SetMaxHealth", "320000", 0.0, false);
FastFire2("FB.MetalBase", "AddOutput", "health 320000", 0.0, false);
}
case 2:{
//PrintToChatAll("Recognized 1 -> 2, things are heating up!");
AudioManager.ChangeBGM(22);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFT1x0", 3.00, false);
FastFire2("FB.MetalFace.SkeleSpawner", "Enable", "", 0.0, false);
FastFire2("FB.MetalFace.SkeleSpawner", "Disable", "", 120.0, false);
FastFire2("mfTelefect", "Start", "", 120.0, false);
FastFire2("FB.MetalFace.ReturnSND", "PlaySound", "", 120.0, false);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFTHOME", 120.25, false);
FastFire2("FB.MetalFace.Invuln", "Disable", "", 123.0, false);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "tank_path_a_100", 126.85, false);
FastFire2("mfTelefect", "Start", "", 127.0, false);
FastFire2("FB.MetalFace.ReturnSND", "PlaySound", "", 127.0, false);
}
case 3:{
//PrintToChatAll("Recognized 2 -> 3, oh boi");
AudioManager.ChangeBGM(24);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFT2x0", 3.00, false);
FastFire2("FB.MetalFace.MerasmusSpawner", "ForceSpawn", "", 5.0, false); //Spawn halloween bosses at MetalFace's location
FastFire2("FB.MetalFace.MonoculusSpawner", "ForceSpawn", "", 7.0, false); //Spawn halloween bosses at MetalFace's location
FastFire2("FB.MetalFace.HHHSpawner", "ForceSpawn", "", 9.0, false); //Spawn halloween bosses at MetalFace's location
FastFire2("FB.MetalFace.Invuln", "Disable", "", 123.0, false);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "tank_path_a_250", 126.85, false);
FastFire2("mfTelefect", "Start", "", 127.0, false);
FastFire2("FB.MetalFace.ReturnSND", "PlaySound", "", 127.0, false);
}
case 4:{
//PrintToChatAll("Recognized 3 -> 4, OHSHITOHFUCKOHNO");
AudioManager.ChangeBGM(26);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFT3x0", 3.00, false);
FastFire2("FB.MetalFace.GigaBuster", "ForceSpawn", "", 10.0, false);
}
}
}
}
}
}
//For tracking bgm and updating bgm based on player emnity
void TickBGM(){
if (this.shouldTickBGM){
int iBGM0;
int iBGM1;
switch(this.iBossPhase){
case 1:{
iBGM0 = 20;
iBGM1 = 21;
}
case 2:{
iBGM0 = 22;
iBGM1 = 23;
}
case 3:{
iBGM0 = 24;
iBGM1 = 25;
}
case 4:{
iBGM0 = 26;
iBGM1 = 27;
}
}
for (int i = 0; i < MaxClients; i++){
if (EmnityManager[i].IsAboveEmnityThreshold(SuggestEmnityThreshold())) {
CSEClient(i, BGMArray[iBGM1].realPath, BGMArray[iBGM1].SNDLVL, true, 1, 1.0, 100);
CSEClient(i, BGMArray[iBGM0].realPath, BGMArray[iBGM0].SNDLVL, true, 1, 0.05, 100);
}
else {
CSEClient(i, BGMArray[iBGM1].realPath, BGMArray[iBGM1].SNDLVL, true, 1, 0.05, 100);
CSEClient(i, BGMArray[iBGM0].realPath, BGMArray[iBGM0].SNDLVL, true, 1, 1.0, 100);
}
}
AudioManager.indexBGM = iBGM0;
}
}
//Tank buster thing
void TickBuster(){
float cPos[3]; //Client's Position
float pPos[3]; //Ground Particle Target Position
float sPos[3]; //Sign/Arrow's Target Position
float rPos[3];
float fVelocity[3]; //Velocity for teleporting entities, used for angles as well so we don't need two vectors.
int iAirParticle = FindEntityByTargetname("FB.TankBuster.AirParticle", "func_brush");
int iBuster = FindEntityByTargetname("FB.TankBuster", "trigger_hurt");
int iExploParticle = FindEntityByTargetname("FB.TankBuster.ExplodeParticle", "info_particle_system");
int iParticle = FindEntityByTargetname("FB.TankBuster.GroundParticle", "info_particle_system");
int iSign = FindEntityByTargetname("FB.TankBuster.Sign", "func_rotating");
int iSpin = FindEntityByTargetname("FB.TankBuster.Spinner", "func_rotating");
GetClientAbsOrigin(this.bustTarget, cPos);
rPos[0] = cPos[0];
rPos[1] = cPos[1];
rPos[2] = cPos[2] + 50.0;
pPos[0] = cPos[0];
pPos[1] = cPos[1];
pPos[2] = cPos[2] + 25.0;
sPos[0] = cPos[0];
sPos[1] = cPos[1];
sPos[2] = cPos[2] + 150.0;
TeleportEntity(iAirParticle, rPos, fVelocity, fVelocity);
TeleportEntity(iParticle, pPos, fVelocity, fVelocity);
TeleportEntity(iExploParticle, pPos, fVelocity, fVelocity);
TeleportEntity(iBuster, cPos, fVelocity, fVelocity);
TeleportEntity(iSign, sPos, fVelocity, fVelocity);
TeleportEntity(iSpin, pPos, fVelocity, fVelocity);
}
//Tick client post
void TickForClient(int client){
float cPos[3];
GetClientAbsOrigin(client, cPos);
if(GetVectorDistance(cPos, this.fPos) < 500 && client == GetEmnityMax() && this.bDoTankBuster){
char sDamage[32];
this.bustTarget = client;
this.bDoTankBuster = false;
int iHealth = GetClientHealth(this.bustTarget);
Format(sDamage, sizeof(sDamage), "damage %i", RoundToFloor(iHealth * 0.65));
FastFire2("FB.TankBuster", "AddOutput", sDamage, 0.0, false);
FastFire2("FB.TankBusterSND", "PlaySound", "", 1.25, false);
FastFire2("FB.TankBuster.GroundParticle", "Start", "", 0.0, false);
FastFire2("FB.TankBuster.ExplodeSND", "PlaySound", "", 5.50, false);
FastFire2("FB.TankBuster.ExplodeParticle", "Start", "", 5.75, false);
FastFire2("FB.TankBuster.ExplodeParticle", "Stop", "", 9.0, false);
FastFire2("FB.TankBuster", "Enable", "", 5.75, false);
FastFire2("FB.TankBuster", "Disable", "", 6.0, false);
CreateTimer(1.0, StartTickBuster);
PrintToServer("Dropping a tank buster on %N, they have %i HP, the tank buster will do %s.", this.bustTarget, iHealth, sDamage);
CreateTimer(7.0, ResetTickBuster);
}
}
//Boss was slain
void TriggerDeath(){
this.shouldTick = false;
this.tickBuster = false;
this.iBossPhase = 0;
switch(this.bossID){
//Onslaughter lost
case 0: {
}
//Sephiroth lost
case 1:{
}
//Metal Face lost
case 2:{
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFTHOME", 0.0, false);
}
}
}
//Boss reached bomb hatch
void TriggerVictory(){
this.shouldTick = false;
this.tickBuster = false;
float bossOrigin[3];
float targetOrigin[3];
int targetEnt = FindEntityByTargetname("capturezone_blue", "func_capturezone");
GetEntPropVector(targetEnt, Prop_Send, "m_vecOrigin", targetOrigin);
switch(this.bossID){
//Onslaughter Won
case 0:{
int bossEnt = FindEntityByTargetname("FB.MetalBase", "base_boss");
if(bossEnt == -1) return;
GetEntPropVector(bossEnt, Prop_Send, "m_vecOrigin", bossOrigin);
if (GetVectorDistance(bossOrigin, targetOrigin) < 2200){
//Do something here because Onslaughter is at the pit, victory for boss.
}
}
//Sephiroth Won
case 1:{
}
//Metallizer Won
case 2:{
int bossEnt = FindEntityByTargetname("FB.MetalBase", "base_boss");
if(bossEnt == -1) return;
GetEntPropVector(bossEnt, Prop_Send, "m_vecOrigin", bossOrigin);
if (GetVectorDistance(bossOrigin, targetOrigin) < 2200){
//Do something here because Metal Face is at the pit, victory for boss.
}
}
}
}
//Spawn the boi
void TriggerSpawn(int boss){
this.bossID = boss;
this.shouldTick = true;
switch(boss){
case 0:{
}
case 1:{
}
case 2:{
this.EmitSpawnSound(2);
FastFire2("FB.MetalFace.Train", "TeleportToPathTrack", "MFT0x0", 1.0, false);
FastFire2("FB.MetalFace.SpawnParticle", "Start", "", 1.0, false);
FastFire2("FB.MetalFace.Train", "SetSpeedReal", "1024", 1.0, false);
//switch(GetClientCount(true))
FastFire2("FB.MetalBase", "AddOutput", "health 320000", 0.0, false);
}
}
}
}
BOSSHANDLER BossHandler;
//Player specific async tick process
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon){
if (BossHandler.shouldTick) BossHandler.TickForClient(client);
return Plugin_Continue;
}
stock int SuggestEmnityThreshold(){
switch(GetClientCount(true)){
case 1:{
return 75;
}
case 2:{
return 60;
}
case 3:{
return 50;
}
case 4:{
return 35;
}
case 5:{
return 25;
}
case 6:{
return 20;
}
case 7:{
return 15;
}
case 8,9,10:{
return 10;
}
}
return -1;
}
//Used for emitting boss sounds
public Action QueueBossSound(Handle timer, int sound){
AssLogger(LOGLVL_DEBUG, "QueueBossSound played %i", sound);
switch(sound){
case 2:{
}
case 10:{
CustomSoundEmitter(SFXArray[71].realPath, 65, false, 0, 1.0, 100); //Interrupting
CreateTimer(3.1, QueueBossSound, GetRandomInt(16,22));
}
case 11:{
CustomSoundEmitter(SFXArray[69].realPath, 65, false, 0, 1.0, 100); //FunnyLooking
CreateTimer(3.0, QueueBossSound, GetRandomInt(18, 21));
}
case 12:{
CustomSoundEmitter(SFXArray[75].realPath, 65, false, 0, 1.0, 100); //Racket
CreateTimer(3.2, QueueBossSound, GetRandomInt(16, 22));
}
case 13:{
CustomSoundEmitter(SFXArray[78].realPath, 65, false, 0, 1.0, 100); //WhatDoing
}
case 14:{
CustomSoundEmitter(SFXArray[79].realPath, 65, false, 0, 1.0, 100); //WhateverDoing
CreateTimer(4.3, QueueBossSound, GetRandomInt(16,17));
}
case 15:{
CustomSoundEmitter(SFXArray[72].realPath, 65, false, 0, 1.0, 100); //Join In
CreateTimer(3.2, QueueBossSound, 16);
}
//pt 2
case 16:{
CustomSoundEmitter(SFXArray[70].realPath, 65, false, 0, 1.0, 100); //Good show
}
case 17:{
CustomSoundEmitter(SFXArray[67].realPath, 65, false, 0, 1.0, 100); //Carryon
}
case 18:{
CustomSoundEmitter(SFXArray[66].realPath, 65, false, 0, 1.0, 100); //Carnage
}
case 19:{
CustomSoundEmitter(SFXArray[73].realPath, 65, false, 0, 1.0, 100); //Lets Start
}
case 20:{
CustomSoundEmitter(SFXArray[74].realPath, 65, false, 0, 1.0, 100); //Make Way
}
//Attack sounds, but also shared with spawn sounds
case 21:{
CustomSoundEmitter(SFXArray[76].realPath, 65, false, 0, 1.0, 100); //SliceYou
}
case 22:{
CustomSoundEmitter(SFXArray[77].realPath, 65, false, 0, 1.0, 100); //Stroll
}
//Attack sounds, used for random grunts
case 23:{
CustomSoundEmitter(SFXArray[80].realPath, 65, false, 0, 1.0, 100); //gah
}
case 24:{
CustomSoundEmitter(SFXArray[81].realPath, 65, false, 0, 1.0, 100); //guh
}
case 25:{
CustomSoundEmitter(SFXArray[82].realPath, 65, false, 0, 1.0, 100); //hah
}
//Defeats
case 26:{
CustomSoundEmitter(SFXArray[83].realPath, 65, false, 0, 1.0, 100); //BadSide
}
case 27:{
CustomSoundEmitter(SFXArray[84].realPath, 65, false, 0, 1.0, 100); //NotFair
}
case 28:{
CustomSoundEmitter(SFXArray[85].realPath, 65, false, 0, 1.0, 100); //Nothing
}
case 29:{
CustomSoundEmitter(SFXArray[86].realPath, 65, false, 0, 1.0, 100); //Scream
}
case 30:{
CustomSoundEmitter(SFXArray[87].realPath, 65, false, 0, 1.0, 100); //ToGo
}
//Special attack sounds like phase changes
case 31:{
CustomSoundEmitter(SFXArray[88].realPath, 65, false, 0, 1.0, 100); //Clever
}
case 32:{
CustomSoundEmitter(SFXArray[89].realPath, 65, false, 0, 1.0, 100); //Cmon
}
case 33:{
CustomSoundEmitter(SFXArray[90].realPath, 65, false, 0, 1.0, 100); //Die
}
case 34:{
CustomSoundEmitter(SFXArray[91].realPath, 65, false, 0, 1.0, 100); //GetOff
}
case 35:{
CustomSoundEmitter(SFXArray[92].realPath, 65, false, 0, 1.0, 100); //HearYouScream
}
case 36:{
CustomSoundEmitter(SFXArray[93].realPath, 65, false, 0, 1.0, 100); //IsntOver
}
case 37:{
CustomSoundEmitter(SFXArray[94].realPath, 65, false, 0, 1.0, 100); //Like
}
case 38:{
CustomSoundEmitter(SFXArray[95].realPath, 65, false, 0, 1.0, 100); //Little
}
case 39:{
CustomSoundEmitter(SFXArray[96].realPath, 65, false, 0, 1.0, 100); //Pay
}
case 40:{
CustomSoundEmitter(SFXArray[97].realPath, 65, false, 0, 1.0, 100); //Pointers
}
case 41:{
CustomSoundEmitter(SFXArray[98].realPath, 65, false, 0, 1.0, 100); //Seat
}
case 42:{
CustomSoundEmitter(SFXArray[99].realPath, 65, false, 0, 1.0, 100); //Size
}
case 43:{
CustomSoundEmitter(SFXArray[100].realPath, 65, false, 0, 1.0, 100); //There
}
case 44:{
CustomSoundEmitter(SFXArray[101].realPath, 65, false, 0, 1.0, 100); //TimeToDie
}
case 45:{
CustomSoundEmitter(SFXArray[102].realPath, 65, false, 0, 1.0, 100); //Way
}
//Ultimates
case 46:{
CustomSoundEmitter(SFXArray[103].realPath, 65, false, 0, 1.0, 100); //FinalWords
}
case 47:{
CustomSoundEmitter(SFXArray[104].realPath, 65, false, 0, 1.0, 100); //PartingGift
}
case 48:{
CustomSoundEmitter(SFXArray[105].realPath, 65, false, 0, 1.0, 100); //WatchAndLearn
}
}
return Plugin_Stop;
}
//Teleport all entities to the client every frame
public Action StartTickBuster(Handle timer){
BossHandler.tickBuster = true;
return Plugin_Stop;
}
//Used for stopping tank busters from ticking
public Action ResetTickBuster(Handle time){
BossHandler.tickBuster = false;
float fAirPart[3] = {
-1437.270019,
-3906.739990,
-1334.989990
};
float fVelocity[3];
int iAirParticle = FindEntityByTargetname("FB.TankBuster.AirParticle", "func_brush");
int iBuster = FindEntityByTargetname("FB.TankBuster", "trigger_hurt");
int iExploParticle = FindEntityByTargetname("FB.TankBuster.ExplodeParticle", "info_particle_system");
int iParticle = FindEntityByTargetname("FB.TankBuster.GroundParticle", "info_particle_system");
int iSign = FindEntityByTargetname("FB.TankBuster.Sign", "func_rotating");
int iSpin = FindEntityByTargetname("FB.TankBuster.Spinner", "func_rotating");
TeleportEntity(iAirParticle, fAirPart, fVelocity, fVelocity);
TeleportEntity(iParticle, fAirPart, fVelocity, fVelocity);
TeleportEntity(iExploParticle, fAirPart, fVelocity, fVelocity);
TeleportEntity(iBuster, fAirPart, fVelocity, fVelocity);
TeleportEntity(iSign, fAirPart, fVelocity, fVelocity);
TeleportEntity(iSpin, fAirPart, fVelocity, fVelocity);
return Plugin_Stop;
}
//Spawn metal face
public Action DelayedMetalFace(Handle timer){
AudioManager.indexBGM = 20;
AudioManager.stopBGM = true;
CustomSoundEmitter(SFXArray[68].realPath, 65, false, 0, 1.0, 100); //Evil Laugh
CreateTimer(3.2, QueueBossSound, GetRandomInt(10,14));
sudo(1000);
BossHandler.shouldTickBGM = true;
return Plugin_Stop;
}

View File

@@ -0,0 +1,165 @@
#include <sourcemod>
public Action Command_AOE(int client, int args){
float pos[3];
pos[0] = GetCmdArgFloat(1);
pos[1] = GetCmdArgFloat(2);
pos[2] = GetCmdArgFloat(3);
PrintToChat(client, "pos %f %f %f", pos[0], pos[1], pos[2]);
DispatchCircleAOE(pos);
return Plugin_Handled;
}
public Action Command_SetFogDensity(int client, int args){
tickOnslaughter = true;
char arg1[5];
GetCmdArg(1, arg1, sizeof(arg1));
WeatherManager.fogTarget = StringToFloat(arg1);
PrintToChatAll("Changing fog density to %s", arg1);
return Plugin_Handled;
}
public Action Command_SetFogSEU(int client, int args){
char arg01[5];
char arg02[5];
char arg03[5];
GetCmdArg(1, arg01, sizeof(arg01));
GetCmdArg(2, arg02, sizeof(arg02));
GetCmdArg(3, arg03, sizeof(arg03));
WeatherManager.SetFogStartQueued(arg01);
WeatherManager.SetFogEndQueued(arg02);
if (StringToInt(arg03) == 1) WeatherManager.StartFogTransition();
PrintToChatAll("Received fog start: %s, fog end: %s, begin transition: %s", arg01, arg02, arg03);
return Plugin_Handled;
}
//Get client's stats via command
public Action Command_MyStats(int client, int args) {
int steamID = GetSteamAccountID(client);
if (!Get_Ass_Database() || !steamID || steamID <= 10000) return Plugin_Stop;
char queryID[256];
Format(queryID, sizeof(queryID), "SELECT * from ass_activity WHERE steamid = %i;", steamID);
Get_Ass_Database().Query(MyStats, queryID, client);
return Plugin_Continue;
}
public void MyStats(Database db, DBResultSet results, const char[] error, int client) {
if (!results) {
LogError("Failed to query database: %s", error);
return;
}
char name[64];
char class [64];
int health, healthMax, steamID, damagedealt, damagedealtsession, kills, killssession, deaths, deathssession, bombsreset, bombsresetsession, sacrifices, sacrificessession;
char lastkilledname[128];
char lastusedweapon[128];
char killedbyname[128];
char killedbyweapon[128];
if (results.FetchRow()) {
results.FetchString(0, name, 64); //name
steamID = results.FetchInt(1); //steamid
results.FetchString(4, class, 64); //class
health = results.FetchInt(5); //health
healthMax = results.FetchInt(6); //health
damagedealt = results.FetchInt(7); //damage dealt
damagedealtsession = results.FetchInt(8); //damage dealt session
kills = results.FetchInt(9); //kills
killssession = results.FetchInt(10); //kills session
deaths = results.FetchInt(11); //deaths
deathssession = results.FetchInt(12); //deaths session
bombsreset = results.FetchInt(13); //bombs reset
bombsresetsession = results.FetchInt(14); //bombs reset session
sacrifices = results.FetchInt(15); //sacrifices
sacrificessession = results.FetchInt(16); //sacrifices session
results.FetchString(17, lastkilledname, sizeof(lastkilledname)); //last client killed
results.FetchString(18, lastusedweapon, sizeof(lastusedweapon)); //using weapon
results.FetchString(19, killedbyname, sizeof(killedbyname)); //last client that killed
results.FetchString(20, killedbyweapon, sizeof(killedbyweapon)); //using weapon
CPrintToChat(client, "\x07AAAAAA[CORE] Showing stats of %s [%s, %i/%i hp] || SteamID: %i ", name, class, health, healthMax, steamID);
CPrintToChat(client, "{white}Damage Dealt: %i (Session: %i) || Kills: %i (Session: %i) || Deaths: %i (Session: %i) || Bombs Reset: %i (Session: %i)", damagedealt, damagedealtsession, kills, killssession, deaths, deathssession, bombsreset, bombsresetsession);
CPrintToChat(client, "Sacrifices: %i(Session:%i) || Killed %s (using %s) || Last killed by: %s (using %s)", sacrifices, sacrificessession, lastkilledname, lastusedweapon, killedbyname, killedbyweapon);
}
return;
}
//Fartsy's A.S.S
public Action Command_SacrificePointShop(int client, int args) {
ShowFartsysAss(client);
return Plugin_Handled;
}
//Fartsy's A.S.S
public void ShowFartsysAss(int client) {
CPrintToChat(client, (!core.isWave ? "{darkviolet}[{forestgreen}CORE{darkviolet}] {forestgreen}The sacrificial points counter is currently at %i of %i maximum for this wave." : core.sacPoints <= 9 ? "{darkviolet}[{forestgreen}CORE{darkviolet}] {red}You do not have enough sacrifice points to use this shop. You have %i / 10 required." : ""), core.sacPoints, core.sacPointsMax);
if (!core.isWave || core.sacPoints < 10) return;
Menu menu = new Menu(MenuHandlerFartsysAss, MENU_ACTIONS_DEFAULT);
char buffer[100];
menu.SetTitle("Fartsy's Annihilation Supply Shop");
menu.ExitButton = true;
for (int i = 0; i < RoundToFloor(core.sacPoints / 10.0); i++) menu.AddItem(buffer, ass[i].name);
menu.Display(client, 20);
}
//Also Fartsy's A.S.S
public int MenuHandlerFartsysAss(Menu menu, MenuAction action, int client, int item) {
if (action == MenuAction_Select) {
if (core.sacPoints < ass[item].price) return 0;
if(WeatherManager.TornadoWarning && item == 5){
CPrintToChatAll("{darkred}[Fartsy's Operator] {limegreen}-> {red}%N {darkred}I'm sorry, it is too late for that.. You are doomed...", client);
}
else sudo(ass[item].purchase);
AssLogger(LOGLVL_INFO, "%N opted for %s via the A.S.S.", client, ass[item].name);
} else if (action == MenuAction_End) CloseHandle(menu);
return 0;
}
//Command action definitions
//Get current song
public Action Command_GetCurrentSong(int client, int args) {
char buffer[16];
char tbuffer[16];
int sPos = RoundToFloor(AudioManager.ticksBGM / 66.6666666666);
int tPos = RoundToFloor(AudioManager.refireBGM / 66.6666666666);
Format(buffer, 16, "%02d:%02d", sPos / 60, sPos % 60);
Format(tbuffer, 16, "%02d:%02d", tPos / 60, tPos % 60);
CPrintToChat(client, "The current song is: {limegreen}%s {orange}(%s / %s)", AudioManager.songName, buffer, tbuffer);
return Plugin_Handled;
}
//Determine which bomb has been recently pushed and tell the client if a bomb is ready or not.
public Action Command_FBBombStatus(int client, int args) {
char bombStatusMsg[256];
Format(bombStatusMsg, sizeof(bombStatusMsg), (bombState[0].isMoving ? "{darkviolet}[{forestgreen}CORE{darkviolet}] {white}(%i/%i) Your team is currently pushing a %s!" : bombState[0].isReady ? "{darkviolet}[{forestgreen}CORE{darkviolet}] {white}(%i/%i) Your team's %s is ready!" : "{darkviolet}[{forestgreen}CORE{darkviolet}] {white}(%i/%i) Your team recently deployed a %s! Please wait for the next bomb."), bombState[0].state, bombState[0].stateMax, bombState[RoundToFloor(bombState[0].state / 8.0)].name);
CPrintToChat(client, bombStatusMsg);
return Plugin_Handled;
}
//Return the client to spawn
public Action Command_Return(int client, int args) {
if (!IsPlayerAlive(client)) {
CPrintToChat(client, "{red}[Core] You must be alive to use this command...");
return Plugin_Handled;
}
char name[128];
GetClientName(client, name, sizeof(name));
CPrintToChatAll("{darkviolet}[{forestgreen}CORE{darkviolet}] {white}Client {red}%s {white}began casting {darkviolet}/return{white}.", name);
CustomSoundEmitter(SFXArray[41].realPath, 65, false, 0, 1.0, 100);
CreateTimer(5.0, ReturnClient, client);
return Plugin_Handled;
}
//Return the client to spawn
public Action ReturnClient(Handle timer, int clientID) {
TeleportEntity(clientID, Return, NULL_VECTOR, NULL_VECTOR);
CSEClient(clientID, SFXArray[42].realPath, 65, false, 0, 1.0, 100);
return Plugin_Handled;
}
//Join us on Discord!
public Action Command_Discord(int client, int args) {
CPrintToChat(client, "{darkviolet}[{forestgreen}CORE{darkviolet}] {white}Our Discord server URL is {darkviolet}https://discord.com/invite/ZfUUQWxCmw{white}.");
ShowMOTDPanel(client, "FireHostRedux Discord", "https://discord.com/invite/ZfUUQWxCmw", MOTDPANEL_TYPE_URL);
return Plugin_Handled;
}
//Operator, core of the entire map
public Action Command_Operator(int args) {
char arg1[16];
GetCmdArg(1, arg1, sizeof(arg1));
sudo(StringToInt(arg1));
return Plugin_Continue;
}

View File

@@ -0,0 +1,773 @@
//Fartsy's Scene Enhancer v1.0.0 (Inspired by Mrbt0907/Weather2Remastered)
bool Enhancer_IsWave;
//All background music
enum struct BGM {
char realPath[64];
char songName[64];
int refireTime;
int ticksOffset;
int SNDLVL;
}
BGM BGMArray[32];
//All sound effects
enum struct SFXARRAY {
char realPath[64];
int SNDLVL;
}
SFXARRAY SFXArray[127];
//Sound preference menu
char sndPrefs[][128] = {
"Sounds are currently DISABLED.",
"Sounds are currently MUSIC ONLY.",
"Sounds are currently SOUND EFFECTS ONLY.",
"Sounds are currently ALL ON.",
"Somehow your sound preference was stored as non-existent 5... Please configure your sounds."
};
Handle cvarSNDDefault = INVALID_HANDLE;
int soundPreference[MAXPLAYERS + 1];
//Get client sound prefs
public void SQL_SNDPrefs(Database db, DBResultSet results, const char[] error, int client) {
if (!results) {
LogError("Failed to query database: %s", error);
return;
}
if (!IsValidClient(client)) return;
if (results.FetchRow()) soundPreference[client] = results.FetchInt(0);
}
//Music system rewrite for the 6th time. I will never make a change. My code will never mend. Still everything's the same and it all just fades to math.
enum struct AUDIOMANAGER {
bool bgmPlaying;
bool shouldTick;
bool stopBGM;
bool tickBGMOffset;
char cachedPath[128];
char songName[128];
int indexBGM;
int refireBGM;
int chanBGM;
int ticksBGM;
int VIPBGM;
void ChangeBGM(int bgm){
this.indexBGM = (this.VIPBGM >= 0 ? this.VIPBGM : bgm);
this.ticksBGM = -2;
this.refireBGM = 2;
this.shouldTick = true;
this.tickBGMOffset = BGMArray[this.indexBGM].ticksOffset > 0 ? true : false;
this.stopBGM = (!StrEqual(this.cachedPath, BGMArray[this.indexBGM].realPath) ? true : false);
this.bgmPlaying = true;
if (this.indexBGM >= 20) for (int i = 0; i < MaxClients; i++) for (int s = 19; s < bgm; s++) StopSound(i, this.chanBGM, BGMArray[s].realPath); //Very quick, very dirty, very suboptimal, but gets the job done... This stops all boss music.
}
void Reset() {
this.stopBGM = true;
this.indexBGM = GetRandomInt(1, 4);
this.ticksBGM = -2;
this.refireBGM = 2;
for (int i = 0; i < MaxClients; i++) for (int s = this.indexBGM; s < sizeof(BGMArray); s++) StopSound(i, this.chanBGM, BGMArray[s].realPath); //Very quick, very dirty, very suboptimal, but gets the job done... This stops all boss music.
AssLogger(LOGLVL_DEBUG, "AudioManager has been reset!");
}
void Stop() {
this.bgmPlaying = false;
this.stopBGM = true;
this.ticksBGM = -2;
this.refireBGM = 2;
this.shouldTick = false;
}
void TickBGM() {
this.ticksBGM++;
if (this.ticksBGM >= this.refireBGM) {
if (this.stopBGM){
for (int i = 0; i < MaxClients; ++i) {
StopSound(i, this.chanBGM, this.cachedPath);
this.stopBGM = false;
}
}
if (GetClientCount(true) == 0) {
AssLogger(LOGLVL_INFO, "Server is empty. Music queue stopped.");
this.indexBGM = GetRandomInt(1, 4);
this.Stop();
}
strcopy(this.songName, sizeof(this.songName), BGMArray[this.indexBGM].songName);
this.refireBGM = BGMArray[this.indexBGM].refireTime;
this.ticksBGM = (this.tickBGMOffset ? BGMArray[this.indexBGM].ticksOffset : 0);
CustomSoundEmitter(BGMArray[this.indexBGM].realPath, BGMArray[this.indexBGM].SNDLVL, true, 1, 1.0, 100);
CreateTimer(1.0, SyncMusic, this.indexBGM);
}
}
}
AUDIOMANAGER AudioManager;
//Custom sound emitter, I don't know how many fucking times I've rewritten this! See potato.sp
//int flags:
// SND_NOFLAGS= 0, /**< Nothing */
// SND_CHANGEVOL = 1, /**< Change sound volume */
// SND_CHANGEPITCH = 2, /**< Change sound pitch */
// SND_STOP = 3, /**< Stop the sound */
// SND_SPAWNING = 4, /**< Used in some cases for ambients */
// SND_DELAY = 5, /**< Sound has an initial delay */
// SND_STOPLOOPING = 6, /**< Stop looping all sounds on the entity */
// SND_SPEAKER = 7, /**< Being played by a mic through a speaker */
// SND_SHOULDPAUSE = 8 /**< Pause if game is paused */
void CustomSoundEmitter(char[] sndName, int TSNDLVL, bool isBGM, int flags, float vol, int pitch) {
for (int i = 1; i <= MaxClients; i++) {
if (!IsValidClient(i)) continue;
if (isBGM && (soundPreference[i] == 1 || soundPreference[i] == 3) || !isBGM && soundPreference[i] >= 2) EmitSoundToClient(i, sndName, _, AudioManager.chanBGM, TSNDLVL, flags, vol, pitch, _, _, _, _, _);
}
}
//Play sound to client. Ripped straight from potato. Allows us to play sounds directly to people when they join.
void CSEClient(int client, char[] sndName, int TSNDLVL, bool isBGM, int flags, float vol, int pitch) {
if (!IsValidClient(client)) return;
if (isBGM && (soundPreference[client] == 1 || soundPreference[client] == 3) || !isBGM && soundPreference[client] >= 2) EmitSoundToClient(client, sndName, _, AudioManager.chanBGM, TSNDLVL, flags, vol, pitch, _, _, _, _, _);
}
//VIP Music Menu
public Action Command_Music(int client, int args) {
int steamID = GetSteamAccountID(client);
if (!steamID || steamID <= 10000) return Plugin_Handled;
else ShowFartsyMusicMenu(client);
return Plugin_Handled;
}
//VIP Music Menu
public void ShowFartsyMusicMenu(int client) {
Menu menu = new Menu(MenuHandlerFartsyMusic, MENU_ACTIONS_DEFAULT);
char buffer[100];
menu.SetTitle("FartsysAss Music Menu");
for (int i = 0; i < sizeof(BGMArray); i++) menu.AddItem(buffer, BGMArray[i].songName);
menu.Display(client, 20);
menu.ExitButton = true;
}
//Set Fartsy Sound menu
public void FartsysSNDSelected(int client, CookieMenuAction action, any info, char[] buffer, int maxlen) {
if (action == CookieMenuAction_SelectOption) ShowFartsyMenu(client);
}
// Get clients sound preferences then send them the menu
public Action Command_Sounds(int client, int args) {
int steamID = GetSteamAccountID(client);
if (!steamID || steamID <= 10000) return Plugin_Handled;
else {
char queryID[256];
Format(queryID, sizeof(queryID), "SELECT soundprefs from ass_activity WHERE steamid = '%d';", steamID);
Get_Ass_Database().Query(SQL_SNDPrefs, queryID, client);
ShowFartsyMenu(client);
PrintToChat(client, sndPrefs[soundPreference[client]]);
return Plugin_Handled;
}
}
//Send client sound menu
public void ShowFartsyMenu(int client) {
Menu menu = new Menu(MenuHandlerFartsy, MENU_ACTIONS_DEFAULT);
char buffer[100];
menu.SetTitle("FartsysAss Sound Menu");
menu.AddItem(buffer, "Disable ALL");
menu.AddItem(buffer, "Music Only");
menu.AddItem(buffer, "Sound Effects Only");
menu.AddItem(buffer, "Enable ALL");
menu.Display(client, 20);
menu.ExitButton = true;
}
// Handle client choices for sound preference
public int MenuHandlerFartsy(Menu menu, MenuAction action, int param1, int param2) {
if (action == MenuAction_Select) {
char query[256];
int steamID = GetSteamAccountID(param1);
if (!Get_Ass_Database() || !steamID) return 0;
else {
Format(query, sizeof(query), "UPDATE ass_activity SET soundprefs = '%i' WHERE steamid = '%d';", param2, steamID);
Get_Ass_Database().Query(Database_FastQuery, query);
soundPreference[param1] = param2;
Command_Sounds(param1, 0);
}
} else if (action == MenuAction_End) CloseHandle(menu);
return 0;
}
//Restart music for the new client
public Action RefireMusicForClient(Handle timer, int client) {
if (IsValidClient(client)) {
if (GetClientTeam(client) == 0) CreateTimer(1.0, RefireMusicForClient, client);
else if (GetClientTeam(client) == 2) CSEClient(client, BGMArray[AudioManager.indexBGM].realPath, BGMArray[AudioManager.indexBGM].SNDLVL, true, 1, 1.0, 100);
}
return Plugin_Stop;
}
//Light Entities
bool g_PowerOutage;
enum struct MAPLIGHTING {
bool hasCustomPattern;
bool isBroken;
char arcs[32];
char beam[32];
char buzz[32];
char explosion[35];
char light[32];
char status[32];
char stun[32];
char zap[32];
void Explode(){
if(this.isBroken) return;
this.isBroken = true;
FastFire2(this.arcs, "StartSpark", "", 0.0, false);
FastFire2(this.arcs, "StartSpark", "", 0.1, false);
FastFire2(this.beam, "LightOff", "", 0.0, false);
FastFire2(this.buzz, "PlaySound", "", 0.0, false);
FastFire2(this.explosion, "Explode", "", 0.0, false);
FastFire2(this.light, "TurnOff", "", 0.0, false);
FastFire2(this.status, "Color", "255 0 0", 0.0, false);
FastFire2(this.stun, "Enable", "", 0.0, false);
FastFire2(this.zap, "Enable", "", 0.0, false);
}
void Repair(){
this.isBroken = false;
FastFire2(this.arcs, "StopSpark", "", 0.0, false);
FastFire2(this.buzz, "StopSound", "", 0.25, false);
FastFire2(this.status, "Color", "0 255 0", 0.0, false);
FastFire2(this.stun, "Disable", "", 0.0, false);
FastFire2(this.zap, "Disable", "", 0.0, false);
if(!g_PowerOutage) {
FastFire2(this.light, "SetPattern", "", 0.0, false);
FastFire2(this.light, "TurnOff", "", 0.0, false);
FastFire2(this.light, "TurnOn", "", 0.1, false);
FastFire2(this.light, "SetPattern", "", 0.1, false);
FastFire2(this.beam, "LightOff", "", 0.1, false);
FastFire2(this.beam, "LightOn", "", 0.2, false);
}
}
void RestorePower(){
if(!this.isBroken || strcmp(this.light, "MapLighting.StreetLamp0C.light") == 0){
FastFire2(this.light, "TurnOn", "", 0.0, false);
FastFire2(this.beam, "LightOn", "", 0.0, false);
FastFire2(this.beam, "LightOn", "", 1.0, false);
FastFire2(this.beam, "LightOn", "", 3.0, false);
FastFire2(this.light, "SetPattern", "", 0.0, false);
this.hasCustomPattern = false;
}
}
}
MAPLIGHTING MapLighting[15];
//Weather Manager
BULKFIRE lightningStrike[16];
BULKFIRE lightningFlash[13];
enum struct WEATHERMANAGER {
bool canTornado;
bool hasTornado;
bool powerSurging;
bool sirenExplode;
bool sirenExploded;
bool tickWeather;
bool TornadoTimerActive;
bool TornadoWarning;
char defFogStartDist[5];
char defFogEndDist[5];
char defRainDensity;
char rainDensity;
float fogDensity;
float defFogDensity;
float fogTarget;
float fogChangeRate;
float sirenPitch;
float sirenPitchRate;
float sirenPitchTarget;
int intensity;
int mIntensity;
void Activate(){
this.Reset();
sudo(1001); //Stop any BGM
FastFire2("Weather.Sky", "Enable", "", 0.0, false);
this.tickWeather = true;
this.PerformRandomWeather(); //Start weather system
}
void doLightning(){
sudo(1003);
FastFire2(lightningStrike[GetRandomInt(0, sizeof(lightningStrike)-1)].fireStr, "", "", 0.0, true);
FastFire2("Weather.LightningHurt*", "Disable", "", 0.07, false);
CustomSoundEmitter(SFXArray[GetRandomInt(27, 34)].realPath, 65, false, 0, 1.0, 100);
//Affect lights
int i = GetRandomInt(this.intensity, 15);
AssLogger(LOGLVL_DEBUG, "Doing light interactions with %i", i);
switch(i){
case 2,3,5:{
int index = GetRandomInt(0, 12);
float f = GetRandomFloat(0.5, 3.0);
FastFire2(MapLighting[index].light, "TurnOff", "", 0.0, false);
FastFire2(MapLighting[index].beam, "LightOff", "", 0.0, false);
FastFire2(MapLighting[index].light, "TurnOn", "", f, false);
FastFire2(MapLighting[index].beam, "LightOn", "", f, false);
}
case 11,15:{
g_PowerOutage = true;
if(!this.hasTornado) CreateTimer(GetRandomFloat(5.0, 30.0), RestorePower, GetRandomInt(0, 3));
FastFire2("MapLighting.*", "LightOff", "", 0.0, false);
FastFire2("MapLighting.*", "TurnOff", "", 0.0, false);
FastFire2("MapLighting.*", "LightOff", "", 1.0, false);
FastFire2("MapLighting.*", "LightOff", "", 2.0, false);
FastFire2("MapLighting.*", "LightOff", "", 3.0, false);
FastFire2("MapLighting.*", "LightOff", "", 4.0, false);
FastFire2("MapLighting.*", "LightOff", "", 5.0, false);
}
}
}
void Dissipate(){
this.sirenPitchTarget = 0.0;
this.sirenPitchRate = 0.25;
this.fogTarget = this.defFogDensity;
g_PowerOutage = false;
this.hasTornado = false;
if(Enhancer_IsWave){
this.mIntensity = 5;
this.intensity = 7;
} else {
this.mIntensity = 0;
this.intensity = 0;
}
if (this.sirenExploded) {
this.sirenPitch = 0.0;
this.sirenExploded = false;
}
this.TornadoWarning = false;
CreateTimer(GetRandomFloat(45.0, 135.0), ResetTornado);
for (int i = 0; i < sizeof(MapLighting); i++) if (!MapLighting[i].isBroken) FastFire2(MapLighting[i].light, "TurnOn", "", 0.0, false);
FastFire2("Weather.FogOutdoor", "SetStartDistLerp", this.defFogStartDist, 0.0, false);
FastFire2("Weather.FogOutdoor", "SetEndDistLerp", this.defFogEndDist, 0.0, false);
FastFire2("Weather.FogOutdoor", "StartFogTransition", "", 0.0, false);
FastFire2("tornadof1", "Stop", "", 0.0, false);
FastFire2("TornadoKill", "Disable", "", 0.0, false);
FastFire2("tornadof1wind", "Disable", "", 0.0, false);
FastFire2("tornadowindf1", "StopSound", "", 0.0, false);
FastFire2("shaketriggerf1", "Disable", "", 0.0, false);
FastFire2("tornadobutton", "Unlock", "", 30.0, false);
FastFire2("FB.FakeTankTank01", "Kill", "", 0.0, false);
FastFire2("FB.FakeTankPhys01", "Kill", "", 0.0, false);
FastFire2("Weather.EASScreen", "Disable", "", 0.0, false);
FastFire2("Weather.Siren.ExplodeParticle", "Stop", "", 0.0, false);
FastFire2("Weather.Siren", "StopSound", "", 5.0, false);
}
void FormTornado(){
this.hasTornado = true;
this.mIntensity = 15;
this.intensity = 15;
CreateTimer(1.5, TornadoShaker);
FastFire2("TornadoKill", "Enable", "", 0.0, false);
FastFire2("tornadobutton", "Lock", "", 0.0, false);
FastFire2("tornadof1", "Start", "", 20.0, false);
FastFire2("shaketriggerf1", "Enable", "", 20.0, false);
FastFire2("tornadowindf1", "PlaySound", "", 20.0, false);
FastFire2("tornadof1wind", "Enable", "", 21.50, false);
float f = GetRandomFloat(60.0, 120.0);
CreateTimer(f, TimedOperator, 42);
}
void IssueTornadoWarning(){
this.TornadoWarning = true;
this.sirenPitchTarget = 100.0;
this.sirenPitchRate = 0.1;
FastFire2("Weather.EASScreen", "Enable", "", 0.0, false);
FastFire2("Weather.EAS", "PlaySound", "", 0.0, false);
CreateTimer(GetRandomFloat(1.0, 3.0), ModulateSiren);
}
void PerformRandomWeather(){
if (!this.tickWeather) return;
AssLogger(LOGLVL_DEBUG, "[Fartsy's Enhancer] Storm Intensity @ %f% (%i)", (this.intensity / 15.0), this.intensity);
this.doLightning();
float flStormMin;
float flStormMax;
switch(GetRandomInt(this.mIntensity, this.intensity)){
case 0:{
this.SetFogStartQueued("500");
this.SetFogEndQueued("3000");
this.StartFogTransition();
flStormMin = 15.0;
flStormMax = 35.0;
this.fogTarget = 0.55;
FastFire2("rain", "Alpha", "15", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.1, 100); //Rain, no wind, reduced volume
}
case 1:{
this.SetFogStartQueued("500");
this.SetFogEndQueued("2700");
this.StartFogTransition();
flStormMin = 12.0;
flStormMax = 32.0;
this.fogTarget = 0.60;
FastFire2("rain", "Alpha", "30", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.1, 100); //Rain, no wind, reduced volume
}
case 2:{
this.SetFogStartQueued("500");
this.SetFogEndQueued("2500");
this.StartFogTransition();
this.mIntensity = 1;
flStormMin = 12.0;
flStormMax = 30.0;
FastFire2("rain", "Alpha", "50", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.1, 100); //Rain, no wind, increased volume
}
case 3:{
this.SetFogStartQueued("500");
this.SetFogEndQueued("2500");
this.StartFogTransition();
flStormMin = 10.0;
flStormMax = 28.5;
this.fogTarget = 0.70;
FastFire2("rain", "Alpha", "65", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.1, 100); //Rain, no wind, increased volume
}
case 4:{
flStormMin = 9.0;
flStormMax = 26.5;
FastFire2("rain", "Alpha", "75", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 1.0, 100); //Rain, no wind, increased volume
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.1, 100); //Rain, wind, decreased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.01, 100); //Extra wind
}
case 5:{
this.SetFogStartQueued("500");
this.SetFogEndQueued("2100");
this.StartFogTransition();
this.mIntensity = 3;
flStormMin = 7.0;
flStormMax = 25.0;
this.fogTarget = 0.75;
FastFire2("rain", "Alpha", "95", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.1, 100); //Rain, no wind, decreased volume
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.15, 100); //Rain, wind
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.05, 100); //Extra wind
}
case 6:{
this.mIntensity = 4;
flStormMin = 7.0;
flStormMax = 23.5;
FastFire2("rain", "Alpha", "125", 0.0, false);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.05, 100); //Rain, no wind, decreased volume
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.21, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.125, 100); //Extra wind
}
case 7:{
this.SetFogStartQueued("500");
this.SetFogEndQueued("2000");
this.StartFogTransition();
flStormMin = 6.0;
flStormMax = 21.0;
this.fogTarget = 0.80;
FastFire2("rain", "Alpha", "155", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 0);
CustomSoundEmitter(SFXArray[108].realPath, 65, false, 1, 0.05, 100); //Rain, no wind, decreased volume
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.26, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.25, 100); //Extra wind
}
case 8:{
this.mIntensity = 6;
this.SetFogStartQueued("470");
this.SetFogEndQueued("2000");
this.StartFogTransition();
flStormMin = 5.0;
flStormMax = 20.0;
this.fogTarget = 0.875;
FastFire2("rain", "Alpha", "175", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 1);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.37, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.35, 100); //Extra wind
}
case 9:{
this.SetFogStartQueued("425");
this.SetFogEndQueued("1500");
this.StartFogTransition();
this.mIntensity = 7;
flStormMin = 5.0;
flStormMax = 19.0;
FastFire2("rain", "Alpha", "200", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 2);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.41, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.42, 100); //Extra wind
}
case 10:{
this.SetFogStartQueued("375");
this.SetFogEndQueued("1500");
this.StartFogTransition();
flStormMin = 5.0;
flStormMax = 18.0;
this.fogTarget = 0.925;
FastFire2("rain", "Alpha", "215", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 3);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.45, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.56, 100); //Extra wind
}
case 11:{
this.mIntensity = 9;
flStormMin = 5.0;
flStormMax = 17.0;
FastFire2("rain", "Alpha", "235", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 4);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.63, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.69, 100); //Extra wind
}
case 12:{
this.mIntensity = 10;
flStormMin = 5.0;
flStormMax = 15.0;
this.fogTarget = 1.0;
this.SetFogStartQueued("225");
this.SetFogEndQueued("700");
this.StartFogTransition();
FastFire2("rain", "Alpha", "255", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 5);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.72, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.76, 100); //Extra wind
if (!this.TornadoTimerActive) sudo(1004);
}
case 13:{
this.SetFogStartQueued("200");
this.SetFogEndQueued("700");
this.StartFogTransition();
this.mIntensity = 12;
flStormMin = 5.0;
flStormMax = 14.0;
this.fogTarget = 1.0;
FastFire2("rain", "Alpha", "255", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 6);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.85, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.83, 100); //Extra wind
if (!this.TornadoTimerActive) sudo(1004);
}
case 14:{
this.mIntensity = 13;
this.SetFogStartQueued("100");
this.SetFogEndQueued("700");
this.StartFogTransition();
flStormMin = 5.0;
flStormMax = 13.0;
this.fogTarget = 1.0;
FastFire2("rain", "Alpha", "255", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 7);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 0.9, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 0.92, 100); //Extra wind
if (!this.TornadoTimerActive) sudo(1004);
}
case 15:{
this.mIntensity = 14;
this.SetFogStartQueued("50");
this.SetFogEndQueued("500");
this.StartFogTransition();
flStormMin = 5.0;
flStormMax = 12.0;
this.fogTarget = 1.0;
FastFire2("rain", "Alpha", "255", 0.0, false);
CreateTimer(GetRandomFloat(0.1, 1.25), GetRandomWind, 7);
CustomSoundEmitter(SFXArray[107].realPath, 65, false, 1, 1.0, 100); //Rain, wind, increased volume
CustomSoundEmitter(SFXArray[109].realPath, 65, false, 1, 1.0, 100); //Extra wind
if (!this.TornadoTimerActive) sudo(1004);
}
default:{
}
}
CreateTimer(GetRandomFloat(flStormMin, flStormMax), GetRandomWeather);
}
void Reset(){
AssLogger(LOGLVL_DEBUG, "[Fartsy's Enhancer] WeatherManager has been reset!");
this.fogDensity = 0.50;
this.Dissipate();
this.tickWeather = false;
FastFire2("rain", "Alpha", "0", 0.0, false);
}
void SetFogStartQueued(const char[] fsq){
FastFire2("Weather.FogOutdoor", "SetStartDistLerpTo", fsq, 0.0, false);
}
void SetFogEndQueued(const char[] feq){
FastFire2("Weather.FogOutdoor", "SetEndDistLerpTo", feq, 0.0, false);
}
void StartFogTransition(){
FastFire2("Weather.FogOutdoor", "StartFogTransition", "", 0.0, false);
}
void TickFogDensity(){
if(this.fogDensity != this.fogTarget){
char targetDensity[24];
this.fogDensity = (this.fogDensity < this.fogTarget) ? FloatMin(this.fogDensity+=this.fogChangeRate, this.fogTarget) : FloatMax(this.fogDensity-=this.fogChangeRate, this.fogTarget);
FloatToString(this.fogDensity, targetDensity, sizeof(targetDensity));
FastFire2("Weather.FogOutdoor", "SetMaxDensity", targetDensity, 0.0, false);
}
}
void TickSiren(){
if(this.TornadoWarning){
if(!this.sirenExploded && (this.sirenPitch > 165.0)){
FastFire2("Weather.Siren", "Pitch", "50", 0.0, false);
FastFire2("Weather.Siren", "Pitch", "40", 0.1, false);
FastFire2("Weather.Siren", "Pitch", "30", 0.2, false);
FastFire2("Weather.Siren", "Pitch", "20", 0.3, false);
FastFire2("Weather.Siren", "Pitch", "10", 0.4, false);
FastFire2("Weather.Siren", "Pitch", "0", 0.5, false);
FastFire2("Weather.Siren.ExplodeParticle", "Start", "", 0.0, false);
FastFire2("Weather.Siren.ExplodeSND", "PlaySound", "", 0.0, false);
FastFire2("Weather.Siren", "StopSound", "", 5.0, false);
FastFire2("Weather.Siren.ExplodeParticle", "Stop", "", 5.0, false);
FastFire2("Weather.Siren.ExplodeParticle", "Start", "", 5.1, false);
this.sirenExploded = true;
}
if(this.sirenPitch != this.sirenPitchTarget && !this.sirenExploded){
char targetPitch[24];
this.sirenPitch = (this.sirenPitch < this.sirenPitchTarget) ? FloatMin(this.sirenPitch+=this.sirenPitchRate, this.sirenPitchTarget) : FloatMax(this.sirenPitch-=this.sirenPitchRate, this.sirenPitchTarget);
FloatToString(this.sirenPitch, targetPitch, sizeof(targetPitch));
FastFire2("Weather.Siren", "Pitch", targetPitch, 0.0, false);
PrintToServer("SirenPitch = %s", targetPitch);
}
}
}
}
WEATHERMANAGER WeatherManager;
//Ghosties
enum struct GHOSTHANDLER {
bool placeholder;
void SpawnRandom(){
switch(GetRandomInt(0,3)){
case 0:{
FastFire2("gTrain", "TeleportToPathTrack", "gPath00_0", 0.0, false);
}
case 1:{
FastFire2("gTrain", "TeleportToPathTrack", "gPath01_0", 0.0, false);
}
case 2:{
FastFire2("gTrain", "TeleportToPathTrack", "gPath02_0", 0.0, false);
}
case 3:{
FastFire2("gTrain", "TeleportToPathTrack", "gPath03_0", 0.0, false);
}
}
}
}
GHOSTHANDLER GhostHandler;
//Timers
public Action GetRandomWeather(Handle timer){
if(WeatherManager.tickWeather){
switch(GetRandomInt (0, 10)){
case 0,4,8:{
if(WeatherManager.intensity > 9) GhostHandler.SpawnRandom();
if (WeatherManager.intensity > 0 && (WeatherManager.intensity-1 > WeatherManager.mIntensity)) WeatherManager.intensity--;
}
case 1,2,3,5,6,7,9,10:{
if (WeatherManager.intensity < 15) WeatherManager.intensity++;
}
}
WeatherManager.PerformRandomWeather();
}
return Plugin_Stop;
}
public Action GetRandomWind(Handle timer, int intensity){
switch(intensity){
case 0:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 114)].realPath, 65, true, 1, 0.125, 100);
}
case 1:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 114)].realPath, 65, true, 1, 0.20, 100);
}
case 2:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 114)].realPath, 65, true, 1, 0.30, 100);
}
case 3:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 115)].realPath, 65, true, 1, 0.45, 100);
}
case 4:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 115)].realPath, 65, true, 1, 0.55, 100);
}
case 5:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 115)].realPath, 65, true, 1, 0.65, 100);
}
case 6:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 116)].realPath, 65, true, 1, 0.80, 100);
}
case 7:{
CustomSoundEmitter(SFXArray[GetRandomInt(113, 116)].realPath, 65, true, 1, 1.0, 100);
}
}
return Plugin_Stop;
}
public Action ModulateSiren(Handle timer){
if(WeatherManager.TornadoWarning && !WeatherManager.sirenExplode){
WeatherManager.sirenPitchTarget = WeatherManager.powerSurging ? GetRandomFloat(95.0, 210.0) : GetRandomFloat(85.0, 125.0);
WeatherManager.sirenPitchRate = WeatherManager.powerSurging ? GetRandomFloat(0.0525, 0.20) : GetRandomFloat(0.01, 0.125);
CreateTimer(GetRandomFloat(1.0, 3.0), ModulateSiren);
}
return Plugin_Stop;
}
public Action ResetTornado(Handle timer){
WeatherManager.canTornado = true;
WeatherManager.TornadoTimerActive = false;
return Plugin_Stop;
}
public Action RestorePower(Handle timer, int surge){
g_PowerOutage = false;
WeatherManager.powerSurging = ((surge == 1) ? true : false);
if (surge == 1){
CreateTimer(1.0, SurgePower);
}
for (int i = 0; i < sizeof(MapLighting); i++) MapLighting[i].RestorePower();
FastFire2("MapLighting.Indoor*", "TurnOn", "", 0.0, false);
FastFire2("MapLighting.Indoor*", "LightOn", "", 0.0, false);
return Plugin_Stop;
}
char LightingPatterns[][25] = {
/////Allistor/////
"sduehrjkihwerte",
"ihqopeiruhiqwer",
"sadnpiudghsfiod",
"kjahbfihkabweoi",
"djfohoaeiufgawt",
"ewrtyvghbvfczfr",
"aesrergtafdcgvz",
"aeradyjdghnyjxc",
"oihaecpnefijanle",
"oaihbewrpoijnae",
//////Jeffy///////
"gewsaadgfhgtfsr",
"kuyijyterytdfsadfvgzs",
"bvcxfgtertyaetr",
"gyukkjtyasde",
"bxcvmvbnhkgfj",
"ewrhrtmhgjf",
"bfgmghntjy",
"afsdgdsfayrwte",
"hfgjgfdiyet",
"fsdbvxfgkytestry"
};
public Action SurgePower(Handle timer){
if (WeatherManager.powerSurging){
int target = GetRandomInt(0, 12);
if (MapLighting[target].isBroken) target = GetRandomInt(0, 12);
if(!MapLighting[target].isBroken){
if (GetRandomInt(0, 7) == 5) MapLighting[target].Explode();
FastFire2(MapLighting[target].light, "SetPattern", LightingPatterns[GetRandomInt(0, 19)], 0.0, false);
FastFire2(MapLighting[target].light, "TurnOn", "", 0.0, false);
FastFire2(MapLighting[target].beam, "LightOn", "", 0.0, false);
CreateTimer(GetRandomFloat(7.5, 15.0), RestorePower, 0);
CreateTimer(GetRandomFloat(0.1, 3.0), SurgePower);
CreateTimer(GetRandomFloat(1.5, 2.0), SurgePowerFX);
}
}
return Plugin_Stop;
}
public Action SurgePowerFX(Handle timer){
for (int i = 0; i < sizeof(MapLighting); i++){
if(WeatherManager.powerSurging && !MapLighting[i].isBroken){
FastFire2(MapLighting[i].light, "SetPattern", LightingPatterns[GetRandomInt(0, 19)], 0.0, false);
FastFire2(MapLighting[i].beam, "LightOff", "", 0.0, false);
FastFire2(MapLighting[i].beam, "LightOn", "", GetRandomFloat(0.1, 0.35), false);
FastFire2(MapLighting[i].beam, "LightOff", "", GetRandomFloat(0.4, 0.75), false);
FastFire2(MapLighting[i].beam, "LightOn", "", GetRandomFloat(1.0, 1.35), false);
}
}
return Plugin_Stop;
}
public Action TornadoShaker(Handle timer){
if(WeatherManager.hasTornado){
FastFire2("tornadoshake_f1", "StartShake", "", 0.0, false);
CreateTimer(1.5, TornadoShaker);
}
return Plugin_Stop;
}

View File

@@ -0,0 +1,250 @@
//Sync client stats when they leave
public void OnClientDisconnect(int client) {
//Database Ass_Database = Get_Ass_Database();
int steamID = GetSteamAccountID(client);
if (steamID) {
iDmgHealingTotal -= EmnityManager[client].iDamage;
iDmgHealingTotal -= EmnityManager[client].iHealing;
}
if (!Ass_Database || !steamID || steamID <= 10000) return;
char query[256];
char clientName[128];
GetClientInfo(client, "name", clientName, 128);
Format(query, sizeof(query), "INSERT INTO ass_activity (name, steamid, date, seconds) VALUES ('%s', %d, CURRENT_DATE, %d) ON DUPLICATE KEY UPDATE name = '%s', seconds = seconds + VALUES(seconds);", clientName, steamID, GetClientMapTime(client), clientName);
Ass_Database.Query(Database_FastQuery, query);
}
//Check who spawned and log their class
public Action EventSpawn(Event Spawn_Event, const char[] Spawn_Name, bool Spawn_Broadcast) {
int client = GetClientOfUserId(Spawn_Event.GetInt("userid"));
if (IsValidClient(client)) {
int class = Spawn_Event.GetInt("class");
int steamID = GetSteamAccountID(client);
if (!Ass_Database || !steamID || !class) return Plugin_Handled;
char strClass[32];
char query[256];
strClass = ClassDefinitions[class - 1];
Format(query, sizeof(query), "UPDATE ass_activity SET class = '%s' WHERE steamid = %i;", strClass, steamID);
Ass_Database.Query(Database_FastQuery, query);
}
return Plugin_Handled;
}
//Log Damage!
public void Event_PlayerHurt(Handle event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(GetEventInt(event, "userid"));
int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
int damage = GetEventInt(event, "damageamount");
if (IsValidClient(attacker) && attacker != client) {
int steamID = GetSteamAccountID(attacker);
if (!Ass_Database || !steamID) return;
PrintToServer("Adding Damage %i dealt by %N, with index %i", damage, attacker, attacker);
int healer = GetHealerOfClient(attacker);
if (healer != -1){
EmnityManager[healer].iDamage += RoundToFloor(damage * 0.35);
iDmgHealingTotal += RoundToFloor(damage * 0.35);
}
EmnityManager[attacker].iDamage += damage;
iDmgHealingTotal += damage;
char query[256];
Format(query, sizeof(query), "UPDATE ass_activity SET damagedealt = damagedealt + %i, damagedealtsession = damagedealtsession + %i WHERE steamid = %i;", damage, damage, steamID);
Ass_Database.Query(Database_FastQuery, query);
}
}
//Check who died by what and announce it to chat.
public Action EventDeath(Event Spawn_Event, const char[] Spawn_Name, bool Spawn_Broadcast) {
int client = GetClientOfUserId(Spawn_Event.GetInt("userid"));
int attacker = GetClientOfUserId(Spawn_Event.GetInt("attacker"));
int steamid = GetSteamAccountID(client);
if(steamid){
iDmgHealingTotal -= EmnityManager[client].iDamage;
iDmgHealingTotal -= EmnityManager[client].iHealing;
EmnityManager[client].iBossDamage = 0;
EmnityManager[client].iDamage = 0;
EmnityManager[client].iHealing = 0;
}
char name[64];
char weapon[32];
Format(name, sizeof(name), attacker == 0 ? "[INTENTIONAL GAME DESIGN]" : "%N", IsValidClient(attacker) ? client : attacker);
Spawn_Event.GetString("weapon", weapon, sizeof(weapon));
if (0 < client <= MaxClients && IsClientInGame(client)) {
int damagebits = Spawn_Event.GetInt("damagebits");
if (IsValidClient(attacker) && core.sacrificedByClient) SacrificeClient(client, attacker, core.bombReset);
if (!attacker) {
switch (damagebits) {
case 1: { //CRUSH
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was crushed by a {red}FALLING ROCK FROM OUTER SPACE{white}!", client);
weapon = "Meteor to the Face";
}
case 8: { //BURN
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was {red}MELTED{white}.", client);
weapon = "Melted by Sharts or Ass Gas";
}
case 16: { //FREEZE
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was flattened out by a {red}TRAIN{white}!", client);
weapon = "Attempted Train Robbery";
}
case 32: { //FALL
if (WeatherManager.hasTornado) {
switch (GetClientTeam(client)) {
case 2: {
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was {red}%s{white}!", client, DeathMessage[GetRandomInt(0, 5)]);
weapon = "Yeeted into Orbit via Tornado";
}
case 3: {
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was {red}%s{white}! ({limegreen}+1 pt{white})", client, DeathMessage[GetRandomInt(0, 5)]);
core.sacPoints++;
CustomSoundEmitter(SFXArray[GetRandomInt(11, 26)].realPath, 65, false, 0, 1.0, 100);
}
}
} else {
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N fell to a {red}CLUMSY PAINFUL DEATH{white}!", client);
weapon = "Tripped on a LEGO";
}
}
case 64: { //BLAST
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N went {red} KABOOM{white}!", client);
weapon = "Gone Kaboom!";
}
case 128: { //CLUB
if (core.canHindenburg) {
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N is {red}CRASHING THE HINDENBURG{white}!!!", client);
weapon = "Crashing the Hindenburg";
}
}
case 256: { //SHOCK
if(core.CodeEntry > 0){
CPrintToChatAll("{darkviolet}[{red}EXTERMINATUS{darkviolet}] {white}Client %N has humliated themselves with an {red}incorrect {white}key entry!", client);
weapon = "Failed FB Code Entry";
int i = GetRandomInt(1, 16);
switch (i) {
case 1, 3, 10: {
FastFire2("BG.Meteorites1", "ForceSpawn", "", 0.0, false);
CPrintToChatAll("{darkviolet}[{red}WARN{darkviolet}] {white}Uh oh, a {red}METEOR{white}has been spotted coming towards Dovah's Ass!!!");
FastFire2("bg.meteorite1", "StartForward", "", 0.1, false);
}
case 2, 5, 16: {
CreateTimer(0.5, TimedOperator, 71);
FastFire2("FB.TankTrain", "TeleportToPathTrack", "Tank01", 0.0, false);
FastFire2("FB.TankTrain", "StartForward", "", 0.25, false);
FastFire2("FB.TankTrain", "SetSpeed", "1", 0.35, false);
FastFire2("FB.Tank", "Enable", "", 1.0, false);
}
case 4, 8, 14: {
CustomSoundEmitter("ambient/alarms/train_horn_distant1.wav", 65, false, 0, 1.0, 100);
FastFire2("TrainSND","PlaySound", "", 0.0, false);
FastFire2("TrainDamage", "Enable", "", 0.0, false);
FastFire2("Train01", "Enable", "", 0.0, false);
CPrintToChatAll("{darkviolet}[{red}WARN{darkviolet}] {orange}KISSONE'S TRAIN{white}is {red}INCOMING{white}. Look out!");
FastFire2("TrainTrain", "TeleportToPathTrack", "TrainTrack01", 0.0, false);
FastFire2("TrainTrain", "StartForward", "", 0.1, false);
}
case 6, 9: {
WeatherManager.canTornado = true;
CreateTimer(1.0, TimedOperator, 41);
}
case 7, 13: {
CPrintToChatAll("{darkviolet}[{red}WARN{darkviolet}] {white}Uh oh, it appears to have started raining a {red}METEOR SHOWER{white}!!!");
core.canSENTMeteors = true;
CreateTimer(1.0, SENTMeteorTimer);
CreateTimer(30.0, TimedOperator, 12);
}
case 11: {
FastFire2("FB.Slice", "Enable", "", 0.0, false);
CustomSoundEmitter("ambient/sawblade_impact1.wav", 65, false, 0, 1.0, 100);
FastFire2("FB.Slice", "Disable", "", 1.0, false);
}
}
}
}
case 512: { //SONIC
CPrintToChatAll("{darkviolet}[{red}EXTERMINATUS{darkviolet}] {white}Client %N has sacrificed themselves with a {forestgreen}correct {white}key entry! Prepare your anus!", client);
sudo(1006);
weapon = "Correct FB Code Entry";
}
case 1024: { //ENERGYBEAM
char EnergyDeath[32];
Format(EnergyDeath, sizeof(EnergyDeath), (core.crusader ? "THE CRUSADER" : core.waveFlags == 1 ? "ONSLAUGHTER" : "LIGHTNING"));
weapon = (core.crusader ? "Crusader" : core.waveFlags == 1 ? "Onslaughter" : "Lightning");
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N has been %s by {red}%s{white}!", client, (core.crusader ? "nuked" : core.waveFlags == 1 ? "deleted" : "struck"), EnergyDeath);
}
case 16384: { //DROWN
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N {red}DROWNED{white}.", client);
weapon = "Darwin Award for Drowning";
}
case 32768: { //PARALYZE
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N has been crushed by a {darkviolet}MYSTERIOUS BLUE BALL{white}!", client);
weapon = "Mysterious Blue Ball";
}
case 65536: { //NERVEGAS
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N has been {red}SLICED TO RIBBONS{white}!", client);
weapon = "FB Code Entry Failed";
}
case 131072: { //POISON
CPrintToChat(client, "{darkviolet}[{red}CORE{darkviolet}] {white}Please don't sit {red}IDLE {white}in the FC Tavern.");
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was killed for standing in the Tavern instead of helping their team!", client);
weapon = "Idle in FC Tavern..?";
}
case 262144: { //RADIATION
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was blown away by a {red}NUCLEAR EXPLOSION{white}!", client);
weapon = "Nuclear Explosion";
}
case 524288: { //DROWNRECOVER
CPrintToChatAll("{darkviolet}[{red}CORE{darkviolet}] {white}Client %N experienced {red}TACO BELL{white}!", client);
weapon = "Taco Bell";
}
case 1048576: { //ACID
CPrintToChatAll( isGoobbue ? "{darkviolet}[{red}CORE{darkviolet}] {white}Client %N has been crushed by a {forestgreen}FALLING GOOBBUE FROM OUTER SPACE{white}!" : "{darkviolet}[{red}CORE{darkviolet}] {white}Client %N was deleted by {orange}AN AREA OF EFFECT{white}!", client);
weapon = isGoobbue ? "Falling Goobbue" : "AREA_EFFECT";
}
}
}
//Log if a player killed someone or was killed by a robot
if (attacker != client) {
if (!Ass_Database) return Plugin_Handled;
char query[256];
int steamID = (IsValidClient(attacker) ? GetSteamAccountID(attacker) : GetSteamAccountID(client));
Format(query, sizeof(query), IsValidClient(attacker) && !StrEqual(weapon, "world") ? "UPDATE ass_activity SET kills = kills +1, killssession = killssession + 1, lastkilledname = '%s', lastweaponused = '%s' WHERE steamid = %i;" : !StrEqual(weapon, "world") && !IsValidClient(attacker) ? "UPDATE ass_activity SET deaths = deaths + 1, deathssession = deathssession + 1, killedbyname = '%s', killedbyweapon = '%s' WHERE steamid = %i;" : "RETURN", name, weapon, steamID);
if (StrEqual(query, "RETURN")) return Plugin_Handled;
Ass_Database.Query(Database_FastQuery, query);
}
}
return Plugin_Handled;
}
//When we win
public Action EventWaveComplete(Event Spawn_Event, const char[] Spawn_Name, bool Spawn_Broadcast) {
sudo(300);
CPrintToChatAll("{darkviolet}[{forestgreen}CORE{darkviolet}] {white}You've defeated the wave!");
return Plugin_Handled;
}
//Announce when we are in danger.
public Action EventWarning(Event Spawn_Event,
const char[] Spawn_Name, bool Spawn_Broadcast) {
if (core.doFailsafe) {
core.failsafeCount++;
CPrintToChatAll("%s Counter: %i", failsafe[GetRandomInt(0, sizeof(failsafe) - 1)], core.failsafeCount);
EmitSoundToAll(SFXArray[55].realPath);
PerformWaveFailsafe(GetRandomInt(0,1));
core.doFailsafe = false;
} else CPrintToChatAll("{darkviolet}[{red}WARN{darkviolet}] {darkred}PROFESSOR'S ASS IS ABOUT TO BE DEPLOYED!!!");
return Plugin_Handled;
}
//When the wave fails
public Action EventWaveFailed(Event Spawn_Event, const char[] Spawn_Name, bool Spawn_Broadcast) {
CPrintToChatAll("{darkviolet}[{forestgreen}CORE{darkviolet}] {white}Wave {red}failed {white}successfully!");
sudo(300);
return Plugin_Handled;
}
//Sacrifice target and grant bonus points
public Action SacrificeClient(int client, int attacker, bool wasBombReset) {
if (attacker <= MaxClients && IsClientInGame(attacker)) {
core.bombReset = false;
core.sacPoints += wasBombReset ? 5 : 1;
core.sacrificedByClient = false;
int steamID = GetSteamAccountID(attacker);
if (!Ass_Database || !steamID) return Plugin_Handled;
char query[256];
CPrintToChatAll(wasBombReset ? "{darkviolet}[{forestgreen}CORE{darkviolet}] {white}Client {red}%N {white}has reset the ass! ({limegreen}+5 pts{white})" : "{darkviolet}[{forestgreen}CORE{darkviolet}] {white}Client {red}%N {white}has sacrificed {blue}%N {white}for the ass! ({limegreen}+1 pt{white})", attacker, client);
Format(query, sizeof(query), wasBombReset ? "UPDATE ass_activity SET bombsreset = bombsreset + 1, bombsresetsession = bombsresetsession + 1 WHERE steamid = %i;" : "UPDATE ass_activity SET sacrifices = sacrifices + 1, sacrificessession = sacrificessession + 1 WHERE steamid = %i;", steamID);
Ass_Database.Query(Database_FastQuery, query);
}
return Plugin_Handled;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
//Fartsy's FastFire2
int ff2Ref;
//Inject entity IO logic
public void OnMapStart() {
InjectFastFire2();
}
void InjectFastFire2(){
int ff2 = FindEntityByTargetname("FastFire2", "info_target");
AssLogger(LOGLVL_INFO, "Injecting FastFire2!");
if (!IsValidEntity(ff2)){
ff2 = CreateEntityByName("info_target");
if (!IsValidEdict(ff2)) SetFailState("Could not inject FastFire2, aborting!!!");
DispatchSpawn(ff2);
DispatchKeyValue(ff2, "targetname", "FastFire2");
ActivateEntity(ff2);
AssLogger(LOGLVL_INFO, "Injected info_target FastFire2 to map!")
}
ff2Ref = EntIndexToEntRef(ff2);
OnFastFire2Ready();
}
//Execute inputs - EXPERT MODE
public void FastFire2(const char[] target, const char[] input, const char[] param, const float delay, bool isLegacy) {
int ff2 = EntRefToEntIndex(ff2Ref);
char FireStr[128];
FormatEx(FireStr, sizeof(FireStr), (isLegacy ? target : "OnUser1 %s,%s,%s,%f,1"), target, input, param, delay);
SetVariantString(FireStr);
AcceptEntityInput(ff2, "AddOutput");
AcceptEntityInput(ff2, "FireUser1");
}