halloween: update
This commit is contained in:
parent
f5e17c4e9f
commit
38f6bf8bea
BIN
season_halloween/content/sound/unloze/season/witch.wav
Normal file
BIN
season_halloween/content/sound/unloze/season/witch.wav
Normal file
Binary file not shown.
@ -1,11 +1,10 @@
|
||||
#pragma semicolon 1
|
||||
|
||||
#include <sourcemod>
|
||||
#include <sdkhooks>
|
||||
#include <sdktools>
|
||||
#include <multicolors>
|
||||
#include <zombiereloaded>
|
||||
|
||||
#pragma semicolon 1
|
||||
#pragma newdecls required
|
||||
|
||||
/* CONVARS */
|
||||
@ -29,7 +28,6 @@ bool g_bPreAdminChecked[MAXPLAYERS+1];
|
||||
bool g_bResponseFailed[MAXPLAYERS+1];
|
||||
bool g_bResponsePassed[MAXPLAYERS+1];
|
||||
|
||||
|
||||
/* INTEGERS */
|
||||
int g_iCollected[MAXPLAYERS+1];
|
||||
int g_iCounter = 0;
|
||||
@ -42,7 +40,7 @@ public Plugin myinfo =
|
||||
name = "UNLOZE Season Event (Halloween)",
|
||||
author = "Neon",
|
||||
description = "UNLOZE Season Event (Halloween)",
|
||||
version = "2.0",
|
||||
version = "2.1",
|
||||
url = "https://steamcommunity.com/id/n3ontm"
|
||||
};
|
||||
|
||||
@ -52,15 +50,15 @@ public Plugin myinfo =
|
||||
public void OnPluginStart()
|
||||
{
|
||||
g_hCVar_CollectablesEnabled = CreateConVar("sm_unloze_season_collectables_enabled", "1", "Spawn Collectables.", 0, true, 0.0, true, 1.0);
|
||||
g_hCVar_RandomIntervalMin = CreateConVar("sm_unloze_season_random_interval_min", "60", "Minimum Interval between spawning Collectables.", 0, true, 0.0);
|
||||
g_hCVar_RandomIntervalMax = CreateConVar("sm_unloze_season_random_interval_max", "120", "Maximum Interval between spawning Collectables.", 0, true, 0.0);
|
||||
g_hCVar_InfectionEffectEnabled = CreateConVar("sm_unloze_season_infection_effect_enabled", "1", "Spawn Props on Infection.", 0, true, 0.0, true, 1.0);
|
||||
g_hCVar_MilestoneInfection = CreateConVar("sm_unloze_season_milestone_infection", "25", "Amount of Collectables you need to unlock the Infection Effect.", 0, true, 0.0);
|
||||
g_hCVar_MilestoneGrenade = CreateConVar("sm_unloze_season_milestone_grenade", "75", "Amount of Collectables you need to unlock the Grenade Skin.", 0, true, 0.0);
|
||||
g_hCVar_MilestoneSkin = CreateConVar("sm_unloze_season_milestone_skin", "150", "Amount of Collectables you need to unlock the Skin(s).", 0, true, 0.0);
|
||||
g_hCVar_HighscoreDisplay = CreateConVar("sm_unloze_season_highscore_display", "5", "Amount of Players to display via sm_highscore", 0, true, 0.0);
|
||||
g_hCVar_PlayerRequirement = CreateConVar("sm_unloze_season_player_requirement", "10", "Amount of Players needed to spawn Collectables.", 0, true, 0.0);
|
||||
g_hCVar_EntityLimit = CreateConVar("sm_unloze_season_entity_limit", "2000", "Entity Safety Limit.", 0, true, 0.0);
|
||||
g_hCVar_RandomIntervalMin = CreateConVar("sm_unloze_season_random_interval_min", "60", "Minimum Interval between spawning Collectables.", 0, true, 0.0);
|
||||
g_hCVar_RandomIntervalMax = CreateConVar("sm_unloze_season_random_interval_max", "120", "Maximum Interval between spawning Collectables.", 0, true, 0.0);
|
||||
g_hCVar_InfectionEffectEnabled = CreateConVar("sm_unloze_season_infection_effect_enabled", "1", "Spawn Props on Infection.", 0, true, 0.0, true, 1.0);
|
||||
g_hCVar_MilestoneInfection = CreateConVar("sm_unloze_season_milestone_infection", "25", "Amount of Collectables you need to unlock the Infection Effect.", 0, true, 0.0);
|
||||
g_hCVar_MilestoneGrenade = CreateConVar("sm_unloze_season_milestone_grenade", "75", "Amount of Collectables you need to unlock the Grenade Skin.", 0, true, 0.0);
|
||||
g_hCVar_MilestoneSkin = CreateConVar("sm_unloze_season_milestone_skin", "150", "Amount of Collectables you need to unlock the Skin(s).", 0, true, 0.0);
|
||||
g_hCVar_HighscoreDisplay = CreateConVar("sm_unloze_season_highscore_display", "5", "Amount of Players to display via sm_highscore", 0, true, 0.0);
|
||||
g_hCVar_PlayerRequirement = CreateConVar("sm_unloze_season_player_requirement", "10", "Amount of Players needed to spawn Collectables.", 0, true, 0.0);
|
||||
g_hCVar_EntityLimit = CreateConVar("sm_unloze_season_entity_limit", "2000", "Entity Safety Limit.", 0, true, 0.0);
|
||||
|
||||
HookEvent("round_start", OnRoundStart, EventHookMode_Post);
|
||||
|
||||
@ -70,13 +68,6 @@ public void OnPluginStart()
|
||||
RegConsoleCmd("sm_highscore", Command_HighScore, "Shows the Pumpkin HighScore");
|
||||
|
||||
AutoExecConfig();
|
||||
|
||||
char sError[256];
|
||||
if (SQL_CheckConfig("season"))
|
||||
g_hDatabase = SQL_Connect("season", true, sError, sizeof(sError));
|
||||
|
||||
if (g_hDatabase == null)
|
||||
LogError("Could not connect to database: %s", sError);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -212,13 +203,52 @@ public void OnMapStart()
|
||||
AddFileToDownloadsTable("materials/models/unloze/cute_skeleton/skull3.vtf");
|
||||
PrecacheModel("models/unloze/cute_skeleton.mdl");
|
||||
|
||||
AddFileToDownloadsTable("sound/unl1/season/witch.wav");
|
||||
PrecacheSound("sound/unl1/season/witch.wav");
|
||||
AddFileToDownloadsTable("sound/unloze/season/witch.wav");
|
||||
PrecacheSound("unloze/season/witch.wav");
|
||||
|
||||
float fRandomInterval = GetRandomFloat(GetConVarFloat(g_hCVar_RandomIntervalMin), GetConVarFloat(g_hCVar_RandomIntervalMax));
|
||||
CreateTimer(fRandomInterval, SpawnCollectable, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnConfigsExecuted()
|
||||
{
|
||||
Database.Connect(SQL_OnDatabaseConnect, "season");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void SQL_OnDatabaseConnect(Database db, const char[] error, any data)
|
||||
{
|
||||
if(!db || strlen(error))
|
||||
{
|
||||
LogError("Database error: %s", error);
|
||||
return;
|
||||
}
|
||||
|
||||
g_hDatabase = db;
|
||||
|
||||
char sQuery[256];
|
||||
Format(sQuery, sizeof(sQuery), "CREATE TABLE IF NOT EXISTS halloween_table (`steam_auth` varchar(64), `name` int varchar(256), `collected` int(16), PRIMARY KEY (`steam_auth`))");
|
||||
|
||||
g_hDatabase.Query(SQL_OnTableCreated, sQuery, _, DBPrio_High);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void SQL_OnTableCreated(Database db, DBResultSet results, const char[] error, any data)
|
||||
{
|
||||
if(!db || strlen(error))
|
||||
{
|
||||
LogError("Database error: %s", error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -242,18 +272,6 @@ public Action OnRebuildAdminCachePost(Handle hTimer)
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnClientConnected(int client)
|
||||
{
|
||||
g_bPreAdminChecked[client] = false;
|
||||
g_bResponseFailed[client] = false;
|
||||
g_bResponsePassed[client] = false;
|
||||
|
||||
g_iCollected[client] = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -277,30 +295,35 @@ public void OnClientAuthorized(int client, const char[] sSteamID32)
|
||||
char sSteamID[32];
|
||||
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
||||
|
||||
char sQuery[255];
|
||||
char sQuery[256];
|
||||
Format(sQuery, sizeof(sQuery), "SELECT collected FROM halloween_table WHERE steam_auth = '%s'", sSteamID);
|
||||
SQL_TQuery(g_hDatabase, TQueryCBConnect, sQuery, GetClientUserId(client));
|
||||
g_hDatabase.Query(SQL_OnQueryCompletedFetch, sQuery, GetClientSerial(client));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void TQueryCBConnect(Handle owner, Handle rs, const char[] error, any data)
|
||||
public void SQL_OnQueryCompletedFetch(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||
{
|
||||
int client = 0;
|
||||
|
||||
if ((client = GetClientOfUserId(data)) == 0)
|
||||
int client;
|
||||
if ((client = GetClientFromSerial(iSerial)) == 0)
|
||||
return;
|
||||
|
||||
if (SQL_GetRowCount(rs) > 0)
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
int iField;
|
||||
SQL_FetchRow(rs);
|
||||
SQL_FieldNameToNum(rs, "collected", iField);
|
||||
g_iCollected[client] = SQL_FetchInt(rs, iField);
|
||||
LogError("Query error: %s", error);
|
||||
return;
|
||||
}
|
||||
|
||||
delete rs;
|
||||
if (results.RowCount && results.FetchRow())
|
||||
{
|
||||
int iFieldNum;
|
||||
|
||||
results.FieldNameToNum("collected", iFieldNum);
|
||||
g_iCollected[client] = results.FetchInt(iFieldNum);
|
||||
}
|
||||
else
|
||||
g_iCollected[client] = 0;
|
||||
|
||||
g_bResponsePassed[client] = true;
|
||||
if (g_bPreAdminChecked[client])
|
||||
@ -358,39 +381,44 @@ public Action Command_HighScore(int client, int args)
|
||||
{
|
||||
char sQuery[255];
|
||||
Format(sQuery, sizeof(sQuery), "SELECT * from halloween_table order by collected desc limit %d", g_hCVar_HighscoreDisplay.IntValue);
|
||||
SQL_TQuery(g_hDatabase, TQueryCBHighscore, sQuery, GetClientUserId(client));
|
||||
g_hDatabase.Query(SQL_OnQueryCompletedCheck, sQuery, GetClientSerial(client));
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void TQueryCBHighscore(Handle owner, Handle rs, const char[] error, any data)
|
||||
public void SQL_OnQueryCompletedHighscore(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||
{
|
||||
int client = 0;
|
||||
|
||||
if ((client = GetClientOfUserId(data)) == 0)
|
||||
int client;
|
||||
if ((client = GetClientFromSerial(iSerial)) == 0)
|
||||
return;
|
||||
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
LogError("Query error: %s", error);
|
||||
return;
|
||||
}
|
||||
|
||||
char sName[MAX_NAME_LENGTH];
|
||||
char sBuffer[2048] = "{darkorange}[UNLOZE HALLOWEEN] {white}TOP COLLECTORS:\n";
|
||||
char sTempBuffer[1024] = "";
|
||||
|
||||
for(int i = 1; i <= g_hCVar_HighscoreDisplay.IntValue; i++)
|
||||
{
|
||||
int iField;
|
||||
SQL_FetchRow(rs);
|
||||
int iFieldNum;
|
||||
if (!results.FetchRow())
|
||||
break;
|
||||
|
||||
SQL_FieldNameToNum(rs, "name", iField);
|
||||
SQL_FetchString(rs, iField, sName, sizeof(sName));
|
||||
results.FieldNameToNum("name", iFieldNum);
|
||||
results.FetchString(iFieldNum, sName, sizeof(sName));
|
||||
|
||||
SQL_FieldNameToNum(rs, "collected", iField);
|
||||
int iCollected = SQL_FetchInt(rs, iField);
|
||||
results.FieldNameToNum("collected", iFieldNum);
|
||||
int iCollected = results.FetchInt(iFieldNum);
|
||||
|
||||
Format(sTempBuffer, sizeof(sTempBuffer), "{green}%d: %s - {red}%d \n", i, sName, iCollected);
|
||||
StrCat(sBuffer, sizeof(sBuffer), sTempBuffer);
|
||||
}
|
||||
delete rs;
|
||||
|
||||
CPrintToChat(client, sBuffer);
|
||||
}
|
||||
@ -403,34 +431,37 @@ public Action Command_Collected(int client, int args)
|
||||
char sSteamID[32];
|
||||
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
||||
|
||||
char sQuery[255];
|
||||
char sQuery[256];
|
||||
Format(sQuery, sizeof(sQuery), "SELECT collected FROM halloween_table WHERE steam_auth = '%s'", sSteamID);
|
||||
SQL_TQuery(g_hDatabase, TQueryCBCollected, sQuery, GetClientUserId(client));
|
||||
g_hDatabase.Query(SQL_OnQueryCompletedCheck, sQuery, GetClientSerial(client));
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void TQueryCBCollected(Handle owner, Handle rs, const char[] error, any data)
|
||||
public void SQL_OnQueryCompletedCheck(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||
{
|
||||
int client = 0;
|
||||
|
||||
if ((client = GetClientOfUserId(data)) == 0)
|
||||
int client;
|
||||
if ((client = GetClientFromSerial(iSerial)) == 0)
|
||||
return;
|
||||
|
||||
if (SQL_GetRowCount(rs) > 0)
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
int iField;
|
||||
SQL_FetchRow(rs);
|
||||
SQL_FieldNameToNum(rs, "collected", iField);
|
||||
g_iCollected[client] = SQL_FetchInt(rs, iField);
|
||||
LogError("Query error: %s", error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (results.RowCount && results.FetchRow())
|
||||
{
|
||||
int iFieldNum;
|
||||
|
||||
results.FieldNameToNum("collected", iFieldNum);
|
||||
g_iCollected[client] = results.FetchInt(iFieldNum);
|
||||
}
|
||||
else
|
||||
g_iCollected[client] = 0;
|
||||
|
||||
delete rs;
|
||||
|
||||
CPrintToChat(client, "{darkorange}[UNLOZE HALLOWEEN] {white}You have collected {green}%d {white}pumpkins so far.", g_iCollected[client]);
|
||||
|
||||
if ((g_iCollected[client] > g_hCVar_MilestoneInfection.IntValue) && (g_iCollected[client] > g_hCVar_MilestoneSkin.IntValue))
|
||||
@ -466,9 +497,9 @@ public Action SpawnCollectable(Handle timer)
|
||||
|
||||
// Rotating
|
||||
int iRotating = CreateEntityAtOrigin("func_rotating", fOrigin);
|
||||
DispatchKeyFormat(iRotating, "targetname", "season_rotating_%d", g_iCounter);
|
||||
DispatchKeyFormat(iRotating, "maxspeed", "20");
|
||||
DispatchKeyFormat(iRotating, "spawnflags", "65");
|
||||
DispatchKeyFormat(iRotating, "targetname", "season_rotating_%d", g_iCounter);
|
||||
DispatchKeyFormat(iRotating, "maxspeed", "20");
|
||||
DispatchKeyFormat(iRotating, "spawnflags", "65");
|
||||
SpawnAndActivate(iRotating);
|
||||
|
||||
// make the trigger work.
|
||||
@ -478,9 +509,9 @@ public Action SpawnCollectable(Handle timer)
|
||||
|
||||
// Model
|
||||
int iModel = CreateEntityAtOrigin("prop_dynamic_override", fOrigin);
|
||||
DispatchKeyFormat(iModel, "targetname", "season_prop_%d", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/models_kit/hallo_pumpkin_l.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "1.0");
|
||||
DispatchKeyFormat(iModel, "targetname", "season_prop_%d", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/models_kit/hallo_pumpkin_l.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "1.0");
|
||||
DispatchKeyFormat(iModel, "disablebonefollowers", "1");
|
||||
SpawnAndActivate(iModel);
|
||||
ParentToEntity(iModel, iRotating);
|
||||
@ -498,18 +529,18 @@ public Action SpawnCollectable(Handle timer)
|
||||
fTempOrigin[1] = fOrigin[1];
|
||||
fTempOrigin[2] = fOrigin[2] - 10.0;
|
||||
int iParticle = CreateEntityAtOrigin("info_particle_system", fTempOrigin);
|
||||
DispatchKeyFormat(iParticle, "targetname", "season_particle_%d", g_iCounter);
|
||||
DispatchKeyFormat(iParticle, "effect_name", "achieved");
|
||||
DispatchKeyFormat(iParticle, "targetname", "season_particle_%d", g_iCounter);
|
||||
DispatchKeyFormat(iParticle, "effect_name", "achieved");
|
||||
SpawnAndActivate(iParticle);
|
||||
ParentToEntity(iParticle, iRotating);
|
||||
|
||||
|
||||
// Trigger
|
||||
int iTrigger = CreateEntityAtOrigin("trigger_multiple", fOrigin);
|
||||
DispatchKeyFormat(iTrigger, "targetname", "season_trigger_%d", g_iCounter);
|
||||
DispatchKeyFormat(iTrigger, "spawnflags", "1");
|
||||
DispatchKeyFormat(iTrigger, "startdisabled", "1");
|
||||
DispatchKeyFormat(iTrigger, "OnUser1", "season_hitbox_%d,FireUser2,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iTrigger, "targetname", "season_trigger_%d", g_iCounter);
|
||||
DispatchKeyFormat(iTrigger, "spawnflags", "1");
|
||||
DispatchKeyFormat(iTrigger, "startdisabled", "1");
|
||||
DispatchKeyFormat(iTrigger, "OnUser1", "season_hitbox_%d,FireUser2,,0,1", g_iCounter);
|
||||
SpawnAndActivate(iTrigger);
|
||||
ParentToEntity(iTrigger, iRotating);
|
||||
|
||||
@ -522,39 +553,39 @@ public Action SpawnCollectable(Handle timer)
|
||||
|
||||
// Ambient
|
||||
int iSound = CreateEntityAtOrigin("ambient_generic", fOrigin);
|
||||
DispatchKeyFormat(iSound, "targetname", "season_sound_%d", g_iCounter);
|
||||
DispatchKeyFormat(iSound, "spawnflags", "49");
|
||||
DispatchKeyFormat(iSound, "radius", "2000");
|
||||
DispatchKeyFormat(iSound, "message", "unl1/season/witch.wav");
|
||||
DispatchKeyFormat(iSound, "volume", "10");
|
||||
DispatchKeyFormat(iSound, "health", "10");
|
||||
DispatchKeyFormat(iSound, "pitch", "100");
|
||||
DispatchKeyFormat(iSound, "pitchstart", "100");
|
||||
DispatchKeyFormat(iSound, "targetname", "season_sound_%d", g_iCounter);
|
||||
DispatchKeyFormat(iSound, "spawnflags", "49");
|
||||
DispatchKeyFormat(iSound, "radius", "2000");
|
||||
DispatchKeyFormat(iSound, "message", "unl1/season/witch.wav");
|
||||
DispatchKeyFormat(iSound, "volume", "10");
|
||||
DispatchKeyFormat(iSound, "health", "10");
|
||||
DispatchKeyFormat(iSound, "pitch", "100");
|
||||
DispatchKeyFormat(iSound, "pitchstart", "100");
|
||||
SpawnAndActivate(iSound);
|
||||
ParentToEntity(iSound, iRotating);
|
||||
|
||||
|
||||
// Hitbox
|
||||
int iHitbox = CreateEntityAtOrigin("func_physbox_multiplayer", fOrigin);
|
||||
DispatchKeyFormat(iHitbox, "targetname", "season_hitbox_%d", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "model", "models/models_kit/hallo_pumpkin_l.mdl");
|
||||
DispatchKeyFormat(iHitbox, "modelscale", "1.0");
|
||||
DispatchKeyFormat(iHitbox, "disableshadows", "1");
|
||||
DispatchKeyFormat(iHitbox, "disablereceiveshadows", "1");
|
||||
DispatchKeyFormat(iHitbox, "DisableBoneFollowers", "1");
|
||||
DispatchKeyFormat(iHitbox, "rendermode", "10");
|
||||
DispatchKeyFormat(iHitbox, "PerformanceMode", "1");
|
||||
DispatchKeyFormat(iHitbox, "material", "3");
|
||||
DispatchKeyFormat(iHitbox, "health", "200");
|
||||
DispatchKeyFormat(iHitbox, "physdamagescale", "1.0");
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_rotating_%d,KillHierarchy,,2.5,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_particle_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,PlaySound,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,Kill,,2.4,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser1", "season_rotating_%d,KillHierarchy,,59.0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser1", "season_sound_%d,Kill,,59.0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser2", "season_rotating_%d,KillHierarchy,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser2", "season_sound_%d,Kill,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "targetname", "season_hitbox_%d", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "model", "models/models_kit/hallo_pumpkin_l.mdl");
|
||||
DispatchKeyFormat(iHitbox, "modelscale", "1.0");
|
||||
DispatchKeyFormat(iHitbox, "disableshadows", "1");
|
||||
DispatchKeyFormat(iHitbox, "disablereceiveshadows", "1");
|
||||
DispatchKeyFormat(iHitbox, "DisableBoneFollowers", "1");
|
||||
DispatchKeyFormat(iHitbox, "rendermode", "10");
|
||||
DispatchKeyFormat(iHitbox, "PerformanceMode", "1");
|
||||
DispatchKeyFormat(iHitbox, "material", "3");
|
||||
DispatchKeyFormat(iHitbox, "health", "200");
|
||||
DispatchKeyFormat(iHitbox, "physdamagescale", "1.0");
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_rotating_%d,KillHierarchy,,2.5,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_particle_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,PlaySound,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnBreak", "season_sound_%d,Kill,,2.4,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser1", "season_rotating_%d,KillHierarchy,,59.0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser1", "season_sound_%d,Kill,,59.0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser2", "season_rotating_%d,KillHierarchy,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iHitbox, "OnUser2", "season_sound_%d,Kill,,0,1", g_iCounter);
|
||||
SpawnAndActivate(iHitbox);
|
||||
ParentToEntity(iHitbox, iRotating);
|
||||
|
||||
@ -627,9 +658,9 @@ public void HookCallback(const char[] output, int caller, int activator, float d
|
||||
char sName[MAX_NAME_LENGTH];
|
||||
GetClientName(client, sName, sizeof(sName));
|
||||
|
||||
char sQuery[255];
|
||||
char sQuery[256];
|
||||
Format(sQuery, sizeof(sQuery), "INSERT INTO halloween_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sName);
|
||||
SQL_FastQuery(g_hDatabase, sQuery);
|
||||
g_hDatabase.Query(SQL_OnQueryCompletedUpdate, sQuery);
|
||||
|
||||
g_iCollected[client] += 1;
|
||||
CheckAndAddFlag(client);
|
||||
@ -647,27 +678,42 @@ public void HookCallback(const char[] output, int caller, int activator, float d
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void SQL_OnQueryCompletedUpdate(Database db, DBResultSet results, const char[] error, any data)
|
||||
{
|
||||
if (!db || strlen(error))
|
||||
{
|
||||
LogError("Query error: %s", error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
||||
{
|
||||
if (!g_hCVar_InfectionEffectEnabled.BoolValue)
|
||||
return;
|
||||
|
||||
if (!IsValidClient(attacker))
|
||||
return;
|
||||
|
||||
if (g_hCVar_InfectionEffectEnabled.BoolValue && ((g_iCollected[client] >= g_hCVar_MilestoneInfection.IntValue) || g_iCollected[attacker] >= g_hCVar_MilestoneInfection.IntValue))
|
||||
if (g_iCollected[client] >= g_hCVar_MilestoneInfection.IntValue || g_iCollected[attacker] >= g_hCVar_MilestoneInfection.IntValue)
|
||||
{
|
||||
float fInfectionOrigin[3];
|
||||
GetClientAbsOrigin(client, fInfectionOrigin);
|
||||
|
||||
// Rotating
|
||||
int iRotating = CreateEntityAtOrigin("func_rotating", fInfectionOrigin);
|
||||
DispatchKeyFormat(iRotating, "targetname", "season_infection_rotating_%d", g_iCounter);
|
||||
DispatchKeyFormat(iRotating, "maxspeed", "13");
|
||||
DispatchKeyFormat(iRotating, "spawnflags", "64");
|
||||
DispatchKeyFormat(iRotating, "OnUser1", "!self,KillHierarchy,,45,1");
|
||||
DispatchKeyFormat(iRotating, "OnUser2", "!self,KillHierarchy,,0,1");
|
||||
DispatchKeyFormat(iRotating, "OnUser3", "!self,Start,,0,1");
|
||||
DispatchKeyFormat(iRotating, "targetname", "season_infection_rotating_%d", g_iCounter);
|
||||
DispatchKeyFormat(iRotating, "maxspeed", "13");
|
||||
DispatchKeyFormat(iRotating, "spawnflags", "64");
|
||||
DispatchKeyFormat(iRotating, "OnUser1", "season_infection_prop_%d,FireUser1,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iRotating, "OnUser1", "!self,KillHierarchy,,45,1");
|
||||
DispatchKeyFormat(iRotating, "OnUser2", "!self,KillHierarchy,,0,1");
|
||||
SpawnAndActivate(iRotating);
|
||||
|
||||
// make the trigger work.
|
||||
@ -676,89 +722,89 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
|
||||
|
||||
|
||||
int iModel = CreateEntityAtOrigin("prop_dynamic_override", fInfectionOrigin);
|
||||
DispatchKeyFormat(iModel, "targetname", "season_infection_prop_%d", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "targetname", "season_infection_prop_%d", g_iCounter);
|
||||
|
||||
int iRandomSkin = GetRandomInt(0, 6);
|
||||
if (iRandomSkin == 0)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/jackolantern_01.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.03");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/jackolantern_01.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.03");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
}
|
||||
else if (iRandomSkin == 1)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/jackolantern_02.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.025");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/jackolantern_02.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.025");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
}
|
||||
else if (iRandomSkin == 2)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/skull_island_horns.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.08");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/skull_island_horns.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.08");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
|
||||
}
|
||||
else if (iRandomSkin == 3)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/skull_island01.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.1");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/hh2015/escalados/skull_island01.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.1");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
fInfectionOrigin[2] += 7;
|
||||
}
|
||||
else if (iRandomSkin == 4)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "model", "models/syoudous/spooky/ghost_no_hat.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.4");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "model", "models/syoudous/spooky/ghost_no_hat.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.4");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,0,1", g_iCounter);
|
||||
}
|
||||
else if ((iRandomSkin == 5) || (iRandomSkin == 6))
|
||||
{
|
||||
DispatchKeyFormat(iModel, "model", "models/unloze/cute_skeleton.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.35");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "DefaultAnim","crumbled");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,wakeup,3,1");
|
||||
DispatchKeyFormat(iModel, "model", "models/unloze/cute_skeleton.mdl");
|
||||
DispatchKeyFormat(iModel, "modelscale", "0.35");
|
||||
DispatchKeyFormat(iModel, "angles", "0 0 0");
|
||||
DispatchKeyFormat(iModel, "DefaultAnim", "crumbled");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,wakeup,3,1");
|
||||
|
||||
int iRandomAnimation = GetRandomInt(0, 4);
|
||||
|
||||
if (iRandomAnimation == 0)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,idle,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,idle,4.5,1");
|
||||
}
|
||||
else if (iRandomAnimation == 1)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_1,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_1,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
}
|
||||
else if (iRandomAnimation == 2)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_2,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_2,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
}
|
||||
else if (iRandomAnimation == 3)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_3,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_3,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
}
|
||||
else if (iRandomAnimation == 4)
|
||||
{
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_4,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
DispatchKeyFormat(iModel, "OnUser1", "!self,SetAnimation,dance_4,4.5,1");
|
||||
DispatchKeyFormat(iModel, "OnUser1", "season_infection_rotating_%d,Start,,4.5,1", g_iCounter);
|
||||
}
|
||||
}
|
||||
|
||||
DispatchKeyFormat(iModel, "disableshadows", "1");
|
||||
DispatchKeyFormat(iModel, "disablereceiveshadows", "1");
|
||||
DispatchKeyFormat(iModel, "DisableBoneFollowers", "1");
|
||||
DispatchKeyFormat(iModel, "disableshadows", "1");
|
||||
DispatchKeyFormat(iModel, "disablereceiveshadows", "1");
|
||||
DispatchKeyFormat(iModel, "DisableBoneFollowers", "1");
|
||||
DispatchKeyValueVector(iModel, "origin", fInfectionOrigin);
|
||||
|
||||
SpawnAndActivate(iModel);
|
||||
ParentToEntity(iModel, iRotating);
|
||||
AcceptEntityInput(iModel, "FireUser1");
|
||||
AcceptEntityInput(iRotating, "FireUser1");
|
||||
|
||||
int iEntityLimit = g_hCVar_EntityLimit.IntValue;
|
||||
@ -777,29 +823,31 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnEntitySpawned(int Entity, const char[] sClassname)
|
||||
{
|
||||
if (StrContains(sClassname, "_projectile", false) == -1)
|
||||
return;
|
||||
|
||||
int iOwner = GetEntPropEnt(Entity, Prop_Data, "m_hOwnerEntity");
|
||||
if(!IsValidClient(iOwner))
|
||||
return;
|
||||
|
||||
if (g_iCollected[iOwner] >= g_hCVar_MilestoneGrenade.IntValue)
|
||||
{
|
||||
SetEntityRenderMode(Entity, RENDER_NONE);
|
||||
if (g_iCollected[iOwner] < g_hCVar_MilestoneGrenade.IntValue)
|
||||
return;
|
||||
|
||||
float fNadeOrigin[3];
|
||||
GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", fNadeOrigin);
|
||||
SetEntityRenderMode(Entity, RENDER_NONE);
|
||||
|
||||
int iNadeProp = CreateEntityAtOrigin("prop_dynamic_override", fNadeOrigin);
|
||||
DispatchKeyFormat(iNadeProp, "targetname", "season_nade_prop_%d", g_iCounter);
|
||||
float fNadeOrigin[3];
|
||||
GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", fNadeOrigin);
|
||||
|
||||
DispatchKeyFormat(iNadeProp, "model", "models/models_kit/hallo_pumpkin_l.mdl");
|
||||
DispatchKeyFormat(iNadeProp, "disableshadows", "1");
|
||||
DispatchKeyFormat(iNadeProp, "disablereceiveshadows", "1");
|
||||
DispatchKeyFormat(iNadeProp, "DisableBoneFollowers", "1");
|
||||
DispatchKeyFormat(iNadeProp, "modelscale", "0.35");
|
||||
int iNadeProp = CreateEntityAtOrigin("prop_dynamic_override", fNadeOrigin);
|
||||
DispatchKeyFormat(iNadeProp, "targetname", "season_nade_prop_%d", g_iCounter);
|
||||
DispatchKeyFormat(iNadeProp, "model", "models/models_kit/hallo_pumpkin_l.mdl");
|
||||
DispatchKeyFormat(iNadeProp, "disableshadows", "1");
|
||||
DispatchKeyFormat(iNadeProp, "disablereceiveshadows", "1");
|
||||
DispatchKeyFormat(iNadeProp, "DisableBoneFollowers", "1");
|
||||
DispatchKeyFormat(iNadeProp, "modelscale", "0.35");
|
||||
|
||||
SpawnAndActivate(iNadeProp);
|
||||
ParentToEntity(iNadeProp, Entity);
|
||||
}
|
||||
SpawnAndActivate(iNadeProp);
|
||||
ParentToEntity(iNadeProp, Entity);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user