mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-02-27 01:43:36 +00:00
Merge branch 'NoEvo'
This commit is contained in:
commit
d872ec247e
9 changed files with 103 additions and 39 deletions
|
|
@ -466,7 +466,7 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
if (%startStalemate)
|
||||
%game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate);
|
||||
|
||||
if($Host::ClassicEvoStats && !$Host::TournamentMode)
|
||||
if($Host::ClassicEvoStats)
|
||||
{
|
||||
$stats::grabs[%client]++;
|
||||
if($stats::grabs[%client] > $stats::grabs_counter)
|
||||
|
|
@ -480,7 +480,7 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
%game.totalFlagHeldTime[%flag] = getSimTime();
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats && !%player.flagStatsWait && !$Host::TournamentMode)
|
||||
if($Host::ClassicEvoStats && !%player.flagStatsWait)
|
||||
{
|
||||
// get the grab speed
|
||||
%grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6);
|
||||
|
|
|
|||
|
|
@ -693,7 +693,7 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
if (%startStalemate)
|
||||
%game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate);
|
||||
|
||||
if($Host::ClassicEvoStats && !$Host::TournamentMode)
|
||||
if($Host::ClassicEvoStats)
|
||||
{
|
||||
$stats::grabs[%client]++;
|
||||
if($stats::grabs[%client] > $stats::grabs_counter)
|
||||
|
|
@ -707,7 +707,7 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
%game.totalFlagHeldTime[%flag] = getSimTime();
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats && !%player.flagStatsWait && !$Host::TournamentMode)
|
||||
if($Host::ClassicEvoStats && !%player.flagStatsWait)
|
||||
{
|
||||
// get the grab speed
|
||||
%grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6);
|
||||
|
|
|
|||
63
Classic/scripts/autoexec/AntiPack.cs
Normal file → Executable file
63
Classic/scripts/autoexec/AntiPack.cs
Normal file → Executable file
|
|
@ -79,14 +79,43 @@ package AntiPackCloak
|
|||
|
||||
function CloakingPackImage::onActivate(%data, %obj, %slot)
|
||||
{
|
||||
if(%obj.reCloak !$= "")
|
||||
{
|
||||
Cancel(%obj.reCloak);
|
||||
%obj.reCloak = "";
|
||||
}
|
||||
|
||||
if(%obj.client.armor $= "Light")
|
||||
{
|
||||
// can the player currently cloak (function returns "true" or reason for failure)?
|
||||
if(%obj.canCloak() $= "true")
|
||||
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloakpack is disabled until %1 players.', $Host::AntiPackPlayerCount );
|
||||
{
|
||||
if(%obj.getImageState($BackpackSlot) $= "activate")
|
||||
{
|
||||
// cancel recloak thread
|
||||
if(%obj.reCloak !$= "")
|
||||
{
|
||||
Cancel(%obj.reCloak);
|
||||
%obj.reCloak = "";
|
||||
}
|
||||
|
||||
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloakpack is disabled until %1 players.', $Host::AntiPackPlayerCount );
|
||||
%obj.setCloaked(false);
|
||||
%obj.setImageTrigger($BackpackSlot, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// notify player that they cannot cloak
|
||||
messageClient(%obj.client, 'MsgCloakingPackFailed', '\c2Jamming field prevents cloaking.');
|
||||
%obj.setImageTrigger(%slot, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// hopefully avoid some loopholes
|
||||
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloaking available for light armors only.');
|
||||
%obj.setImageTrigger(%slot, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,4 +138,34 @@ function ShieldPackImage::onDeactivate(%data, %obj, %slot)
|
|||
|
||||
};
|
||||
|
||||
package AntiPack
|
||||
{
|
||||
|
||||
//Reset Everything
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
if( $Host::AntiPackEnable )
|
||||
{
|
||||
if($InvBanList[CTF, "CloakingPack"])
|
||||
$InvBanList[CTF, "CloakingPack"] = 0;
|
||||
if(isActivePackage(AntiPackCloak))
|
||||
deactivatePackage(AntiPackCloak);
|
||||
|
||||
if($InvBanList[CTF, "ShieldPack"])
|
||||
$InvBanList[CTF, "ShieldPack"] = 0;
|
||||
if(isActivePackage(AntiPackShield))
|
||||
deactivatePackage(AntiPackShield);
|
||||
|
||||
$AntiPackStatus = "OFF";
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(AntiPack))
|
||||
activatePackage(AntiPack);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ function connectLog(%client, %isDisconnect)
|
|||
{
|
||||
// get the client info
|
||||
%authInfo = %client.getAuthInfo();
|
||||
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
|
||||
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
|
||||
|
||||
// net tournament client present?
|
||||
if (!%client.t2csri_sentComCertDone)
|
||||
|
|
@ -177,7 +177,7 @@ function teamkillLog(%victimID, %killerID, %damageType)
|
|||
|
||||
//Stage in warnings
|
||||
%s = "";
|
||||
if(!%killerID.isAdmin) //Admins dont get warnings
|
||||
if(!%killerID.isAdmin && !$Host::TournamentMode) //Admins dont get warnings. No warnings in Tournament Mode
|
||||
{
|
||||
if(%ktk >= $Host::TKWarn1 && %ktk < $Host::TKWarn2)
|
||||
%s = "[Warned] ";
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
|||
{
|
||||
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
// call the function
|
||||
if(!$Host::TournamentMode && $Host::ClassicEvoStats)
|
||||
if($Host::ClassicEvoStats)
|
||||
handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %
|
|||
{
|
||||
Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
|
||||
// call the function
|
||||
if(!$Host::TournamentMode && $Host::ClassicEvoStats)
|
||||
if($Host::ClassicEvoStats)
|
||||
handleKillStat(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifie
|
|||
if(isObject(%targetObject)) // Console spam fix.
|
||||
{
|
||||
// call the function
|
||||
if(!$Host::TournamentMode && $Host::ClassicEvoStats)
|
||||
if($Host::ClassicEvoStats)
|
||||
handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal);
|
||||
}
|
||||
Parent::onCollision( %data, %projectile, %targetObject, %modifier, %position, %normal );
|
||||
|
|
|
|||
|
|
@ -14,18 +14,22 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID, %damageType)
|
|||
return false; // is not a tk
|
||||
|
||||
// No Bots
|
||||
if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
||||
return true;
|
||||
//if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
|
||||
// return true;
|
||||
|
||||
// Log TeamKill
|
||||
teamkillLog(%victimID, %killerID, %damageType);
|
||||
|
||||
//No warnings in tournament mode
|
||||
if($Host::TournamentMode)
|
||||
return true;
|
||||
|
||||
// No Admins
|
||||
if(%killerID.isAdmin)
|
||||
return true;
|
||||
|
||||
// Ignore this map
|
||||
if($CurrentMission $= "Mac_FlagArena" || $CurrentMission $= "Machineeggs" || $CurrentMission $= "DMP_SimpleFlagArena")
|
||||
if($CurrentMission $= "Mac_FlagArena" || $CurrentMission $= "Machineeggs")
|
||||
return true;
|
||||
|
||||
// warn the player of the imminent kick vote
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@ $EnableMultipleMapRotation = 0;
|
|||
//Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc
|
||||
$mapRotationFilesCount = 3;
|
||||
|
||||
function multipleMapRotation()
|
||||
function multipleMapRotation()
|
||||
{
|
||||
if($EnableMultipleMapRotation)
|
||||
//Look for a progressing number
|
||||
%var = stripChars($Host::ClassicRotationFile, "prefs/mapRotation.cs");
|
||||
//echo("var: " @ %var);
|
||||
|
||||
if(%var) //If number exists proceed
|
||||
{
|
||||
%var = stripChars($Host::ClassicRotationFile, "prefs/mapRotation.cs");
|
||||
//echo("var: " @ %var);
|
||||
if(%var $= $mapRotationFilesCount)
|
||||
%var = 1;
|
||||
else
|
||||
|
|
@ -20,17 +22,17 @@ function multipleMapRotation()
|
|||
|
||||
%mapRot = "prefs/mapRotation" @ %var @ ".cs";
|
||||
$Host::ClassicRotationFile = %mapRot;
|
||||
|
||||
//Echo at start
|
||||
schedule(10000,0,"multipleMapRotationEcho",0);
|
||||
}
|
||||
|
||||
schedule(10000,0,"multipleMapRotationEcho",0); //Echo at start
|
||||
}
|
||||
|
||||
//Echo at start
|
||||
//Echo
|
||||
function multipleMapRotationEcho()
|
||||
{
|
||||
echo("Current MapRotation: " @ $Host::ClassicRotationFile);
|
||||
}
|
||||
|
||||
//Run
|
||||
multipleMapRotation();
|
||||
if($EnableMultipleMapRotation)
|
||||
multipleMapRotation();
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
|
||||
//exec("scripts/autoexec/zzDiscordBot.cs");
|
||||
|
||||
//note first channel is for monitoring
|
||||
$discordBot::discordCHID = "";
|
||||
//ip of the bot
|
||||
$discordBot::IP = "";
|
||||
$discordBot::reconnectTimeout = 3 * 60000;
|
||||
//auto connect on start
|
||||
$discordBot::autoStart = 0;
|
||||
//used on the bot to help split thigns up
|
||||
$discordBot::cmdSplit = "%cmd%";
|
||||
$discordBot::cmdSubSplit = "%tab%";
|
||||
//These correspond with $discordBot::discordCHID
|
||||
$discordBot::monitorChannel = 1;
|
||||
$discordBot::serverFeed = 2;
|
||||
$discordBot::cmdSplit = "%c%";
|
||||
$discordBot::cmdSubSplit = "%t%";
|
||||
//These are set via the bot
|
||||
$discordBot::monitorChannel = 0;
|
||||
$discordBot::serverFeed = 1;
|
||||
package discordPackage
|
||||
{
|
||||
|
||||
|
|
@ -33,8 +33,7 @@ function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8
|
|||
switch$(%type)
|
||||
{
|
||||
case "msgExplosionKill" or "msgSuicide" or "msgVehicleSpawnKill" or "msgVehicleCrash" or "msgVehicleKill" or "msgTurretSelfKill" or "msgTurretSelfKill" or "msgCTurretKill" or "msgTurretKill" or
|
||||
"msgSelfKill" or "msgOOBKill" or "msgCampKill" or "msgTeamKill" or "msgLavaKill" or "msgLightningKill" or "MsgRogueMineKill" or "MsgHeadshotKill" or "MsgRearshotKill" or "MsgLegitKill" or
|
||||
"MsgClientJoin" or "MsgClientDrop":
|
||||
"msgSelfKill" or "msgOOBKill" or "msgCampKill" or "msgTeamKill" or "msgLavaKill" or "msgLightningKill" or "MsgRogueMineKill" or "MsgHeadshotKill" or "MsgRearshotKill" or "MsgLegitKill":
|
||||
%message = getTaggedString(%msgString);
|
||||
%message = strreplace(%message,"%1",getTaggedString(%a1));
|
||||
%message = strreplace(%message,"%2",getTaggedString(%a2));
|
||||
|
|
@ -209,7 +208,7 @@ function sendToDiscord(%msg,%channel)
|
|||
{
|
||||
if(discord.lastState $= "Connected")
|
||||
{
|
||||
discord.send("MSG" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
discord.send("MSG" @ $discordBot::cmdSplit @ (%channel) @ $discordBot::cmdSplit @ "0" @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -219,7 +218,7 @@ function sendToDiscordEmote(%msg,%channel)//emote filter will be applyed used in
|
|||
{
|
||||
if(discord.lastState $= "Connected")
|
||||
{
|
||||
discord.send("MSGE" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
discord.send("MSG" @ $discordBot::cmdSplit @ (%channel) @ $discordBot::cmdSplit @ "emote" @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -262,7 +261,7 @@ function discord::onDNSResolved(%this){
|
|||
function discord::onConnected(%this){
|
||||
%this.lastState = "Connected";
|
||||
error(%this.lastState);
|
||||
discord.send("AUTH" @ $discordBot::cmdSplit @ $discordBot::discordCHID @ $discordBot::cmdSplit @ $Host::GameName @ "\r\n");
|
||||
discord.send("AUTH" @ $discordBot::cmdSplit @ $discordBot::cmdSplit @ $Host::GameName @ "\r\n");
|
||||
}
|
||||
|
||||
function discord::onDisconnect(%this){
|
||||
|
|
|
|||
|
|
@ -772,7 +772,7 @@ function DefaultGame::sendDebriefing( %game, %client )
|
|||
}
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
if($Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF"))
|
||||
sendEvoDebriefing(%client);
|
||||
}
|
||||
|
||||
|
|
@ -1751,7 +1751,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
//displayObserverHud( %client, 0 );
|
||||
// Eolk - flag stats stuff
|
||||
//updateObserverFlyHud(%client);
|
||||
if($Host::ClassicEvoStats && $CurrentMissionType $= "CTF")
|
||||
if($Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF"))
|
||||
schedule(10000, %client, updateObserverFlyHud, %client);
|
||||
}
|
||||
|
||||
|
|
@ -1774,7 +1774,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
}
|
||||
}
|
||||
|
||||
if( $Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF") )
|
||||
if( $Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF"))
|
||||
{
|
||||
%nickTeam1 = ($flagstats::heldTeam1 ? $flagstats::nickTeam1 : "N/A");
|
||||
%realTeam1 = ($flagstats::heldTeam1 ? $flagstats::realTeam1 : "N/A");
|
||||
|
|
@ -1833,7 +1833,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
if(isEventPending(%client.okschedule))
|
||||
cancel(%client.okschedule);
|
||||
|
||||
%time = $Host::KickObserverTimeout;
|
||||
%time = $Host::KickObserverTimeout;
|
||||
//%time = ($Host::KickObserverTimeout) + ($Host::KickObserverTimeout/2);
|
||||
//%minutes = %time / 60;
|
||||
//messageClient(%client, 'MsgNoObservers', '\c2You have %1 minutes to join the game or you will be kicked.', %minutes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue