mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
Merge branch 'NoEvo'
This commit is contained in:
commit
18b1ec9075
|
|
@ -1,145 +0,0 @@
|
|||
// Team Autobalance Script
|
||||
//
|
||||
// Determines which team needs players and proceeds to switch them
|
||||
// Goon style: At respawn
|
||||
//
|
||||
// Enable or Disable Autobalance
|
||||
// $Host::EnableAutobalance = 1;
|
||||
//
|
||||
// exec("scripts/autoexec/Autobalance.cs");
|
||||
//
|
||||
// If it takes too long for specific canidates to die. After a time choose anyone.
|
||||
$Autobalance::Fallback = 120000; //60000 is 1 minute
|
||||
|
||||
// Run from TeamBalanceNotify.cs via NotifyUnbalanced
|
||||
function Autobalance( %game )
|
||||
{
|
||||
if(isEventPending($AutoBalanceSchedule))
|
||||
cancel($AutoBalanceSchedule);
|
||||
|
||||
if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset).
|
||||
return;
|
||||
|
||||
//Difference Variables
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
//Determine BigTeam
|
||||
if( %team1difference >= 2 )
|
||||
$BigTeam = 1;
|
||||
else if( %team2difference >= 2 )
|
||||
$BigTeam = 2;
|
||||
else
|
||||
return;
|
||||
|
||||
$Autobalance::UseAllMode = 0;
|
||||
$Autobalance::FallbackTime = getSimTime();
|
||||
%otherTeam = $BigTeam == 1 ? 2 : 1;
|
||||
$Autobalance::AMThreshold = mCeil(MissionGroup.CTF_scoreLimit/3) * 100;
|
||||
|
||||
//If BigTeam score is greater than otherteam score + threshold
|
||||
if($TeamScore[$BigTeam] > ($TeamScore[%otherTeam] + $Autobalance::AMThreshold) || $TeamRank[%otherTeam, count] $= 0)
|
||||
$Autobalance::UseAllMode = 1;
|
||||
//If BigTeam Top Players score is greater than otherTeam Top Players score + threshold
|
||||
else if($TeamRank[$BigTeam, count] >= 5 && $TeamRank[%otherTeam, count] >= 3)
|
||||
{
|
||||
%max = mfloor($TeamRank[$BigTeam, count]/2);
|
||||
if(%max > $TeamRank[%otherTeam, count])
|
||||
%max = $TeamRank[%otherTeam, count];
|
||||
%threshold = %max * 100;
|
||||
for(%i = 0; %i < %max; %i++)
|
||||
{
|
||||
%bigTeamTop = %bigTeamTop + $TeamRank[$BigTeam, %i].score;
|
||||
%otherTeamTop = %otherTeamTop + $TeamRank[%otherTeam, %i].score;
|
||||
}
|
||||
|
||||
if(%bigTeamTop > (%otherTeamTop + %threshold))
|
||||
$Autobalance::UseAllMode = 1;
|
||||
}
|
||||
//echo("Allmode " @ $Autobalance::UseAllMode);
|
||||
|
||||
//Select lower half of team rank as canidates for team change
|
||||
if(!$Autobalance::UseAllMode)
|
||||
{
|
||||
$Autobalance::Max = mFloor($TeamRank[$BigTeam, count]/2);
|
||||
for(%i = $Autobalance::Max; %i < $TeamRank[$BigTeam, count]; %i++)
|
||||
{
|
||||
//echo("[Autobalance]: Selected" SPC $TeamRank[$BigTeam, %i].nameBase @ ", " @ %i);
|
||||
$TeamRank[$BigTeam, %i].abCanidate = true;
|
||||
}
|
||||
%a = " selected";
|
||||
}
|
||||
|
||||
if($TeamRank[$BigTeam, count] - $TeamRank[%otherTeam, count] >= 3)
|
||||
%s = "s";
|
||||
|
||||
//Warning message
|
||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0Autobalance will switch the next%3 respawning player%2 on Team %1.', $TeamName[$BigTeam], %s, %a);
|
||||
}
|
||||
|
||||
function ResetABClients()
|
||||
{
|
||||
for(%i = 0; %i < $TeamRank[$BigTeam, count]; %i++)
|
||||
{
|
||||
$TeamRank[$BigTeam, %i].abCanidate = false;
|
||||
}
|
||||
}
|
||||
|
||||
package Autobalance
|
||||
{
|
||||
|
||||
function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
|
||||
{
|
||||
parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
|
||||
|
||||
if($BigTeam !$= "" && %clVictim.team == $BigTeam)
|
||||
{
|
||||
%otherTeam = $BigTeam == 1 ? 2 : 1;
|
||||
if($TeamRank[$BigTeam, count] - $TeamRank[%otherTeam, count] >= 2)
|
||||
{
|
||||
%fallback = 0;
|
||||
if((getSimTime() - $Autobalance::FallbackTime) > $Autobalance::Fallback)
|
||||
%fallback = 1;
|
||||
|
||||
//damageType 0: If someone switches to observer or disconnects
|
||||
if(%damageType !$= 0 && (%clVictim.abCanidate || $Autobalance::UseAllMode || %fallback))
|
||||
{
|
||||
echo("[Autobalance]" SPC %clVictim.nameBase @ " has been moved to Team " @ %otherTeam @ " for balancing. [AM:" @ $Autobalance::UseAllMode SPC "#BT:" @ ($TeamRank[$BigTeam, count]-1) SPC "#OT:" @ ($TeamRank[%otherTeam, count]+1) SPC "FB:" @ %fallback @ "]");
|
||||
messageClient(%clVictim, 'MsgTeamBalanceNotify', '\c0You were switched to Team %1 for balancing.~wfx/powered/vehicle_screen_on.wav', $TeamName[%otherTeam]);
|
||||
messageAllExcept(%clVictim, -1, 'MsgTeamBalanceNotify', '~wfx/powered/vehicle_screen_on.wav');
|
||||
|
||||
Game.clientChangeTeam( %clVictim, %otherTeam, 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetABClients();
|
||||
ResetTBNStatus();
|
||||
$BigTeam = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
if($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF")
|
||||
{
|
||||
//Reset Autobalance
|
||||
$BigTeam = "";
|
||||
|
||||
//Reset all clients canidate var
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%client.abCanidate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(Autobalance))
|
||||
activatePackage(Autobalance);
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
// GetTeamCounts Script
|
||||
//
|
||||
// GetTeamCounts was made to accurately keep track of how many players
|
||||
// are on teams, on the server, on each team, observer, etc.
|
||||
// AntiTurrets, Team Balance Notify, AntiCloak, AutoBalance, Base Rape and Base Rape Notify all rely on this.
|
||||
// It runs every 5 seconds.
|
||||
//
|
||||
// Whether or not a portion of the script is run or not depends on
|
||||
// if a player has switched teams or not. Or if a team changing event has occurred.
|
||||
// This is triggered via various event functions throughout the game.
|
||||
//
|
||||
|
||||
// Set reset string
|
||||
$GetCountsStatus = "UPDATE";
|
||||
|
||||
package StartTeamCounts
|
||||
{
|
||||
|
||||
function CreateServer( %mission, %missionType )
|
||||
{
|
||||
parent::CreateServer( %mission, %missionType );
|
||||
//Call for a GetTeamCount update
|
||||
GetTeamCounts(%game);
|
||||
|
||||
// Set when server starts
|
||||
// Used to reset timelimit (if voted) when map changes
|
||||
$DefaultTimeLimit = $Host::TimeLimit;
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(TeamCountsTriggers))
|
||||
activatePackage(TeamCountsTriggers);
|
||||
|
||||
// Auto Daily Hard Server Restart at a specific time
|
||||
// getTimeDif from zDarkTigerStats.cs
|
||||
if($dtStats::version)
|
||||
schedule(getTimeDif("10\t00\tam"),0,"quit");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(StartTeamCounts))
|
||||
activatePackage(StartTeamCounts);
|
||||
|
||||
function GetTeamCounts(%game)
|
||||
{
|
||||
switch$($GetCountsStatus)
|
||||
{
|
||||
case UPDATE:
|
||||
if($countdownStarted && $MatchStarted )
|
||||
{
|
||||
//Variables
|
||||
$TotalTeamPlayerCount = $TeamRank[1, count] + $TeamRank[2, count];
|
||||
$AllPlayerCount = $HostGamePlayerCount;
|
||||
|
||||
//Observers
|
||||
$Observers = $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]);
|
||||
|
||||
//echo("$PlayerCount[0] " @ $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]));
|
||||
//echo("$PlayerCount[1] " @ $TeamRank[1, count]);
|
||||
//echo("$PlayerCount[2] " @ $TeamRank[2, count]);
|
||||
|
||||
if( !$Host::TournamentMode )
|
||||
{
|
||||
if( $CurrentMissionType $= "CTF" )
|
||||
{
|
||||
NBRStatusNotify(%game);
|
||||
CheckAntiPack(%game);
|
||||
}
|
||||
TeamBalanceNotify(%game);
|
||||
}
|
||||
|
||||
//Set so counter wont run when it doesnt need to.
|
||||
$GetCountsStatus = "IDLE";
|
||||
}
|
||||
case IDLE:
|
||||
//Do Nothing
|
||||
}
|
||||
|
||||
if(isEventPending($GetCountsSchedule))
|
||||
cancel($GetCountsSchedule);
|
||||
|
||||
//Call itself again. Every 5 seconds.
|
||||
$GetCountsSchedule = schedule(5000, 0, "GetTeamCounts");
|
||||
}
|
||||
|
||||
|
||||
// Triggers a Full run
|
||||
function ResetGetCountsStatus()
|
||||
{
|
||||
$GetCountsStatus = "UPDATE";
|
||||
}
|
||||
|
||||
// Proper Overrides
|
||||
// Events that determine a TeamGetCounts update
|
||||
package TeamCountsTriggers
|
||||
{
|
||||
|
||||
function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn )
|
||||
{
|
||||
Parent::clientJoinTeam( %game, %client, %team, %respawn );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawned)
|
||||
{
|
||||
Parent::clientChangeTeam(%game, %client, %team, %fromObs, %respawned);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::assignClientTeam(%game, %client, %respawn )
|
||||
{
|
||||
Parent::assignClientTeam(%game, %client, %respawn );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::onClientEnterObserverMode( %game, %client )
|
||||
{
|
||||
Parent::onClientEnterObserverMode( %game, %client );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::AIChangeTeam(%game, %client, %newTeam)
|
||||
{
|
||||
Parent::AIChangeTeam(%game, %client, %newTeam);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch)
|
||||
{
|
||||
Parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
{
|
||||
Parent::onDrop(%client, %reason);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
// LockedTeams.cs
|
||||
|
||||
// Toggled in serverCmdStartNewVote in VoteMenu.cs
|
||||
//
|
||||
// case "ToggleLockedTeams":
|
||||
// if (%client.isAdmin)
|
||||
// {
|
||||
// if(!$LockedTeams)
|
||||
// {
|
||||
// if(!isActivePackage(LockedTeams))
|
||||
// activatePackage(LockedTeams);
|
||||
// $LockedTeams = 1;
|
||||
// messageClient( %client, '', "Locked Teams has been enabled.~wfx/powered/vehicle_screen_on.wav" );
|
||||
// adminLog(%client, " has enabled Locked Teams.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if(isActivePackage(LockedTeams))
|
||||
// deactivatePackage(LockedTeams);
|
||||
// $LockedTeams = 0;
|
||||
// messageClient( %client, '', "Locked Teams has been disabled.~wfx/powered/vehicle_screen_on.wav" );
|
||||
// adminLog(%client, " has disabled Locked Teams.");
|
||||
// }
|
||||
// }
|
||||
// return;
|
||||
|
||||
// Reset in MissionTypeOptions.cs
|
||||
//
|
||||
// if(isActivePackage(LockedTeams) && !$LockedTeams)
|
||||
// deactivatePackage(LockedTeams);
|
||||
|
||||
package LockedTeams
|
||||
{
|
||||
|
||||
// function serverCmdClientJoinTeam(%client, %team)
|
||||
// {
|
||||
// if ($LockedTeams)
|
||||
// {
|
||||
// messageClient( %client, '', "Teams are locked. Asked the admin to set your team. (JoinTeam)" );
|
||||
// return;
|
||||
// }
|
||||
// Parent::serverCmdClientJoinTeam(%client, %team);
|
||||
// }
|
||||
|
||||
function serverCmdClientJoinGame(%client)
|
||||
{
|
||||
if ($LockedTeams)
|
||||
{
|
||||
messageClient( %client, '', "Teams are locked. Ask the admin to set your team." );
|
||||
return;
|
||||
}
|
||||
Parent::serverCmdClientJoinGame(%client);
|
||||
}
|
||||
|
||||
function serverCmdClientPickedTeam(%client, %option)
|
||||
{
|
||||
Parent::serverCmdClientPickedTeam(%client, %option); //Put first
|
||||
if($LockedTeams) //Added
|
||||
{
|
||||
if($Host::TournamentMode && %client.team !$= 0) //Added
|
||||
{
|
||||
messageClient( %client, '', "Teams are locked. Ask the admin to set your team." );
|
||||
serverCmdClientMakeObserver( %client );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function serverCmdClientTeamChange(%client, %option)
|
||||
{
|
||||
if ($LockedTeams)
|
||||
{
|
||||
messageClient( %client, '', "Teams are locked. Ask the admin to set your team." );
|
||||
return;
|
||||
}
|
||||
Parent::serverCmdClientTeamChange(%client, %option);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -20,22 +20,29 @@ function loadMissionStage2()
|
|||
switch$($Host::PUGpasswordAlwaysOn)
|
||||
{
|
||||
case 0:
|
||||
if( $CurrentMissionType !$= "LakRabbit" )
|
||||
if( $CurrentMissionType !$= "LakRabbit" )
|
||||
{
|
||||
if( $Host::TournamentMode && $Host::PUGautoPassword )
|
||||
$Host::Password = $Host::PUGPassword;
|
||||
else if( !$Host::TournamentMode )
|
||||
$Host::Password = "";
|
||||
$LockedTeams = 0;
|
||||
{
|
||||
if($Host::Password)
|
||||
$Host::Password = "";
|
||||
if($LockedTeams)
|
||||
$LockedTeams = 0;
|
||||
}
|
||||
|
||||
//Set server mode to SPEED
|
||||
$Host::HiVisibility = "0";
|
||||
}
|
||||
else if( $CurrentMissionType $= "LakRabbit" )
|
||||
else if( $CurrentMissionType $= "LakRabbit" )
|
||||
{
|
||||
$Host::Password = "";
|
||||
$Host::TournamentMode = 0;
|
||||
$LockedTeams = 0;
|
||||
if($Host::Password)
|
||||
$Host::Password = "";
|
||||
if($LockedTeams)
|
||||
$LockedTeams = 0;
|
||||
if($Host::TournamentMode)
|
||||
$Host::TournamentMode = 0;
|
||||
|
||||
//Set server mode to DISTANCE
|
||||
$Host::HiVisibility = "1";
|
||||
|
|
@ -44,16 +51,16 @@ function loadMissionStage2()
|
|||
$Host::Password = $Host::PUGPassword;
|
||||
$Host::HiVisibility = "0"; //always SPEED
|
||||
}
|
||||
|
||||
|
||||
//Siege NoBaseRape Fix
|
||||
if( $CurrentMissionType $= "Siege" )
|
||||
if( $CurrentMissionType $= "Siege" )
|
||||
$Host::NoBaseRapeEnabled = 0;
|
||||
else
|
||||
$Host::NoBaseRapeEnabled = 1;
|
||||
|
||||
|
||||
if(isActivePackage(LockedTeams) && !$LockedTeams)
|
||||
deactivatePackage(LockedTeams);
|
||||
|
||||
|
||||
parent::loadMissionStage2();
|
||||
}
|
||||
|
||||
|
|
@ -61,4 +68,4 @@ function loadMissionStage2()
|
|||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(MissionTypeOptions))
|
||||
activatePackage(MissionTypeOptions);
|
||||
activatePackage(MissionTypeOptions);
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
// No Base Rape Notify Script
|
||||
//
|
||||
// Notifys clients if NoBase rape is on or off.
|
||||
//
|
||||
// Enable or Disable
|
||||
// $Host::EnableNoBaseRapeNotify = 1;
|
||||
//
|
||||
|
||||
// Called in GetTeamCounts.cs
|
||||
function NBRStatusNotify( %game )
|
||||
{
|
||||
if( $Host::EnableNoBaseRapeNotify && $Host::NoBaseRapeEnabled )
|
||||
{
|
||||
//On
|
||||
if( $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount )
|
||||
{
|
||||
if( $NBRStatus !$= "PLAYEDON" )
|
||||
$NBRStatus = "ON";
|
||||
}
|
||||
//Off
|
||||
else
|
||||
{
|
||||
if( $NBRStatus !$= "PLAYEDOFF" )
|
||||
$NBRStatus = "OFF";
|
||||
}
|
||||
|
||||
switch$($NBRStatus)
|
||||
{
|
||||
case ON:
|
||||
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Enabled.');
|
||||
$NBRStatus = "PLAYEDON";
|
||||
case OFF:
|
||||
messageAll('MsgNoBaseRapeNotify', '\c1No Base Rape: \c0Disabled.~wfx/misc/diagnostic_on.wav');
|
||||
$NBRStatus = "PLAYEDOFF";
|
||||
case PLAYEDON:
|
||||
//Do Nothing
|
||||
case PLAYEDOFF:
|
||||
//Do Nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reset gameover
|
||||
package ResetNBRNotify
|
||||
{
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset NoBaseRapeNotify
|
||||
$NBRStatus = "IDLE";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(ResetNBRNotify))
|
||||
activatePackage(ResetNBRNotify);
|
||||
|
||||
|
||||
|
|
@ -303,6 +303,3 @@ function ConcussionGrenadeThrown::onThrow(%this, %gren)
|
|||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(TacoOverrides))
|
||||
activatePackage(TacoOverrides);
|
||||
|
||||
//Ban WhiteOut Grenade
|
||||
$InvBanList[CTF, "FlashGrenade"] = 1;
|
||||
|
|
|
|||
|
|
@ -1,120 +0,0 @@
|
|||
// Team Balance Notify Script
|
||||
//
|
||||
// Give the client a notification on the current state of balancing
|
||||
// Furthermore if Autobalance is enabled. Proceed to Autobalancing
|
||||
// Autobalance does not need TeamBalanceNotify to be enabled to run
|
||||
//
|
||||
// Enable or Disable
|
||||
// $Host::EnableTeamBalanceNotify = 1;
|
||||
// Enable or Disable Autobalance
|
||||
// $Host::EnableAutobalance = 1;
|
||||
//
|
||||
|
||||
|
||||
// Called in GetTeamCounts.cs
|
||||
function TeamBalanceNotify(%game)
|
||||
{
|
||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
||||
{
|
||||
//Uneven
|
||||
if($TeamRank[1, count] !$= $TeamRank[2, count])
|
||||
{
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
//echo("%Team1Difference " @ %team1difference);
|
||||
//echo("%Team2Difference " @ %team2difference);
|
||||
|
||||
if( %team1difference >= 2 || %team2difference >= 2 ) //Teams are unbalanced
|
||||
{
|
||||
if( $TBNStatus !$= "NOTIFY" ) //Stops any new schedules
|
||||
$TBNStatus = "UNBALANCED";
|
||||
}
|
||||
else
|
||||
//Man down. 6vs7, 4vs3 etc
|
||||
$TBNStatus = "UNEVEN";
|
||||
}
|
||||
//Teams are even
|
||||
else if($TeamRank[1, count] == $TeamRank[2, count] && $TBNStatus !$= "PLAYEDEVEN" )
|
||||
$TBNStatus = "EVEN";
|
||||
|
||||
switch$($TBNStatus)
|
||||
{
|
||||
case IDLE:
|
||||
//Do Nothing
|
||||
case UNEVEN:
|
||||
//Do Nothing
|
||||
case UNBALANCED:
|
||||
//Start Schedule to Notify
|
||||
$NotifySchedule = schedule(15000, 0, "NotifyUnbalanced", %game );
|
||||
$TBNStatus = "NOTIFY";
|
||||
case EVEN:
|
||||
//messageAll('MsgTeamBalanceNotify', '\c1Teams are balanced.');
|
||||
$TBNStatus = "PLAYEDEVEN";
|
||||
case PLAYEDEVEN:
|
||||
//Do Nothing
|
||||
case NOTIFY:
|
||||
//Do Nothing
|
||||
}
|
||||
}
|
||||
//echo($TBNStatus);
|
||||
}
|
||||
|
||||
//Check to see if teams are still unbalanced
|
||||
//Fire AutoBalance in 30 sec if enabled
|
||||
function NotifyUnbalanced( %game )
|
||||
{
|
||||
if(isEventPending($NotifySchedule))
|
||||
cancel($NotifySchedule);
|
||||
|
||||
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
||||
return;
|
||||
|
||||
//Difference Variables
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
if( %team1difference >= 2 || %team2difference >= 2 )
|
||||
{
|
||||
//Autobalance Warning
|
||||
if( $Host::EnableAutobalance )
|
||||
{
|
||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0Autobalance Initializing.~wgui/vote_nopass.wav');
|
||||
$AutoBalanceSchedule = schedule(30000, 0, "Autobalance", %game );
|
||||
}
|
||||
//If Autobalance is disabled, message only.
|
||||
else if( $Host::EnableTeamBalanceNotify )
|
||||
{
|
||||
%observers = $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]);
|
||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0%1 vs %2 with %3 observers.~wgui/vote_nopass.wav', $TeamRank[1, count], $TeamRank[2, count], %observers );
|
||||
schedule(13000, 0, "ResetTBNStatus");
|
||||
schedule(15000, 0, "ResetGetCountsStatus");
|
||||
}
|
||||
}
|
||||
else
|
||||
ResetTBNStatus();
|
||||
}
|
||||
|
||||
// Reset TBNStatus
|
||||
function ResetTBNStatus()
|
||||
{
|
||||
$TBNStatus = "IDLE";
|
||||
}
|
||||
|
||||
// Reset every map change
|
||||
package ResetTBNGameOver
|
||||
{
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset TBNStatus
|
||||
ResetTBNStatus();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(ResetTBNGameOver))
|
||||
activatePackage(ResetTBNGameOver);
|
||||
432
Classic/scripts/autoexec/TeamManagement.cs
Normal file
432
Classic/scripts/autoexec/TeamManagement.cs
Normal file
|
|
@ -0,0 +1,432 @@
|
|||
// GetTeamCounts Script
|
||||
//
|
||||
// GetTeamCounts was made to accurately keep track of how many players
|
||||
// are on teams, on the server, on each team, observer, etc.
|
||||
// AntiTurrets, Team Balance Notify, AntiCloak, AutoBalance, Base Rape and Base Rape Notify all rely on this.
|
||||
// It runs every 5 seconds.
|
||||
//
|
||||
// Whether or not a portion of the script is run or not depends on
|
||||
// if a player has switched teams or not. Or if a team changing event has occurred.
|
||||
// This is triggered via various event functions throughout the game.
|
||||
//
|
||||
// If it takes too long for specific canidates to die. After a time choose anyone.
|
||||
$Autobalance::Fallback = 120000; //60000 is 1 minute
|
||||
|
||||
// Set reset string
|
||||
$GetCountsStatus = "UPDATE";
|
||||
|
||||
package StartTeamCounts
|
||||
{
|
||||
|
||||
function CreateServer( %mission, %missionType )
|
||||
{
|
||||
parent::CreateServer( %mission, %missionType );
|
||||
//Call for a GetTeamCount update
|
||||
GetTeamCounts(%game);
|
||||
|
||||
// Set when server starts
|
||||
// Used to reset timelimit (if voted) when map changes
|
||||
$DefaultTimeLimit = $Host::TimeLimit;
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(TeamCountsTriggers))
|
||||
activatePackage(TeamCountsTriggers);
|
||||
|
||||
// Auto Daily Hard Server Restart at a specific time
|
||||
// getTimeDif from zDarkTigerStats.cs
|
||||
if($dtStats::version)
|
||||
schedule(getTimeDif("10\t00\tam"),0,"quit");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(StartTeamCounts))
|
||||
activatePackage(StartTeamCounts);
|
||||
|
||||
function GetTeamCounts(%game)
|
||||
{
|
||||
switch$($GetCountsStatus)
|
||||
{
|
||||
case UPDATE:
|
||||
if($countdownStarted && $MatchStarted )
|
||||
{
|
||||
//Variables
|
||||
$TotalTeamPlayerCount = $TeamRank[1, count] + $TeamRank[2, count];
|
||||
$AllPlayerCount = $HostGamePlayerCount;
|
||||
|
||||
//Observers
|
||||
$Observers = $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]);
|
||||
|
||||
//echo("$PlayerCount[0] " @ $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]));
|
||||
//echo("$PlayerCount[1] " @ $TeamRank[1, count]);
|
||||
//echo("$PlayerCount[2] " @ $TeamRank[2, count]);
|
||||
|
||||
if( !$Host::TournamentMode )
|
||||
{
|
||||
if( $CurrentMissionType $= "CTF" )
|
||||
{
|
||||
NBRStatusNotify(%game);
|
||||
CheckAntiPack(%game);
|
||||
}
|
||||
TeamBalanceNotify(%game);
|
||||
}
|
||||
|
||||
//Set so counter wont run when it doesnt need to.
|
||||
$GetCountsStatus = "IDLE";
|
||||
}
|
||||
case IDLE:
|
||||
//Do Nothing
|
||||
}
|
||||
|
||||
if(isEventPending($GetCountsSchedule))
|
||||
cancel($GetCountsSchedule);
|
||||
|
||||
//Call itself again. Every 5 seconds.
|
||||
$GetCountsSchedule = schedule(5000, 0, "GetTeamCounts");
|
||||
}
|
||||
|
||||
|
||||
// Triggers a Full run
|
||||
function ResetGetCountsStatus()
|
||||
{
|
||||
$GetCountsStatus = "UPDATE";
|
||||
}
|
||||
|
||||
// Proper Overrides
|
||||
// Events that determine a TeamGetCounts update
|
||||
package TeamCountsTriggers
|
||||
{
|
||||
|
||||
function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn )
|
||||
{
|
||||
Parent::clientJoinTeam( %game, %client, %team, %respawn );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawned)
|
||||
{
|
||||
Parent::clientChangeTeam(%game, %client, %team, %fromObs, %respawned);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::assignClientTeam(%game, %client, %respawn )
|
||||
{
|
||||
Parent::assignClientTeam(%game, %client, %respawn );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::onClientEnterObserverMode( %game, %client )
|
||||
{
|
||||
Parent::onClientEnterObserverMode( %game, %client );
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::AIChangeTeam(%game, %client, %newTeam)
|
||||
{
|
||||
Parent::AIChangeTeam(%game, %client, %newTeam);
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function GameConnection::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch)
|
||||
{
|
||||
Parent::onConnect(%client, %name, %raceGender, %skin, %voice, %voicePitch);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
{
|
||||
Parent::onDrop(%client, %reason);
|
||||
|
||||
//Reset GetCounts
|
||||
ResetGetCountsStatus();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Team Balance Notify Script
|
||||
//
|
||||
// Give the client a notification on the current state of balancing
|
||||
// Furthermore if Autobalance is enabled. Proceed to Autobalancing
|
||||
// Autobalance does not need TeamBalanceNotify to be enabled to run
|
||||
//
|
||||
// Enable or Disable
|
||||
// $Host::EnableTeamBalanceNotify = 1;
|
||||
// Enable or Disable Autobalance
|
||||
// $Host::EnableAutobalance = 1;
|
||||
//
|
||||
|
||||
|
||||
// Called in GetTeamCounts
|
||||
function TeamBalanceNotify(%game)
|
||||
{
|
||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 )
|
||||
{
|
||||
//Uneven
|
||||
if($TeamRank[1, count] !$= $TeamRank[2, count])
|
||||
{
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
//echo("%Team1Difference " @ %team1difference);
|
||||
//echo("%Team2Difference " @ %team2difference);
|
||||
|
||||
if( %team1difference >= 2 || %team2difference >= 2 ) //Teams are unbalanced
|
||||
{
|
||||
if( $TBNStatus !$= "NOTIFY" ) //Stops any new schedules
|
||||
$TBNStatus = "UNBALANCED";
|
||||
}
|
||||
else
|
||||
//Man down. 6vs7, 4vs3 etc
|
||||
$TBNStatus = "UNEVEN";
|
||||
}
|
||||
//Teams are even
|
||||
else if($TeamRank[1, count] == $TeamRank[2, count] && $TBNStatus !$= "PLAYEDEVEN" )
|
||||
$TBNStatus = "EVEN";
|
||||
|
||||
switch$($TBNStatus)
|
||||
{
|
||||
case IDLE:
|
||||
//Do Nothing
|
||||
case UNEVEN:
|
||||
//Do Nothing
|
||||
case UNBALANCED:
|
||||
//Start Schedule to Notify
|
||||
$NotifySchedule = schedule(15000, 0, "NotifyUnbalanced", %game );
|
||||
$TBNStatus = "NOTIFY";
|
||||
case EVEN:
|
||||
//messageAll('MsgTeamBalanceNotify', '\c1Teams are balanced.');
|
||||
$TBNStatus = "PLAYEDEVEN";
|
||||
case PLAYEDEVEN:
|
||||
//Do Nothing
|
||||
case NOTIFY:
|
||||
//Do Nothing
|
||||
}
|
||||
}
|
||||
//echo($TBNStatus);
|
||||
}
|
||||
|
||||
//Check to see if teams are still unbalanced
|
||||
//Fire AutoBalance in 30 sec if enabled
|
||||
function NotifyUnbalanced( %game )
|
||||
{
|
||||
if(isEventPending($NotifySchedule))
|
||||
cancel($NotifySchedule);
|
||||
|
||||
if( $TBNStatus !$= "NOTIFY" ) //If Status has changed to EVEN or anything else (GameOver reset).
|
||||
return;
|
||||
|
||||
//Difference Variables
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
if( %team1difference >= 2 || %team2difference >= 2 )
|
||||
{
|
||||
//Autobalance Warning
|
||||
if( $Host::EnableAutobalance )
|
||||
{
|
||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0Autobalance Initializing.~wgui/vote_nopass.wav');
|
||||
$AutoBalanceSchedule = schedule(30000, 0, "Autobalance", %game );
|
||||
}
|
||||
//If Autobalance is disabled, message only.
|
||||
else if( $Host::EnableTeamBalanceNotify )
|
||||
{
|
||||
%observers = $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]);
|
||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0%1 vs %2 with %3 observers.~wgui/vote_nopass.wav', $TeamRank[1, count], $TeamRank[2, count], %observers );
|
||||
schedule(13000, 0, "ResetTBNStatus");
|
||||
schedule(15000, 0, "ResetGetCountsStatus");
|
||||
}
|
||||
}
|
||||
else
|
||||
ResetTBNStatus();
|
||||
}
|
||||
|
||||
// Reset TBNStatus
|
||||
function ResetTBNStatus()
|
||||
{
|
||||
$TBNStatus = "IDLE";
|
||||
}
|
||||
|
||||
// Reset every map change
|
||||
package ResetTBNGameOver
|
||||
{
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset TBNStatus
|
||||
ResetTBNStatus();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(ResetTBNGameOver))
|
||||
activatePackage(ResetTBNGameOver);
|
||||
|
||||
|
||||
// Team Autobalance Script
|
||||
//
|
||||
// Determines which team needs players and proceeds to switch them
|
||||
// Goon style: At respawn
|
||||
//
|
||||
// Enable or Disable Autobalance
|
||||
// $Host::EnableAutobalance = 1;
|
||||
//
|
||||
// exec("scripts/autoexec/Autobalance.cs");
|
||||
//
|
||||
|
||||
// Run from TeamBalanceNotify via NotifyUnbalanced
|
||||
function Autobalance( %game )
|
||||
{
|
||||
if(isEventPending($AutoBalanceSchedule))
|
||||
cancel($AutoBalanceSchedule);
|
||||
|
||||
if($TBNStatus !$= "NOTIFY") //If Status has changed to EVEN or anything else (GameOver reset).
|
||||
return;
|
||||
|
||||
//Difference Variables
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
//Determine BigTeam
|
||||
if( %team1difference >= 2 )
|
||||
$BigTeam = 1;
|
||||
else if( %team2difference >= 2 )
|
||||
$BigTeam = 2;
|
||||
else
|
||||
return;
|
||||
|
||||
$Autobalance::UseAllMode = 0;
|
||||
$Autobalance::FallbackTime = getSimTime();
|
||||
%otherTeam = $BigTeam == 1 ? 2 : 1;
|
||||
$Autobalance::AMThreshold = mCeil(MissionGroup.CTF_scoreLimit/3) * 100;
|
||||
|
||||
//If BigTeam score is greater than otherteam score + threshold
|
||||
if($TeamScore[$BigTeam] > ($TeamScore[%otherTeam] + $Autobalance::AMThreshold) || $TeamRank[%otherTeam, count] $= 0)
|
||||
$Autobalance::UseAllMode = 1;
|
||||
//If BigTeam Top Players score is greater than otherTeam Top Players score + threshold
|
||||
else if($TeamRank[$BigTeam, count] >= 5 && $TeamRank[%otherTeam, count] >= 3)
|
||||
{
|
||||
%max = mfloor($TeamRank[$BigTeam, count]/2);
|
||||
if(%max > $TeamRank[%otherTeam, count])
|
||||
%max = $TeamRank[%otherTeam, count];
|
||||
%threshold = %max * 100;
|
||||
for(%i = 0; %i < %max; %i++)
|
||||
{
|
||||
%bigTeamTop = %bigTeamTop + $TeamRank[$BigTeam, %i].score;
|
||||
%otherTeamTop = %otherTeamTop + $TeamRank[%otherTeam, %i].score;
|
||||
}
|
||||
|
||||
if(%bigTeamTop > (%otherTeamTop + %threshold))
|
||||
$Autobalance::UseAllMode = 1;
|
||||
}
|
||||
//echo("Allmode " @ $Autobalance::UseAllMode);
|
||||
|
||||
//Select lower half of team rank as canidates for team change
|
||||
if(!$Autobalance::UseAllMode)
|
||||
{
|
||||
//Reset clients canidate var
|
||||
ResetABClients();
|
||||
|
||||
$Autobalance::Max = mFloor($TeamRank[$BigTeam, count]/2);
|
||||
for(%i = $Autobalance::Max; %i < $TeamRank[$BigTeam, count]; %i++)
|
||||
{
|
||||
//echo("[Autobalance]: Selected" SPC $TeamRank[$BigTeam, %i].nameBase @ ", " @ %i);
|
||||
$TeamRank[$BigTeam, %i].abCanidate = true;
|
||||
}
|
||||
%a = " selected";
|
||||
}
|
||||
|
||||
if($TeamRank[$BigTeam, count] - $TeamRank[%otherTeam, count] >= 3)
|
||||
%s = "s";
|
||||
|
||||
//Warning message
|
||||
messageAll('MsgTeamBalanceNotify', '\c1Teams are unbalanced: \c0Autobalance will switch the next%3 respawning player%2 on Team %1.', $TeamName[$BigTeam], %s, %a);
|
||||
}
|
||||
|
||||
function ResetABClients()
|
||||
{
|
||||
for(%i = 0; %i < $TeamRank[$BigTeam, count]; %i++)
|
||||
{
|
||||
$TeamRank[$BigTeam, %i].abCanidate = false;
|
||||
}
|
||||
}
|
||||
|
||||
package Autobalance
|
||||
{
|
||||
|
||||
function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
|
||||
{
|
||||
parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
|
||||
|
||||
if($BigTeam !$= "" && %clVictim.team == $BigTeam)
|
||||
{
|
||||
%otherTeam = $BigTeam == 1 ? 2 : 1;
|
||||
if($TeamRank[$BigTeam, count] - $TeamRank[%otherTeam, count] >= 2)
|
||||
{
|
||||
%fallback = 0;
|
||||
if((getSimTime() - $Autobalance::FallbackTime) > $Autobalance::Fallback)
|
||||
%fallback = 1;
|
||||
|
||||
//damageType 0: If someone switches to observer or disconnects
|
||||
if(%damageType !$= 0 && (%clVictim.abCanidate || $Autobalance::UseAllMode || %fallback))
|
||||
{
|
||||
echo("[Autobalance]" SPC %clVictim.nameBase @ " has been moved to Team " @ %otherTeam @ " for balancing. [AM:" @ $Autobalance::UseAllMode SPC "#BT:" @ ($TeamRank[$BigTeam, count]-1) SPC "#OT:" @ ($TeamRank[%otherTeam, count]+1) SPC "FB:" @ %fallback @ "]");
|
||||
messageClient(%clVictim, 'MsgTeamBalanceNotify', '\c0You were switched to Team %1 for balancing.~wfx/powered/vehicle_screen_on.wav', $TeamName[%otherTeam]);
|
||||
messageAllExcept(%clVictim, -1, 'MsgTeamBalanceNotify', '~wfx/powered/vehicle_screen_on.wav');
|
||||
|
||||
Game.clientChangeTeam( %clVictim, %otherTeam, 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetABClients();
|
||||
ResetTBNStatus();
|
||||
$BigTeam = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset Autobalance
|
||||
$BigTeam = "";
|
||||
|
||||
//Reset all clients canidate var
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%client.abCanidate = false;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(Autobalance))
|
||||
activatePackage(Autobalance);
|
||||
|
|
@ -171,7 +171,7 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
|
|||
messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password');
|
||||
else
|
||||
messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password');
|
||||
|
||||
|
||||
if($LockedTeams)
|
||||
messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams');
|
||||
else
|
||||
|
|
@ -568,7 +568,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
adminLog(%client, " has enabled Net Tourney Client checking.");
|
||||
}
|
||||
}
|
||||
return;
|
||||
return;
|
||||
case "ForceVote":
|
||||
if (%client.isAdmin && $Host::AllowAdminVotes)
|
||||
{
|
||||
|
|
@ -746,7 +746,7 @@ function DefaultGame::voteKickPlayer(%game, %admin, %client)
|
|||
{
|
||||
kick(%client, %admin, %game.kickGuid);
|
||||
%cause = "(vote)";
|
||||
|
||||
|
||||
%key = "Passed";
|
||||
}
|
||||
else
|
||||
|
|
@ -783,7 +783,7 @@ function DefaultGame::voteKickPlayer(%game, %admin, %client)
|
|||
function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId)
|
||||
{
|
||||
%typeName = "VoteChangeMission";
|
||||
|
||||
|
||||
%mission = $HostMissionFile[%missionId];
|
||||
if ( %mission $= "" )
|
||||
{
|
||||
|
|
@ -839,7 +839,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ
|
|||
function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId )
|
||||
{
|
||||
%typeName = "VoteTournamentMode";
|
||||
|
||||
|
||||
%mission = $HostMissionFile[%missionId];
|
||||
if ( %mission $= "" )
|
||||
{
|
||||
|
|
@ -864,16 +864,16 @@ function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %t
|
|||
{
|
||||
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
|
||||
// Added people who dont vote into the equation, now if you do not vote, it doesn't count as a no. - z0dd - ZOD
|
||||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone)) > ($Host::VotePasspercent / 100))
|
||||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone)) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
messageAll('MsgVotePassed', '\c2Server switched to Tournament mode by vote (%1): %2 percent.', %missionDisplayName, mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100));
|
||||
|
||||
|
||||
//Log Vote % - Must be before Game Over
|
||||
%key = "Passed";
|
||||
votePercentLog(%missionDisplayName, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
|
||||
//Show Vote %
|
||||
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
|
||||
|
||||
|
||||
setModeTournament( %mission, %missionType );
|
||||
}
|
||||
else
|
||||
|
|
@ -883,7 +883,7 @@ function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %t
|
|||
votePercentLog(%missionDisplayName, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
|
||||
//Show Vote %
|
||||
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
|
||||
|
||||
|
||||
messageAll('MsgVoteFailed', '\c2Tournament mode vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100));
|
||||
}
|
||||
}
|
||||
|
|
@ -896,7 +896,7 @@ function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %t
|
|||
function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
|
||||
{
|
||||
%typeName = "VoteChangeTimeLimit";
|
||||
|
||||
|
||||
if( %newLimit == 999 )
|
||||
%display = "unlimited";
|
||||
else
|
||||
|
|
@ -936,7 +936,7 @@ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
|
|||
votePercentLog(%newLimit, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
|
||||
//Show Vote %
|
||||
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
|
||||
|
||||
|
||||
// VoteOvertime
|
||||
ResetVOall(%game);
|
||||
}
|
||||
|
|
@ -984,7 +984,7 @@ function DefaultGame::voteFFAMode( %game, %admin, %client )
|
|||
function DefaultGame::voteSkipMission(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||
{
|
||||
%typeName = "VoteSkipMission";
|
||||
|
||||
|
||||
if(isObject(%admin))
|
||||
{
|
||||
messageAll('MsgAdminForce', '\c2The Admin %1 has skipped to the next mission.',%admin.name );
|
||||
|
|
@ -999,13 +999,13 @@ function DefaultGame::voteSkipMission(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
|||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone)) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
messageAll('MsgVotePassed', '\c2The mission was skipped to next by vote.');
|
||||
|
||||
|
||||
//Log Vote % - Must be before Game Over
|
||||
%key = "Passed";
|
||||
votePercentLog("N/A", %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
|
||||
//Show Vote %
|
||||
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
|
||||
|
||||
|
||||
echo("mission skipped (vote)");
|
||||
%game.gameOver();
|
||||
//loadMission( findNextCycleMission(), $CurrentMissionType, false );
|
||||
|
|
@ -1014,7 +1014,7 @@ function DefaultGame::voteSkipMission(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
|||
else
|
||||
{
|
||||
messageAll('MsgVoteFailed', '\c2Skip mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100));
|
||||
|
||||
|
||||
//Log Vote %
|
||||
%key = "Failed";
|
||||
votePercentLog("N/A", %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
|
||||
|
|
@ -1442,6 +1442,53 @@ function resetViewSchedule(%client)
|
|||
%client.schedViewRules = "";
|
||||
}
|
||||
|
||||
// Locked Teams code (Tournament Mode Only)
|
||||
// Doesnt allow players Joining the server late to join teams when enable, disables when server if switched back to free for all mode
|
||||
|
||||
// Reset in MissionTypeOptions.cs
|
||||
//
|
||||
// if(isActivePackage(LockedTeams) && !$LockedTeams)
|
||||
// deactivatePackage(LockedTeams);
|
||||
|
||||
package LockedTeams
|
||||
{
|
||||
|
||||
function serverCmdClientJoinGame(%client)
|
||||
{
|
||||
if($LockedTeams)
|
||||
{
|
||||
messageClient( %client, '', "Teams are locked. Ask the admin to set your team." );
|
||||
return;
|
||||
}
|
||||
Parent::serverCmdClientJoinGame(%client);
|
||||
}
|
||||
|
||||
function serverCmdClientPickedTeam(%client, %option)
|
||||
{
|
||||
Parent::serverCmdClientPickedTeam(%client, %option); //Put first
|
||||
if($LockedTeams) //Added
|
||||
{
|
||||
if($Host::TournamentMode && %client.team !$= 0) //Added
|
||||
{
|
||||
messageClient( %client, '', "Teams are locked. Ask the admin to set your team." );
|
||||
serverCmdClientMakeObserver( %client );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function serverCmdClientTeamChange(%client, %option)
|
||||
{
|
||||
if($LockedTeams)
|
||||
{
|
||||
messageClient( %client, '', "Teams are locked. Ask the admin to set your team." );
|
||||
return;
|
||||
}
|
||||
Parent::serverCmdClientTeamChange(%client, %option);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(ExtraVoteMenu))
|
||||
activatePackage(ExtraVoteMenu);
|
||||
|
|
|
|||
5
Classic/scripts/autoexec/dtBanSystem.cs
Normal file → Executable file
5
Classic/scripts/autoexec/dtBanSystem.cs
Normal file → Executable file
|
|
@ -10,6 +10,10 @@
|
|||
//$dtBanList::GUID3555379 = "DAY OF THE YEAR BANNED \t YEAR BANNED \t HOUR BANNED \t MINUTE BANNED \t TIME TO BE BANNED";
|
||||
//$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400";
|
||||
|
||||
//TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER
|
||||
//unban(%guid,%ip); in console
|
||||
//Example: unban(555555,"22.222.222.222"); put ip in quotes
|
||||
|
||||
package dtBan
|
||||
{
|
||||
|
||||
|
|
@ -147,6 +151,7 @@ function unban(%guid,%ip){
|
|||
$dtBanList::GUID[%guid] = "";
|
||||
error("GUID" SPC %guid SPC "UNBANNED");
|
||||
}
|
||||
%ip = strReplace(%ip, ".", "_");
|
||||
if($dtBanList::IP[%ip] !$= ""){
|
||||
$dtBanList::IP[%ip] = "";
|
||||
error("IP" SPC %ip SPC "UNBANNED");
|
||||
|
|
|
|||
660
Classic/scripts/autoexec/zDarkTigerStats.cs
Executable file → Normal file
660
Classic/scripts/autoexec/zDarkTigerStats.cs
Executable file → Normal file
File diff suppressed because it is too large
Load diff
46
Classic/scripts/autoexec/zDebriefLoadingScreen.cs
Normal file → Executable file
46
Classic/scripts/autoexec/zDebriefLoadingScreen.cs
Normal file → Executable file
|
|
@ -33,11 +33,11 @@
|
|||
// $Host::LoadScreenLine1 = "Join Discord:";
|
||||
// $Host::LoadScreenLine1_Msg = "https://discord.me/tribes2";
|
||||
// $Host::LoadScreenLine2 = "Game Modes:";
|
||||
// $Host::LoadScreenLine2_Msg = "LakRabbit, Capture the Flag, DeathMatch, (Light Only) Capture the Flag";
|
||||
// $Host::LoadScreenLine2_Msg = "LakRabbit, Capture the Flag, DeathMatch, (Light Only) Capture the Flag";
|
||||
// $Host::LoadScreenLine3 = "Required Mappacks:";
|
||||
// $Host::LoadScreenLine3_Msg = "S5, S8, TWL, TWL2";
|
||||
// $Host::LoadScreenLine4 = "Server Provided by:";
|
||||
// $Host::LoadScreenLine4_Msg = "Ravin";
|
||||
// $Host::LoadScreenLine4_Msg = "Ravin";
|
||||
// $Host::LoadScreenLine5 = "Server Hosted by:";
|
||||
// $Host::LoadScreenLine5_Msg = "Branzone";
|
||||
// $Host::LoadScreenLine6 = "Server Github:";
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
// First Screen loading time (Map Screen)
|
||||
// If this is set too low the second screen wont show at all
|
||||
$dtLoadingScreen::FirstScreen = 6000;
|
||||
$dtLoadingScreen::FirstScreen = 5500;
|
||||
// Second Screen Delay
|
||||
$dtLoadingScreen::Delay = 0;
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ if( $Host::LoadScreenColor3 $= " " ) $Host::LoadScreenColor3 = "33CCCC";
|
|||
// So ServerDefaults wont replace a "" value when meant to be blank
|
||||
function DLSBlank()
|
||||
{
|
||||
for(%x = 1; %x <= 4; %x++)
|
||||
for(%x = 1; %x <= 4; %x++)
|
||||
{
|
||||
if( $Host::LoadScreenMOTD[%x] $= "")
|
||||
{
|
||||
|
|
@ -88,7 +88,7 @@ DLSBlank();
|
|||
// Keep it in a package to be neat and organized!
|
||||
package LoadScreenPackage
|
||||
{
|
||||
function sendLoadInfoToClient( %client )
|
||||
function sendLoadInfoToClient( %client )
|
||||
{
|
||||
//error( "** SENDING LOAD INFO TO CLIENT " @ %client @ "! **" );
|
||||
%singlePlayer = $CurrentMissionType $= "SinglePlayer";
|
||||
|
|
@ -149,7 +149,7 @@ if (!isActivePackage(LoadScreenPackage) && $Host::LoadingScreenUseDebrief)
|
|||
// Dont even try to override sendModInfoToClient since evo has it
|
||||
// Just make our own
|
||||
function ALTsendModInfoToClient(%client)
|
||||
{
|
||||
{
|
||||
// Wont allow Debrief on consecutive map loads
|
||||
if(%client.loaded)
|
||||
{
|
||||
|
|
@ -160,7 +160,7 @@ function ALTsendModInfoToClient(%client)
|
|||
// Sound
|
||||
// As the background hum will stop on the debrief page
|
||||
// Breaks the abrupt stop
|
||||
// LoadingScreen sounds are limited to 5 secs or you'll receive an error
|
||||
// LoadingScreen sounds are limited to 5 secs or you'll receive an error
|
||||
%snd = '~wgui/inventory_hum.wav';
|
||||
messageClient(%client, 'MsgLoadQuoteLine', %snd, "");
|
||||
|
||||
|
|
@ -169,10 +169,10 @@ function ALTsendModInfoToClient(%client)
|
|||
%line3 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine3 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine3_Msg;
|
||||
%line4 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine4 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine4_Msg;
|
||||
%line5 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine5 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine5_Msg;
|
||||
%line6 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine6 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine6_Msg;
|
||||
%line6 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine6 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine6_Msg;
|
||||
|
||||
if($Host::TimeLimit $= "999" || $Host::TimeLimit $= "unlimited") %timeloadingvar = "Unlimited"; else %timeloadingvar = $Host::TimeLimit;
|
||||
|
||||
|
||||
if($Host::KickObserverTimeout $= 0) %obskickvar = "Off"; else %obskickvar = ($Host::KickObserverTimeout / 60) @ " Minutes";
|
||||
|
||||
%time = "<color:" @ $Host::LoadScreenColor1 @ ">Time limit: <color:" @ $Host::LoadScreenColor2 @ ">" @ %timeloadingvar;
|
||||
|
|
@ -201,13 +201,13 @@ function ALTsendModInfoToClient(%client)
|
|||
|
||||
|
||||
$dmlP = 0;
|
||||
|
||||
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
|
||||
// Images
|
||||
// Desired pics much exist in the texticons folder on the client in some capacity
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
if($dtLoadingScreen::ShowImages)
|
||||
{
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
|
|
@ -218,13 +218,13 @@ function ALTsendModInfoToClient(%client)
|
|||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Just:CENTER><bitmap:twb/twb_lakedebris_01><Just:RIGHT><bitmap:twb/twb_waterdemise_03><Just:LEFT><bitmap:twb/twb_action_05>";
|
||||
case 2:
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Just:CENTER><bitmap:twb/twb_blowngen_01><Just:RIGHT><bitmap:twb/twb_action_03><Just:LEFT><bitmap:twb/twb_starwolf_shrike>";
|
||||
case 3:
|
||||
case 3:
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Just:CENTER><bitmap:twb/twb_TRIBES2><Just:RIGHT><bitmap:twb/twb_Harbingers><Just:LEFT><bitmap:twb/twb_action_10>";
|
||||
case 4:
|
||||
case 4:
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Just:CENTER><bitmap:twb/twb_inferno_02><Just:RIGHT><bitmap:twb/twb_action_04><Just:LEFT><bitmap:twb/twb_action_06>";
|
||||
}
|
||||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Just:CENTER><bitmap:Cred_logo5.png><bitmap:twb/twb_action_04><bitmap:twb/twb_action_06><Just:LEFT>";
|
||||
|
||||
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
|
|
@ -240,7 +240,7 @@ function ALTsendModInfoToClient(%client)
|
|||
if(%client.dmpVersion $=$DMP::Version)
|
||||
{
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<bitmap:" @ $dtLoadingScreen::LogoName @ ">";
|
||||
|
||||
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
|
|
@ -322,7 +322,7 @@ function ALTsendModInfoToClient(%client)
|
|||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Font:Arial:15>*" @ $Host::GameName;
|
||||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Font:Arial:15>" @ $Host::Info;
|
||||
|
||||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Font:univers:18><lmargin:12><color:" @ $Host::LoadScreenColor2 @ "><Font:Univers Condensed Bold:28>Map Info:<lmargin:24><Font:univers:18>";
|
||||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<Font:univers:18><lmargin:12><color:" @ $Host::LoadScreenColor2 @ "><Font:Univers Condensed Bold:28>Map Info:<lmargin:24><Font:univers:18>";
|
||||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = %currentmis;
|
||||
|
||||
schedule($dtLoadingScreen::Delay, 0, "sendLoadscreen", %client);
|
||||
|
|
@ -351,17 +351,17 @@ function sendLoadscreen(%client)
|
|||
{
|
||||
%msgTag = $dtLoadingScreen::LoadScreenMessage[%a];
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", %msgTag);
|
||||
}
|
||||
}
|
||||
|
||||
%MOTDHeader = "<lmargin:12><Font:Univers Condensed Bold:28><color:" @ $Host::LoadScreenColor2 @ ">Events:";
|
||||
%MOTDMsg1 = "<lmargin:24><Font:univers:18><bitmap:bullet_2><color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenMOTD1;
|
||||
%MOTDMsg2 = "<lmargin:24><Font:univers:18><bitmap:bullet_2><color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenMOTD2;
|
||||
%MOTDMsg3 = "<lmargin:24><Font:univers:18><bitmap:bullet_2><color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenMOTD3;
|
||||
%MOTDMsg4 = "<lmargin:24><Font:univers:18><bitmap:bullet_2><color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenMOTD4;
|
||||
|
||||
|
||||
//MOTD Loop
|
||||
//Leave line " " in ServerPrefs to not show a line
|
||||
for(%x = 1; %x <= 4; %x++)
|
||||
for(%x = 1; %x <= 4; %x++)
|
||||
{
|
||||
if($Host::LoadScreenMOTD[%x] !$= " " && $Host::LoadScreenMOTD[%x] !$= "")
|
||||
{
|
||||
|
|
@ -375,7 +375,7 @@ function sendLoadscreen(%client)
|
|||
messageClient(%client, 'MsgDebriefAddLine', "", %MOTDMsg[%x]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Normal Screen Always in the Background
|
||||
// If client hits continue during debrief screen
|
||||
sendLoadInfoToClient(%client);
|
||||
|
|
@ -383,7 +383,7 @@ function sendLoadscreen(%client)
|
|||
|
||||
// Show normal second screen during following map loads
|
||||
function NORMALsendModInfoToClient(%client)
|
||||
{
|
||||
{
|
||||
%line1 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine1 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine1_Msg;
|
||||
%line2 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine2 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine2_Msg;
|
||||
%line3 = "<color:" @ $Host::LoadScreenColor1 @ ">" @ $Host::LoadScreenLine3 @ " <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::LoadScreenLine3_Msg;
|
||||
|
|
@ -397,7 +397,7 @@ function NORMALsendModInfoToClient(%client)
|
|||
%max = "<color:" @ $Host::LoadScreenColor1 @ ">Max players: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::MaxPlayers;
|
||||
%net = "<color:" @ $Host::LoadScreenColor1 @ ">Packets Rate / Size: <color:" @ $Host::LoadScreenColor2 @ ">" @ $pref::Net::PacketRateToClient @ " / " @ $pref::Net::PacketSize;
|
||||
%smurf = "<color:" @ $Host::LoadScreenColor1 @ ">Refuse smurfs: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::NoSmurfs ? "On" : "Off");
|
||||
|
||||
|
||||
//%random = "<color:" @ $Host::LoadScreenColor1 @ ">Random teams: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($RandomTeams ? "On" : "Off");
|
||||
//%fair = "<color:" @ $Host::LoadScreenColor1 @ ">Fair teams: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::ClassicFairTeams ? "On" : "Off");
|
||||
//%rape = "<color:" @ $Host::LoadScreenColor1 @ ">No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::EvoNoBaseRapeEnabled ? "On" : "Off");
|
||||
|
|
@ -492,4 +492,4 @@ function NORMALsendModInfoToClient(%client)
|
|||
messageClient(%client, 'MsgLoadRulesLine', "", %ServerTextLine[%line], !%singlePlayer);
|
||||
|
||||
messageClient(%client, 'MsgLoadInfoDone');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
62
Classic/scripts/autoexec/zzDiscordBot.cs
Executable file → Normal file
62
Classic/scripts/autoexec/zzDiscordBot.cs
Executable file → Normal file
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
//exec("scripts/autoexec/zzDiscordBot.cs");
|
||||
|
||||
//note first channel is for monitoring
|
||||
//note first channel is for monitoring
|
||||
$discordBot::discordCHID = "";
|
||||
$discordBot::IP = "";
|
||||
$discordBot::reconnectTimeout = 3 * 60000;
|
||||
|
|
@ -32,21 +32,21 @@ function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8
|
|||
%type = getTaggedString(%msgType);
|
||||
switch$(%type)
|
||||
{
|
||||
case "msgExplosionKill" or "msgSuicide" or "msgVehicleSpawnKill" or "msgVehicleCrash" or "msgVehicleKill" or "msgTurretSelfKill" or "msgTurretSelfKill" or "msgCTurretKill" or "msgTurretKill" or
|
||||
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":
|
||||
"MsgClientJoin" or "MsgClientDrop":
|
||||
%message = getTaggedString(%msgString);
|
||||
%message = strreplace(%message,"%1",getTaggedString(%a1));
|
||||
%message = strreplace(%message,"%2",getTaggedString(%a2));
|
||||
%message = strreplace(%message,"%3",getTaggedString(%a3));
|
||||
%message = strreplace(%message,"%4",getTaggedString(%a4));
|
||||
%message = strreplace(%message,"%5",getTaggedString(%a5));
|
||||
%message = strreplace(%message,"%6",getTaggedString(%a6));
|
||||
%message = strreplace(%message,"%7",getTaggedString(%a7));
|
||||
%message = strreplace(%message,"%8",getTaggedString(%a8));
|
||||
%message = strreplace(%message,"%1",getTaggedString(%a1));
|
||||
%message = strreplace(%message,"%2",getTaggedString(%a2));
|
||||
%message = strreplace(%message,"%3",getTaggedString(%a3));
|
||||
%message = strreplace(%message,"%4",getTaggedString(%a4));
|
||||
%message = strreplace(%message,"%5",getTaggedString(%a5));
|
||||
%message = strreplace(%message,"%6",getTaggedString(%a6));
|
||||
%message = strreplace(%message,"%7",getTaggedString(%a7));
|
||||
%message = strreplace(%message,"%8",getTaggedString(%a8));
|
||||
%message = stripChars(%message, "\cp\co\c0\c6\c7\c8\c9");
|
||||
sendToDiscordEmote(%message, $discordBot::serverFeed);
|
||||
}
|
||||
}
|
||||
if($missionName !$= $discordBot::cm && ClientGroup.getCount() > 2){
|
||||
sendToDiscordEmote("The mission changed to" SPC $missionName, $discordBot::serverFeed);
|
||||
$discordBot::cm = $missionName;
|
||||
|
|
@ -139,11 +139,11 @@ function LogMessage(%client, %msg, %cat){
|
|||
|
||||
if(!isActivePackage(discordPackage))
|
||||
activatePackage(discordPackage);
|
||||
|
||||
|
||||
function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
||||
{
|
||||
//echo(%type SPC %var1 SPC %var2 SPC %var3 SPC %var4 SPC %var5 SPC %var6);
|
||||
|
||||
|
||||
switch$ (%type)
|
||||
{
|
||||
case "flagCap":
|
||||
|
|
@ -162,7 +162,7 @@ function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
|||
if(%flag.isHome)
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
else if(!%flag.isHome)
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag in the field. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag in the field. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
}
|
||||
case "droppedFlag":
|
||||
%game = %var1;
|
||||
|
|
@ -187,16 +187,16 @@ function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
|||
case "lakMApoints":
|
||||
%sourceObject = %var1;
|
||||
%points = %var2;
|
||||
if(%points == 1)
|
||||
if(%points !$=1)
|
||||
%s = "s";
|
||||
%hitType = %var3;
|
||||
%weapon = %var4;
|
||||
%distance = %var5;
|
||||
%vel = %var6;
|
||||
if(%points)
|
||||
%msg = getTaggedString(%sourceObject.client.name) SPC "receives" SPC %points @ %s SPC "points! [" @ %hitType SPC %weapon @ "] [Distance:" SPC %distance @ "] [Speed:" SPC %vel @ "]";
|
||||
%msg = getTaggedString(%sourceObject.client.name) SPC "receives" SPC %points SPC "point" @ %s @ "! [" @ %hitType SPC %weapon @ "] [Distance:" SPC %distance @ "] [Speed:" SPC %vel @ "]";
|
||||
}
|
||||
|
||||
|
||||
if(%msg !$= "")
|
||||
{
|
||||
%msg = stripChars(%msg, "\cp\co\c0\c6\c7\c8\c9");
|
||||
|
|
@ -223,20 +223,20 @@ function sendToDiscordEmote(%msg,%channel)//emote filter will be applyed used in
|
|||
}
|
||||
}
|
||||
}
|
||||
function discordCon(){
|
||||
function discordCon(){
|
||||
if(discord.lastState !$= "Connected"){
|
||||
if(isEventPending($discordBot::reconnectEvent))
|
||||
cancel($discordBot::reconnectEvent);
|
||||
if(isObject(discord))
|
||||
discord.delete();
|
||||
new TCPObject(discord);
|
||||
new TCPObject(discord);
|
||||
discord.lastState = "Connecting";
|
||||
discord.connect($discordBot::IP);
|
||||
discord.connect($discordBot::IP);
|
||||
}
|
||||
}
|
||||
function discordKill(){
|
||||
if(isEventPending($discordBot::reconnectEvent))
|
||||
cancel($discordBot::reconnectEvent);
|
||||
cancel($discordBot::reconnectEvent);
|
||||
discord.delete();
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ function discord::onLine(%this, %line){
|
|||
%cmd = getWord(%lineStrip,0);
|
||||
switch$(%cmd){
|
||||
//case "Discord":
|
||||
//messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1));
|
||||
//messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1));
|
||||
case "PING":
|
||||
discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n");
|
||||
case "PINGAVG":
|
||||
|
|
@ -287,20 +287,20 @@ function discord::onLine(%this, %line){
|
|||
%max = -10000;
|
||||
%lowCount = %lowPing = 0;
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||
%min = (%ping < %min) ? %ping : %min;
|
||||
%max = (%ping > %max) ? %ping : %max;
|
||||
if(%ping < 250){
|
||||
%lowCount++;
|
||||
%lowPing += %ping;
|
||||
%lowPing += %ping;
|
||||
}
|
||||
%pc++;
|
||||
%pingT += %ping;
|
||||
%pingT += %ping;
|
||||
}
|
||||
%lowCount = (%lowCount == 0) ? 1 : %lowCount;
|
||||
if(!%pc){
|
||||
sendToDiscord("Ping AVG:" @ 0 SPC "Low Avg:" @ 0 SPC "Min:" @ 0 SPC "Max:" @ 0, $discordBot::monitorChannel);
|
||||
sendToDiscord("Ping AVG:" @ 0 SPC "Low Avg:" @ 0 SPC "Min:" @ 0 SPC "Max:" @ 0, $discordBot::monitorChannel);
|
||||
}
|
||||
else{
|
||||
%avg = mFloor(%pingT/%pc);
|
||||
|
|
@ -312,8 +312,8 @@ function discord::onLine(%this, %line){
|
|||
%channel = 1;
|
||||
if(ClientGroup.getCount() > 0){
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||
%msg = %cl.namebase @ $discordBot::cmdSubSplit @ %ping @ $discordBot::cmdSubSplit @ %i;
|
||||
discord.schedule(%i*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
|
|
@ -325,4 +325,4 @@ function discord::onLine(%this, %line){
|
|||
}
|
||||
}
|
||||
if(!isObject(discord) && $discordBot::autoStart)
|
||||
discordCon();
|
||||
discordCon();
|
||||
|
|
|
|||
224
Classic/scripts/dtChatCmdGame.cs
Normal file → Executable file
224
Classic/scripts/dtChatCmdGame.cs
Normal file → Executable file
|
|
@ -13,7 +13,7 @@ function chatMessageAll(%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
|
|||
chatCmd(%sender,%a2,0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
parent::chatMessageAll(%sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
|
||||
}
|
||||
|
||||
|
|
@ -28,8 +28,8 @@ if (!isActivePackage(dtChatCmd))
|
|||
function chatCmd(%client, %message) //%client is sender
|
||||
{
|
||||
%command = strlwr(trim(getWord(%message, 0)));// strip command trim and make it lower case
|
||||
|
||||
switch$(%command)
|
||||
|
||||
switch$(%command)
|
||||
{
|
||||
case "/help":
|
||||
if(%client.isSuperAdmin)
|
||||
|
|
@ -39,8 +39,8 @@ function chatCmd(%client, %message) //%client is sender
|
|||
messageClient(%client, 'msgChatCmd', '\c2/snowsky - changes the sky to a snow sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/firesky - changes the sky to a fire sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/rainsky - changes the sky to a rain sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/sandsky - changes the sky to a sand sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/nicesky - changes the sky to a variation of four nice skies.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/sandsky - changes the sky to a sand sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/nicesky - changes the sky to a variation of four nice skies.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/normalsky - changes the sky to a fallback sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/spookysky - changes the sky to a halloween sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/fireworks - look at some fireworks.');
|
||||
|
|
@ -49,20 +49,20 @@ function chatCmd(%client, %message) //%client is sender
|
|||
}
|
||||
else if(%client.isAdmin)
|
||||
{
|
||||
messageClient(%client, 'msgChatCmd', '\c2/snowsky - changes the sky to a snow sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/snowsky - changes the sky to a snow sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/firesky - changes the sky to a fire sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/rainsky - changes the sky to a rain sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/sandsky - changes the sky to a sand sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/nicesky - changes the sky to a variation of four nice skies.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/nicesky - changes the sky to a variation of four nice skies.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/normalsky - changes the sky to a fallback sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/spookysky - changes the sky to a halloween sky.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/fireworks - look at some fireworks.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/AIQ 1 or 0 - to enable tor disable ai chat.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/idInfo - get id resources.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/idInfo - get id resources.');
|
||||
}
|
||||
messageClient(%client, 'msgChatCmd', '\c2/report "message" - report a problem for server owner.');
|
||||
messageClient(%client, 'msgChatCmd', '\c2/msg "message" - leave the server owner a message.');
|
||||
|
||||
|
||||
case "/summon":
|
||||
if(%client.isSuperAdmin)
|
||||
{
|
||||
|
|
@ -72,7 +72,7 @@ function chatCmd(%client, %message) //%client is sender
|
|||
%obj.setTransform(%pos SPC getWords(%obj.getTransform(), 3, 6));
|
||||
%obj.setVelocity("0 0 1");// stop them incase they are going over 9000
|
||||
}
|
||||
|
||||
|
||||
case "/warpto":
|
||||
if(%client.isSuperAdmin)
|
||||
{
|
||||
|
|
@ -81,42 +81,42 @@ function chatCmd(%client, %message) //%client is sender
|
|||
%obj = %client.player;
|
||||
%obj.setTransform(%pos SPC getWords(%obj.getTransform(), 3, 6));
|
||||
}
|
||||
|
||||
|
||||
case "/fireworks":
|
||||
if(%client.isAdmin || %client.isSuperAdmin )
|
||||
{
|
||||
fireworksSky(1);// only one sky for right now
|
||||
$CurrentSky = "fireworks";
|
||||
}
|
||||
|
||||
|
||||
case "/normalsky":
|
||||
if(%client.isAdmin || %client.isSuperAdmin )
|
||||
{
|
||||
normalSky(1);// only one sky for right now
|
||||
$CurrentSky = "normal";
|
||||
}
|
||||
|
||||
|
||||
case "/firesky":
|
||||
if(%client.isAdmin || %client.isSuperAdmin )
|
||||
{
|
||||
fireSky(1);// only one sky for right now
|
||||
$CurrentSky = "fire";
|
||||
}
|
||||
|
||||
|
||||
case "/rainsky":
|
||||
if(%client.isAdmin || %client.isSuperAdmin )
|
||||
{
|
||||
rainSky(1);// only one sky for right now
|
||||
$CurrentSky = "rain";
|
||||
}
|
||||
|
||||
|
||||
case "/snowsky":
|
||||
if(%client.isAdmin || %client.isSuperAdmin )
|
||||
{
|
||||
snowSky(1);// only one sky for right now
|
||||
$CurrentSky = "snow";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case "/sandsky":
|
||||
if(%client.isAdmin || %client.isSuperAdmin )
|
||||
{
|
||||
|
|
@ -129,15 +129,15 @@ function chatCmd(%client, %message) //%client is sender
|
|||
niceSky(1);// only one sky for right now
|
||||
$CurrentSky = "nice";
|
||||
}
|
||||
|
||||
|
||||
case "/report":
|
||||
LogMessage(%client, %message, "report");
|
||||
messageClient(%client, 'msgChatCmd', 'Your report has been received.');
|
||||
|
||||
|
||||
case "/msg":
|
||||
LogMessage(%client, %message, "message");
|
||||
messageClient(%client, 'msgChatCmd', 'Your message has been received.');
|
||||
|
||||
|
||||
case "/idInfo":
|
||||
if(%client.isSuperAdmin || %client.isAdmin)
|
||||
{
|
||||
|
|
@ -145,21 +145,21 @@ function chatCmd(%client, %message) //%client is sender
|
|||
messageClient(%client, 'msgChatCmd', '\c2 Num of id left %1 / 2147483647 = %2%',%num, (%num / 2147483647) * 100);
|
||||
%num.delete();
|
||||
}
|
||||
|
||||
|
||||
case "/enableAI":
|
||||
if(%client.isSuperAdmin)
|
||||
{
|
||||
AISystemEnabled(true);
|
||||
messageAll('message', 'AI is now enabled.');
|
||||
}
|
||||
|
||||
|
||||
case "/disableAI":
|
||||
if(%client.isSuperAdmin)
|
||||
{
|
||||
AISystemEnabled(false);
|
||||
messageAll('message', 'AI is now disabled.');
|
||||
}
|
||||
|
||||
|
||||
case "/AIQ":
|
||||
if(%client.isSuperAdmin || %client.isAdmin)
|
||||
{
|
||||
|
|
@ -171,7 +171,7 @@ function chatCmd(%client, %message) //%client is sender
|
|||
}
|
||||
else
|
||||
{
|
||||
$AIDisableChat = 0;
|
||||
$AIDisableChat = 0;
|
||||
messageClient(%client, 'msgChatCmd', '\c2AI Chat Enabled.');
|
||||
}
|
||||
}
|
||||
|
|
@ -182,7 +182,7 @@ function chatCmd(%client, %message) //%client is sender
|
|||
spookySky(1);// only one sky for right now
|
||||
$CurrentSky = "spookySky";
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
messageClient(%client, 'msgChatCmd', '\c2Oops, that command is not recognized. ');
|
||||
}
|
||||
|
|
@ -191,7 +191,7 @@ function chatCmd(%client, %message) //%client is sender
|
|||
|
||||
function clientNameAuto(%name) //client name auto complate
|
||||
{
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{ // the client list
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%fullName = %client.nameBase;
|
||||
|
|
@ -199,10 +199,10 @@ function clientNameAuto(%name) //client name auto complate
|
|||
%partname = strlwr(%name);
|
||||
for(%a=1; %a <= strlen(%partname); %a++){
|
||||
if(getSubStr(%fullName,0,%a) $= getSubStr(%partname,0,%a)){
|
||||
//echo(getSubStr(%fullName,0,%a) SPC getSubStr(%partname,0,%a));
|
||||
//echo(getSubStr(%fullName,0,%a) SPC getSubStr(%partname,0,%a));
|
||||
if(%c[%i] > %x){
|
||||
%x =%c[%i];
|
||||
%f = %i;
|
||||
%f = %i;
|
||||
}
|
||||
%c[%i]++;
|
||||
}
|
||||
|
|
@ -215,8 +215,8 @@ function clientNameAuto(%name) //client name auto complate
|
|||
function LogMessage(%client, %msg, %cat) //phantoms chatlogging
|
||||
{
|
||||
%filename = "logs/" @ %cat @ "/" @ formattimestring("mm-dd-yy") @ ".txt";
|
||||
|
||||
if (!IsFile(%filename))
|
||||
|
||||
if (!IsFile(%filename))
|
||||
{
|
||||
new fileobject(Clog);
|
||||
Clog.openforwrite(%filename);
|
||||
|
|
@ -224,7 +224,7 @@ function LogMessage(%client, %msg, %cat) //phantoms chatlogging
|
|||
Clog.close();
|
||||
Clog.delete();
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
new fileobject(Clog);
|
||||
Clog.openforappend(%filename);
|
||||
|
|
@ -240,7 +240,7 @@ function removeSky(%sky)
|
|||
Sky.delete();
|
||||
if(isObject(Precipitation))
|
||||
{
|
||||
alxStopAll();
|
||||
alxStopAll();
|
||||
Precipitation.delete();
|
||||
}
|
||||
if(isObject(Lightning))
|
||||
|
|
@ -257,12 +257,12 @@ function normalSky(%sky)
|
|||
{
|
||||
if($CurrentSky $= "normal")
|
||||
return;
|
||||
|
||||
|
||||
MessageAll('Msg', "\c2Looks like the weather is clearing up.");
|
||||
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -300,10 +300,10 @@ function fireSky(%sky)
|
|||
return;
|
||||
|
||||
MessageAll('Msg', "\c2Is it getting hot outside?");
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1216 -1336 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -334,12 +334,12 @@ function fireSky(%sky)
|
|||
high_fogVolume1 = "-1 3.22439e-42 1.04486e-40";
|
||||
high_fogVolume2 = "-1 1.04845e-40 3.26643e-42";
|
||||
high_fogVolume3 = "-1 3.28324e-42 1.05581e-40";
|
||||
|
||||
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
|
||||
|
||||
%fireball = new FireballAtmosphere(FireballAtmosphere)
|
||||
{
|
||||
position = "0 0 0";
|
||||
|
|
@ -356,7 +356,7 @@ function fireSky(%sky)
|
|||
dropHeight = "2000";
|
||||
dropDir = "0.212 0.212 -0.953998";
|
||||
};
|
||||
%embers = new Precipitation(Precipitation)
|
||||
%embers = new Precipitation(Precipitation)
|
||||
{
|
||||
position = "116.059 -26.7731 156.557";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -374,7 +374,7 @@ function fireSky(%sky)
|
|||
maxNumDrops = "500";
|
||||
maxRadius = "125";
|
||||
};
|
||||
%firewind = new AudioEmitter(PlanetSoundEmitter)
|
||||
%firewind = new AudioEmitter(PlanetSoundEmitter)
|
||||
{
|
||||
position = "289.762 209.214 173.677";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -395,7 +395,7 @@ function fireSky(%sky)
|
|||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
};
|
||||
};
|
||||
|
||||
MissionCleanup.add(%fireball);
|
||||
MissionCleanup.add(%embers2);
|
||||
|
|
@ -404,17 +404,17 @@ function fireSky(%sky)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function rainSky(%sky)
|
||||
{
|
||||
if($CurrentSky $= "rain")
|
||||
return;
|
||||
|
||||
MessageAll('Msg', "\c2Looks like a storm is brewing.");
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
MessageAll('Msg', "\c2Looks like a storm is brewing.");
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -445,14 +445,14 @@ function rainSky(%sky)
|
|||
high_fogVolume1 = "-1 107 1.07457e-38";
|
||||
high_fogVolume2 = "-1 9.69184e-34 8.26766e-44";
|
||||
high_fogVolume3 = "-1 0 3.2509e-38";
|
||||
|
||||
|
||||
cloudSpeed0 = "0.000000 0.000400";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
|
||||
|
||||
//Requires RainNoSound Datablock in weather.cs
|
||||
%rain = new Precipitation(Precipitation)
|
||||
%rain = new Precipitation(Precipitation)
|
||||
{
|
||||
position = "-336.859 -631.623 191.648";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -470,7 +470,7 @@ function rainSky(%sky)
|
|||
maxNumDrops = "1000";
|
||||
maxRadius = "80";
|
||||
};
|
||||
%lightning = new Lightning(Lightning)
|
||||
%lightning = new Lightning(Lightning)
|
||||
{
|
||||
position = "-274.935 -143.111 353.049";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -487,7 +487,7 @@ function rainSky(%sky)
|
|||
fadeColor = "0.100000 0.100000 1.000000 1.000000";
|
||||
useFog = "0";
|
||||
};
|
||||
%rainthunder = new AudioEmitter(PlanetSoundEmitter)
|
||||
%rainthunder = new AudioEmitter(PlanetSoundEmitter)
|
||||
{
|
||||
position = "289.762 209.214 173.677";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -509,7 +509,7 @@ function rainSky(%sky)
|
|||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
};
|
||||
%rainsound = new AudioEmitter(PlanetSoundEmitter)
|
||||
%rainsound = new AudioEmitter(PlanetSoundEmitter)
|
||||
{
|
||||
position = "-361.683 451 83.9062";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -545,13 +545,13 @@ function snowSky(%sky)
|
|||
{
|
||||
if($CurrentSky $= "snow")
|
||||
return;
|
||||
|
||||
MessageAll('Msg', "\c2The temperature seems to be dropping.");
|
||||
|
||||
removeSky(%sky);
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
MessageAll('Msg', "\c2The temperature seems to be dropping.");
|
||||
|
||||
removeSky(%sky);
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -576,13 +576,13 @@ function snowSky(%sky)
|
|||
fogVolumeColor1 = "128.000000 128.000000 128.000000 -0.000000";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
|
||||
|
||||
cloudSpeed0 = "0.000000 0.000400";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
|
||||
%snow = new Precipitation(Precipitation)
|
||||
|
||||
%snow = new Precipitation(Precipitation)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -598,7 +598,7 @@ function snowSky(%sky)
|
|||
maxNumDrops = "2000";
|
||||
maxRadius = "125";
|
||||
};
|
||||
%snowwind = new AudioEmitter(PlanetSoundEmitter)
|
||||
%snowwind = new AudioEmitter(PlanetSoundEmitter)
|
||||
{
|
||||
position = "289.762 209.214 173.677";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -620,7 +620,7 @@ function snowSky(%sky)
|
|||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(%snow);
|
||||
MissionCleanup.add(%snowwind);
|
||||
}
|
||||
|
|
@ -630,13 +630,13 @@ function sandSky(%sky)
|
|||
{
|
||||
if($CurrentSky $= "sand")
|
||||
return;
|
||||
|
||||
MessageAll('Msg', "\c2Visibility looks like its getting low.");
|
||||
|
||||
removeSky(%sky);
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
MessageAll('Msg', "\c2Visibility looks like its getting low.");
|
||||
|
||||
removeSky(%sky);
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1216 -848 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -670,10 +670,10 @@ function sandSky(%sky)
|
|||
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
|
||||
%sandwind = new AudioEmitter(PlanetSoundEmitter)
|
||||
|
||||
%sandwind = new AudioEmitter(PlanetSoundEmitter)
|
||||
{
|
||||
position = "289.762 209.214 173.677";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -695,7 +695,7 @@ function sandSky(%sky)
|
|||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(%sandwind);
|
||||
}
|
||||
|
||||
|
|
@ -703,11 +703,11 @@ function sandSky(%sky)
|
|||
function niceSky(%sky)
|
||||
{
|
||||
removeSky(%sky);
|
||||
removeSky(%sky);
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
if($niceSkyNumber $= "" || $niceSkyNumber $= 4)
|
||||
{
|
||||
new Sky(Sky)
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1216 -848 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -741,13 +741,13 @@ function niceSky(%sky)
|
|||
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
$niceSkyNumber = 1;
|
||||
}
|
||||
else if($niceSkyNumber $= 1)
|
||||
{
|
||||
new Sky(Sky)
|
||||
{
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1024 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -781,13 +781,13 @@ function niceSky(%sky)
|
|||
|
||||
cloudSpeed0 = "0.900000 0.900000";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
$niceSkyNumber = 2;
|
||||
}
|
||||
else if($niceSkyNumber $= 2)
|
||||
{
|
||||
new Sky(Sky)
|
||||
{
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -821,13 +821,13 @@ function niceSky(%sky)
|
|||
|
||||
cloudSpeed0 = "0.0000003 0.0000003";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
$niceSkyNumber = 3;
|
||||
}
|
||||
else if($niceSkyNumber $= 3)
|
||||
{
|
||||
new Sky(Sky)
|
||||
{
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1216 -848 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -861,23 +861,23 @@ function niceSky(%sky)
|
|||
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
$niceSkyNumber = 4;
|
||||
}
|
||||
}
|
||||
|
||||
function fireworksSky(%sky)
|
||||
{
|
||||
{
|
||||
if($CurrentSky $= "fireworks")
|
||||
{
|
||||
schedule(1500, 0, "dtCommandsReset");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
new Sky(Sky)
|
||||
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -908,20 +908,20 @@ function fireworksSky(%sky)
|
|||
high_fogVolume1 = "-1 -2.58511e+36 2.28656e-38";
|
||||
high_fogVolume2 = "-1 -1991.03 nan";
|
||||
high_fogVolume3 = "-1 7945.87 7.22445e-09";
|
||||
|
||||
|
||||
cloudSpeed0 = "0.0000003 0.0000003";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
|
||||
|
||||
schedule(1500, 0, "fireworkLoop");
|
||||
}
|
||||
|
||||
function fireworkLoop()
|
||||
{
|
||||
if($CurrentSky !$= "fireworks")
|
||||
if($CurrentSky !$= "fireworks" || !ClientGroup.getCount())
|
||||
return;
|
||||
|
||||
|
||||
// find a random client.
|
||||
%client = ClientGroup.getObject(getRandom(ClientGroup.getCount() - 1));
|
||||
|
||||
|
|
@ -972,15 +972,15 @@ datablock AudioProfile(dtFireworksSound)
|
|||
};
|
||||
|
||||
function spookySky(%sky)
|
||||
{
|
||||
{
|
||||
if($CurrentSky $= "spookySky")
|
||||
{
|
||||
schedule(1500, 0, "dtCommandsReset");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
removeSky(%sky);
|
||||
|
||||
|
||||
new Sky(Sky) {
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
|
|
@ -1015,17 +1015,17 @@ function spookySky(%sky)
|
|||
locked = "true";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
|
||||
|
||||
MissionCleanup.add(Sky);
|
||||
|
||||
|
||||
schedule(1500, 0, "spookyFireworkLoop");
|
||||
}
|
||||
|
||||
function spookyFireworkLoop()
|
||||
{
|
||||
if($CurrentSky !$= "spookySky")
|
||||
if($CurrentSky !$= "spookySky" || !ClientGroup.getCount())
|
||||
return;
|
||||
|
||||
|
||||
// find a random client.
|
||||
%client = ClientGroup.getObject(getRandom(ClientGroup.getCount() - 1));
|
||||
|
||||
|
|
@ -1505,7 +1505,7 @@ package dtCommandsReset
|
|||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
|
||||
//Reset CurrentSky
|
||||
dtCommandsReset();
|
||||
}
|
||||
|
|
@ -1514,7 +1514,7 @@ function DefaultGame::gameOver(%game)
|
|||
function DestroyServer()
|
||||
{
|
||||
Parent::DestroyServer();
|
||||
|
||||
|
||||
//Reset CurrentSky
|
||||
dtCommandsReset();
|
||||
}
|
||||
|
|
@ -1523,4 +1523,4 @@ function DestroyServer()
|
|||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(dtCommandsReset))
|
||||
activatePackage(dtCommandsReset);
|
||||
activatePackage(dtCommandsReset);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue