Update plugins

This commit is contained in:
Jackz 2023-07-20 20:15:44 -05:00
parent cc9eb7d9d4
commit 52c3d04c89
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
25 changed files with 2163 additions and 870 deletions

View file

@ -4,7 +4,7 @@
//Allow MAX_TROLLS to be defined elsewhere
#if defined MAX_TROLLS
#else
#define MAX_TROLLS 49
#define MAX_TROLLS 50
#endif
enum trollModifier {
@ -123,7 +123,9 @@ enum struct Troll {
}
int AddFlag(const char[] name, bool defaultOn) {
if(this.flagNames == null) this.flagNames = new ArrayList(MAX_TROLL_FLAG_LENGTH);
if(this.flagNames == null) {
this.flagNames = new ArrayList(MAX_TROLL_FLAG_LENGTH);
}
// Check if flag already added
int flagIndex = this.GetFlagIndex(name);
@ -131,8 +133,13 @@ enum struct Troll {
// Grab the prompt
static TrollFlagPrompt prompt;
// TODO: CHECK IF MISSING PROMPT
if(g_trollAddPromptIndex >= this.flagPrompts.Length) {
ThrowError("No prompt added for troll \"%s\", for flag \"%s\"", this.id, name);
}
this.flagPrompts.GetArray(g_trollAddPromptIndex, prompt);
prompt.flags |= (1 << flagIndex);
if(defaultOn) {

View file

@ -776,8 +776,10 @@ public Action Event_TakeDamage(int victim, int& attacker, int& inflictor, float&
if(IsTrollActive(victim, "Damage Boost")) {
damage * 2;
return Plugin_Changed;
} else if(Trolls[reverseFF].IsActive(attacker) && damagetype != DMG_BURN && attacker != victim && GetClientTeam(attacker) == GetClientTeam(victim)) {
} else if(Trolls[reverseFF].IsActive(attacker) && attacker != victim && GetClientTeam(attacker) == GetClientTeam(victim)
&& (damagetype == DMG_BURN && Trolls[reverseFF].activeFlagClients[attacker] & 32)
&& (damagetype == DMG_BLAST && Trolls[reverseFF].activeFlagClients[attacker] & 64)
) {
float returnDmg = damage; //default is 1:1
if(Trolls[reverseFF].activeFlagClients[attacker] & 2) {
returnDmg *= 2.0;

View file

@ -46,14 +46,14 @@ public int Insta_SpecialHandler(Menu menu, MenuAction action, int client, int pa
if(inFace) {
if(SpawnSpecialForTarget(special, target, view_as<int>(Special_OnTarget))) {
LogAction(client, target, "\"%L\" spawned Insta-%s™ on \"%L\"", client, SPECIAL_NAMES[specialInt-1], target);
ShowActivityEx(client, "[FTT] ", "spawned Insta-%s™ on %N", SPECIAL_NAMES[specialInt-1], target);
CShowActivityEx(client, "[FTT] ", "spawned {olive}Insta-%s™{default} on {olive}%N", SPECIAL_NAMES[specialInt-1], target);
} else {
ReplyToCommand(client, "Could not spawn special.");
}
} else {
if(SpawnSpecialForTarget(special, target)) {
CShowActivityEx(client, "[FTT] ", "spawned {green}Insta-%s™{default} near {green}%N", SPECIAL_NAMES[specialInt-1], target);
LogAction(client, target, "\"%L\" spawned Insta-%s™ near \"%L\"", client, SPECIAL_NAMES[specialInt-1], target);
ShowActivityEx(client, "[FTT] ", "spawned Insta-%s™ near %N", SPECIAL_NAMES[specialInt-1], target);
} else {
ReplyToCommand(client, "Could not spawn special.");
}

View file

@ -27,6 +27,19 @@ public Action Timer_Main(Handle timer) {
for(int i = 1; i <= MaxClients; i++) {
if(IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2) {
if(Trolls[t_randomizeAnglesIndex].IsActive(i)) {
float chance = 0.10;
if(Trolls[t_randomizeAnglesIndex].activeFlagClients[i] & 2) chance = 0.35;
else if(Trolls[t_randomizeAnglesIndex].activeFlagClients[i] & 4) chance = 0.58;
else if(Trolls[t_randomizeAnglesIndex].activeFlagClients[i] & 8) chance = 0.90;
else if(Trolls[t_randomizeAnglesIndex].activeFlagClients[i] & 16) chance = 1.00;
if(GetURandomFloat() < chance) {
float ang[3];
ang[0] = GetRandomFloat(-180.0, 180.0);
ang[1] = GetRandomFloat(-180.0, 180.0);
TeleportEntity(i, NULL_VECTOR, ang, NULL_VECTOR);
}
}
if(Trolls[slowDrainIndex].IsActive(i)) {
if(loopTick % 4 == 0) {
int hp = GetClientHealth(i);
@ -34,7 +47,8 @@ public Action Timer_Main(Handle timer) {
SetEntProp(i, Prop_Send, "m_iHealth", hp - 1);
}
}
}else if(Trolls[tempHealthQuickDrainIndex].IsActive(i)) {
}
if(Trolls[tempHealthQuickDrainIndex].IsActive(i)) {
if(loopTick % 2 == 0) {
float bufferTime = GetEntPropFloat(i, Prop_Send, "m_healthBufferTime");
float tempHealth = L4D_GetTempHealth(i);
@ -42,13 +56,16 @@ public Action Timer_Main(Handle timer) {
SetEntPropFloat(i, Prop_Send, "m_healthBufferTime", bufferTime - 7.0);
}
}
}else if(Trolls[swarmIndex].IsActive(i)) {
}
if(Trolls[swarmIndex].IsActive(i)) {
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", GetClientUserId(i), 15000);
} else if(Trolls[slipperyShoesIndex].IsActive(i) && Trolls[slipperyShoesIndex].activeFlagClients[i] & 1) {
}
if(Trolls[slipperyShoesIndex].IsActive(i) && Trolls[slipperyShoesIndex].activeFlagClients[i] & 1) {
if(GetRandomFloat() <= 0.4) {
L4D_StaggerPlayer(i, i, NULL_VECTOR);
}
} else if(Trolls[instantCommonIndex].IsActive(i)) {
}
if(Trolls[instantCommonIndex].IsActive(i)) {
int common = EntRefToEntIndex(instantCommonRef[i]);
if(common <= 0 || !IsValidEntity(common)) {
static float pos[3];
@ -58,7 +75,8 @@ public Action Timer_Main(Handle timer) {
}
SetEntPropEnt(common, Prop_Send, "m_clientLookatTarget", i);
SetEntProp(common, Prop_Send, "m_nSequence", 96);
} else if(loopTick % 60 && Trolls[randomizeAmmoIndex].IsActive(i)) {
}
if(loopTick % 60 && Trolls[randomizeAmmoIndex].IsActive(i)) {
int primaryWpn = GetPlayerWeaponSlot(i, 0);
if(primaryWpn > 0) {
int maxCap = GetEntProp(primaryWpn, Prop_Send, "m_iClip1");

View file

@ -3,6 +3,7 @@
int slipperyShoesIndex = 0;
int stickyGooIndex = 0;
int invertedTrollIndex;
int t_randomizeAnglesIndex;
// int fireSpitMagnetTrollIndex;
void SetupTrolls() {
@ -75,7 +76,10 @@ void SetupTrolls() {
Trolls[index].AddFlag("Biles", true);
Trolls[index].AddFlag("Molotovs", true);
Trolls[index].AddFlag("Pipebombs", true);
SetupTroll("Molotov Bath", "Throws a molotov on their feet", TrollMod_Instant);
index = SetupTroll("Molotov Bath", "Throws a molotov on their feet", TrollMod_Instant);
Trolls[index].AddFlagPrompt(false);
Trolls[index].AddFlag("Normal", true);
Trolls[index].AddFlag("Set the town ablaze", false);
// CATEGORY: Items
SetCategory("Items");
@ -149,6 +153,11 @@ void SetupTrolls() {
Trolls[index].AddFlag("0.5x Ratio", false); //4
Trolls[index].AddFlag("0.0x Ratio (None)", false); //8
Trolls[index].AddFlag("3x Ratio", false); //16
Trolls[index].AddCustomFlagPrompt("Modes", true);
Trolls[index].AddFlag("Reverse Fire Damage", false); //32
Trolls[index].AddFlag("Reverse Explosions", false); //64
index = SetupTroll("Dep Bots", "Makes bots heal a player. At any cost", TrollMod_Constant);
Trolls[index].AddFlagPrompt(false);
Trolls[index].AddFlag("Do not spawn extra", true); // 1
@ -187,6 +196,15 @@ void SetupTrolls() {
Trolls[index].AddFlag("On pills/adrenaline use", false);
Trolls[index].AddFlag("On zombie bite", false);
slipperyShoesIndex = index;
index = SetupTroll("Randomize Angles", "Randomly change their angles", TrollMod_Constant);
Trolls[index].AddCustomFlagPrompt("Frequency:", false);
Trolls[index].AddFlag("Once in a while", true); //1
Trolls[index].AddFlag("Periodically", false); //2
Trolls[index].AddFlag("A lot", false); //4
Trolls[index].AddFlag("Painful", false); //8
Trolls[index].AddFlag("Seizure", false); //16
t_randomizeAnglesIndex = index;
/// CATEGORY: MISC
SetCategory("Misc");
@ -364,6 +382,8 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
ang[0] = 90.0;
L4D_TankRockPrj(0, dropPos, ang);
} else if(StrEqual(troll.name, "Molotov Bath")) {
int count = 1;
if(flags & 2) count = 8;
float pos[3], dropPos[3];
GetClientEyePosition(victim, pos);
dropPos = pos;
@ -379,7 +399,9 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
}
float vel[3];
vel[2] = -90.0;
L4D_MolotovPrj(victim, dropPos, vel);
for(int i = 0; i < count; i++) {
L4D_MolotovPrj(victim, dropPos, vel);
}
} else if(StrEqual(troll.name, "Dep Bots")) {
if(!toActive) {
StopHealingBots();