Initial commit

This commit is contained in:
ChocoTaco 2018-06-28 14:34:52 -04:00
commit 0c4253f743
22 changed files with 23038 additions and 0 deletions

15
autoexec/AntiCloak.cs Normal file
View file

@ -0,0 +1,15 @@
$AntiCloakPlayerCount = 6; // amount of players needed on server for CloakPack to be selectable
//Activates when default Inventory for player is set so player cant select it thru hotkeys or select it thru the gui.
function ActivateAntiCloak ()
{
//echo("TotalTeamPlayerCount " @ $TotalTeamPlayerCount);
//echo("AntiCloakPlayerCount " @ $AntiCloakPlayerCount);
if(!$Host::TournamentMode && $TotalTeamPlayerCount < $AntiCloakPlayerCount)
//If server is in Tourny mode or if the server population isnt higher than the AntiCloakPlayerCount the CloakPack is not selectable.
$InvBanList[CTF, "CloakingPack"] = true;
else
//If AntiCloakPlayerCount is lower than server population, CloakPack is enabled and Selectable.
$InvBanList[CTF, "CloakingPack"] = false;
}

89
autoexec/GetTeamCounts.cs Normal file
View file

@ -0,0 +1,89 @@
//This function is Called at:
//CreateServer(%mission, %missionType) in Server.cs
package StartTeamCounts {
//Start
function CreateServer(%mission, %missionType)
{
//Call default function
parent::CreateServer(%mission, %missionType);
//Start
//Call for a GetTeamCount update
GetTeamCounts( %game, %client, %respawn );
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(StartTeamCounts))
activatePackage(StartTeamCounts);
function GetTeamCounts( %game, %client, %respawn )
{
if (!isActivePackage(StartTeamCounts)) {
deactivatePackage(StartTeamCounts);
}
//echo ("Clientgroup " @ ClientGroup.getCount());
//echo ("$PlayerCount[0] " @ $PlayerCount[0]);
//echo ("$PlayerCount[1] " @ $PlayerCount[1]);
//echo ("$PlayerCount[2] " @ $PlayerCount[2]);
//echo ("client.team " @ %client.team);
//Team Count code by Keen
$PlayerCount[0] = 0;
$PlayerCount[1] = 0;
$PlayerCount[2] = 0;
for(%i = 0; %i < ClientGroup.getCount(); %i++)
{
%client = ClientGroup.getObject(%i);
//if(!%client.isAIControlled())
$PlayerCount[%client.team]++;
}
//Other variables
//Amount of players on teams
$TotalTeamPlayerCount = $PlayerCount[1] + $PlayerCount[2];
//Amount of all players including observers
$AllPlayerCount = $PlayerCount[1] + $PlayerCount[2] + $PlayerCount[0];
//Call Team Balance Notify
//Make sure it's CTF Mode
if($CurrentMissionType $= "CTF" && $TotalTeamPlayerCount !$= 0 && $countdownStarted $= true && $MatchStarted $= true) {
TeamBalanceNotify::AtSpawn( %game, %client, %respawn );
}
//Start
//Make sure it's CTF Mode
if($CurrentMissionType $= "CTF" && $countdownStarted $= true && $MatchStarted $= true) {
PlayerNotify::AtSpawn( %game, %client, %respawn );
}
//AntiCloak Start
//if($CurrentMissionType $= "CTF") {
//ActivateAntiCloak ();
//}
//Call itself again. Every 5 seconds.
schedule(5000, 0, "GetTeamCounts");
}
//For instant Calls for an update
//function QuickTeamCounts( %game, %client, %respawn )
//{
//Team Count code by Keen
//$PlayerCount[0] = 0;
//$PlayerCount[1] = 0;
//$PlayerCount[2] = 0;
//for(%i = 0; %i < ClientGroup.getCount(); %i++)
//{
//%client = ClientGroup.getObject(%i);
//if(!%client.isAIControlled())
//$PlayerCount[%client.team]++;
//}
//}

View file

@ -0,0 +1,70 @@
//Start and Reset Notify
package NoRapeNotify {
//Start Notify
//function DefaultGame::spawnPlayer( %game, %client, %respawn ) {
//Call default function
//parent::spawnPlayer( %game, %client, %respawn );
//Start
//Make sure it's CTF Mode
//if( $CurrentMissionType $= "CTF" ) {
//PlayerNotify::AtSpawn( %game, %client, %respawn );
//}
//}
//Reset Notify
function DefaultGame::gameOver( %game ) {
//Call default function
parent::gameOver( %game );
//Reset NoBaseRape Notify
ResetNotify::MissionEnd( %game, %client );
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(NoRapeNotify))
activatePackage(NoRapeNotify);
//This function is at DefaultGame::spawnPlayer( %game, %client, %respawn ) defaultGame.cs
//Notifys the user if NoBase rape is on or off. Has a Counter so it is only run once and doesnt spam the client. It is triggered at spawn.
function PlayerNotify::AtSpawn( %game, %client, %respawn )
{
//echo ("%client " @ %client);
//echo ("$TeamBalanceClient " @ $TeamBalanceClient);
//Is NoBaseRape On or off
if( !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled && $Host::EvoNoBaseRapeClassicPlayerCount > $TotalTeamPlayerCount ) {
//If on, has the client gotten the notification already
if($NoBaseRapeNotifyCount !$= 0) {
messageAll('MsgNoBaseRapeNotify', 'No Base Rape is \c3Enabled.~wfx/misc/nexus_cap.wav');
$NoBaseRapeNotifyCount = 0;
}
}
else
//NoBaseRape is off
//Has the client gotten the notification already
if($NoBaseRapeNotifyCount !$= 1) {
messageAll('MsgNoBaseRapeNotify', 'No Base Rape is \c3Disabled.~wfx/misc/diagnostic_on.wav');
$NoBaseRapeNotifyCount = 1;
}
}
//This function is at StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
//In the evopackage.cs or evoClassic.vl2
//Plays a sound when a player hits a protected asset
function PlayerNotifyEnabled::OnDamage( %game, %sourceObject )
{
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '~wfx/misc/diagnostic_beep.wav');
}
//This function is at DefaultGame::gameOver(%game) CTFGame.cs
//Resets the client NotifyCount when the mission ends
function ResetNotify::MissionEnd( %game, %client )
{
$NoBaseRapeNotifyCount = -1;
}

View file

@ -0,0 +1,87 @@
//Give the client a notification on the current state of balancing.
//This function is in GetTeamCounts( %game, %client, %respawn ) GetTeamCounts.cs
function TeamBalanceNotify::AtSpawn( %game, %client, %respawn )
{
//Call for a GetTeamCount update
//GetTeamCounts( %game, %client, %respawn );
//evoplayercount does not count yourself
//variables
//%balancedifference = 2; //player difference you want to allow before sending notifications between teams.
//%Team1Difference = $PlayerCount[1] - $PlayerCount[2];
//%Team2Difference = $PlayerCount[2] - $PlayerCount[1];
//echo ("%Team1Difference " @ %Team1Difference);
//echo ("%Team2Difference " @ %Team2Difference);
//Are teams unbalanced?
if( $PlayerCount[1] !$= $PlayerCount[2] ) {
//Reset Balanced
$BalancedCount = 0;
if( ($PlayerCount[1] - $PlayerCount[2]) >= 2 || ($PlayerCount[2] - $PlayerCount[1]) >= 2 ) {
//Has the client gotten the notification already
if($TeamBalanceNotifyCount !$= 1) {
//If unbalanced, send a notification. Will continue to send notifications until teams are balanced.
messageAll('MsgTeamBalanceNotify', 'Teams are unbalanced.');
//Only get the notification once per spawn.
$TeamBalanceNotifyCount = 1;
//Reset Stat
$StatsBalanceCount = 0;
}
}
}
else
//If teams are balanced and teams dont equal 0.
if( $PlayerCount[1] == $PlayerCount[2] && $TotalTeamPlayerCount !$= 0 ) {
//Has the client gotten the notification already
if($BalancedCount !$= 1) {
//If balanced, send a notification.
messageAll('MsgTeamBalanceNotify', 'Teams are balanced.');
//Only get the balance notification once.
$BalancedCount = 1;
//Reset Unbalanced
$TeamBalanceNotifyCount = 0;
//Reset Stat
$StatsBalanceCount = 0;
}
}
//3 or more difference gets a count notify
if( ($PlayerCount[1] - $PlayerCount[2]) >= 3 || ($PlayerCount[2] - $PlayerCount[1]) >= 3 ) {
//Run it once
if($StatsBalanceCount !$= 1) {
messageAll('MsgTeamBalanceNotify', 'It is currently %1 vs %2 with %3 observers.', $PlayerCount[1], $PlayerCount[2], $PlayerCount[0] );
$StatsBalanceCount = 1;
}
}
}
//Called in evo in CTFGame.ovl
function ResetUnbalancedNotifyPerCap()
{
$TeamBalanceNotifyCount = 0;
$StatsBalanceCount = 0;
}
//Start and Reset Notify
package TeamCountNotify {
//Reset Notify
function DefaultGame::gameOver( %game ) {
//Call default function
parent::gameOver( %game );
//Reset TeamBalance Variables
$BalancedCount = -1;
$TeamBalanceNotifyCount = -1;
$StatsBalanceCount = -1;
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(TeamCountNotify))
activatePackage(TeamCountNotify);

19
autoexec/antiTurret.cs Normal file
View file

@ -0,0 +1,19 @@
$TurretPlayerCount = 10; // amount of players needed on server for turrets
package antiTurret {
function TurretData::selectTarget(%this, %turret)
{
if( !$Host::TournamentMode && $TotalTeamPlayerCount < $TurretPlayerCount) {
%turret.clearTarget();
}
else {
Parent::selectTarget(%this, %turret);
}
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(antiTurret))
activatePackage(antiTurret);

View file

@ -0,0 +1,21 @@
// anti NoFog Snipe by Red Shifter
// A far cry to the solution of noFog, but this'll stop the snipes
// This is a Server-Side Script
package antiNoFogSnipe {
function DefaultGame::missionLoadDone(%game) {
Parent::missionLoadDone(%game);
if (Sky.visibleDistance $= "" || Sky.visibleDistance == 0) {
// This script plays it safe. You better have a map that works.
error("WARNING! This map will not work with NoFog Snipe!");
BasicSniperShot.maxRifleRange = 1000;
}
else
BasicSniperShot.maxRifleRange = Sky.visibleDistance;
}
};
activatePackage(antiNoFogSnipe);

77
autoexec/checkver.cs Normal file
View file

@ -0,0 +1,77 @@
// TribesNext Minimum Version Enforcement
// Written by Thyth
// 2014-08-18
// Updated on 2014-08-31 after testing/feedback from Heat Killer.
// This script prevents clients from joining a non-observer team if they are not running
// TribesNext RC2a or newer, with the tournamentNetClient.vl2 installed. An early form of
// anticheat was added to the RC2 patch that kills HM2. This script allows detecting of
// a new enough version by the interaction with the TribesNext community/browser system.
// Support for clan tags (and account renaming) was added along with the HM2 killer in RC2,
// but no client side code to talk to the browser server was in yet. Now that the browser
// system backend is complete, all clients can install the tournamentNetClient to the
// browser, and users running RC2 (with HM2 killer) can be detected.
// The variable on the client object:
// %client.t2csri_sentComCertDone
// Will be 1 if they are running RC2+ with tournamentNetClient.vl2
// Admins can override this restriction when forcing players to join a team.
function checkVer_showBanner(%client)
{
// customize me
commandToClient(%client, 'CenterPrint', "<font:Sui Generis:22><color:3cb4b4>Version Check Failed!\n<font:Univers:16><color:3cb4b4>You need the latest TribesNext patch and TournyNetClient to play.\n Download it from T2Discord.tk and drop it into your GameData/Base folder.", 10, 3);
}
package checkver
{
function serverCmdClientJoinTeam(%client, %team)
{
if (!%client.t2csri_sentComCertDone)
{
checkVer_showBanner(%client);
return;
}
Parent::serverCmdClientJoinTeam(%client, %team);
}
function serverCmdClientJoinGame(%client)
{
if (!%client.t2csri_sentComCertDone)
{
checkVer_showBanner(%client);
return;
}
Parent::serverCmdClientJoinGame(%client);
}
function serverCmdClientPickedTeam(%client, %option)
{
if (!%client.t2csri_sentComCertDone)
{
checkVer_showBanner(%client);
return;
}
Parent::serverCmdClientPickedTeam(%client, %option);
}
function serverCmdClientTeamChange(%client, %option)
{
if (!%client.t2csri_sentComCertDone)
{
checkVer_showBanner(%client);
return;
}
Parent::serverCmdClientTeamChange(%client, %option);
}
function Observer::onTrigger(%data, %obj, %trigger, %state)
{
%client = %obj.getControllingClient();
if (!%client.t2csri_sentComCertDone)
{
checkVer_showBanner(%client);
return;
}
Parent::onTrigger(%data, %obj, %trigger, %state);
}
};
activatePackage(checkver);

View file

@ -0,0 +1,19 @@
// ban mortar turret from inventory in main gametypes
$InvBanList[CTF, "MortarBarrelPack"] = 1;
$InvBanList[CnH, "MortarBarrelPack"] = 1;
$InvBanList[Siege, "MortarBarrelPack"] = 1;
package noMortarTurret {
// if a mortar turret somehow makes it into the game, keep it from working
function TurretData::selectTarget(%this, %turret) {
if( %turret.initialBarrel !$= "MortarBarrelLarge" ) {
Parent::selectTarget(%this, %turret);
}
}
};
// Prevent package from being activated if it is already
if (!isActivePackage( noMortarTurret ))
activatePackage( noMortarTurret );